aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:45:47 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:45:47 +0000
commit926eaeedf1c2a3e1f9e2976409f1a7f774ecd731 (patch)
tree04f71ff4b1486048d9162f4d92ed3a60d3fb08a1
parent211bde9af9bf8f77c4d1fd1ffaa80bbbe5677229 (diff)
downloadsrc-926eaeedf1c2a3e1f9e2976409f1a7f774ecd731.tar.gz
src-926eaeedf1c2a3e1f9e2976409f1a7f774ecd731.zip
MFC r367716:
Use mlx5core to create/destroy all Dynamically Connected Targets, DCTs. To prevent a hardware memory leak when a DEVX DCT object is destroyed without calling drain DCT before, (e.g. under cleanup flow), need to manage its creation and destruction via mlx5 core. Linux commit: c5ae1954c47d3fd8815bd5a592aba18702c93f33 Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/stable/11/; revision=368220
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_qp.c9
-rw-r--r--sys/dev/mlx5/qp.h3
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_qp.c b/sys/dev/mlx5/mlx5_core/mlx5_qp.c
index ea35286dd007..c5fb95cc2d2b 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_qp.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_qp.c
@@ -349,19 +349,18 @@ EXPORT_SYMBOL_GPL(mlx5_core_xrcd_dealloc);
int mlx5_core_create_dct(struct mlx5_core_dev *dev,
struct mlx5_core_dct *dct,
- u32 *in)
+ u32 *in, int inlen,
+ u32 *out, int outlen)
{
struct mlx5_qp_table *table = &dev->priv.qp_table;
- u32 out[MLX5_ST_SZ_DW(create_dct_out)] = {0};
u32 dout[MLX5_ST_SZ_DW(destroy_dct_out)] = {0};
u32 din[MLX5_ST_SZ_DW(destroy_dct_in)] = {0};
- int inlen = MLX5_ST_SZ_BYTES(create_dct_in);
int err;
init_completion(&dct->drained);
MLX5_SET(create_dct_in, in, opcode, MLX5_CMD_OP_CREATE_DCT);
- err = mlx5_cmd_exec(dev, in, inlen, &out, sizeof(out));
+ err = mlx5_cmd_exec(dev, in, inlen, out, outlen);
if (err) {
mlx5_core_warn(dev, "create DCT failed, ret %d", err);
return err;
@@ -387,7 +386,7 @@ int mlx5_core_create_dct(struct mlx5_core_dev *dev,
err_cmd:
MLX5_SET(destroy_dct_in, din, opcode, MLX5_CMD_OP_DESTROY_DCT);
MLX5_SET(destroy_dct_in, din, dctn, dct->dctn);
- mlx5_cmd_exec(dev, &din, sizeof(din), &out, sizeof(dout));
+ mlx5_cmd_exec(dev, &din, sizeof(din), dout, sizeof(dout));
return err;
}
diff --git a/sys/dev/mlx5/qp.h b/sys/dev/mlx5/qp.h
index 8a4901151688..9cf96be46e08 100644
--- a/sys/dev/mlx5/qp.h
+++ b/sys/dev/mlx5/qp.h
@@ -586,7 +586,8 @@ int mlx5_core_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn);
int mlx5_core_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn);
int mlx5_core_create_dct(struct mlx5_core_dev *dev,
struct mlx5_core_dct *dct,
- u32 *in);
+ u32 *in, int inlen,
+ u32 *out, int outlen);
int mlx5_core_destroy_dct(struct mlx5_core_dev *dev,
struct mlx5_core_dct *dct);
int mlx5_core_create_rq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,