summaryrefslogtreecommitdiffstats
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorAhmed Zaki <ahmed.zaki@intel.com>2023-12-12 17:33:15 -0700
committerJakub Kicinski <kuba@kernel.org>2023-12-13 22:07:16 -0800
commitdcd8dbf9e734eb334113ea43186c1c26e9f497bb (patch)
tree15cbc0d3da9e7ebb468a5c64726bf6ee6f84fcc8 /include/linux/ethtool.h
parentfb6e30a72539ce28c1323aef4190d35aac106f6f (diff)
downloadlinux-dcd8dbf9e734eb334113ea43186c1c26e9f497bb.tar.gz
linux-dcd8dbf9e734eb334113ea43186c1c26e9f497bb.tar.bz2
linux-dcd8dbf9e734eb334113ea43186c1c26e9f497bb.zip
net: ethtool: get rid of get/set_rxfh_context functions
Add the RSS context parameters to struct ethtool_rxfh_param and use the get/set_rxfh to handle the RSS contexts as well. This is part 2/2 of the fix suggested in [1]: - Add a rss_context member to the argument struct and a capability like cap_link_lanes_supported to indicate whether driver supports rss contexts, then you can remove *et_rxfh_context functions, and instead call *et_rxfh() with a non-zero rss_context. Link: https://lore.kernel.org/netdev/20231121152906.2dd5f487@kernel.org/ [1] CC: Jesse Brandeburg <jesse.brandeburg@intel.com> CC: Tony Nguyen <anthony.l.nguyen@intel.com> CC: Marcin Wojtas <mw@semihalf.com> CC: Russell King <linux@armlinux.org.uk> CC: Sunil Goutham <sgoutham@marvell.com> CC: Geetha sowjanya <gakula@marvell.com> CC: Subbaraya Sundeep <sbhatta@marvell.com> CC: hariprasad <hkelam@marvell.com> CC: Saeed Mahameed <saeedm@nvidia.com> CC: Leon Romanovsky <leon@kernel.org> CC: Edward Cree <ecree.xilinx@gmail.com> CC: Martin Habets <habetsm.xilinx@gmail.com> Suggested-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com> Link: https://lore.kernel.org/r/20231213003321.605376-3-ahmed.zaki@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 3ab2b6a90419..66fe254c3e51 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -609,6 +609,12 @@ struct ethtool_mm_stats {
* which may be zero. On GET (read from the driver), the size of the
* hardware hash key.
* @key: The hash key of size @key_size bytes.
+ * @rss_context: RSS context identifier. Context 0 is the default for normal
+ * traffic; other contexts can be referenced as the destination for RX flow
+ * classification rules. On SET, %ETH_RXFH_CONTEXT_ALLOC is used
+ * to allocate a new RSS context; on return this field will
+ * contain the ID of the newly allocated context.
+ * @rss_delete: Set to non-ZERO to remove the @rss_context context.
*/
struct ethtool_rxfh_param {
u8 hfunc;
@@ -616,12 +622,16 @@ struct ethtool_rxfh_param {
u32 *indir;
u32 key_size;
u8 *key;
+ u32 rss_context;
+ u8 rss_delete;
};
/**
* struct ethtool_ops - optional netdev operations
* @cap_link_lanes_supported: indicates if the driver supports lanes
* parameter.
+ * @cap_rss_ctx_supported: indicates if the driver supports RSS
+ * contexts.
* @supported_coalesce_params: supported types of interrupt coalescing.
* @supported_ring_params: supported ring params.
* @get_drvinfo: Report driver/device information. Modern drivers no
@@ -718,15 +728,6 @@ struct ethtool_rxfh_param {
* will remain unchanged.
* Returns a negative error code or zero. An error code must be returned
* if at least one unsupported change was requested.
- * @get_rxfh_context: Get the contents of the RX flow hash indirection table,
- * hash key, and/or hash function assiciated to the given rss context.
- * Returns a negative error code or zero.
- * @set_rxfh_context: Create, remove and configure RSS contexts. Allows setting
- * the contents of the RX flow hash indirection table, hash key, and/or
- * hash function associated to the given context. Arguments which are set
- * to %NULL or zero will remain unchanged.
- * Returns a negative error code or zero. An error code must be returned
- * if at least one unsupported change was requested.
* @get_channels: Get number of channels.
* @set_channels: Set number of channels. Returns a negative error code or
* zero.
@@ -809,6 +810,7 @@ struct ethtool_rxfh_param {
*/
struct ethtool_ops {
u32 cap_link_lanes_supported:1;
+ u32 cap_rss_ctx_supported:1;
u32 supported_coalesce_params;
u32 supported_ring_params;
void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
@@ -871,12 +873,6 @@ struct ethtool_ops {
int (*get_rxfh)(struct net_device *, struct ethtool_rxfh_param *);
int (*set_rxfh)(struct net_device *, struct ethtool_rxfh_param *,
struct netlink_ext_ack *extack);
- int (*get_rxfh_context)(struct net_device *,
- struct ethtool_rxfh_param *,
- u32 rss_context);
- int (*set_rxfh_context)(struct net_device *,
- struct ethtool_rxfh_param *,
- u32 *rss_context, bool delete);
void (*get_channels)(struct net_device *, struct ethtool_channels *);
int (*set_channels)(struct net_device *, struct ethtool_channels *);
int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);