Commit 8075411d authored by Erez Shitrit's avatar Erez Shitrit Committed by Saeed Mahameed

net/mlx5: DR, On creation set CQ's arm_db member to right value

In polling mode, set arm_db member to a value that will avoid CQ
event recovery by the HW.
Otherwise we might get event without completion function.
In addition,empty completion function to was added to protect from
unexpected events.

Fixes: 297ccceb ("net/mlx5: DR, Expose an internal API to issue RDMA operations")
Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Reviewed-by: default avatarAlex Vesker <valex@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent f8d1edda
...@@ -695,6 +695,12 @@ static void dr_cq_event(struct mlx5_core_cq *mcq, ...@@ -695,6 +695,12 @@ static void dr_cq_event(struct mlx5_core_cq *mcq,
pr_info("CQ event %u on CQ #%u\n", event, mcq->cqn); pr_info("CQ event %u on CQ #%u\n", event, mcq->cqn);
} }
static void dr_cq_complete(struct mlx5_core_cq *mcq,
struct mlx5_eqe *eqe)
{
pr_err("CQ completion CQ: #%u\n", mcq->cqn);
}
static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,
struct mlx5_uars_page *uar, struct mlx5_uars_page *uar,
size_t ncqe) size_t ncqe)
...@@ -756,6 +762,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, ...@@ -756,6 +762,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,
mlx5_fill_page_frag_array(&cq->wq_ctrl.buf, pas); mlx5_fill_page_frag_array(&cq->wq_ctrl.buf, pas);
cq->mcq.event = dr_cq_event; cq->mcq.event = dr_cq_event;
cq->mcq.comp = dr_cq_complete;
err = mlx5_core_create_cq(mdev, &cq->mcq, in, inlen, out, sizeof(out)); err = mlx5_core_create_cq(mdev, &cq->mcq, in, inlen, out, sizeof(out));
kvfree(in); kvfree(in);
...@@ -767,7 +774,12 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, ...@@ -767,7 +774,12 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,
cq->mcq.set_ci_db = cq->wq_ctrl.db.db; cq->mcq.set_ci_db = cq->wq_ctrl.db.db;
cq->mcq.arm_db = cq->wq_ctrl.db.db + 1; cq->mcq.arm_db = cq->wq_ctrl.db.db + 1;
*cq->mcq.set_ci_db = 0; *cq->mcq.set_ci_db = 0;
*cq->mcq.arm_db = 0;
/* set no-zero value, in order to avoid the HW to run db-recovery on
* CQ that used in polling mode.
*/
*cq->mcq.arm_db = cpu_to_be32(2 << 28);
cq->mcq.vector = 0; cq->mcq.vector = 0;
cq->mcq.irqn = irqn; cq->mcq.irqn = irqn;
cq->mcq.uar = uar; cq->mcq.uar = uar;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment