Commit 7637e499 authored by Tariq Toukan's avatar Tariq Toukan Committed by Saeed Mahameed

net/mlx5e: Enable napi in channel's activation stage

The channel's napi is first needed upon activation, not creation.
Minimize its enabled scope by moving it from the channel's open/close
stage into the activate/deactivate stage.
Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
Reviewed-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 6b424e13
...@@ -428,16 +428,13 @@ static int mlx5e_ptp_open_queues(struct mlx5e_port_ptp *c, ...@@ -428,16 +428,13 @@ static int mlx5e_ptp_open_queues(struct mlx5e_port_ptp *c,
if (err) if (err)
return err; return err;
napi_enable(&c->napi);
err = mlx5e_ptp_open_txqsqs(c, cparams); err = mlx5e_ptp_open_txqsqs(c, cparams);
if (err) if (err)
goto disable_napi; goto close_cqs;
return 0; return 0;
disable_napi: close_cqs:
napi_disable(&c->napi);
mlx5e_ptp_close_cqs(c); mlx5e_ptp_close_cqs(c);
return err; return err;
...@@ -446,7 +443,6 @@ static int mlx5e_ptp_open_queues(struct mlx5e_port_ptp *c, ...@@ -446,7 +443,6 @@ static int mlx5e_ptp_open_queues(struct mlx5e_port_ptp *c,
static void mlx5e_ptp_close_queues(struct mlx5e_port_ptp *c) static void mlx5e_ptp_close_queues(struct mlx5e_port_ptp *c)
{ {
mlx5e_ptp_close_txqsqs(c); mlx5e_ptp_close_txqsqs(c);
napi_disable(&c->napi);
mlx5e_ptp_close_cqs(c); mlx5e_ptp_close_cqs(c);
} }
...@@ -515,6 +511,8 @@ void mlx5e_ptp_activate_channel(struct mlx5e_port_ptp *c) ...@@ -515,6 +511,8 @@ void mlx5e_ptp_activate_channel(struct mlx5e_port_ptp *c)
{ {
int tc; int tc;
napi_enable(&c->napi);
for (tc = 0; tc < c->num_tc; tc++) for (tc = 0; tc < c->num_tc; tc++)
mlx5e_activate_txqsq(&c->ptpsq[tc].txqsq); mlx5e_activate_txqsq(&c->ptpsq[tc].txqsq);
} }
...@@ -525,4 +523,6 @@ void mlx5e_ptp_deactivate_channel(struct mlx5e_port_ptp *c) ...@@ -525,4 +523,6 @@ void mlx5e_ptp_deactivate_channel(struct mlx5e_port_ptp *c)
for (tc = 0; tc < c->num_tc; tc++) for (tc = 0; tc < c->num_tc; tc++)
mlx5e_deactivate_txqsq(&c->ptpsq[tc].txqsq); mlx5e_deactivate_txqsq(&c->ptpsq[tc].txqsq);
napi_disable(&c->napi);
} }
...@@ -1892,13 +1892,11 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, ...@@ -1892,13 +1892,11 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,
if (err) if (err)
goto err_close_rx_cq; goto err_close_rx_cq;
napi_enable(&c->napi);
spin_lock_init(&c->async_icosq_lock); spin_lock_init(&c->async_icosq_lock);
err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq); err = mlx5e_open_icosq(c, params, &cparam->async_icosq, &c->async_icosq);
if (err) if (err)
goto err_disable_napi; goto err_close_xdpsq_cq;
err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq); err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->icosq);
if (err) if (err)
...@@ -1941,9 +1939,7 @@ static int mlx5e_open_queues(struct mlx5e_channel *c, ...@@ -1941,9 +1939,7 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,
err_close_async_icosq: err_close_async_icosq:
mlx5e_close_icosq(&c->async_icosq); mlx5e_close_icosq(&c->async_icosq);
err_disable_napi: err_close_xdpsq_cq:
napi_disable(&c->napi);
if (c->xdp) if (c->xdp)
mlx5e_close_cq(&c->rq_xdpsq.cq); mlx5e_close_cq(&c->rq_xdpsq.cq);
...@@ -1974,7 +1970,6 @@ static void mlx5e_close_queues(struct mlx5e_channel *c) ...@@ -1974,7 +1970,6 @@ static void mlx5e_close_queues(struct mlx5e_channel *c)
mlx5e_close_sqs(c); mlx5e_close_sqs(c);
mlx5e_close_icosq(&c->icosq); mlx5e_close_icosq(&c->icosq);
mlx5e_close_icosq(&c->async_icosq); mlx5e_close_icosq(&c->async_icosq);
napi_disable(&c->napi);
if (c->xdp) if (c->xdp)
mlx5e_close_cq(&c->rq_xdpsq.cq); mlx5e_close_cq(&c->rq_xdpsq.cq);
mlx5e_close_cq(&c->rq.cq); mlx5e_close_cq(&c->rq.cq);
...@@ -2059,6 +2054,8 @@ static void mlx5e_activate_channel(struct mlx5e_channel *c) ...@@ -2059,6 +2054,8 @@ static void mlx5e_activate_channel(struct mlx5e_channel *c)
{ {
int tc; int tc;
napi_enable(&c->napi);
for (tc = 0; tc < c->num_tc; tc++) for (tc = 0; tc < c->num_tc; tc++)
mlx5e_activate_txqsq(&c->sq[tc]); mlx5e_activate_txqsq(&c->sq[tc]);
mlx5e_activate_icosq(&c->icosq); mlx5e_activate_icosq(&c->icosq);
...@@ -2081,8 +2078,9 @@ static void mlx5e_deactivate_channel(struct mlx5e_channel *c) ...@@ -2081,8 +2078,9 @@ static void mlx5e_deactivate_channel(struct mlx5e_channel *c)
mlx5e_deactivate_icosq(&c->icosq); mlx5e_deactivate_icosq(&c->icosq);
for (tc = 0; tc < c->num_tc; tc++) for (tc = 0; tc < c->num_tc; tc++)
mlx5e_deactivate_txqsq(&c->sq[tc]); mlx5e_deactivate_txqsq(&c->sq[tc]);
mlx5e_qos_deactivate_queues(c); mlx5e_qos_deactivate_queues(c);
napi_disable(&c->napi);
} }
static void mlx5e_close_channel(struct mlx5e_channel *c) static void mlx5e_close_channel(struct mlx5e_channel *c)
......
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