Skip to content

Commit 96780e4

Browse files
Awik84Saeed Mahameed
authored andcommitted
net/mlx5: Introduce new TIR creation core API
Introducing new TIR creation core API which allows caller to receive back from the call the full command outbox. This comes as a preparation for the next patch that will retrieve the TIR ICM address from the command outbox. Signed-off-by: Ariel Levkovich <lariel@mellanox.com> Reviewed-by: Eli Cohen <eli@mellanox.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 3e07047 commit 96780e4

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

‎drivers/net/ethernet/mellanox/mlx5/core/transobj.c‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,24 @@ int mlx5_core_query_sq_state(struct mlx5_core_dev *dev, u32 sqn, u8 *state)
182182
}
183183
EXPORT_SYMBOL_GPL(mlx5_core_query_sq_state);
184184

185+
int mlx5_core_create_tir_out(struct mlx5_core_dev *dev,
186+
u32 *in, int inlen,
187+
u32 *out, int outlen)
188+
{
189+
MLX5_SET(create_tir_in, in, opcode, MLX5_CMD_OP_CREATE_TIR);
190+
191+
return mlx5_cmd_exec(dev, in, inlen, out, outlen);
192+
}
193+
EXPORT_SYMBOL(mlx5_core_create_tir_out);
194+
185195
int mlx5_core_create_tir(struct mlx5_core_dev *dev, u32 *in, int inlen,
186196
u32 *tirn)
187197
{
188-
u32 out[MLX5_ST_SZ_DW(create_tir_out)] = {0};
198+
u32 out[MLX5_ST_SZ_DW(create_tir_out)] = {};
189199
int err;
190200

191-
MLX5_SET(create_tir_in, in, opcode, MLX5_CMD_OP_CREATE_TIR);
192-
193-
memset(out, 0, sizeof(out));
194-
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
201+
err = mlx5_core_create_tir_out(dev, in, inlen,
202+
out, sizeof(out));
195203
if (!err)
196204
*tirn = MLX5_GET(create_tir_out, out, tirn);
197205

‎include/linux/mlx5/transobj.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ int mlx5_core_query_sq(struct mlx5_core_dev *dev, u32 sqn, u32 *out);
5050
int mlx5_core_query_sq_state(struct mlx5_core_dev *dev, u32 sqn, u8 *state);
5151
int mlx5_core_create_tir(struct mlx5_core_dev *dev, u32 *in, int inlen,
5252
u32 *tirn);
53+
int mlx5_core_create_tir_out(struct mlx5_core_dev *dev,
54+
u32 *in, int inlen,
55+
u32 *out, int outlen);
5356
int mlx5_core_modify_tir(struct mlx5_core_dev *dev, u32 tirn, u32 *in,
5457
int inlen);
5558
void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn);

0 commit comments

Comments
 (0)