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]
Date: Mon, 20 Nov 2023 10:52:14 +0000
From: Simon Horman <horms@...nel.org>
To: Yinjun Zhang <yinjun.zhang@...igine.com>
Cc: Louis Peens <louis.peens@...igine.com>,
	David Miller <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	oss-drivers <oss-drivers@...igine.com>
Subject: Re: [PATCH net-next 1/2] nfp: add ethtool flow steering callbacks

On Mon, Nov 20, 2023 at 10:18:13AM +0000, Yinjun Zhang wrote:
> On Monday, November 20, 2023 5:43 PM, Simon Horman wrote:
> <...>
> > > +     case TCP_V6_FLOW:
> > > +     case UDP_V6_FLOW:
> > > +     case SCTP_V6_FLOW:
> > > +             for (i = 0; i < 4; i++) {
> > > +                     fs->h_u.tcp_ip6_spec.ip6src[i] = entry->key.sip6[i];
> > > +                     fs->h_u.tcp_ip6_spec.ip6dst[i] = entry->key.dip6[i];
> > > +                     fs->m_u.tcp_ip6_spec.ip6src[i] = entry->msk.sip6[i];
> > > +                     fs->m_u.tcp_ip6_spec.ip6dst[i] = entry->msk.dip6[i];
> > > +             }
> > 
> > I think the above loop can be more succinctly be expressed using a single
> > memcpy(). For which I do see precedence in Intel drivers. Likewise
> > elsewhere in this patch-set.
> > 
> > I don't feel strongly about this, so feel free to take this suggestion,
> > defer it to later, or dismiss it entirely.
> 
> Thanks Simon. Louis did have same suggestion about this part. But
> since we have similar code below:
> ```
> for (i = 0; i < 4; i++) {
> 	entry->msk.sip6[i] = fs->m_u.tcp_ip6_spec.ip6src[i];
> 	entry->msk.dip6[i] = fs->m_u.tcp_ip6_spec.ip6dst[i];
> 	entry->key.sip6[i] = fs->h_u.tcp_ip6_spec.ip6src[i] & entry->msk.sip6[i];
> 	entry->key.dip6[i] = fs->h_u.tcp_ip6_spec.ip6dst[i] & entry->msk.dip6[i];
> }
> ```
> which can not be replaced by `memcpy`, so I decided to leave them as
> they are to keep consistency.
> So if you don't feel strongly and nobody else objects it, I'll leave it.

Hi Yinjun,

thanks for the clarification. I agree that we can leave this
if nobody else objects.

> 
> > 
> > > +             fs->h_u.tcp_ip6_spec.psrc = entry->key.sport;
> > > +             fs->h_u.tcp_ip6_spec.pdst = entry->key.dport;
> > > +             fs->m_u.tcp_ip6_spec.psrc = entry->msk.sport;
> > > +             fs->m_u.tcp_ip6_spec.pdst = entry->msk.dport;
> > > +             break;
> > 
> > ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ