examples/multi_process: make RSS and checksum optional
authorWenwu Ma <wenwux.ma@intel.com>
Tue, 22 Feb 2022 10:51:27 +0000 (10:51 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 8 Mar 2022 13:20:11 +0000 (14:20 +0100)
The default values of rx mq_mode and rx offloads for port
will cause symmetric_mp startup failure if the port do not
support rss or csum. This patch makes the app to reconfigure
the NIC without them. Only quit the app if the second
reconfiguration fails.

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
examples/multi_process/symmetric_mp/main.c

index 0503377..75237de 100644 (file)
@@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
        }
 
        retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+       if (retval == -EINVAL) {
+               printf("Port %u configuration failed. Re-attempting with HW checksum disabled.\n",
+                       port);
+               port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM);
+               retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+       }
+
+       if (retval == -ENOTSUP) {
+               printf("Port %u configuration failed. Re-attempting with HW RSS disabled.\n",
+                       port);
+               port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS);
+               retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
+       }
+
        if (retval < 0)
                return retval;