Skip to content

Commit 5e6ad64

Browse files
Maxim Mikityanskiygregkh
authored andcommitted
net/mlx5e: Fix ICOSQ recovery flow for XSK
[ Upstream commit 19c4aba ] There are two ICOSQs per channel: one is needed for RX, and the other for async operations (XSK TX, kTLS offload). Currently, the recovery flow for both is the same, and async ICOSQ is mistakenly treated like the regular ICOSQ. This patch prevents running the regular ICOSQ recovery on async ICOSQ. The purpose of async ICOSQ is to handle XSK wakeup requests and post kTLS offload RX parameters, it has nothing to do with RQ and XSKRQ UMRs, so the regular recovery sequence is not applicable here. Fixes: be5323c ("net/mlx5e: Report and recover from CQE error on ICOSQ") Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Reviewed-by: Aya Levin <ayal@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7366516 commit 5e6ad64

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

‎drivers/net/ethernet/mellanox/mlx5/core/en.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,9 +916,6 @@ void mlx5e_deactivate_rq(struct mlx5e_rq *rq);
916916
void mlx5e_close_rq(struct mlx5e_rq *rq);
917917

918918
struct mlx5e_sq_param;
919-
int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params,
920-
struct mlx5e_sq_param *param, struct mlx5e_icosq *sq);
921-
void mlx5e_close_icosq(struct mlx5e_icosq *sq);
922919
int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
923920
struct mlx5e_sq_param *param, struct xsk_buff_pool *xsk_pool,
924921
struct mlx5e_xdpsq *sq, bool is_redirect);

‎drivers/net/ethernet/mellanox/mlx5/core/en_main.c‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,9 +1051,20 @@ static void mlx5e_icosq_err_cqe_work(struct work_struct *recover_work)
10511051
mlx5e_reporter_icosq_cqe_err(sq);
10521052
}
10531053

1054+
static void mlx5e_async_icosq_err_cqe_work(struct work_struct *recover_work)
1055+
{
1056+
struct mlx5e_icosq *sq = container_of(recover_work, struct mlx5e_icosq,
1057+
recover_work);
1058+
1059+
/* Not implemented yet. */
1060+
1061+
netdev_warn(sq->channel->netdev, "async_icosq recovery is not implemented\n");
1062+
}
1063+
10541064
static int mlx5e_alloc_icosq(struct mlx5e_channel *c,
10551065
struct mlx5e_sq_param *param,
1056-
struct mlx5e_icosq *sq)
1066+
struct mlx5e_icosq *sq,
1067+
work_func_t recover_work_func)
10571068
{
10581069
void *sqc_wq = MLX5_ADDR_OF(sqc, param->sqc, wq);
10591070
struct mlx5_core_dev *mdev = c->mdev;
@@ -1073,7 +1084,7 @@ static int mlx5e_alloc_icosq(struct mlx5e_channel *c,
10731084
if (err)
10741085
goto err_sq_wq_destroy;
10751086

1076-
INIT_WORK(&sq->recover_work, mlx5e_icosq_err_cqe_work);
1087+
INIT_WORK(&sq->recover_work, recover_work_func);
10771088

10781089
return 0;
10791090

@@ -1423,13 +1434,14 @@ static void mlx5e_tx_err_cqe_work(struct work_struct *recover_work)
14231434
mlx5e_reporter_tx_err_cqe(sq);
14241435
}
14251436

1426-
int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params,
1427-
struct mlx5e_sq_param *param, struct mlx5e_icosq *sq)
1437+
static int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params,
1438+
struct mlx5e_sq_param *param, struct mlx5e_icosq *sq,
1439+
work_func_t recover_work_func)
14281440
{
14291441
struct mlx5e_create_sq_param csp = {};
14301442
int err;
14311443

1432-
err = mlx5e_alloc_icosq(c, param, sq);
1444+
err = mlx5e_alloc_icosq(c, param, sq, recover_work_func);
14331445
if (err)
14341446
return err;
14351447

@@ -1459,7 +1471,7 @@ void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq)
14591471
synchronize_net(); /* Sync with NAPI. */
14601472
}
14611473

1462-
void mlx5e_close_icosq(struct mlx5e_icosq *sq)
1474+
static void mlx5e_close_icosq(struct mlx5e_icosq *sq)
14631475
{
14641476
struct mlx5e_channel *c = sq->channel;
14651477

@@ -1862,11 +1874,13 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,
18621874

18631875
spin_lock_init(&c->async_icosq_lock);
18641876

1865-
err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq);
1877+
err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq,
1878+
mlx5e_async_icosq_err_cqe_work);
18661879
if (err)
18671880
goto err_disable_napi;
18681881

1869-
err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq);
1882+
err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq,
1883+
mlx5e_icosq_err_cqe_work);
18701884
if (err)
18711885
goto err_close_async_icosq;
18721886

0 commit comments

Comments
 (0)