summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vnet/vnet/devices/dpdk/dpdk.h4
-rw-r--r--vnet/vnet/devices/dpdk/format.c14
-rw-r--r--vnet/vnet/devices/dpdk/init.c10
3 files changed, 21 insertions, 7 deletions
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h
index 5ebb067e981..4123cc9cbef 100644
--- a/vnet/vnet/devices/dpdk/dpdk.h
+++ b/vnet/vnet/devices/dpdk/dpdk.h
@@ -311,7 +311,9 @@ typedef struct dpdk_efd_t {
#define foreach_dpdk_device_config_item \
_ (num_rx_queues) \
- _ (num_tx_queues)
+ _ (num_tx_queues) \
+ _ (num_rx_desc) \
+ _ (num_tx_desc)
typedef struct {
vlib_pci_addr_t pci_addr;
diff --git a/vnet/vnet/devices/dpdk/format.c b/vnet/vnet/devices/dpdk/format.c
index b093a99e203..3aee0d9275f 100644
--- a/vnet/vnet/devices/dpdk/format.c
+++ b/vnet/vnet/devices/dpdk/format.c
@@ -486,6 +486,8 @@ u8 * format_dpdk_device (u8 * s, va_list * args)
pci->addr.devid, pci->addr.function);
s = format(s, "%Umax rx packet len: %d\n",
format_white_space, indent + 2, di.max_rx_pktlen);
+ s = format(s, "%Umax num of queues: rx %d tx %d\n",
+ format_white_space, indent + 2, di.max_rx_queues, di.max_tx_queues);
s = format(s, "%Upromiscuous: unicast %s all-multicast %s\n",
format_white_space, indent + 2,
rte_eth_promiscuous_get(xd->device_index) ? "on" : "off",
@@ -517,12 +519,14 @@ u8 * format_dpdk_device (u8 * s, va_list * args)
xd->tx_q_used, xd->tx_q_used);
}
+ s = format (s, "%Urx queues %d, rx desc %d, tx queues %d, tx desc %d\n",
+ format_white_space, indent + 2,
+ xd->rx_q_used, xd->nb_rx_desc,
+ xd->tx_q_used, xd->nb_tx_desc);
+
if (xd->cpu_socket > -1)
- s = format (s, "%Ucpu socket %d\n%Uqueues rx %d (%d) tx %d (%d)",
- format_white_space, indent + 2, xd->cpu_socket,
- format_white_space, indent + 2,
- xd->rx_q_used, di.max_rx_queues,
- xd->tx_q_used, di.max_tx_queues);
+ s = format (s, "%Ucpu socket %d\n",
+ format_white_space, indent + 2, xd->cpu_socket);
/* $$$ MIB counters */
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index 58e16ee71e0..b49c405504c 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -504,7 +504,11 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->port_type = VNET_DPDK_PORT_TYPE_NETMAP;
}
#endif
+ if (devconf->num_rx_desc)
+ xd->nb_rx_desc = devconf->num_rx_desc;
+ if (devconf->num_tx_desc)
+ xd->nb_tx_desc = devconf->num_tx_desc;
}
/*
@@ -871,7 +875,11 @@ dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr, unforma
{
if (unformat (input, "num-rx-queues %u", &devconf->num_rx_queues))
;
- if (unformat (input, "num-tx-queues %u", &devconf->num_tx_queues))
+ else if (unformat (input, "num-tx-queues %u", &devconf->num_tx_queues))
+ ;
+ else if (unformat (input, "num-rx-desc %u", &devconf->num_rx_desc))
+ ;
+ else if (unformat (input, "num-tx-desc %u", &devconf->num_tx_desc))
;
else
{