disable scatter/gather for ENA with DPDK 18.08 77/14877/1
authorMatthew Smith <mgsmith@netgate.com>
Tue, 18 Sep 2018 15:52:58 +0000 (10:52 -0500)
committerMatthew Smith <mgsmith@netgate.com>
Tue, 18 Sep 2018 16:33:30 +0000 (11:33 -0500)
The scatter/gather rxmode flag was set for ENA when building
against DPDK >= 18.08. ENA does not support this, so disable
it. It looks like enabling it was a copy/paste error.

Also, after offloads are adjusted based on whether "no-multi-seg"
is set, those configurations are overwritten by copying
port_conf_template over the port config. That should only happen
for versions of DPDK older than 18.08 because 18.08 and newer
make changes directly on the port config instead of making changes
to the template. Make the clib_memcpy() conditional on the DPDK
version being less than 18.08. After doing so, compiler
errors complain about port_conf_template being declared but not
used, so make it's declaration conditional.

Change-Id: If81980d71c379a565b51dd700b953f8c811a8703
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/plugins/dpdk/device/init.c

index c811c47..bb761c0 100644 (file)
@@ -46,6 +46,7 @@ dpdk_config_main_t dpdk_config_main;
 
 /* Port configuration, mildly modified Intel app values */
 
+#if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
 static struct rte_eth_conf port_conf_template = {
   .rxmode = {
             .split_hdr_size = 0,
@@ -54,6 +55,7 @@ static struct rte_eth_conf port_conf_template = {
             .mq_mode = ETH_MQ_TX_NONE,
             },
 };
+#endif
 
 static dpdk_port_type_t
 port_type_from_speed_capa (struct rte_eth_dev_info *dev_info)
@@ -369,8 +371,10 @@ dpdk_lib_init (dpdk_main_t * dm)
          xd->flags |= DPDK_DEVICE_FLAG_MAYBE_MULTISEG;
        }
 
+#if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
       clib_memcpy (&xd->port_conf, &port_conf_template,
                   sizeof (struct rte_eth_conf));
+#endif
 
       xd->tx_q_used = clib_min (dev_info.max_tx_queues, tm->n_vlib_mains);
 
@@ -490,7 +494,7 @@ dpdk_lib_init (dpdk_main_t * dm)
 #if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
              xd->port_conf.rxmode.enable_scatter = 0;
 #else
-             xd->port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SCATTER;
+             xd->port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_SCATTER;
 #endif
              break;