examples: fix RSS hash function configuration
[dpdk.git] / examples / ipsec-secgw / ipsec-secgw.c
index 199bae5..68b3465 100644 (file)
@@ -1565,6 +1565,18 @@ port_init(uint16_t portid)
        if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                local_port_conf.txmode.offloads |=
                        DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+       local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+               dev_info.flow_type_rss_offloads;
+       if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+                       port_conf.rx_adv_conf.rss_conf.rss_hf) {
+               printf("Port %u modified RSS hash function based on hardware support,"
+                       "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+                       portid,
+                       port_conf.rx_adv_conf.rss_conf.rss_hf,
+                       local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+       }
+
        ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
                        &local_port_conf);
        if (ret < 0)