diff mbox series

[v4,net-next,5/7] net: ethtool: add an extack parameter to new rxfh_context APIs

Message ID 63183b19786e2a97dfe55ed31313ede1a50427fc.1695838185.git.ecree.xilinx@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series ethtool: track custom RSS contexts in the core | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3216 this patch: 3216
netdev/cc_maintainers warning 3 maintainers not CCed: d-tatianin@yandex-team.ru daniel@iogearbox.net vladimir.oltean@nxp.com
netdev/build_clang success Errors and warnings before: 1558 this patch: 1558
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3465 this patch: 3465
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 49 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

edward.cree@amd.com Sept. 27, 2023, 6:13 p.m. UTC
From: Edward Cree <ecree.xilinx@gmail.com>

Currently passed as NULL, but will allow drivers to report back errors
 when ethnl support for these ops is added.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
---
 include/linux/ethtool.h | 9 ++++++---
 net/core/dev.c          | 3 ++-
 net/ethtool/ioctl.c     | 9 ++++++---
 3 files changed, 14 insertions(+), 7 deletions(-)

Comments

Jacob Keller Sept. 29, 2023, 6:24 p.m. UTC | #1
On 9/27/2023 11:13 AM, edward.cree@amd.com wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Currently passed as NULL, but will allow drivers to report back errors
>  when ethnl support for these ops is added.
> 
> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
> ---

Why not just squash this into the version that introduces the ops?

I guess this calls it out a bit better?

Thanks,
Jake

>  include/linux/ethtool.h | 9 ++++++---
>  net/core/dev.c          | 3 ++-
>  net/ethtool/ioctl.c     | 9 ++++++---
>  3 files changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 975fda7218f8..c8963bde9289 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -927,14 +927,17 @@ struct ethtool_ops {
>  	int	(*create_rxfh_context)(struct net_device *,
>  				       struct ethtool_rxfh_context *ctx,
>  				       const u32 *indir, const u8 *key,
> -				       const u8 hfunc, u32 rss_context);
> +				       const u8 hfunc, u32 rss_context,
> +				       struct netlink_ext_ack *extack);
>  	int	(*modify_rxfh_context)(struct net_device *,
>  				       struct ethtool_rxfh_context *ctx,
>  				       const u32 *indir, const u8 *key,
> -				       const u8 hfunc, u32 rss_context);
> +				       const u8 hfunc, u32 rss_context,
> +				       struct netlink_ext_ack *extack);
>  	int	(*remove_rxfh_context)(struct net_device *,
>  				       struct ethtool_rxfh_context *ctx,
> -				       u32 rss_context);
> +				       u32 rss_context,
> +				       struct netlink_ext_ack *extack);
>  	int	(*set_rxfh_context)(struct net_device *, const u32 *indir,
>  				    const u8 *key, const u8 hfunc,
>  				    u32 *rss_context, bool delete);
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 637218adca22..69579d9cd7ba 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -10892,7 +10892,8 @@ static void netdev_rss_contexts_free(struct net_device *dev)
>  			xa_erase(&dev->ethtool->rss_ctx, context);
>  			if (dev->ethtool_ops->create_rxfh_context)
>  				dev->ethtool_ops->remove_rxfh_context(dev, ctx,
> -								      context);
> +								      context,
> +								      NULL);
>  			else
>  				dev->ethtool_ops->set_rxfh_context(dev, indir,
>  								   key,
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index c23d2bd3cd2a..3920ddee3ee2 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -1381,14 +1381,17 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
>  			if (create)
>  				ret = ops->create_rxfh_context(dev, ctx, indir,
>  							       hkey, rxfh.hfunc,
> -							       rxfh.rss_context);
> +							       rxfh.rss_context,
> +							       NULL);
>  			else if (delete)
>  				ret = ops->remove_rxfh_context(dev, ctx,
> -							       rxfh.rss_context);
> +							       rxfh.rss_context,
> +							       NULL);
>  			else
>  				ret = ops->modify_rxfh_context(dev, ctx, indir,
>  							       hkey, rxfh.hfunc,
> -							       rxfh.rss_context);
> +							       rxfh.rss_context,
> +							       NULL);
>  		} else {
>  			ret = ops->set_rxfh_context(dev, indir, hkey,
>  						    rxfh.hfunc,
>
Martin Habets Oct. 2, 2023, 12:13 p.m. UTC | #2
On Wed, Sep 27, 2023 at 07:13:36PM +0100, edward.cree@amd.com wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Currently passed as NULL, but will allow drivers to report back errors
>  when ethnl support for these ops is added.
> 
> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>

Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  include/linux/ethtool.h | 9 ++++++---
>  net/core/dev.c          | 3 ++-
>  net/ethtool/ioctl.c     | 9 ++++++---
>  3 files changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 975fda7218f8..c8963bde9289 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -927,14 +927,17 @@ struct ethtool_ops {
>  	int	(*create_rxfh_context)(struct net_device *,
>  				       struct ethtool_rxfh_context *ctx,
>  				       const u32 *indir, const u8 *key,
> -				       const u8 hfunc, u32 rss_context);
> +				       const u8 hfunc, u32 rss_context,
> +				       struct netlink_ext_ack *extack);
>  	int	(*modify_rxfh_context)(struct net_device *,
>  				       struct ethtool_rxfh_context *ctx,
>  				       const u32 *indir, const u8 *key,
> -				       const u8 hfunc, u32 rss_context);
> +				       const u8 hfunc, u32 rss_context,
> +				       struct netlink_ext_ack *extack);
>  	int	(*remove_rxfh_context)(struct net_device *,
>  				       struct ethtool_rxfh_context *ctx,
> -				       u32 rss_context);
> +				       u32 rss_context,
> +				       struct netlink_ext_ack *extack);
>  	int	(*set_rxfh_context)(struct net_device *, const u32 *indir,
>  				    const u8 *key, const u8 hfunc,
>  				    u32 *rss_context, bool delete);
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 637218adca22..69579d9cd7ba 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -10892,7 +10892,8 @@ static void netdev_rss_contexts_free(struct net_device *dev)
>  			xa_erase(&dev->ethtool->rss_ctx, context);
>  			if (dev->ethtool_ops->create_rxfh_context)
>  				dev->ethtool_ops->remove_rxfh_context(dev, ctx,
> -								      context);
> +								      context,
> +								      NULL);
>  			else
>  				dev->ethtool_ops->set_rxfh_context(dev, indir,
>  								   key,
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index c23d2bd3cd2a..3920ddee3ee2 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -1381,14 +1381,17 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
>  			if (create)
>  				ret = ops->create_rxfh_context(dev, ctx, indir,
>  							       hkey, rxfh.hfunc,
> -							       rxfh.rss_context);
> +							       rxfh.rss_context,
> +							       NULL);
>  			else if (delete)
>  				ret = ops->remove_rxfh_context(dev, ctx,
> -							       rxfh.rss_context);
> +							       rxfh.rss_context,
> +							       NULL);
>  			else
>  				ret = ops->modify_rxfh_context(dev, ctx, indir,
>  							       hkey, rxfh.hfunc,
> -							       rxfh.rss_context);
> +							       rxfh.rss_context,
> +							       NULL);
>  		} else {
>  			ret = ops->set_rxfh_context(dev, indir, hkey,
>  						    rxfh.hfunc,
diff mbox series

Patch

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 975fda7218f8..c8963bde9289 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -927,14 +927,17 @@  struct ethtool_ops {
 	int	(*create_rxfh_context)(struct net_device *,
 				       struct ethtool_rxfh_context *ctx,
 				       const u32 *indir, const u8 *key,
-				       const u8 hfunc, u32 rss_context);
+				       const u8 hfunc, u32 rss_context,
+				       struct netlink_ext_ack *extack);
 	int	(*modify_rxfh_context)(struct net_device *,
 				       struct ethtool_rxfh_context *ctx,
 				       const u32 *indir, const u8 *key,
-				       const u8 hfunc, u32 rss_context);
+				       const u8 hfunc, u32 rss_context,
+				       struct netlink_ext_ack *extack);
 	int	(*remove_rxfh_context)(struct net_device *,
 				       struct ethtool_rxfh_context *ctx,
-				       u32 rss_context);
+				       u32 rss_context,
+				       struct netlink_ext_ack *extack);
 	int	(*set_rxfh_context)(struct net_device *, const u32 *indir,
 				    const u8 *key, const u8 hfunc,
 				    u32 *rss_context, bool delete);
diff --git a/net/core/dev.c b/net/core/dev.c
index 637218adca22..69579d9cd7ba 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10892,7 +10892,8 @@  static void netdev_rss_contexts_free(struct net_device *dev)
 			xa_erase(&dev->ethtool->rss_ctx, context);
 			if (dev->ethtool_ops->create_rxfh_context)
 				dev->ethtool_ops->remove_rxfh_context(dev, ctx,
-								      context);
+								      context,
+								      NULL);
 			else
 				dev->ethtool_ops->set_rxfh_context(dev, indir,
 								   key,
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index c23d2bd3cd2a..3920ddee3ee2 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -1381,14 +1381,17 @@  static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
 			if (create)
 				ret = ops->create_rxfh_context(dev, ctx, indir,
 							       hkey, rxfh.hfunc,
-							       rxfh.rss_context);
+							       rxfh.rss_context,
+							       NULL);
 			else if (delete)
 				ret = ops->remove_rxfh_context(dev, ctx,
-							       rxfh.rss_context);
+							       rxfh.rss_context,
+							       NULL);
 			else
 				ret = ops->modify_rxfh_context(dev, ctx, indir,
 							       hkey, rxfh.hfunc,
-							       rxfh.rss_context);
+							       rxfh.rss_context,
+							       NULL);
 		} else {
 			ret = ops->set_rxfh_context(dev, indir, hkey,
 						    rxfh.hfunc,