summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_defs.h
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2018-06-26 04:33:35 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2018-07-03 01:35:58 +0200
commite10245a13b2e340f48ce80484f19bcbc13e9ebe6 (patch)
tree8f0de8d640641bcdaab729683b5733842c0b97cd /drivers/net/mlx5/mlx5_defs.h
parent342a7bdd6e413cbb360289811601c516ec8b56a0 (diff)
downloaddpdk-next-eventdev-e10245a13b2e340f48ce80484f19bcbc13e9ebe6.zip
dpdk-next-eventdev-e10245a13b2e340f48ce80484f19bcbc13e9ebe6.tar.gz
dpdk-next-eventdev-e10245a13b2e340f48ce80484f19bcbc13e9ebe6.tar.xz
net/mlx5: fix Rx buffer replenishment threshold
The threshold of buffer replenishment for vectorized Rx burst is a constant value (64). If the size of Rx queue is comparatively small, device could run out of buffers. For example, if the size of Rx queue is 128, buffers are replenished only twice per a wraparound. This can cause jitter in receiving packets and the jitter can cause unnecessary retransmission for TCP connections. Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86") Fixes: 570acdb1da8a ("net/mlx5: add vectorized Rx/Tx burst for ARM") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_defs.h')
-rw-r--r--drivers/net/mlx5/mlx5_defs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 51124cd..b52f7dc 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -64,10 +64,11 @@
#define MLX5_VPMD_MIN_TXQS 4
/* Threshold of buffer replenishment for vectorized Rx. */
-#define MLX5_VPMD_RXQ_RPLNSH_THRESH 64U
+#define MLX5_VPMD_RXQ_RPLNSH_THRESH(n) \
+ (RTE_MIN(MLX5_VPMD_RX_MAX_BURST, (unsigned int)(n) >> 2))
/* Maximum size of burst for vectorized Rx. */
-#define MLX5_VPMD_RX_MAX_BURST MLX5_VPMD_RXQ_RPLNSH_THRESH
+#define MLX5_VPMD_RX_MAX_BURST 64U
/*
* Maximum size of burst for vectorized Tx. This is related to the maximum size