提交 5fd08f65 编写于 作者: Y Yevgeny Kliteynik 提交者: Saeed Mahameed

net/mlx5: DR, Check device state when polling CQ

Calling fast teardown as part of the normal unloading caused
a problem with SW steering - SW steering still needs to clear
its tables, write to ICM and poll for completions.
When teardown has been done, SW steering keeps polling the CQ
forever, because nobody flushes it.

This patch fixes the issue by checking the device state in
cases where no CQE was returned.
Signed-off-by: NYevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: NAlex Vesker <valex@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 c4193a12
...@@ -78,8 +78,15 @@ static int dr_cq_poll_one(struct mlx5dr_cq *dr_cq) ...@@ -78,8 +78,15 @@ static int dr_cq_poll_one(struct mlx5dr_cq *dr_cq)
int err; int err;
cqe64 = mlx5_cqwq_get_cqe(&dr_cq->wq); cqe64 = mlx5_cqwq_get_cqe(&dr_cq->wq);
if (!cqe64) if (!cqe64) {
if (unlikely(dr_cq->mdev->state ==
MLX5_DEVICE_STATE_INTERNAL_ERROR)) {
mlx5_core_dbg_once(dr_cq->mdev,
"Polling CQ while device is shutting down\n");
return CQ_POLL_ERR;
}
return CQ_EMPTY; return CQ_EMPTY;
}
mlx5_cqwq_pop(&dr_cq->wq); mlx5_cqwq_pop(&dr_cq->wq);
err = dr_parse_cqe(dr_cq, cqe64); err = dr_parse_cqe(dr_cq, cqe64);
...@@ -833,6 +840,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, ...@@ -833,6 +840,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev,
cq->mcq.vector = 0; cq->mcq.vector = 0;
cq->mcq.uar = uar; cq->mcq.uar = uar;
cq->mdev = mdev;
return cq; return cq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册