summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2024-11-13 12:13:09 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 09:58:06 +0100
commitad1ec19b0bb98c6236c3f3420a1b20e7bc29bad7 (patch)
treeb1db7b2923027c04ef0d00156a482cce7d0439cb /include/linux
parent3e44707da8db9e285e2a6a0574683ad0264cecf1 (diff)
downloadlinux-ad1ec19b0bb98c6236c3f3420a1b20e7bc29bad7.tar.gz
linux-ad1ec19b0bb98c6236c3f3420a1b20e7bc29bad7.tar.bz2
linux-ad1ec19b0bb98c6236c3f3420a1b20e7bc29bad7.zip
net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in
[ Upstream commit 9e43ad7a1edef268acac603e1975c8f50a20d02f ] Ethtool ntuple filters with FLOW_RSS were originally defined as adding the base queue ID (ring_cookie) to the value from the indirection table, so that the same table could distribute over more than one set of queues when used by different filters. However, some drivers / hardware ignore the ring_cookie, and simply use the indirection table entries as queue IDs directly. Thus, for drivers which have not opted in by setting ethtool_ops.cap_rss_rxnfc_adds to declare that they support the original (addition) semantics, reject in ethtool_set_rxnfc any filter which combines FLOW_RSS and a nonzero ring. (For a ring_cookie of zero, both behaviours are equivalent.) Set the cap bit in sfc, as it is known to support this feature. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com> Link: https://patch.msgid.link/cc3da0844083b0e301a33092a6299e4042b65221.1731499022.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 4f5a52adeb1a ("ethtool: Fix set RXNFC command with symmetric RSS hash") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ethtool.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 12f6dc567598..b8b935b52603 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -734,6 +734,9 @@ struct kernel_ethtool_ts_info {
* @rxfh_per_ctx_key: device supports setting different RSS key for each
* additional context. Netlink API should report hfunc, key, and input_xfrm
* for every context, not just context 0.
+ * @cap_rss_rxnfc_adds: device supports nonzero ring_cookie in filters with
+ * %FLOW_RSS flag; the queue ID from the filter is added to the value from
+ * the indirection table to determine the delivery queue.
* @rxfh_indir_space: max size of RSS indirection tables, if indirection table
* size as returned by @get_rxfh_indir_size may change during lifetime
* of the device. Leave as 0 if the table size is constant.
@@ -956,6 +959,7 @@ struct ethtool_ops {
u32 cap_rss_ctx_supported:1;
u32 cap_rss_sym_xor_supported:1;
u32 rxfh_per_ctx_key:1;
+ u32 cap_rss_rxnfc_adds:1;
u32 rxfh_indir_space;
u16 rxfh_key_space;
u16 rxfh_priv_size;