diff options
author | 2016-06-06 13:21:04 +0200 | |
---|---|---|
committer | 2016-06-06 13:29:30 +0200 | |
commit | 39da6211a3371cee46642602f6d16b4afba37f83 (patch) | |
tree | e04e0de62fe2317ad4719877283258af5d832913 | |
parent | 3535222f979742d65c28a312d415aa6831f816d6 (diff) |
Add startup conf options to set per-interface descriptor ring size
This patch introduces following 2 startup options:
num-rx-desc
num-tx-desc
Which can be specified under the dpdk { dev PCI_ADDR {...} } or
dpdk { dev default {...} } .
"show hardware" output is extended to display what is set:
TenGigabitEthernet2/0/0 5 down TenGigabitEthernet2/0/0
Ethernet address 90:e2:ba:96:d0:54
Intel 82599
carrier up full duplex speed 10000 mtu 9216
rx queues 2, rx desc 512, tx queues 2, tx desc 1024
cpu socket 0
Change-Id: Ia832885c8e5cf0eb0575367e97581e7065934753
Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r-- | vnet/vnet/devices/dpdk/dpdk.h | 4 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/format.c | 14 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/init.c | 10 |
3 files changed, 21 insertions, 7 deletions
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h index 5ebb067e..4123cc9c 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 b093a99e..3aee0d92 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 58e16ee7..b49c4055 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 { |