Skip to contentSkip to conversation

vdpa/mlx5: fix completion queue assertion

PATCH Applied Matan Azrad 2 participants 3 messages Sep 2, 2020 – Sep 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vdpa/mlx5: fix completion queue assertion

The CQ configuration enables the collapse feature in HW what cause HW to write all the completions in the first CQE.
When this feature is enabled the HW doesn't switch the owner bit when it starts a new cycle of the CQ, not like working without the collapse feature.

The current SW CQ polling wrongly added an assertion to validate the owner bit switch what causes a panic in debug mode.

Remove the aforementioned assertion.

Fixes c5f714e50b0e ("vdpa/mlx5: optimize completion queue poll")
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 --
 1 file changed, 2 deletions(-)
drivers/vdpa/mlx5/mlx5_vdpa_event.c +0 -2
index 5a2d4fb..742ee62 100644
@@ -205,8 +205,6 @@
 	comp = (cur_wqe_counter + 1u - next_wqe_counter) & cq_mask;
 	if (comp) {
 		cq->cq_ci += comp;
-		MLX5_ASSERT(!!(cq->cq_ci & cq_size) ==
-			    MLX5_CQE_OWNER(last_word.op_own));
 		MLX5_ASSERT(MLX5_CQE_OPCODE(last_word.op_own) !=
 			    MLX5_CQE_INVALID);
 		if (unlikely(!(MLX5_CQE_OPCODE(last_word.op_own) ==
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Matan Azrad

The CQ configuration enables the collapse feature in HW what cause HW to write all the completions in the first CQE.
When this feature is enabled the HW doesn't switch the owner bit when it starts a new cycle of the CQ, not like working without the collapse feature.

The current SW CQ polling wrongly added an assertion to validate the owner bit switch what causes a panic in debug mode.

Remove the aforementioned assertion.

Fixes c5f714e50b0e ("vdpa/mlx5: optimize completion queue poll")
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 --
 1 file changed, 2 deletions(-)
drivers/vdpa/mlx5/mlx5_vdpa_event.c +0 -0
index 5a2d4fb..742ee62 100644

drivers/vdpa/mlx5/mlx5_vdpa_event.c line 210

Quoted 8 lines
drivers/vdpa/mlx5/mlx5_vdpa_event.c +0 -2
@@ -205,8 +205,6 @@
 	comp = (cur_wqe_counter + 1u - next_wqe_counter) & cq_mask;
 	if (comp) {
 		cq->cq_ci += comp;
-		MLX5_ASSERT(!!(cq->cq_ci & cq_size) ==
-			    MLX5_CQE_OWNER(last_word.op_own));
 		MLX5_ASSERT(MLX5_CQE_OPCODE(last_word.op_own) !=
 			    MLX5_CQE_INVALID);
 		if (unlikely(!(MLX5_CQE_OPCODE(last_word.op_own) ==

Thanks,
Maxime

#2 lore raw
In reply to Matan Azrad
Quoted 11 lines · Matan Azrad

The CQ configuration enables the collapse feature in HW what cause HW to write all the completions in the first CQE.
When this feature is enabled the HW doesn't switch the owner bit when it starts a new cycle of the CQ, not like working without the collapse feature.

The current SW CQ polling wrongly added an assertion to validate the owner bit switch what causes a panic in debug mode.

Remove the aforementioned assertion.

Quoted 8 lines
Fixes c5f714e50b0e ("vdpa/mlx5: optimize completion queue poll")
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 --
 1 file changed, 2 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime