From 8a387fa85f02ed64f755e0baa72e567d1917af48 Mon Sep 17 00:00:00 2001 From: Helin Zhang Date: Thu, 5 Jun 2014 13:08:50 +0800 Subject: [PATCH] ethdev: more RSS flags - i40e RSS flags have been added (and enlarged to 64-bit) - A new configuration of 'uint8_t rss_key_len' has been added in 'struct rte_eth_rss_conf' to support different length of RSS keys. - In each PMD, only the supported flags are masked. Signed-off-by: Helin Zhang Signed-off-by: Jing Chen Acked-by: Cunming Liang Acked-by: Jijiang Liu Acked-by: Jingjing Wu Acked-by: Heqing Zhu Tested-by: Waterman Cao --- app/test-pmd/cmdline.c | 4 +- app/test-pmd/parameters.c | 5 +- app/test-pmd/testpmd.c | 2 +- app/test-pmd/testpmd.h | 2 +- examples/dpdk_qat/main.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/l3fwd-power/main.c | 2 +- examples/l3fwd-vf/main.c | 2 +- examples/l3fwd/main.c | 2 +- examples/load_balancer/init.c | 2 +- examples/multi_process/symmetric_mp/main.c | 2 +- examples/qos_meter/main.c | 2 +- lib/librte_ether/rte_ethdev.h | 119 ++++++++++++++++++--- lib/librte_pmd_e1000/igb_rxtx.c | 21 +++- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 22 ++-- lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 16 ++- 16 files changed, 159 insertions(+), 48 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 8c358250cb..216752ead1 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1201,9 +1201,9 @@ cmd_config_rss_parsed(void *parsed_result, uint8_t i; if (!strcmp(res->value, "ip")) - rss_conf.rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6; + rss_conf.rss_hf = ETH_RSS_IP; else if (!strcmp(res->value, "udp")) - rss_conf.rss_hf = ETH_RSS_IPV4_UDP | ETH_RSS_IPV6_UDP; + rss_conf.rss_hf = ETH_RSS_UDP; else if (!strcmp(res->value, "none")) rss_conf.rss_hf = 0; else { diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index eb14cd3ca2..aa0e2bf8bd 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -832,10 +832,9 @@ launch_args_parse(int argc, char** argv) if (!strcmp(lgopts[opt_idx].name, "forward-mode")) set_pkt_forwarding_mode(optarg); if (!strcmp(lgopts[opt_idx].name, "rss-ip")) - rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6; + rss_hf = ETH_RSS_IP; if (!strcmp(lgopts[opt_idx].name, "rss-udp")) - rss_hf = ETH_RSS_IPV4 | - ETH_RSS_IPV6 | ETH_RSS_IPV4_UDP; + rss_hf = ETH_RSS_UDP; if (!strcmp(lgopts[opt_idx].name, "rxq")) { n = atoi(optarg); if (n >= 1 && n <= (int) MAX_QUEUE_ID) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 0727fb318b..546d429bcd 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -250,7 +250,7 @@ uint32_t txq_flags = 0; /* No flags set. */ /* * Receive Side Scaling (RSS) configuration. */ -uint16_t rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6; /* RSS IP by default. */ +uint64_t rss_hf = ETH_RSS_IP; /* RSS IP by default. */ /* * Port topology configuration diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index d750a359a5..69afb5b054 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -326,7 +326,7 @@ extern portid_t fwd_ports_ids[RTE_MAX_ETHPORTS]; extern struct rte_port *ports; extern struct rte_eth_rxmode rx_mode; -extern uint16_t rss_hf; +extern uint64_t rss_hf; extern queueid_t nb_rxq; extern queueid_t nb_txq; diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c index a117d66fea..71c03969ff 100644 --- a/examples/dpdk_qat/main.c +++ b/examples/dpdk_qat/main.c @@ -170,7 +170,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 9f4c669aea..625d21f5a7 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -228,7 +228,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 046949f3f9..ae9d3e5d26 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -247,7 +247,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 896ceb317c..c199f0c126 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -207,7 +207,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 04713c7b78..e1754a94c8 100755 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -251,7 +251,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 5bc232e56b..09ba3ff8f1 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -87,7 +87,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 634e66181d..d40223e4d3 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -251,7 +251,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues) .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index 30816dc67e..b4b8c4f016 100755 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -94,7 +94,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 6fb0f43060..26edd47231 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -311,31 +311,116 @@ struct rte_eth_rxmode { * A structure used to configure the Receive Side Scaling (RSS) feature * of an Ethernet port. * If not NULL, the *rss_key* pointer of the *rss_conf* structure points - * to an array of 40 bytes holding the RSS key to use for hashing specific - * header fields of received packets. - * Otherwise, a default random hash key is used by the device driver. + * to an array holding the RSS key to use for hashing specific header + * fields of received packets. The length of this array should be indicated + * by *rss_key_len* below. Otherwise, a default random hash key is used by + * the device driver. + * + * The *rss_key_len* field of the *rss_conf* structure indicates the length + * in bytes of the array pointed by *rss_key*. To be compatible, this length + * will be checked in i40e only. Others assume 40 bytes to be used as before. * * The *rss_hf* field of the *rss_conf* structure indicates the different * types of IPv4/IPv6 packets to which the RSS hashing must be applied. * Supplying an *rss_hf* equal to zero disables the RSS feature. */ struct rte_eth_rss_conf { - uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */ - uint16_t rss_hf; /**< Hash functions to apply - see below. */ + uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */ + uint8_t rss_key_len; /**< hash key length in bytes. */ + uint64_t rss_hf; /**< Hash functions to apply - see below. */ }; -#define ETH_RSS_IPV4 0x0001 /**< IPv4 packet. */ -#define ETH_RSS_IPV4_TCP 0x0002 /**< IPv4/TCP packet. */ -#define ETH_RSS_IPV6 0x0004 /**< IPv6 packet. */ -#define ETH_RSS_IPV6_EX 0x0008 /**< IPv6 packet with extension headers.*/ -#define ETH_RSS_IPV6_TCP 0x0010 /**< IPv6/TCP packet. */ -#define ETH_RSS_IPV6_TCP_EX 0x0020 /**< IPv6/TCP with extension headers. */ -/* Intel RSS extensions to UDP packets */ -#define ETH_RSS_IPV4_UDP 0x0040 /**< IPv4/UDP packet. */ -#define ETH_RSS_IPV6_UDP 0x0080 /**< IPv6/UDP packet. */ -#define ETH_RSS_IPV6_UDP_EX 0x0100 /**< IPv6/UDP with extension headers. */ - -#define ETH_RSS_PROTO_MASK 0x01FF /**< Mask of valid RSS hash protocols */ +/* Supported RSS offloads */ +/* for 1G & 10G */ +#define ETH_RSS_IPV4_SHIFT 0 +#define ETH_RSS_IPV4_TCP_SHIFT 1 +#define ETH_RSS_IPV6_SHIFT 2 +#define ETH_RSS_IPV6_EX_SHIFT 3 +#define ETH_RSS_IPV6_TCP_SHIFT 4 +#define ETH_RSS_IPV6_TCP_EX_SHIFT 5 +#define ETH_RSS_IPV4_UDP_SHIFT 6 +#define ETH_RSS_IPV6_UDP_SHIFT 7 +#define ETH_RSS_IPV6_UDP_EX_SHIFT 8 +/* for 40G only */ +#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 +#define ETH_RSS_NONF_IPV4_TCP_SHIFT 33 +#define ETH_RSS_NONF_IPV4_SCTP_SHIFT 34 +#define ETH_RSS_NONF_IPV4_OTHER_SHIFT 35 +#define ETH_RSS_FRAG_IPV4_SHIFT 36 +#define ETH_RSS_NONF_IPV6_UDP_SHIFT 41 +#define ETH_RSS_NONF_IPV6_TCP_SHIFT 43 +#define ETH_RSS_NONF_IPV6_SCTP_SHIFT 44 +#define ETH_RSS_NONF_IPV6_OTHER_SHIFT 45 +#define ETH_RSS_FRAG_IPV6_SHIFT 46 +#define ETH_RSS_FCOE_OX_SHIFT 48 +#define ETH_RSS_FCOE_RX_SHIFT 49 +#define ETH_RSS_FCOE_OTHER_SHIFT 50 +#define ETH_RSS_L2_PAYLOAD_SHIFT 63 + +/* for 1G & 10G */ +#define ETH_RSS_IPV4 ((uint16_t)1 << ETH_RSS_IPV4_SHIFT) +#define ETH_RSS_IPV4_TCP ((uint16_t)1 << ETH_RSS_IPV4_TCP_SHIFT) +#define ETH_RSS_IPV6 ((uint16_t)1 << ETH_RSS_IPV6_SHIFT) +#define ETH_RSS_IPV6_EX ((uint16_t)1 << ETH_RSS_IPV6_EX_SHIFT) +#define ETH_RSS_IPV6_TCP ((uint16_t)1 << ETH_RSS_IPV6_TCP_SHIFT) +#define ETH_RSS_IPV6_TCP_EX ((uint16_t)1 << ETH_RSS_IPV6_TCP_EX_SHIFT) +#define ETH_RSS_IPV4_UDP ((uint16_t)1 << ETH_RSS_IPV4_UDP_SHIFT) +#define ETH_RSS_IPV6_UDP ((uint16_t)1 << ETH_RSS_IPV6_UDP_SHIFT) +#define ETH_RSS_IPV6_UDP_EX ((uint16_t)1 << ETH_RSS_IPV6_UDP_EX_SHIFT) +/* for 40G only */ +#define ETH_RSS_NONF_IPV4_UDP ((uint64_t)1 << ETH_RSS_NONF_IPV4_UDP_SHIFT) +#define ETH_RSS_NONF_IPV4_TCP ((uint64_t)1 << ETH_RSS_NONF_IPV4_TCP_SHIFT) +#define ETH_RSS_NONF_IPV4_SCTP ((uint64_t)1 << ETH_RSS_NONF_IPV4_SCTP_SHIFT) +#define ETH_RSS_NONF_IPV4_OTHER ((uint64_t)1 << ETH_RSS_NONF_IPV4_OTHER_SHIFT) +#define ETH_RSS_FRAG_IPV4 ((uint64_t)1 << ETH_RSS_FRAG_IPV4_SHIFT) +#define ETH_RSS_NONF_IPV6_UDP ((uint64_t)1 << ETH_RSS_NONF_IPV6_UDP_SHIFT) +#define ETH_RSS_NONF_IPV6_TCP ((uint64_t)1 << ETH_RSS_NONF_IPV6_TCP_SHIFT) +#define ETH_RSS_NONF_IPV6_SCTP ((uint64_t)1 << ETH_RSS_NONF_IPV6_SCTP_SHIFT) +#define ETH_RSS_NONF_IPV6_OTHER ((uint64_t)1 << ETH_RSS_NONF_IPV6_OTHER_SHIFT) +#define ETH_RSS_FRAG_IPV6 ((uint64_t)1 << ETH_RSS_FRAG_IPV6_SHIFT) +#define ETH_RSS_FCOE_OX ((uint64_t)1 << ETH_RSS_FCOE_OX_SHIFT) /* not used */ +#define ETH_RSS_FCOE_RX ((uint64_t)1 << ETH_RSS_FCOE_RX_SHIFT) /* not used */ +#define ETH_RSS_FCOE_OTHER ((uint64_t)1 << ETH_RSS_FCOE_OTHER_SHIFT) /* not used */ +#define ETH_RSS_L2_PAYLOAD ((uint64_t)1 << ETH_RSS_L2_PAYLOAD_SHIFT) + +#define ETH_RSS_IP ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONF_IPV4_OTHER | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONF_IPV6_OTHER | \ + ETH_RSS_FRAG_IPV6) +#define ETH_RSS_UDP ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_IPV6 | \ + ETH_RSS_IPV4_UDP | \ + ETH_RSS_IPV6_UDP | \ + ETH_RSS_IPV6_UDP_EX | \ + ETH_RSS_NONF_IPV4_UDP | \ + ETH_RSS_NONF_IPV6_UDP) +/**< Mask of valid RSS hash protocols */ +#define ETH_RSS_PROTO_MASK ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_IPV4_TCP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV4_UDP | \ + ETH_RSS_IPV6_UDP | \ + ETH_RSS_IPV6_UDP_EX | \ + ETH_RSS_NONF_IPV4_UDP | \ + ETH_RSS_NONF_IPV4_TCP | \ + ETH_RSS_NONF_IPV4_SCTP | \ + ETH_RSS_NONF_IPV4_OTHER | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONF_IPV6_UDP | \ + ETH_RSS_NONF_IPV6_TCP | \ + ETH_RSS_NONF_IPV6_SCTP | \ + ETH_RSS_NONF_IPV6_OTHER | \ + ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_L2_PAYLOAD) + /* Definitions used for redirection table entry size */ #define ETH_RSS_RETA_NUM_ENTRIES 128 #define ETH_RSS_RETA_MAX_QUEUE 16 diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index c11931f228..9f0310ddf3 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -73,6 +73,17 @@ #include "e1000/e1000_api.h" #include "e1000_ethdev.h" +#define IGB_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_IPV4_TCP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV4_UDP | \ + ETH_RSS_IPV6_UDP | \ + ETH_RSS_IPV6_UDP_EX) + static inline struct rte_mbuf * rte_rxmbuf_alloc(struct rte_mempool *mp) { @@ -1526,7 +1537,7 @@ igb_hw_rss_hash_set(struct e1000_hw *hw, struct rte_eth_rss_conf *rss_conf) uint8_t *hash_key; uint32_t rss_key; uint32_t mrqc; - uint16_t rss_hf; + uint64_t rss_hf; uint16_t i; hash_key = rss_conf->rss_key; @@ -1571,7 +1582,7 @@ eth_igb_rss_hash_update(struct rte_eth_dev *dev, { struct e1000_hw *hw; uint32_t mrqc; - uint16_t rss_hf; + uint64_t rss_hf; hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1581,7 +1592,7 @@ eth_igb_rss_hash_update(struct rte_eth_dev *dev, * initialization time, or does not attempt to enable RSS, if RSS was * disabled at initialization time. */ - rss_hf = rss_conf->rss_hf; + rss_hf = rss_conf->rss_hf & IGB_RSS_OFFLOAD_ALL; mrqc = E1000_READ_REG(hw, E1000_MRQC); if (!(mrqc & E1000_MRQC_ENABLE_MASK)) { /* RSS disabled */ if (rss_hf != 0) /* Enable RSS */ @@ -1602,7 +1613,7 @@ int eth_igb_rss_hash_conf_get(struct rte_eth_dev *dev, uint8_t *hash_key; uint32_t rss_key; uint32_t mrqc; - uint16_t rss_hf; + uint64_t rss_hf; uint16_t i; hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1678,7 +1689,7 @@ igb_rss_configure(struct rte_eth_dev *dev) * the RSS hash of input packets. */ rss_conf = dev->data->dev_conf.rx_adv_conf.rss_conf; - if (rss_conf.rss_hf == 0) { + if ((rss_conf.rss_hf & IGB_RSS_OFFLOAD_ALL) == 0) { igb_rss_disable(dev); return; } diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 67afd5a6b5..ca72e7501f 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -77,10 +77,18 @@ #include "ixgbe_ethdev.h" #include "ixgbe/ixgbe_dcb.h" #include "ixgbe/ixgbe_common.h" - - #include "ixgbe_rxtx.h" +#define IXGBE_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_IPV4_TCP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV4_UDP | \ + ETH_RSS_IPV6_UDP | \ + ETH_RSS_IPV6_UDP_EX) static inline struct rte_mbuf * rte_rxmbuf_alloc(struct rte_mempool *mp) @@ -2303,7 +2311,7 @@ ixgbe_hw_rss_hash_set(struct ixgbe_hw *hw, struct rte_eth_rss_conf *rss_conf) uint8_t *hash_key; uint32_t mrqc; uint32_t rss_key; - uint16_t rss_hf; + uint64_t rss_hf; uint16_t i; hash_key = rss_conf->rss_key; @@ -2348,7 +2356,7 @@ ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev, { struct ixgbe_hw *hw; uint32_t mrqc; - uint16_t rss_hf; + uint64_t rss_hf; hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -2361,7 +2369,7 @@ ixgbe_dev_rss_hash_update(struct rte_eth_dev *dev, * initialization time, or does not attempt to enable RSS, if RSS was * disabled at initialization time. */ - rss_hf = rss_conf->rss_hf; + rss_hf = rss_conf->rss_hf & IXGBE_RSS_OFFLOAD_ALL; mrqc = IXGBE_READ_REG(hw, IXGBE_MRQC); if (!(mrqc & IXGBE_MRQC_RSSEN)) { /* RSS disabled */ if (rss_hf != 0) /* Enable RSS */ @@ -2383,7 +2391,7 @@ ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev, uint8_t *hash_key; uint32_t mrqc; uint32_t rss_key; - uint16_t rss_hf; + uint64_t rss_hf; uint16_t i; hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -2460,7 +2468,7 @@ ixgbe_rss_configure(struct rte_eth_dev *dev) * the RSS hash of input packets. */ rss_conf = dev->data->dev_conf.rx_adv_conf.rss_conf; - if (rss_conf.rss_hf == 0) { + if ((rss_conf.rss_hf & IXGBE_RSS_OFFLOAD_ALL) == 0) { ixgbe_rss_disable(dev); return; } diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c index cb711dca84..319bc113c6 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c +++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c @@ -882,9 +882,16 @@ static uint8_t rss_intel_key[40] = { int vmxnet3_rss_configure(struct rte_eth_dev *dev) { +#define VMXNET3_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_IPV4_TCP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_IPV6_TCP) + struct vmxnet3_hw *hw; struct VMXNET3_RSSConf *dev_rss_conf; struct rte_eth_rss_conf *port_rss_conf; + uint64_t rss_hf; uint8_t i, j; PMD_INIT_FUNC_TRACE(); @@ -916,13 +923,14 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev) /* loading hashType */ dev_rss_conf->hashType = 0; - if (port_rss_conf->rss_hf & ETH_RSS_IPV4) + rss_hf = port_rss_conf->rss_hf & VMXNET3_RSS_OFFLOAD_ALL; + if (rss_hf & ETH_RSS_IPV4) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV4; - if (port_rss_conf->rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_IPV4_TCP) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV4; - if (port_rss_conf->rss_hf & ETH_RSS_IPV6) + if (rss_hf & ETH_RSS_IPV6) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6; - if (port_rss_conf->rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_IPV6_TCP) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6; return VMXNET3_SUCCESS; -- 2.20.1