Blame SOURCES/0015-ethtool-copy.h-sync-with-net-next.patch

b96ca7
From ac4c40ab13bbd42145331766f74c3928bc9e6d51 Mon Sep 17 00:00:00 2001
b96ca7
From: Edward Cree <ecree@solarflare.com>
b96ca7
Date: Fri, 9 Mar 2018 15:03:46 +0000
b96ca7
Subject: [PATCH 15/18] ethtool-copy.h: sync with net-next
b96ca7
b96ca7
This covers kernel changes up to commit 84a1d9c48200,
b96ca7
    net: ethtool: extend RXNFC API to support RSS spreading of filter matches
b96ca7
b96ca7
Signed-off-by: Edward Cree <ecree@solarflare.com>
b96ca7
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b96ca7
(cherry picked from commit 23b2e3b14405221b564c5dd6d7bf48c48e3db2c8)
b96ca7
---
b96ca7
 ethtool-copy.h | 32 ++++++++++++++++++++++++++------
b96ca7
 1 file changed, 26 insertions(+), 6 deletions(-)
b96ca7
b96ca7
diff --git a/ethtool-copy.h b/ethtool-copy.h
b96ca7
index f4e7bb2..8cc61e9 100644
b96ca7
--- a/ethtool-copy.h
b96ca7
+++ b/ethtool-copy.h
b96ca7
@@ -912,12 +912,15 @@ static __inline__ __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
b96ca7
  * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
b96ca7
  * @data: Command-dependent value
b96ca7
  * @fs: Flow classification rule
b96ca7
+ * @rss_context: RSS context to be affected
b96ca7
  * @rule_cnt: Number of rules to be affected
b96ca7
  * @rule_locs: Array of used rule locations
b96ca7
  *
b96ca7
  * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
b96ca7
  * the fields included in the flow hash, e.g. %RXH_IP_SRC.  The following
b96ca7
- * structure fields must not be used.
b96ca7
+ * structure fields must not be used, except that if @flow_type includes
b96ca7
+ * the %FLOW_RSS flag, then @rss_context determines which RSS context to
b96ca7
+ * act on.
b96ca7
  *
b96ca7
  * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
b96ca7
  * on return.
b96ca7
@@ -929,7 +932,9 @@ static __inline__ __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
b96ca7
  * set in @data then special location values should not be used.
b96ca7
  *
b96ca7
  * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
b96ca7
- * existing rule on entry and @fs contains the rule on return.
b96ca7
+ * existing rule on entry and @fs contains the rule on return; if
b96ca7
+ * @fs.@flow_type includes the %FLOW_RSS flag, then @rss_context is
b96ca7
+ * filled with the RSS context ID associated with the rule.
b96ca7
  *
b96ca7
  * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
b96ca7
  * user buffer for @rule_locs on entry.  On return, @data is the size
b96ca7
@@ -940,7 +945,11 @@ static __inline__ __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
b96ca7
  * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
b96ca7
  * @fs.@location either specifies the location to use or is a special
b96ca7
  * location value with %RX_CLS_LOC_SPECIAL flag set.  On return,
b96ca7
- * @fs.@location is the actual rule location.
b96ca7
+ * @fs.@location is the actual rule location.  If @fs.@flow_type
b96ca7
+ * includes the %FLOW_RSS flag, @rss_context is the RSS context ID to
b96ca7
+ * use for flow spreading traffic which matches this rule.  The value
b96ca7
+ * from the rxfh indirection table will be added to @fs.@ring_cookie
b96ca7
+ * to choose which ring to deliver to.
b96ca7
  *
b96ca7
  * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
b96ca7
  * existing rule on entry.
b96ca7
@@ -961,7 +970,10 @@ struct ethtool_rxnfc {
b96ca7
 	__u32				flow_type;
b96ca7
 	__u64				data;
b96ca7
 	struct ethtool_rx_flow_spec	fs;
b96ca7
-	__u32				rule_cnt;
b96ca7
+	union {
b96ca7
+		__u32			rule_cnt;
b96ca7
+		__u32			rss_context;
b96ca7
+	};
b96ca7
 	__u32				rule_locs[0];
b96ca7
 };
b96ca7
 
b96ca7
@@ -988,7 +1000,11 @@ struct ethtool_rxfh_indir {
b96ca7
 /**
b96ca7
  * struct ethtool_rxfh - command to get/set RX flow hash indir or/and hash key.
b96ca7
  * @cmd: Specific command number - %ETHTOOL_GRSSH or %ETHTOOL_SRSSH
b96ca7
- * @rss_context: RSS context identifier.
b96ca7
+ * @rss_context: RSS context identifier.  Context 0 is the default for normal
b96ca7
+ *	traffic; other contexts can be referenced as the destination for RX flow
b96ca7
+ *	classification rules.  %ETH_RXFH_CONTEXT_ALLOC is used with command
b96ca7
+ *	%ETHTOOL_SRSSH to allocate a new RSS context; on return this field will
b96ca7
+ *	contain the ID of the newly allocated context.
b96ca7
  * @indir_size: On entry, the array size of the user buffer for the
b96ca7
  *	indirection table, which may be zero, or (for %ETHTOOL_SRSSH),
b96ca7
  *	%ETH_RXFH_INDIR_NO_CHANGE.  On return from %ETHTOOL_GRSSH,
b96ca7
@@ -1007,7 +1023,8 @@ struct ethtool_rxfh_indir {
b96ca7
  * size should be returned.  For %ETHTOOL_SRSSH, an @indir_size of
b96ca7
  * %ETH_RXFH_INDIR_NO_CHANGE means that indir table setting is not requested
b96ca7
  * and a @indir_size of zero means the indir table should be reset to default
b96ca7
- * values. An hfunc of zero means that hash function setting is not requested.
b96ca7
+ * values (if @rss_context == 0) or that the RSS context should be deleted.
b96ca7
+ * An hfunc of zero means that hash function setting is not requested.
b96ca7
  */
b96ca7
 struct ethtool_rxfh {
b96ca7
 	__u32   cmd;
b96ca7
@@ -1019,6 +1036,7 @@ struct ethtool_rxfh {
b96ca7
 	__u32	rsvd32;
b96ca7
 	__u32   rss_config[0];
b96ca7
 };
b96ca7
+#define ETH_RXFH_CONTEXT_ALLOC		0xffffffff
b96ca7
 #define ETH_RXFH_INDIR_NO_CHANGE	0xffffffff
b96ca7
 
b96ca7
 /**
b96ca7
@@ -1633,6 +1651,8 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
b96ca7
 /* Flag to enable additional fields in struct ethtool_rx_flow_spec */
b96ca7
 #define	FLOW_EXT	0x80000000
b96ca7
 #define	FLOW_MAC_EXT	0x40000000
b96ca7
+/* Flag to enable RSS spreading of traffic matching rule (nfc only) */
b96ca7
+#define	FLOW_RSS	0x20000000
b96ca7
 
b96ca7
 /* L3-L4 network traffic flow hash options */
b96ca7
 #define	RXH_L2DA	(1 << 1)
b96ca7
-- 
b96ca7
1.8.3.1
b96ca7