Workaround DPDK net/virtio queue setup issue 73/61773/2
authorPatrice Buriez <patrice.buriez@intel.com>
Mon, 3 Sep 2018 16:55:24 +0000 (18:55 +0200)
committerPatrice Buriez <patrice.buriez@intel.com>
Tue, 4 Sep 2018 14:35:33 +0000 (16:35 +0200)
JIRA: SAMPLEVNF-127

PROX was crashing in the VM with vector mode enabled and multiple OVS
queues. This was not really a PROX bug, but a DPDK issue, which has been
fixed by DPDK commit https://git.dpdk.org/dpdk/commit/?id=efc83a1e7fc3
This "net/virtio: fix queue setup consistency" is included in DPDK 17.11
and subsequent versions, and has been backported into:
- DPDK 16.11.4:
  https://git.dpdk.org/dpdk-stable/commit/?h=16.11&id=516447a5056c
- DPDK 17.08.1:
  https://git.dpdk.org/dpdk-stable/commit/?h=17.08&id=907fe4fc263e

This means the fix is not included into any DPDK 17.02.x used by NSB.
Fortunately, a simple workaround consists of calling
rte_eth_tx_queue_setup() before rte_eth_rx_queue_setup().

This change implements this simple workaround, in order to make PROX
work, even with unfixed DPDK versions.

Change-Id: I818e9bb812babe023c6b7225c8b9769a359d9bec
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
VNFs/DPPD-PROX/prox_port_cfg.c

index d080f5a..7b763c5 100644 (file)
@@ -384,19 +384,6 @@ static void init_port(struct prox_port_cfg *port_cfg)
 
        plog_info("\t\tMAC address set to "MAC_BYTES_FMT"\n", MAC_BYTES(port_cfg->eth_addr.addr_bytes));
 
-       /* initialize RX queues */
-       for (uint16_t queue_id = 0; queue_id < port_cfg->n_rxq; ++queue_id) {
-               plog_info("\t\tSetting up RX queue %u on port %u on socket %u with %u desc (pool 0x%p)\n",
-                         queue_id, port_id, port_cfg->socket,
-                         port_cfg->n_rxd, port_cfg->pool[queue_id]);
-
-               ret = rte_eth_rx_queue_setup(port_id, queue_id,
-                                            port_cfg->n_rxd,
-                                            port_cfg->socket, &port_cfg->rx_conf,
-                                            port_cfg->pool[queue_id]);
-
-               PROX_PANIC(ret < 0, "\t\t\trte_eth_rx_queue_setup() failed on port %u: error %s (%d)\n", port_id, strerror(-ret), ret);
-       }
        if (port_cfg->capabilities.tx_offload_cksum == 0) {
                port_cfg->tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOOFFLOADS;
                plog_info("\t\tDisabling TX offloads as pmd reports that it does not support them)\n");
@@ -406,7 +393,8 @@ static void init_port(struct prox_port_cfg *port_cfg)
                port_cfg->tx_conf.txq_flags |= ETH_TXQ_FLAGS_NOMULTSEGS;
                plog_info("\t\tDisabling multsegs on port %d as vmxnet3 does not support them\n", port_id);
        }
-       /* initialize one TX queue per logical core on each port */
+
+       /* initialize TX queues first */
        for (uint16_t queue_id = 0; queue_id < port_cfg->n_txq; ++queue_id) {
                plog_info("\t\tSetting up TX queue %u on socket %u with %u desc\n",
                          queue_id, port_cfg->socket, port_cfg->n_txd);
@@ -415,6 +403,18 @@ static void init_port(struct prox_port_cfg *port_cfg)
                PROX_PANIC(ret < 0, "\t\t\trte_eth_tx_queue_setup() failed on port %u: error %d\n", port_id, ret);
        }
 
+       /* initialize RX queues */
+       for (uint16_t queue_id = 0; queue_id < port_cfg->n_rxq; ++queue_id) {
+               plog_info("\t\tSetting up RX queue %u on port %u on socket %u with %u desc (pool 0x%p)\n",
+                         queue_id, port_id, port_cfg->socket,
+                         port_cfg->n_rxd, port_cfg->pool[queue_id]);
+               ret = rte_eth_rx_queue_setup(port_id, queue_id,
+                                            port_cfg->n_rxd,
+                                            port_cfg->socket, &port_cfg->rx_conf,
+                                            port_cfg->pool[queue_id]);
+               PROX_PANIC(ret < 0, "\t\t\trte_eth_rx_queue_setup() failed on port %u: error %s (%d)\n", port_id, strerror(-ret), ret);
+       }
+
        plog_info("\t\tStarting up port %u ...", port_id);
        ret = rte_eth_dev_start(port_id);