Skip to content

Commit 774ea6e

Browse files
yishaihLeon Romanovsky
authored andcommitted
net/mlx5: Set uid as part of DCT commands
Set uid as part of DCT commands so that the firmware can manage the DCT object in a secured way. That will enable using a DCT that was created by verbs application to be used by the DEVX flow in case the uid is equal. Signed-off-by: Yishai Hadas <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent a0d8c05 commit 774ea6e

File tree

2 files changed

+7
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core
  • include/linux/mlx5

2 files changed

+7
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/qp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ int mlx5_core_create_dct(struct mlx5_core_dev *dev,
211211
}
212212

213213
qp->qpn = MLX5_GET(create_dct_out, out, dctn);
214+
qp->uid = MLX5_GET(create_dct_in, in, uid);
214215
err = create_resource_common(dev, qp, MLX5_RES_DCT);
215216
if (err)
216217
goto err_cmd;
@@ -219,6 +220,7 @@ int mlx5_core_create_dct(struct mlx5_core_dev *dev,
219220
err_cmd:
220221
MLX5_SET(destroy_dct_in, din, opcode, MLX5_CMD_OP_DESTROY_DCT);
221222
MLX5_SET(destroy_dct_in, din, dctn, qp->qpn);
223+
MLX5_SET(destroy_dct_in, din, uid, qp->uid);
222224
mlx5_cmd_exec(dev, (void *)&in, sizeof(din),
223225
(void *)&out, sizeof(dout));
224226
return err;
@@ -277,6 +279,7 @@ static int mlx5_core_drain_dct(struct mlx5_core_dev *dev,
277279

278280
MLX5_SET(drain_dct_in, in, opcode, MLX5_CMD_OP_DRAIN_DCT);
279281
MLX5_SET(drain_dct_in, in, dctn, qp->qpn);
282+
MLX5_SET(drain_dct_in, in, uid, qp->uid);
280283
return mlx5_cmd_exec(dev, (void *)&in, sizeof(in),
281284
(void *)&out, sizeof(out));
282285
}
@@ -303,6 +306,7 @@ int mlx5_core_destroy_dct(struct mlx5_core_dev *dev,
303306
destroy_resource_common(dev, &dct->mqp);
304307
MLX5_SET(destroy_dct_in, in, opcode, MLX5_CMD_OP_DESTROY_DCT);
305308
MLX5_SET(destroy_dct_in, in, dctn, qp->qpn);
309+
MLX5_SET(destroy_dct_in, in, uid, qp->uid);
306310
err = mlx5_cmd_exec(dev, (void *)&in, sizeof(in),
307311
(void *)&out, sizeof(out));
308312
return err;

include/linux/mlx5/mlx5_ifc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5918,7 +5918,7 @@ struct mlx5_ifc_drain_dct_out_bits {
59185918

59195919
struct mlx5_ifc_drain_dct_in_bits {
59205920
u8 opcode[0x10];
5921-
u8 reserved_at_10[0x10];
5921+
u8 uid[0x10];
59225922

59235923
u8 reserved_at_20[0x10];
59245924
u8 op_mod[0x10];
@@ -6382,7 +6382,7 @@ struct mlx5_ifc_destroy_dct_out_bits {
63826382

63836383
struct mlx5_ifc_destroy_dct_in_bits {
63846384
u8 opcode[0x10];
6385-
u8 reserved_at_10[0x10];
6385+
u8 uid[0x10];
63866386

63876387
u8 reserved_at_20[0x10];
63886388
u8 op_mod[0x10];
@@ -7138,7 +7138,7 @@ struct mlx5_ifc_create_dct_out_bits {
71387138

71397139
struct mlx5_ifc_create_dct_in_bits {
71407140
u8 opcode[0x10];
7141-
u8 reserved_at_10[0x10];
7141+
u8 uid[0x10];
71427142

71437143
u8 reserved_at_20[0x10];
71447144
u8 op_mod[0x10];

0 commit comments

Comments
 (0)