aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:52:15 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:52:15 +0000
commitc7a0f349de00e41cf55b79ebf4a2ae4b987dd27d (patch)
tree29a447f8beb2e3b7e855992afdacbeb5054ef0b1
parent926eaeedf1c2a3e1f9e2976409f1a7f774ecd731 (diff)
downloadsrc-c7a0f349de00e41cf55b79ebf4a2ae4b987dd27d.tar.gz
src-c7a0f349de00e41cf55b79ebf4a2ae4b987dd27d.zip
MFC r367717:
Enhance the mlx5_core_create_cq() function in mlx5core. Enhance mlx5_core_create_cq() to get the command out buffer from the callers to let them use the output. Linux commit: 38164b771947be9baf06e78ffdfb650f8f3e908e Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/stable/11/; revision=368222
-rw-r--r--sys/dev/mlx5/cq.h2
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_cq.c6
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_main.c3
-rw-r--r--sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c3
4 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/mlx5/cq.h b/sys/dev/mlx5/cq.h
index 161fbe13001a..57cc75bb20e1 100644
--- a/sys/dev/mlx5/cq.h
+++ b/sys/dev/mlx5/cq.h
@@ -157,7 +157,7 @@ static inline void mlx5_cq_arm(struct mlx5_core_cq *cq, u32 cmd,
int mlx5_init_cq_table(struct mlx5_core_dev *dev);
void mlx5_cleanup_cq_table(struct mlx5_core_dev *dev);
int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
- u32 *in, int inlen);
+ u32 *in, int inlen, u32 *out, int outlen);
int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
u32 *out, int outlen);
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cq.c b/sys/dev/mlx5/mlx5_core/mlx5_cq.c
index cd2093924242..93bd7903b7b3 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_cq.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_cq.c
@@ -100,16 +100,16 @@ void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type)
int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
- u32 *in, int inlen)
+ u32 *in, int inlen, u32 *out, int outlen)
{
struct mlx5_cq_table *table = &dev->priv.cq_table;
- u32 out[MLX5_ST_SZ_DW(create_cq_out)] = {0};
u32 din[MLX5_ST_SZ_DW(destroy_cq_in)] = {0};
u32 dout[MLX5_ST_SZ_DW(destroy_cq_out)] = {0};
int err;
+ memset(out, 0, outlen);
MLX5_SET(create_cq_in, in, opcode, MLX5_CMD_OP_CREATE_CQ);
- err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
+ err = mlx5_cmd_exec(dev, in, inlen, out, outlen);
if (err)
return err;
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index 00606238d8a4..5621145432c6 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -1863,6 +1863,7 @@ static int
mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix)
{
struct mlx5_core_cq *mcq = &cq->mcq;
+ u32 out[MLX5_ST_SZ_DW(create_cq_out)];
void *in;
void *cqc;
int inlen;
@@ -1891,7 +1892,7 @@ mlx5e_enable_cq(struct mlx5e_cq *cq, struct mlx5e_cq_param *param, int eq_ix)
PAGE_SHIFT);
MLX5_SET64(cqc, cqc, dbr_addr, cq->wq_ctrl.db.dma);
- err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen);
+ err = mlx5_core_create_cq(cq->priv->mdev, mcq, in, inlen, out, sizeof(out));
kvfree(in);
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
index b3cec1a43df5..4d6c9dda501d 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c
@@ -905,6 +905,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
int entries = attr->cqe;
int vector = attr->comp_vector;
struct mlx5_ib_dev *dev = to_mdev(ibdev);
+ u32 out[MLX5_ST_SZ_DW(create_cq_out)];
struct mlx5_ib_cq *cq;
int uninitialized_var(index);
int uninitialized_var(inlen);
@@ -969,7 +970,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev,
if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN)
MLX5_SET(cqc, cqc, oi, 1);
- err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen);
+ err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen, out, sizeof(out));
if (err)
goto err_cqb;