[Intel-wired-lan] [PATCH net-next v6 1/7] net: ethtool: pass ethtool_rxfh to get/set_rxfh ethtool ops

Keller, Jacob E jacob.e.keller at intel.com
Wed Jun 5 18:27:25 UTC 2024



> -----Original Message-----
> From: Gal Pressman <gal at nvidia.com>
> Sent: Wednesday, June 5, 2024 10:43 AM
> To: Zaki, Ahmed <ahmed.zaki at intel.com>; Jakub Kicinski <kuba at kernel.org>
> Cc: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org; corbet at lwn.net;
> Brandeburg, Jesse <jesse.brandeburg at intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; davem at davemloft.net; edumazet at google.com;
> pabeni at redhat.com; vladimir.oltean at nxp.com; andrew at lunn.ch;
> horms at kernel.org; mkubecek at suse.cz; willemdebruijn.kernel at gmail.com;
> alexander.duyck at gmail.com; linux-doc at vger.kernel.org; Bagnucki, Igor
> <igor.bagnucki at intel.com>; Keller, Jacob E <jacob.e.keller at intel.com>
> Subject: Re: [PATCH net-next v6 1/7] net: ethtool: pass ethtool_rxfh to
> get/set_rxfh ethtool ops
> 
> On 27/11/2023 16:14, Ahmed Zaki wrote:
> >
> >
> > On 2023-11-21 16:29, Jakub Kicinski wrote:
> >> On Mon, 20 Nov 2023 13:56:08 -0700 Ahmed Zaki wrote:
> >>>       u32    (*get_rxfh_key_size)(struct net_device *);
> >>>       u32    (*get_rxfh_indir_size)(struct net_device *);
> >>> -    int    (*get_rxfh)(struct net_device *, u32 *indir, u8 *key,
> >>> -                u8 *hfunc);
> >>> -    int    (*set_rxfh)(struct net_device *, const u32 *indir,
> >>> -                const u8 *key, const u8 hfunc);
> >>> +    int    (*get_rxfh)(struct net_device *, struct ethtool_rxfh *,
> >>> +                u32 *indir, u8 *key);
> >>> +    int    (*set_rxfh)(struct net_device *, struct ethtool_rxfh *,
> >>> +                const u32 *indir, const u8 *key);
> >>>       int    (*get_rxfh_context)(struct net_device *, u32 *indir, u8
> >>> *key,
> >>>                       u8 *hfunc, u32 rss_context);
> >>>       int    (*set_rxfh_context)(struct net_device *, const u32 *indir,
> >>
> >> This conversion looks 1/4th done. You should do the following:
> >>
> >>   - First simplify the code by always providing a pointer to all params
> >>     (indir, key and func); the fact that some of them may be NULL seems
> >>     like a weird historic thing or a premature optimization.
> >>     It will simplify the drivers if all pointers are always present.
> >>     You don't have to remove the if () checks in the existing drivers.
> >>
> >>   - Then make the functions take a dev pointer, and a pointer to a
> >>     single struct wrapping all arguments. The set_* should also take
> >>     an extack.
> >
> > Can we skip the "extack" part for this series? There is no
> > "ETHTOOL_MSG_RSS_SET" netlink message, which is needed for user-space to
> > get the ACK and adding all the netlink stuff seems a bit out of scope.
> 
> Hi Ahmed,
> 
> Sorry for reviving this old thread, I noticed you kept the extack in the
> set_rxfh callback eventually. Was that on purpose?
> It's weird that we have a parameter that is always passed as NULL.

Eventually if set_rxfh gains ethtool netlink support it would benefit from already having the extack argument and not needing drivers to be modified again at that time to have extack. Yes, currently there is no message to set RSS through netlink today, so its "useless" but I guess it’s a matter of "will we add that at some point in the near future"


More information about the Intel-wired-lan mailing list