Skip to content

Commit 19c4aba

Browse files
Maxim MikityanskiySaeed Mahameed
authored andcommitted
net/mlx5e: Fix ICOSQ recovery flow for XSK
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>
1 parent 17958d7 commit 19c4aba

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
@@ -1016,9 +1016,6 @@ int mlx5e_create_rq(struct mlx5e_rq *rq, struct mlx5e_rq_param *param);
10161016
void mlx5e_destroy_rq(struct mlx5e_rq *rq);
10171017

10181018
struct mlx5e_sq_param;
1019-
int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params,
1020-
struct mlx5e_sq_param *param, struct mlx5e_icosq *sq);
1021-
void mlx5e_close_icosq(struct mlx5e_icosq *sq);
10221019
int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
10231020
struct mlx5e_sq_param *param, struct xsk_buff_pool *xsk_pool,
10241021
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
@@ -1214,9 +1214,20 @@ static void mlx5e_icosq_err_cqe_work(struct work_struct *recover_work)
12141214
mlx5e_reporter_icosq_cqe_err(sq);
12151215
}
12161216

1217+
static void mlx5e_async_icosq_err_cqe_work(struct work_struct *recover_work)
1218+
{
1219+
struct mlx5e_icosq *sq = container_of(recover_work, struct mlx5e_icosq,
1220+
recover_work);
1221+
1222+
/* Not implemented yet. */
1223+
1224+
netdev_warn(sq->channel->netdev, "async_icosq recovery is not implemented\n");
1225+
}
1226+
12171227
static int mlx5e_alloc_icosq(struct mlx5e_channel *c,
12181228
struct mlx5e_sq_param *param,
1219-
struct mlx5e_icosq *sq)
1229+
struct mlx5e_icosq *sq,
1230+
work_func_t recover_work_func)
12201231
{
12211232
void *sqc_wq = MLX5_ADDR_OF(sqc, param->sqc, wq);
12221233
struct mlx5_core_dev *mdev = c->mdev;
@@ -1237,7 +1248,7 @@ static int mlx5e_alloc_icosq(struct mlx5e_channel *c,
12371248
if (err)
12381249
goto err_sq_wq_destroy;
12391250

1240-
INIT_WORK(&sq->recover_work, mlx5e_icosq_err_cqe_work);
1251+
INIT_WORK(&sq->recover_work, recover_work_func);
12411252

12421253
return 0;
12431254

@@ -1573,13 +1584,14 @@ void mlx5e_tx_err_cqe_work(struct work_struct *recover_work)
15731584
mlx5e_reporter_tx_err_cqe(sq);
15741585
}
15751586

1576-
int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params,
1577-
struct mlx5e_sq_param *param, struct mlx5e_icosq *sq)
1587+
static int mlx5e_open_icosq(struct mlx5e_channel *c, struct mlx5e_params *params,
1588+
struct mlx5e_sq_param *param, struct mlx5e_icosq *sq,
1589+
work_func_t recover_work_func)
15781590
{
15791591
struct mlx5e_create_sq_param csp = {};
15801592
int err;
15811593

1582-
err = mlx5e_alloc_icosq(c, param, sq);
1594+
err = mlx5e_alloc_icosq(c, param, sq, recover_work_func);
15831595
if (err)
15841596
return err;
15851597

@@ -1618,7 +1630,7 @@ void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq)
16181630
synchronize_net(); /* Sync with NAPI. */
16191631
}
16201632

1621-
void mlx5e_close_icosq(struct mlx5e_icosq *sq)
1633+
static void mlx5e_close_icosq(struct mlx5e_icosq *sq)
16221634
{
16231635
struct mlx5e_channel *c = sq->channel;
16241636

@@ -2082,13 +2094,15 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,
20822094

20832095
spin_lock_init(&c->async_icosq_lock);
20842096

2085-
err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq);
2097+
err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq,
2098+
mlx5e_async_icosq_err_cqe_work);
20862099
if (err)
20872100
goto err_close_xdpsq_cq;
20882101

20892102
mutex_init(&c->icosq_recovery_lock);
20902103

2091-
err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq);
2104+
err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq,
2105+
mlx5e_icosq_err_cqe_work);
20922106
if (err)
20932107
goto err_close_async_icosq;
20942108

0 commit comments

Comments
 (0)