]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net/mlx5e: Take HW interrupt trigger into a function
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Fri, 1 Mar 2019 10:05:21 +0000 (12:05 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 23 Apr 2019 19:09:22 +0000 (12:09 -0700)
mlx5e_trigger_irq posts a NOP to the ICO SQ just to trigger an IRQ and
enter the NAPI poll on the right CPU according to the affinity. Use it
in mlx5e_activate_rq.

Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c

index c190061763fda9deb88c5470c2b13876deb0122b..7e0c3d4de108bcff8eb5252260f6ec45c7273a96 100644 (file)
@@ -778,6 +778,7 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev);
 netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
                          struct mlx5e_tx_wqe *wqe, u16 pi, bool xmit_more);
 
+void mlx5e_trigger_irq(struct mlx5e_icosq *sq);
 void mlx5e_completion_event(struct mlx5_core_cq *mcq);
 void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, enum mlx5_event event);
 int mlx5e_napi_poll(struct napi_struct *napi, int budget);
index 1c328dbb6fe01e522193f285705ca0f07ef19fe4..8ae17dcad48746b71c4db7c7dc0a993485ef2bd4 100644 (file)
@@ -877,16 +877,8 @@ static int mlx5e_open_rq(struct mlx5e_channel *c,
 
 static void mlx5e_activate_rq(struct mlx5e_rq *rq)
 {
-       struct mlx5e_icosq *sq = &rq->channel->icosq;
-       struct mlx5_wq_cyc *wq = &sq->wq;
-       struct mlx5e_tx_wqe *nopwqe;
-
-       u16 pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
-
        set_bit(MLX5E_RQ_STATE_ENABLED, &rq->state);
-       sq->db.ico_wqe[pi].opcode     = MLX5_OPCODE_NOP;
-       nopwqe = mlx5e_post_nop(wq, sq->sqn, &sq->pc);
-       mlx5e_notify_hw(wq, sq->pc, sq->uar_map, &nopwqe->ctrl);
+       mlx5e_trigger_irq(&rq->channel->icosq);
 }
 
 static void mlx5e_deactivate_rq(struct mlx5e_rq *rq)
index b4af5e19f6acd63fb9b08375a533ec1fc9085820..f9862bf75491bb6da0be989bcd15414ab59ee8c2 100644 (file)
@@ -71,6 +71,17 @@ static void mlx5e_handle_rx_dim(struct mlx5e_rq *rq)
        net_dim(&rq->dim, dim_sample);
 }
 
+void mlx5e_trigger_irq(struct mlx5e_icosq *sq)
+{
+       struct mlx5_wq_cyc *wq = &sq->wq;
+       struct mlx5e_tx_wqe *nopwqe;
+       u16 pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc);
+
+       sq->db.ico_wqe[pi].opcode = MLX5_OPCODE_NOP;
+       nopwqe = mlx5e_post_nop(wq, sq->sqn, &sq->pc);
+       mlx5e_notify_hw(wq, sq->pc, sq->uar_map, &nopwqe->ctrl);
+}
+
 int mlx5e_napi_poll(struct napi_struct *napi, int budget)
 {
        struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel,