Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx5: Report EQE data upon CQ completion

Report EQE data upon CQ completion to let upper layers use this data.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>

authored by

Yishai Hadas and committed by
Leon Romanovsky
4e0e2ea1 70a43d3f

+13 -11
+1 -1
drivers/infiniband/hw/mlx5/cq.c
··· 37 37 #include "mlx5_ib.h" 38 38 #include "srq.h" 39 39 40 - static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq) 40 + static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe) 41 41 { 42 42 struct ib_cq *ibcq = &to_mibcq(cq)->ibcq; 43 43
+1 -1
drivers/infiniband/hw/mlx5/main.c
··· 4492 4492 * lock/unlock above locks Now need to arm all involved CQs. 4493 4493 */ 4494 4494 list_for_each_entry(mcq, &cq_armed_list, reset_notify) { 4495 - mcq->comp(mcq); 4495 + mcq->comp(mcq, NULL); 4496 4496 } 4497 4497 spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags); 4498 4498 }
+1 -1
drivers/infiniband/hw/mlx5/qp.c
··· 6297 6297 /* Run the CQ handler - this makes sure that the drain WR will 6298 6298 * be processed if wasn't processed yet. 6299 6299 */ 6300 - mcq->mcq.comp(&mcq->mcq); 6300 + mcq->mcq.comp(&mcq->mcq, NULL); 6301 6301 } 6302 6302 6303 6303 wait_for_completion(&sdrain->done);
+3 -2
drivers/net/ethernet/mellanox/mlx5/core/cq.c
··· 58 58 list_for_each_entry_safe(mcq, temp, &ctx->process_list, 59 59 tasklet_ctx.list) { 60 60 list_del_init(&mcq->tasklet_ctx.list); 61 - mcq->tasklet_ctx.comp(mcq); 61 + mcq->tasklet_ctx.comp(mcq, NULL); 62 62 mlx5_cq_put(mcq); 63 63 if (time_after(jiffies, end)) 64 64 break; ··· 68 68 tasklet_schedule(&ctx->task); 69 69 } 70 70 71 - static void mlx5_add_cq_to_tasklet(struct mlx5_core_cq *cq) 71 + static void mlx5_add_cq_to_tasklet(struct mlx5_core_cq *cq, 72 + struct mlx5_eqe *eqe) 72 73 { 73 74 unsigned long flags; 74 75 struct mlx5_eq_tasklet *tasklet_ctx = cq->tasklet_ctx.priv;
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en.h
··· 780 780 struct mlx5e_tx_wqe *wqe, u16 pi, bool xmit_more); 781 781 782 782 void mlx5e_trigger_irq(struct mlx5e_icosq *sq); 783 - void mlx5e_completion_event(struct mlx5_core_cq *mcq); 783 + void mlx5e_completion_event(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe); 784 784 void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, enum mlx5_event event); 785 785 int mlx5e_napi_poll(struct napi_struct *napi, int budget); 786 786 bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget);
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
··· 136 136 return work_done; 137 137 } 138 138 139 - void mlx5e_completion_event(struct mlx5_core_cq *mcq) 139 + void mlx5e_completion_event(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe) 140 140 { 141 141 struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq); 142 142
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/eq.c
··· 153 153 cq = mlx5_eq_cq_get(eq, cqn); 154 154 if (likely(cq)) { 155 155 ++cq->arm_sn; 156 - cq->comp(cq); 156 + cq->comp(cq, eqe); 157 157 mlx5_cq_put(cq); 158 158 } else { 159 159 mlx5_core_warn(eq->dev, "Completion event for bogus CQ 0x%x\n", cqn);
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c
··· 414 414 mlx5_fpga_conn_cqes(conn, MLX5_FPGA_CQ_BUDGET); 415 415 } 416 416 417 - static void mlx5_fpga_conn_cq_complete(struct mlx5_core_cq *mcq) 417 + static void mlx5_fpga_conn_cq_complete(struct mlx5_core_cq *mcq, 418 + struct mlx5_eqe *eqe) 418 419 { 419 420 struct mlx5_fpga_conn *conn; 420 421
+2 -2
include/linux/mlx5/cq.h
··· 47 47 struct completion free; 48 48 unsigned vector; 49 49 unsigned int irqn; 50 - void (*comp) (struct mlx5_core_cq *); 50 + void (*comp)(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe); 51 51 void (*event) (struct mlx5_core_cq *, enum mlx5_event); 52 52 u32 cons_index; 53 53 unsigned arm_sn; ··· 55 55 int pid; 56 56 struct { 57 57 struct list_head list; 58 - void (*comp)(struct mlx5_core_cq *); 58 + void (*comp)(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe); 59 59 void *priv; 60 60 } tasklet_ctx; 61 61 int reset_notify_added;