examples: fix RSS hash function configuration
[dpdk.git] / examples / eventdev_pipeline / main.c
index 7bc2949..700bc69 100644 (file)
@@ -292,6 +292,17 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
                port_conf.txmode.offloads |=
                        DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
+       port_conf.rx_adv_conf.rss_conf.rss_hf &=
+               dev_info.flow_type_rss_offloads;
+       if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+                       port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+               printf("Port %u modified RSS hash function based on hardware support,"
+                       "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+                       port,
+                       port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+                       port_conf.rx_adv_conf.rss_conf.rss_hf);
+       }
+
        /* Configure the Ethernet device. */
        retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
        if (retval != 0)