regex/mlx5: correct value written to doorbell db rec

Message ID 20230221074958.1486157-1-ggribbon@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series regex/mlx5: correct value written to doorbell db rec |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Gerry Gribbon Feb. 21, 2023, 7:49 a.m. UTC
  We were writing a value that should represent the number of items to be
processed by hardware. The value being written was off by 1 (N*4)+3;
The value should be (N*4) + 4 simplified to (N+1)*4

Fixes: 5dfa003db53f ("common/mlx5: fix post doorbell barrier")
Cc: stable@dpdk.org

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
---
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon March 10, 2023, 6:09 p.m. UTC | #1
21/02/2023 08:49, Gerry Gribbon:
> We were writing a value that should represent the number of items to be
> processed by hardware. The value being written was off by 1 (N*4)+3;
> The value should be (N*4) + 4 simplified to (N+1)*4
> 
> Fixes: 5dfa003db53f ("common/mlx5: fix post doorbell barrier")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>

Applied, thanks.

Note: better to say "doorbell record" instead of "db rec".
  

Patch

diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 143c7d7cdf..822370be83 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -211,8 +211,8 @@  send_doorbell(struct mlx5_regex_priv *priv, struct mlx5_regex_hw_qp *qp)
 			    (MLX5_SEND_WQE_BB << (priv->has_umr ? 2 : 0)) +
 			    (priv->has_umr ? MLX5_REGEX_UMR_WQE_SIZE : 0);
 	uint8_t *wqe = (uint8_t *)(uintptr_t)qp->qp_obj.wqes + wqe_offset;
-	uint32_t actual_pi = (priv->has_umr ? (qp->db_pi * 4 + 3) : qp->db_pi) &
-			     MLX5_REGEX_MAX_WQE_INDEX;
+	uint32_t actual_pi = (priv->has_umr ? ((1 + qp->db_pi) * 4) : qp->db_pi)
+			     & MLX5_REGEX_MAX_WQE_INDEX;
 
 	/* Or the fm_ce_se instead of set, avoid the fence be cleared. */
 	((struct mlx5_wqe_ctrl_seg *)wqe)->fm_ce_se |= MLX5_WQE_CTRL_CQ_UPDATE;