[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+Mzur1pA2CZLv3YAjL6GY=6kO2YgTOMhK+Tn_FgCXsEw@mail.gmail.com>
Date: Thu, 20 Jun 2024 20:29:39 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Ziwei Xiao <ziweixiao@...gle.com>,
Praveen Kaligineedi <pkaligineedi@...gle.com>, Harshitha Ramamurthy <hramamurthy@...gle.com>,
Willem de Bruijn <willemb@...gle.com>, Jeroen de Borst <jeroendb@...gle.com>,
Shailend Chand <shailend@...gle.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 6/6] net: ethtool: add the ability to run
ethtool_[gs]et_rxnfc() without RTNL
On Thu, Jun 20, 2024 at 7:45 PM Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
>
> Eric Dumazet wrote:
> > For better scalability, drivers can prefer to implement their own locking schem
> > (for instance one mutex per port or queue) instead of relying on RTNL.
> >
> > This patch adds a new boolean field in ethtool_ops : rxnfc_parallel
> >
> > Drivers can opt-in to this new behavior.
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > ---
> > include/linux/ethtool.h | 2 ++
> > net/ethtool/ioctl.c | 43 +++++++++++++++++++++++++++--------------
> > 2 files changed, 31 insertions(+), 14 deletions(-)
> >
> > diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> > index 6fd9107d3cc010dd2f1ecdb005c412145c461b6c..ee9b8054165361c9236186ff61f886e53cfa6b49 100644
> > --- a/include/linux/ethtool.h
> > +++ b/include/linux/ethtool.h
> > @@ -748,6 +748,7 @@ struct ethtool_rxfh_param {
> > * error code or zero.
> > * @set_rxnfc: Set RX flow classification rules. Returns a negative
> > * error code or zero.
> > + * @rxnfc_parallel: true if @set_rxnfc, @get_rxnfc and @get_rxfh do not need RTNL.
> > * @flash_device: Write a firmware image to device's flash memory.
> > * Returns a negative error code or zero.
> > * @reset: Reset (part of) the device, as specified by a bitmask of
> > @@ -907,6 +908,7 @@ struct ethtool_ops {
> > int (*get_rxnfc)(struct net_device *,
> > struct ethtool_rxnfc *, u32 *rule_locs);
> > int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
> > + bool rxnfc_parallel;
>
> Would it make sense to make this a bit, as there already are u32 bits
> at the start of the struct, with a 29-bit gap?
Indeed, I will squash in V2 the following, thanks Willem.
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ee9b8054165361c9236186ff61f886e53cfa6b49..2a385a9e5590ba4c629577c3679dd593d7d6e335
100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -853,6 +853,7 @@ struct ethtool_ops {
u32 cap_link_lanes_supported:1;
u32 cap_rss_ctx_supported:1;
u32 cap_rss_sym_xor_supported:1;
+ u32 rxnfc_parallel:1;
u32 supported_coalesce_params;
u32 supported_ring_params;
void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
@@ -908,7 +909,6 @@ struct ethtool_ops {
int (*get_rxnfc)(struct net_device *,
struct ethtool_rxnfc *, u32 *rule_locs);
int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
- bool rxnfc_parallel;
int (*flash_device)(struct net_device *, struct ethtool_flash *);
int (*reset)(struct net_device *, u32 *);
u32 (*get_rxfh_key_size)(struct net_device *);
Powered by blists - more mailing lists