aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFan Zhang <roy.fan.zhang@intel.com>2022-03-10 14:49:19 +0000
committerFan Zhang <roy.fan.zhang@intel.com>2022-06-15 07:30:38 +0000
commit73fdb095b36ce6b780cf6d1a6c20effe2e9a684a (patch)
treea8bd15a361baf636c502d7e17b54f5a10abfa381
parent3159d1c2107698b2bdc17dc889088058540f9e10 (diff)
dpdk: improve rx burst count per loop
Type: improvement This patch improves the per dpdk-input loop number of packets received from the port. The change mimics how packets rx happened before VPP 22.02/DPDK 21.11: instead of trying to rx huge number of packets (256) in one go, rx more times with up to 32 packets max each time. Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Change-Id: I804dce6d9121ab21b02e53dd0328dc52ac49d80f (cherry picked from commit a9fe20f4b8f7a9bd65cc8ee1b6a0204af7fc3627)
-rw-r--r--src/plugins/dpdk/device/node.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c
index d83fa35b177..3ae74e096fc 100644
--- a/src/plugins/dpdk/device/node.c
+++ b/src/plugins/dpdk/device/node.c
@@ -364,12 +364,13 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd,
/* get up to DPDK_RX_BURST_SZ buffers from PMD */
while (n_rx_packets < DPDK_RX_BURST_SZ)
{
- n = rte_eth_rx_burst (xd->port_id, queue_id,
- ptd->mbufs + n_rx_packets,
- DPDK_RX_BURST_SZ - n_rx_packets);
+ u32 n_to_rx = clib_min (DPDK_RX_BURST_SZ - n_rx_packets, 32);
+
+ n = rte_eth_rx_burst (xd->port_id, queue_id, ptd->mbufs + n_rx_packets,
+ n_to_rx);
n_rx_packets += n;
- if (n < 32)
+ if (n < n_to_rx)
break;
}