dpdk: refactor i40e RSS hash function

Setting rss_conf->rss_key to NULL and rss_key_len
to zero avoids warnings about register changes
when setting up RSS configuration through RTE flows.
pull/8965/head
Lukas Sismis 2 years ago committed by Victor Julien
parent adb427a15c
commit a9b2f79070

@ -765,7 +765,7 @@ static void DeviceSetPMDSpecificRSS(struct rte_eth_rss_conf *rss_conf, const cha
{ {
// RSS is configured in a specific way for a driver i40e and DPDK version <= 19.xx // RSS is configured in a specific way for a driver i40e and DPDK version <= 19.xx
if (strcmp(driver_name, "net_i40e") == 0) if (strcmp(driver_name, "net_i40e") == 0)
i40eDeviceSetRSSHashFunction(&rss_conf->rss_hf); i40eDeviceSetRSSConf(rss_conf);
if (strcmp(driver_name, "net_ice") == 0) if (strcmp(driver_name, "net_ice") == 0)
iceDeviceSetRSSHashFunction(&rss_conf->rss_hf); iceDeviceSetRSSHashFunction(&rss_conf->rss_hf);
if (strcmp(driver_name, "net_ixgbe") == 0) if (strcmp(driver_name, "net_ixgbe") == 0)

@ -372,16 +372,19 @@ int i40eDeviceSetRSS(int port_id, int nb_rx_queues)
return 0; return 0;
} }
void i40eDeviceSetRSSHashFunction(uint64_t *rss_hf) void i40eDeviceSetRSSConf(struct rte_eth_rss_conf *rss_conf)
{ {
#if RTE_VERSION >= RTE_VERSION_NUM(20, 0, 0, 0) #if RTE_VERSION >= RTE_VERSION_NUM(20, 0, 0, 0)
*rss_hf = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_FRAG_IPV6 | rss_conf->rss_hf = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_OTHER |
RTE_ETH_RSS_NONFRAG_IPV6_OTHER; RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_NONFRAG_IPV6_OTHER;
rss_conf->rss_key = NULL;
rss_conf->rss_key_len = 0;
#else #else
*rss_hf = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP | rss_conf->rss_hf =
RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP |
RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_FRAG_IPV6 |
RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_SCTP; RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_NONFRAG_IPV6_UDP |
RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_SCTP;
#endif #endif
} }

@ -28,8 +28,10 @@
#ifdef HAVE_DPDK #ifdef HAVE_DPDK
#include "util-dpdk.h"
int i40eDeviceSetRSS(int port_id, int nb_rx_queues); int i40eDeviceSetRSS(int port_id, int nb_rx_queues);
void i40eDeviceSetRSSHashFunction(uint64_t *rss_conf); void i40eDeviceSetRSSConf(struct rte_eth_rss_conf *rss_conf);
#endif /* HAVE_DPDK */ #endif /* HAVE_DPDK */

Loading…
Cancel
Save