Commit 430ae0d5 authored by Yishai Hadas's avatar Yishai Hadas Committed by Leon Romanovsky

net/mlx5: Set uid as part of SQ commands

Set uid as part of SQ commands so that the firmware can manage the
SQ object in a secured way.

That will enable using an SQ that was created by verbs application
to be used by the DEVX flow in case the uid is equal.
Signed-off-by: default avatarYishai Hadas <yishaih@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent d269b3af
...@@ -584,6 +584,17 @@ void mlx5_core_destroy_rq_tracked(struct mlx5_core_dev *dev, ...@@ -584,6 +584,17 @@ void mlx5_core_destroy_rq_tracked(struct mlx5_core_dev *dev,
} }
EXPORT_SYMBOL(mlx5_core_destroy_rq_tracked); EXPORT_SYMBOL(mlx5_core_destroy_rq_tracked);
static void destroy_sq_tracked(struct mlx5_core_dev *dev, u32 sqn, u16 uid)
{
u32 in[MLX5_ST_SZ_DW(destroy_sq_in)] = {};
u32 out[MLX5_ST_SZ_DW(destroy_sq_out)] = {};
MLX5_SET(destroy_sq_in, in, opcode, MLX5_CMD_OP_DESTROY_SQ);
MLX5_SET(destroy_sq_in, in, sqn, sqn);
MLX5_SET(destroy_sq_in, in, uid, uid);
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
}
int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen, int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,
struct mlx5_core_qp *sq) struct mlx5_core_qp *sq)
{ {
...@@ -594,6 +605,7 @@ int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen, ...@@ -594,6 +605,7 @@ int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,
if (err) if (err)
return err; return err;
sq->uid = MLX5_GET(create_sq_in, in, uid);
sq->qpn = sqn; sq->qpn = sqn;
err = create_resource_common(dev, sq, MLX5_RES_SQ); err = create_resource_common(dev, sq, MLX5_RES_SQ);
if (err) if (err)
...@@ -602,7 +614,7 @@ int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen, ...@@ -602,7 +614,7 @@ int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,
return 0; return 0;
err_destroy_sq: err_destroy_sq:
mlx5_core_destroy_sq(dev, sq->qpn); destroy_sq_tracked(dev, sq->qpn, sq->uid);
return err; return err;
} }
...@@ -612,7 +624,7 @@ void mlx5_core_destroy_sq_tracked(struct mlx5_core_dev *dev, ...@@ -612,7 +624,7 @@ void mlx5_core_destroy_sq_tracked(struct mlx5_core_dev *dev,
struct mlx5_core_qp *sq) struct mlx5_core_qp *sq)
{ {
destroy_resource_common(dev, sq); destroy_resource_common(dev, sq);
mlx5_core_destroy_sq(dev, sq->qpn); destroy_sq_tracked(dev, sq->qpn, sq->uid);
} }
EXPORT_SYMBOL(mlx5_core_destroy_sq_tracked); EXPORT_SYMBOL(mlx5_core_destroy_sq_tracked);
......
...@@ -5381,7 +5381,7 @@ struct mlx5_ifc_modify_sq_out_bits { ...@@ -5381,7 +5381,7 @@ struct mlx5_ifc_modify_sq_out_bits {
struct mlx5_ifc_modify_sq_in_bits { struct mlx5_ifc_modify_sq_in_bits {
u8 opcode[0x10]; u8 opcode[0x10];
u8 reserved_at_10[0x10]; u8 uid[0x10];
u8 reserved_at_20[0x10]; u8 reserved_at_20[0x10];
u8 op_mod[0x10]; u8 op_mod[0x10];
...@@ -6096,7 +6096,7 @@ struct mlx5_ifc_destroy_sq_out_bits { ...@@ -6096,7 +6096,7 @@ struct mlx5_ifc_destroy_sq_out_bits {
struct mlx5_ifc_destroy_sq_in_bits { struct mlx5_ifc_destroy_sq_in_bits {
u8 opcode[0x10]; u8 opcode[0x10];
u8 reserved_at_10[0x10]; u8 uid[0x10];
u8 reserved_at_20[0x10]; u8 reserved_at_20[0x10];
u8 op_mod[0x10]; u8 op_mod[0x10];
...@@ -6769,7 +6769,7 @@ struct mlx5_ifc_create_sq_out_bits { ...@@ -6769,7 +6769,7 @@ struct mlx5_ifc_create_sq_out_bits {
struct mlx5_ifc_create_sq_in_bits { struct mlx5_ifc_create_sq_in_bits {
u8 opcode[0x10]; u8 opcode[0x10];
u8 reserved_at_10[0x10]; u8 uid[0x10];
u8 reserved_at_20[0x10]; u8 reserved_at_20[0x10];
u8 op_mod[0x10]; u8 op_mod[0x10];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment