[dpdk-dev] [PATCH 01/11] common/mlx5: support receive queue user index
Xueming Li
xuemingl at nvidia.com
Sun Sep 26 13:18:54 CEST 2021
RQ user index is saved in CQE when packet received by RQ.
Signed-off-by: Xueming Li <xuemingl at nvidia.com>
---
drivers/common/mlx5/mlx5_prm.h | 8 +++++++-
drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index d361bcf90ef..72af3710a8f 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -393,7 +393,13 @@ struct mlx5_cqe {
uint16_t hdr_type_etc;
uint16_t vlan_info;
uint8_t lro_num_seg;
- uint8_t rsvd3[3];
+ union {
+ uint8_t user_index_bytes[3];
+ struct {
+ uint8_t user_index_hi;
+ uint16_t user_index_low;
+ } __rte_packed;
+ };
uint32_t flow_table_metadata;
uint8_t rsvd4[4];
uint32_t byte_cnt;
diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index c79445ce7d3..a151e4ce8dc 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -567,7 +567,7 @@ mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id,
uint16_t wq_counter
= (rte_be_to_cpu_16(cqe->wqe_counter) + 1) &
MLX5_REGEX_MAX_WQE_INDEX;
- size_t sqid = cqe->rsvd3[2];
+ size_t sqid = cqe->user_index_bytes[2];
struct mlx5_regex_sq *sq = &queue->sqs[sqid];
/* UMR mode WQE counter move as WQE set(4 WQEBBS).*/
--
2.33.0
More information about the dev
mailing list