summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxq.c
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2018-06-26 05:39:24 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2018-07-03 01:35:58 +0200
commit1787eb7b4d793538a90b7380e9c4e1a974a1c0e6 (patch)
treebb73aa24b9b1a2f4df612f856ab00cb2a8d244d3 /drivers/net/mlx5/mlx5_rxq.c
parent5c0e2db6194ab2d0f0c7861155489a7c3fdbf0cc (diff)
downloaddpdk-1787eb7b4d793538a90b7380e9c4e1a974a1c0e6.zip
dpdk-1787eb7b4d793538a90b7380e9c4e1a974a1c0e6.tar.gz
dpdk-1787eb7b4d793538a90b7380e9c4e1a974a1c0e6.tar.xz
net/mlx5: use stride index in Rx completion entry
Multi-Packet Receive Queue is to receive multiple packets on a single large buffer. The number of consumed strides in CQE is accumulated to keep track of the current stride index. However, it is safer to directly use stride index in CQE to avoid out-of-order situation which can possibly be caused by introducing LRO in the future. If Rx CQE compression is enabled, HW can be configured to store the stride index in a mini-CQE but this will need newer version of library/driver. Therefore, since this change, MPRQ is only supported with the newer library/driver and Rx hash result is not supported if MPRQ is enabled along with Rx CQE compression. Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxq.c')
-rw-r--r--drivers/net/mlx5/mlx5_rxq.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 17db7c1..08dd559 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -818,7 +818,13 @@ mlx5_rxq_ibv_new(struct rte_eth_dev *dev, uint16_t idx)
if (config->cqe_comp && !rxq_data->hw_timestamp) {
attr.cq.mlx5.comp_mask |=
MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE;
+#ifdef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT
+ attr.cq.mlx5.cqe_comp_res_format =
+ mprq_en ? MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX :
+ MLX5DV_CQE_RES_FORMAT_HASH;
+#else
attr.cq.mlx5.cqe_comp_res_format = MLX5DV_CQE_RES_FORMAT_HASH;
+#endif
/*
* For vectorized Rx, it must not be doubled in order to
* make cq_ci and rq_ci aligned.
@@ -976,7 +982,7 @@ mlx5_rxq_ibv_new(struct rte_eth_dev *dev, uint16_t idx)
rxq_data->rq_db = rwq.dbrec;
rxq_data->cqe_n = log2above(cq_info.cqe_cnt);
rxq_data->cq_ci = 0;
- rxq_data->strd_ci = 0;
+ rxq_data->consumed_strd = 0;
rxq_data->rq_pi = 0;
rxq_data->zip = (struct rxq_zip){
.ai = 0,