dpdk: fix issue when tx offload stops working after MTU change 92/9592/2
authorDamjan Marion <damarion@cisco.com>
Mon, 27 Nov 2017 18:55:14 +0000 (19:55 +0100)
committerDave Wallace <dwallacelf@gmail.com>
Mon, 27 Nov 2017 22:30:46 +0000 (22:30 +0000)
Change-Id: I3713b4c460a3cd414b560e16aac054aee2e1181b
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/plugins/dpdk/device/common.c
src/plugins/dpdk/device/init.c

index d488d69..e8f33cf 100644 (file)
@@ -41,6 +41,7 @@ dpdk_device_setup (dpdk_device_t * xd)
   dpdk_main_t *dm = &dpdk_main;
   vnet_main_t *vnm = vnet_get_main ();
   vnet_sw_interface_t *sw = vnet_get_sw_interface (vnm, xd->vlib_sw_if_index);
+  vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, xd->hw_if_index);
   int rv;
   int j;
 
@@ -108,6 +109,8 @@ dpdk_device_setup (dpdk_device_t * xd)
   if (vec_len (xd->errors))
     goto error;
 
+  rte_eth_dev_set_mtu (xd->device_index, hi->max_packet_bytes);
+
   if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
     dpdk_device_start (xd);
 
index 60f8ce6..7a6c5cf 100755 (executable)
@@ -103,26 +103,8 @@ dpdk_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hi, u32 flags)
     }
   else if (ETHERNET_INTERFACE_FLAG_CONFIG_MTU (flags))
     {
-      int rv;
-
       xd->port_conf.rxmode.max_rx_pkt_len = hi->max_packet_bytes;
-
-      if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
-       dpdk_device_stop (xd);
-
-      rv = rte_eth_dev_configure
-       (xd->device_index, xd->rx_q_used, xd->tx_q_used, &xd->port_conf);
-
-      if (rv < 0)
-       vlib_cli_output (vlib_get_main (),
-                        "rte_eth_dev_configure[%d]: err %d",
-                        xd->device_index, rv);
-
-      rte_eth_dev_set_mtu (xd->device_index, hi->max_packet_bytes);
-
-      if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
-       dpdk_device_start (xd);
-
+      dpdk_device_setup (xd);
     }
   return old;
 }