[dpdk-dev] [RFC,v3] ethdev: extend RSS offload types

simei simei.su at intel.com
Mon Jul 29 04:44:11 CEST 2019


From: Simei Su <simei.su at intel.com>

Make it easier to represent to define macro values as (1ULL << ###).

This RFC reserves several bits as input set selection from bottom
of the 64 bits. The flow type is combined with input set to
represent rss types.

for example:
    ETH_RSS_IPV4 | ETH_RSS_INSET_L3_SRC: hash on src ip address only
    ETH_RSS_IPV4_UDP | ETH_RSS_INSET_L4_DST: hash on src/dst IP and
				            dst UDP port
    ETH_RSS_L2_PAYLOAD | ETH_RSS_INSET_L2_DST: hash on dst mac address

Signed-off-by: Simei Su <simei.su at intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index dc6596b..8af6355 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -508,6 +508,19 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_GENEVE             (1ULL << RTE_ETH_FLOW_GENEVE)
 #define ETH_RSS_NVGRE              (1ULL << RTE_ETH_FLOW_NVGRE)
 
+/*
+ * The following six macros are used combined with ETH_RSS_* to
+ * represent rss types. The structure rte_flow_action_rss.types is
+ * 64-bit wide and we reserve couple bits here for input set selection
+ * from bottom of the 64 bits.
+ */
+#define	ETH_RSS_INSET_L2_SRC       (1ULL << 63)
+#define	ETH_RSS_INSET_L2_DST       (1ULL << 62)
+#define	ETH_RSS_INSET_L3_SRC       (1ULL << 61)
+#define	ETH_RSS_INSET_L3_DST       (1ULL << 60)
+#define	ETH_RSS_INSET_L4_SRC       (1ULL << 59)
+#define	ETH_RSS_INSET_L4_DST       (1ULL << 58)
+
 #define ETH_RSS_IP ( \
 	ETH_RSS_IPV4 | \
 	ETH_RSS_FRAG_IPV4 | \
-- 
1.8.3.1



More information about the dev mailing list