From: Matthew Smith Date: Wed, 25 Sep 2024 16:26:58 +0000 (-0500) Subject: dpdk: validate number of tx descriptors X-Git-Tag: v25.06-rc0~213 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=e7226a21274c48909a76dde69ea00a38f5413438;p=vpp.git dpdk: validate number of tx descriptors The default number of tx descriptors per queue is 1024. On some device types, this is larger than the maximum allowed value and rte_eth_tx_queue_setup() can return an error. Compare the configured value to the maximum value for each device and set the configured value to the maximum value if the configured value is larger. Type: improvement Signed-off-by: Matthew Smith Change-Id: Ie29c5c6d58c76388f65f266032821140b0f879fb --- diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index e63a281a175..ec9e6045de7 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -503,6 +503,14 @@ dpdk_lib_init (dpdk_main_t * dm) else if (dr && dr->n_tx_desc) xd->conf.n_tx_desc = dr->n_tx_desc; + if (xd->conf.n_tx_desc > di.tx_desc_lim.nb_max) + { + dpdk_log_warn ("[%u] Configured number of TX descriptors (%u) is " + "bigger than maximum supported (%u)", + port_id, xd->conf.n_tx_desc, di.tx_desc_lim.nb_max); + xd->conf.n_tx_desc = di.tx_desc_lim.nb_max; + } + dpdk_log_debug ( "[%u] n_rx_queues: %u n_tx_queues: %u n_rx_desc: %u n_tx_desc: %u", port_id, xd->conf.n_rx_queues, xd->conf.n_tx_queues,