aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-11-16 10:10:53 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-11-16 10:10:53 +0000
commitf34f0a65b2223db5f307a0e6d376e1cf89623da6 (patch)
tree2ef426cbda6d991ba81a2a0df7572d45fc6d6cfb /sys/dev
parentffdb195f318ac3ceeacbae6cf19cd2949660a55c (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mlx5/cq.h4
-rw-r--r--sys/dev/mlx5/driver.h2
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_cq.c7
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_eq.c3
-rw-r--r--sys/dev/mlx5/mlx5_en/en.h6
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c10
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_rl.c2
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_rx.c2
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_tx.c2
-rw-r--r--sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c2
-rw-r--r--sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c2
11 files changed, 22 insertions, 20 deletions
diff --git a/sys/dev/mlx5/cq.h b/sys/dev/mlx5/cq.h
index cd4dd1ff86b14..55386422efc2a 100644
--- a/sys/dev/mlx5/cq.h
+++ b/sys/dev/mlx5/cq.h
@@ -32,7 +32,7 @@
#include <dev/mlx5/driver.h>
#include <dev/mlx5/mlx5_ifc.h>
-
+struct mlx5_eqe;
struct mlx5_core_cq {
u32 cqn;
int cqe_sz;
@@ -40,7 +40,7 @@ struct mlx5_core_cq {
__be32 *arm_db;
unsigned vector;
int irqn;
- void (*comp) (struct mlx5_core_cq *);
+ void (*comp) (struct mlx5_core_cq *, struct mlx5_eqe *);
void (*event) (struct mlx5_core_cq *, int);
struct mlx5_uar *uar;
u32 cons_index;
diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h
index 778740061ec37..71c050c2dc0e0 100644
--- a/sys/dev/mlx5/driver.h
+++ b/sys/dev/mlx5/driver.h
@@ -1021,7 +1021,7 @@ void mlx5_unregister_debugfs(void);
int mlx5_eq_init(struct mlx5_core_dev *dev);
void mlx5_eq_cleanup(struct mlx5_core_dev *dev);
void mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas);
-void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 cqn);
+void mlx5_cq_completion(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe);
void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type);
void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type);
struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn);
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cq.c b/sys/dev/mlx5/mlx5_core/mlx5_cq.c
index 6908b4a6bbb63..929fd1d6bc312 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_cq.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_cq.c
@@ -55,13 +55,16 @@ mlx5_cq_table_write_unlock(struct mlx5_cq_table *table)
NET_EPOCH_WAIT();
}
-void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 cqn)
+void mlx5_cq_completion(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe)
{
struct mlx5_cq_table *table = &dev->priv.cq_table;
struct mlx5_core_cq *cq;
struct epoch_tracker et;
+ u32 cqn;
bool do_lock;
+ cqn = be32_to_cpu(eqe->data.comp.cqn) & 0xffffff;
+
NET_EPOCH_ENTER(et);
do_lock = atomic_read(&table->writercount) != 0;
@@ -78,7 +81,7 @@ void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 cqn)
if (likely(cq != NULL)) {
++cq->arm_sn;
- cq->comp(cq);
+ cq->comp(cq, eqe);
} else {
mlx5_core_warn(dev,
"Completion event for bogus CQ 0x%x\n", cqn);
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eq.c b/sys/dev/mlx5/mlx5_core/mlx5_eq.c
index 144496c9d3a28..9e744e132c36d 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_eq.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_eq.c
@@ -246,8 +246,7 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, struct mlx5_eq *eq)
eq->eqn, eqe_type_str(eqe->type));
switch (eqe->type) {
case MLX5_EVENT_TYPE_COMP:
- cqn = be32_to_cpu(eqe->data.comp.cqn) & 0xffffff;
- mlx5_cq_completion(dev, cqn);
+ mlx5_cq_completion(dev, eqe);
break;
case MLX5_EVENT_TYPE_PATH_MIG:
diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h
index d5c08e0dc8d58..73376e45be03e 100644
--- a/sys/dev/mlx5/mlx5_en/en.h
+++ b/sys/dev/mlx5/mlx5_en/en.h
@@ -149,7 +149,7 @@ MALLOC_DECLARE(M_MLX5EN);
struct mlx5_core_dev;
struct mlx5e_cq;
-typedef void (mlx5e_cq_comp_t)(struct mlx5_core_cq *);
+typedef void (mlx5e_cq_comp_t)(struct mlx5_core_cq *, struct mlx5_eqe *);
#define mlx5_en_err(_dev, format, ...) \
if_printf(_dev, "ERR: ""%s:%d:(pid %d): " format, \
@@ -1107,8 +1107,8 @@ int mlx5e_open_locked(struct ifnet *);
int mlx5e_close_locked(struct ifnet *);
void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, int event);
-void mlx5e_rx_cq_comp(struct mlx5_core_cq *);
-void mlx5e_tx_cq_comp(struct mlx5_core_cq *);
+mlx5e_cq_comp_t mlx5e_rx_cq_comp;
+mlx5e_cq_comp_t mlx5e_tx_cq_comp;
struct mlx5_cqe64 *mlx5e_get_cqe(struct mlx5e_cq *cq);
void mlx5e_dim_work(struct work_struct *);
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index 001a1a1bb4488..6fe04b260e4f7 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -1898,7 +1898,7 @@ mlx5e_drain_sq(struct mlx5e_sq *sq)
mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR) {
mtx_unlock(&sq->lock);
msleep(1);
- sq->cq.mcq.comp(&sq->cq.mcq);
+ sq->cq.mcq.comp(&sq->cq.mcq, NULL);
mtx_lock(&sq->lock);
}
mtx_unlock(&sq->lock);
@@ -1916,7 +1916,7 @@ mlx5e_drain_sq(struct mlx5e_sq *sq)
mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR) {
mtx_unlock(&sq->lock);
msleep(1);
- sq->cq.mcq.comp(&sq->cq.mcq);
+ sq->cq.mcq.comp(&sq->cq.mcq, NULL);
mtx_lock(&sq->lock);
}
mtx_unlock(&sq->lock);
@@ -2229,7 +2229,7 @@ mlx5e_open_channel(struct mlx5e_priv *priv,
/* poll receive queue initially */
NET_EPOCH_ENTER(et);
- c->rq.cq.mcq.comp(&c->rq.cq.mcq);
+ c->rq.cq.mcq.comp(&c->rq.cq.mcq, NULL);
NET_EPOCH_EXIT(et);
return (0);
@@ -3805,7 +3805,7 @@ mlx5e_disable_rx_dma(struct mlx5e_channel *ch)
while (!mlx5_wq_ll_is_empty(&rq->wq)) {
msleep(1);
NET_EPOCH_ENTER(et);
- rq->cq.mcq.comp(&rq->cq.mcq);
+ rq->cq.mcq.comp(&rq->cq.mcq, NULL);
NET_EPOCH_EXIT(et);
}
@@ -3838,7 +3838,7 @@ mlx5e_enable_rx_dma(struct mlx5e_channel *ch)
rq->enabled = 1;
NET_EPOCH_ENTER(et);
- rq->cq.mcq.comp(&rq->cq.mcq);
+ rq->cq.mcq.comp(&rq->cq.mcq, NULL);
NET_EPOCH_EXIT(et);
}
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c
index 4bb0e9f970d6b..0e34403f2bf95 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c
@@ -232,7 +232,7 @@ mlx5e_rl_open_channel(struct mlx5e_rl_worker *rlw, int eq_ix,
*ppsq = sq;
/* poll TX queue initially */
- sq->cq.mcq.comp(&sq->cq.mcq);
+ sq->cq.mcq.comp(&sq->cq.mcq, NULL);
return (0);
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
index db5ca31bc289e..2bf189efc7e0f 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
@@ -537,7 +537,7 @@ wq_ll_pop:
}
void
-mlx5e_rx_cq_comp(struct mlx5_core_cq *mcq)
+mlx5e_rx_cq_comp(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe __unused)
{
struct mlx5e_rq *rq = container_of(mcq, struct mlx5e_rq, cq.mcq);
int i = 0;
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
index 60606ca64763b..0da68fc5ac248 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
@@ -871,7 +871,7 @@ select_queue:
}
void
-mlx5e_tx_cq_comp(struct mlx5_core_cq *mcq)
+mlx5e_tx_cq_comp(struct mlx5_core_cq *mcq, struct mlx5_eqe *eqe __unused)
{
struct mlx5e_sq *sq = container_of(mcq, struct mlx5e_sq, cq.mcq);
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
index 4d6c9dda501de..78d0518fe2bbe 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
@@ -31,7 +31,7 @@
#include <rdma/ib_cache.h>
#include "mlx5_ib.h"
-static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq)
+static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe __unused)
{
struct ib_cq *ibcq = &to_mibcq(cq)->ibcq;
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
index 76c5a333a3f8a..532223fffed72 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
@@ -2459,7 +2459,7 @@ static void mlx5_ib_handle_internal_error(struct mlx5_ib_dev *ibdev)
* lock/unlock above locks Now need to arm all involved CQs.
*/
list_for_each_entry(mcq, &cq_armed_list, reset_notify) {
- mcq->comp(mcq);
+ mcq->comp(mcq, NULL);
}
spin_unlock_irqrestore(&ibdev->reset_flow_resource_lock, flags);
}