Skip to content

Commit 4e0e2ea

Browse files
yishaihLeon Romanovsky
authored andcommitted
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>
1 parent 70a43d3 commit 4e0e2ea

9 files changed

Lines changed: 13 additions & 11 deletions

File tree

‎drivers/infiniband/hw/mlx5/cq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "mlx5_ib.h"
3838
#include "srq.h"
3939

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)
4141
{
4242
struct ib_cq *ibcq = &to_mibcq(cq)->ibcq;
4343

‎drivers/infiniband/hw/mlx5/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4492,7 +4492,7 @@ static void mlx5_ib_handle_internal_error(struct mlx5_ib_dev *ibdev)
44924492
* lock/unlock above locks Now need to arm all involved CQs.
44934493
*/
44944494
list_for_each_entry(mcq, &cq_armed_list, reset_notify) {
4495-
mcq->comp(mcq);
4495+
mcq->comp(mcq, NULL);
44964496
}
44974497
spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags);
44984498
}

‎drivers/infiniband/hw/mlx5/qp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6297,7 +6297,7 @@ static void handle_drain_completion(struct ib_cq *cq,
62976297
/* Run the CQ handler - this makes sure that the drain WR will
62986298
* be processed if wasn't processed yet.
62996299
*/
6300-
mcq->mcq.comp(&mcq->mcq);
6300+
mcq->mcq.comp(&mcq->mcq, NULL);
63016301
}
63026302

63036303
wait_for_completion(&sdrain->done);

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void mlx5_cq_tasklet_cb(unsigned long data)
5858
list_for_each_entry_safe(mcq, temp, &ctx->process_list,
5959
tasklet_ctx.list) {
6060
list_del_init(&mcq->tasklet_ctx.list);
61-
mcq->tasklet_ctx.comp(mcq);
61+
mcq->tasklet_ctx.comp(mcq, NULL);
6262
mlx5_cq_put(mcq);
6363
if (time_after(jiffies, end))
6464
break;
@@ -68,7 +68,8 @@ void mlx5_cq_tasklet_cb(unsigned long data)
6868
tasklet_schedule(&ctx->task);
6969
}
7070

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)
7273
{
7374
unsigned long flags;
7475
struct mlx5_eq_tasklet *tasklet_ctx = cq->tasklet_ctx.priv;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
780780
struct mlx5e_tx_wqe *wqe, u16 pi, bool xmit_more);
781781

782782
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);
784784
void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, enum mlx5_event event);
785785
int mlx5e_napi_poll(struct napi_struct *napi, int budget);
786786
bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
136136
return work_done;
137137
}
138138

139-
void mlx5e_completion_event(struct mlx5_core_cq *mcq)
139+
void mlx5e_completion_event(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe)
140140
{
141141
struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq);
142142

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static int mlx5_eq_comp_int(struct notifier_block *nb,
153153
cq = mlx5_eq_cq_get(eq, cqn);
154154
if (likely(cq)) {
155155
++cq->arm_sn;
156-
cq->comp(cq);
156+
cq->comp(cq, eqe);
157157
mlx5_cq_put(cq);
158158
} else {
159159
mlx5_core_warn(eq->dev, "Completion event for bogus CQ 0x%x\n", cqn);

‎drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ static void mlx5_fpga_conn_cq_tasklet(unsigned long data)
414414
mlx5_fpga_conn_cqes(conn, MLX5_FPGA_CQ_BUDGET);
415415
}
416416

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)
418419
{
419420
struct mlx5_fpga_conn *conn;
420421

‎include/linux/mlx5/cq.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ struct mlx5_core_cq {
4747
struct completion free;
4848
unsigned vector;
4949
unsigned int irqn;
50-
void (*comp) (struct mlx5_core_cq *);
50+
void (*comp)(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe);
5151
void (*event) (struct mlx5_core_cq *, enum mlx5_event);
5252
u32 cons_index;
5353
unsigned arm_sn;
5454
struct mlx5_rsc_debug *dbg;
5555
int pid;
5656
struct {
5757
struct list_head list;
58-
void (*comp)(struct mlx5_core_cq *);
58+
void (*comp)(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe);
5959
void *priv;
6060
} tasklet_ctx;
6161
int reset_notify_added;

0 commit comments

Comments
 (0)