lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241021191348.sd5k5qnxya734muc@DEN-DL-M70577>
Date: Mon, 21 Oct 2024 19:13:48 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>, <andrew@...n.ch>, Lars Povlsen
	<lars.povlsen@...rochip.com>, Steen Hegelund <Steen.Hegelund@...rochip.com>,
	<horatiu.vultur@...rochip.com>, <jensemil.schulzostergaard@...rochip.com>,
	<Parthiban.Veerasooran@...rochip.com>, <Raju.Lakkaraju@...rochip.com>,
	<UNGLinuxDriver@...rochip.com>, Richard Cochran <richardcochran@...il.com>,
	Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, <jacob.e.keller@...el.com>,
	<ast@...erby.net>, <netdev@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	<devicetree@...r.kernel.org>
Subject: Re: [PATCH net-next 11/15] net: lan969x: add function for
 calculating the DSM calendar

Hi Maxime,

> Hi Daniel,
> 
> On Mon, 21 Oct 2024 15:58:48 +0200
> Daniel Machon <daniel.machon@...rochip.com> wrote:
> 
> > Lan969x has support for RedBox / HSR / PRP (not implemented yet). In
> > order to accommodate for this in the future, we need to give lan969x it's
> > own function for calculating the DSM calendar.
> >
> > The function calculates the calendar for each taxi bus. The calendar is
> > used for bandwidth allocation towards the ports attached to the taxi
> > bus. A calendar configuration consists of up-to 64 slots, which may be
> > allocated to ports or left unused. Each slot accounts for 1 clock cycle.
> >
> > Also expose sparx5_cal_speed_to_value(), sparx5_get_port_cal_speed,
> > sparx5_cal_bw and SPX5_DSM_CAL_EMPTY for use by lan969x.
> >
> > Reviewed-by: Steen Hegelund <Steen.Hegelund@...rochip.com>
> > Signed-off-by: Daniel Machon <daniel.machon@...rochip.com>
> 
> [...]
> 
> > +     /* Place the remaining devices */
> > +     for (u32 i = 0; i < DSM_CAL_DEV_MAX; i++) {
> > +             speed = &dev_speeds[i];
> > +             for (u32 dev = 0; dev < speed->n_devs; dev++) {
> > +                     u32 idx = 0;
> > +
> > +                     for (n_slots = 0; n_slots < speed->n_slots; n_slots++) {
> > +                             lan969x_dsm_cal_idx_find_next_free(data->schedule,
> > +                                                                cal_len,
> > +                                                                &idx);
> 
> You're not checking the return of lan969x_dsm_cal_idx_find_next_free(),
> can this be a problem ?
> 
> Thanks,
> 
> Maxime

Yes, it should be checked as we have a finite number of calendar slots.

Will fix in v2. Thanks!

/Daniel


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ