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] [day] [month] [year] [list]
Message-ID: <CAKxU2N8A2voX+VddMFmUZRzGHA5XZExWTeF4qTbVdt+baN_NCw@mail.gmail.com>
Date: Fri, 25 Oct 2024 12:58:45 -0700
From: Rosen Penev <rosenp@...il.com>
To: Simon Horman <horms@...nel.org>
Cc: netdev@...r.kernel.org, Florian Fainelli <florian.fainelli@...adcom.com>, 
	Andrew Lunn <andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Kurt Kanzenbach <kurt@...utronix.de>, Woojung Huh <woojung.huh@...rochip.com>, 
	"maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER" <UNGLinuxDriver@...rochip.com>, 
	Clément Léger <clement.leger@...tlin.com>, 
	George McCollister <george.mccollister@...il.com>, open list <linux-kernel@...r.kernel.org>, 
	"open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER" <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCHv3 net-next] net: dsa: use ethtool string helpers

On Fri, Oct 25, 2024 at 2:15 AM Simon Horman <horms@...nel.org> wrote:
>
> On Thu, Oct 24, 2024 at 12:52:38PM -0700, Rosen Penev wrote:
> > These are the preferred way to copy ethtool strings.
> >
> > Avoids incrementing pointers all over the place.
> >
> > Signed-off-by: Rosen Penev <rosenp@...il.com>
> > Reviewed-by: Kurt Kanzenbach <kurt@...utronix.de>
> > ---
> >  v3: remove curly braces from ksz_common.c
> >  v2: remove curly braces from rzn1_a5psw.c
>
> ...
>
> > diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> > index 9201f07839ad..2bb1832d21bc 100644
> > --- a/drivers/net/dsa/bcm_sf2.c
> > +++ b/drivers/net/dsa/bcm_sf2.c
> > @@ -1180,11 +1180,8 @@ static const struct b53_io_ops bcm_sf2_io_ops = {
> >  static void bcm_sf2_sw_get_strings(struct dsa_switch *ds, int port,
> >                                  u32 stringset, uint8_t *data)
> >  {
> > -     int cnt = b53_get_sset_count(ds, port, stringset);
> > -
> >       b53_get_strings(ds, port, stringset, data);
>
> Do you need to update b53_get_strings() so that you pass &data
> rather than data? Otherwise, doesn't the call to bcm_sf2_cfp_get_strings()
> overwrite what has been written by bcm_sf2_cfp_get_strings() ?
good point. I can't change b53_get_strings as that's being passed to
.get_strings() which wants a single pointer.
I added back some pointer math for this reason.
>
> > -     bcm_sf2_cfp_get_strings(ds, port, stringset,
> > -                             data + cnt * ETH_GSTRING_LEN);
> > +     bcm_sf2_cfp_get_strings(ds, port, stringset, data);
> >  }
> >
>
> ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ