Increase the default number of rx and tx descriptors to 2K 21/68621/2
authorXavier Simonart <xavier.simonart@intel.com>
Sat, 12 Oct 2019 21:36:41 +0000 (23:36 +0200)
committerXavier Simonart <xavier.simonart@intel.com>
Sat, 12 Oct 2019 22:38:33 +0000 (00:38 +0200)
A high number of RX descriptor can be helpful in avoiding
packet loss due to the core being interrupted.
This commit increases the default number of descriptors from 256 to 2K.

Those values are checked versus the minimum and maximum supported by the pmd.
Number of mbufs (mempool size) have been updated n config files to support this
default number of dsescriptors.

The number of descriptors can still be overwritten by the config file. However
those values must always remain within the limits reported by the pmd.

Change-Id: I5f7999eca886dad68f3c0733da0d796bf4c06a56
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
12 files changed:
VNFs/DPPD-PROX/config/cgnat.cfg
VNFs/DPPD-PROX/config/l2fwd-4ports.cfg
VNFs/DPPD-PROX/config/l3fwd-4ports.cfg
VNFs/DPPD-PROX/config/mcast.cfg
VNFs/DPPD-PROX/config/nop-rings.cfg
VNFs/DPPD-PROX/config/nop.cfg
VNFs/DPPD-PROX/config/nsh_acl.cfg
VNFs/DPPD-PROX/config/nsh_nat.cfg
VNFs/DPPD-PROX/defaults.c
VNFs/DPPD-PROX/helper-scripts/rapid/swap.cfg
VNFs/DPPD-PROX/prox_port_cfg.c
VNFs/DPPD-PROX/prox_port_cfg.h

index 4015d3a..cae02c7 100644 (file)
@@ -30,7 +30,7 @@ nat_table = dofile("cgnat_table.lua")
 lpm4 = dofile("ipv4_1port.lua")
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [global]
 start time=5
index 27fd08e..7049606 100644 (file)
@@ -32,7 +32,7 @@ name=if3
 mac=50:00:00:00:00:04
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [global]
 start time=5
index 3c452b0..a8cae86 100644 (file)
@@ -32,7 +32,7 @@ name=if3
 mac=50:00:00:00:00:04
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [lua]
 lpm4 = dofile("ipv4.lua")
index 3e673e5..9257c85 100644 (file)
@@ -46,7 +46,7 @@ multicast=01:00:5e:00:00:04
 $mbs=8
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [global]
 start time=5
index 000353a..7513c43 100644 (file)
@@ -67,7 +67,7 @@ rx_ring=dpdkr3_tx
 tx_ring=dpdkr3_rx
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [global]
 start time=5
index 757b1ed..2741b41 100644 (file)
@@ -44,7 +44,7 @@ name=if3
 mac=hardware
 
 [defaults]
-mempool size=2K
+mempool size=8K
 
 [global]
 start time=5
index 2893bd4..6ad1d5f 100644 (file)
@@ -28,7 +28,7 @@ mac=hardware
 acl_table=dofile("acl_table.lua")
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [global]
 start time=5
index bb3bf4b..3ae82c4 100644 (file)
@@ -28,7 +28,7 @@ mac=hardware
 nat_table = dofile("nat_table.lua")
 
 [defaults]
-mempool size=4K
+mempool size=8K
 
 [global]
 start time=5
index e1180f1..3dbb7ec 100644 (file)
@@ -34,8 +34,8 @@
 #define NB_PIPES        32768
 #define NB_MBUF         4096
 #define RING_RX_SIZE    256
-#define NB_RX_RING_DESC 256
-#define NB_TX_RING_DESC 256
+#define NB_RX_RING_DESC 2048
+#define NB_TX_RING_DESC 2048
 
 /* 1500000 milliseconds */
 #define DEFAULT_CPE_TIMEOUT_MS    1500000
index b2f39c9..04b37c3 100644 (file)
@@ -27,7 +27,7 @@ mac=hardware
 vlan=yes
 
 [defaults]
-mempool size=2K
+mempool size=8K
 
 [global]
 name=${name}
index a0530c4..de11dbf 100644 (file)
@@ -224,9 +224,14 @@ void init_rte_dev(int use_dummy_devices)
                port_cfg->max_rxq = dev_info.max_rx_queues;
                port_cfg->max_rx_pkt_len = dev_info.max_rx_pktlen;
                port_cfg->min_rx_bufsize = dev_info.min_rx_bufsize;
+               port_cfg->min_tx_desc = dev_info.tx_desc_lim.nb_min;
+               port_cfg->max_tx_desc = dev_info.tx_desc_lim.nb_max;
+               port_cfg->min_rx_desc = dev_info.rx_desc_lim.nb_min;
+               port_cfg->max_rx_desc = dev_info.rx_desc_lim.nb_max;
 
                prox_strncpy(port_cfg->driver_name, dev_info.driver_name, sizeof(port_cfg->driver_name));
                plog_info("\tPort %u : driver='%s' tx_queues=%d rx_queues=%d\n", port_id, !strcmp(port_cfg->driver_name, "")? "null" : port_cfg->driver_name, port_cfg->max_txq, port_cfg->max_rxq);
+               plog_info("\tPort %u : %d<=nb_tx_desc<=%d %d<=nb_rx_desc<=%d\n", port_id, port_cfg->min_tx_desc, port_cfg->max_tx_desc, port_cfg->min_rx_desc, port_cfg->max_rx_desc);
 
                if (strncmp(port_cfg->driver_name, "rte_", 4) == 0) {
                        prox_strncpy(port_cfg->short_name, prox_port_cfg[port_id].driver_name + 4, sizeof(port_cfg->short_name));
@@ -612,12 +617,24 @@ static void init_port(struct prox_port_cfg *port_cfg)
                port_cfg->port_conf.intr_conf.lsc = port_cfg->lsc_val;
                plog_info("\t\tOverriding link state interrupt configuration to '%s'\n", port_cfg->lsc_val? "enabled" : "disabled");
        }
-       if (!strcmp(port_cfg->short_name, "vmxnet3")) {
-               if (port_cfg->n_txd < 512) {
-                       // Vmxnet3 driver requires minimum 512 tx descriptors
-                       plog_info("\t\tNumber of TX descriptors is set to 512 (minimum required for vmxnet3\n");
-                       port_cfg->n_txd = 512;
-               }
+       if (port_cfg->n_txd < port_cfg->min_tx_desc) {
+               plog_info("\t\tNumber of TX descriptors is set to %d (minimum required for %s\n", port_cfg->min_tx_desc, port_cfg->short_name);
+               port_cfg->n_txd = port_cfg->min_tx_desc;
+       }
+
+       if (port_cfg->n_rxd < port_cfg->min_rx_desc) {
+               plog_info("\t\tNumber of RX descriptors is set to %d (minimum required for %s\n", port_cfg->min_rx_desc, port_cfg->short_name);
+               port_cfg->n_rxd = port_cfg->min_rx_desc;
+       }
+
+       if (port_cfg->n_txd > port_cfg->max_tx_desc) {
+               plog_info("\t\tNumber of TX descriptors is set to %d (maximum required for %s\n", port_cfg->max_tx_desc, port_cfg->short_name);
+               port_cfg->n_txd = port_cfg->max_tx_desc;
+       }
+
+       if (port_cfg->n_rxd > port_cfg->max_rx_desc) {
+               plog_info("\t\tNumber of RX descriptors is set to %d (maximum required for %s\n", port_cfg->max_rx_desc, port_cfg->short_name);
+               port_cfg->n_rxd = port_cfg->max_rx_desc;
        }
 
        ret = rte_eth_dev_configure(port_id, port_cfg->n_rxq,
index c025c03..6a02cf0 100644 (file)
@@ -72,6 +72,10 @@ struct prox_port_cfg {
        } capabilities;
        uint32_t max_rx_pkt_len;
        uint32_t min_rx_bufsize;
+       uint16_t min_rx_desc;
+       uint16_t max_rx_desc;
+       uint16_t min_tx_desc;
+       uint16_t max_tx_desc;
        uint32_t nb_mc_addr;
        struct ether_addr mc_addr[NB_MCAST_ADDR];
 };