]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dpdk: refactor i40e RSS hash function
authorLukas Sismis <lsismis@oisf.net>
Thu, 25 May 2023 11:57:57 +0000 (13:57 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 5 Jun 2023 09:07:02 +0000 (11:07 +0200)
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.

src/runmode-dpdk.c
src/util-dpdk-i40e.c
src/util-dpdk-i40e.h

index 52364b3d765487d0baeb3abc2a6d378512a95606..d1c22105cc3bd2b086a9d5d4f2c22f0e4731911f 100644 (file)
@@ -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
     if (strcmp(driver_name, "net_i40e") == 0)
-        i40eDeviceSetRSSHashFunction(&rss_conf->rss_hf);
+        i40eDeviceSetRSSConf(rss_conf);
     if (strcmp(driver_name, "net_ice") == 0)
         iceDeviceSetRSSHashFunction(&rss_conf->rss_hf);
     if (strcmp(driver_name, "net_ixgbe") == 0)
index 4191b7750c82ff8e8ecf5886cec4b31a2f364fc4..9122577a7e9795ab2b258cb0a80103b9dafe9108 100644 (file)
@@ -372,16 +372,19 @@ int i40eDeviceSetRSS(int port_id, int nb_rx_queues)
     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)
-    *rss_hf = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_FRAG_IPV6 |
-              RTE_ETH_RSS_NONFRAG_IPV6_OTHER;
+    rss_conf->rss_hf = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_OTHER |
+                       RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_NONFRAG_IPV6_OTHER;
+    rss_conf->rss_key = NULL;
+    rss_conf->rss_key_len = 0;
 #else
-    *rss_hf = RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP |
-              RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_NONFRAG_IPV4_OTHER |
-              RTE_ETH_RSS_FRAG_IPV6 | 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;
+    rss_conf->rss_hf =
+            RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP |
+            RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_FRAG_IPV6 |
+            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
 }
 
index 6b1eb7fd13cfb2762f1c2425790700a3325de31c..6133aed5d7710719a9753caf6d0bda3c06bf594c 100644 (file)
 
 #ifdef HAVE_DPDK
 
+#include "util-dpdk.h"
+
 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 */