From 516ed17e6c6c59ab0ed4cd868a1205455cfe47ef Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Sat, 12 Oct 2019 23:36:41 +0200 Subject: Increase the default number of rx and tx descriptors to 2K 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 --- VNFs/DPPD-PROX/prox_port_cfg.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'VNFs/DPPD-PROX/prox_port_cfg.c') diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c index a0530c4f..de11dbff 100644 --- a/VNFs/DPPD-PROX/prox_port_cfg.c +++ b/VNFs/DPPD-PROX/prox_port_cfg.c @@ -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, -- cgit 1.2.3-korg