Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_core/mlx5_transobj.c
Show All 24 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include <dev/mlx5/driver.h> | #include <dev/mlx5/driver.h> | ||||
#include "mlx5_core.h" | #include "mlx5_core.h" | ||||
#include "transobj.h" | #include "transobj.h" | ||||
int mlx5_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn) | int mlx5_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn, u32 uid) | ||||
{ | { | ||||
u32 in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {0}; | u32 in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {0}; | ||||
u32 out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {0}; | ||||
int err; | int err; | ||||
MLX5_SET(alloc_transport_domain_in, in, opcode, | MLX5_SET(alloc_transport_domain_in, in, opcode, | ||||
MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN); | MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN); | ||||
MLX5_SET(alloc_transport_domain_in, in, uid, uid); | |||||
err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | ||||
if (!err) | if (!err) | ||||
*tdn = MLX5_GET(alloc_transport_domain_out, out, | *tdn = MLX5_GET(alloc_transport_domain_out, out, | ||||
transport_domain); | transport_domain); | ||||
return err; | return err; | ||||
} | } | ||||
void mlx5_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn) | void mlx5_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn, u32 uid) | ||||
{ | { | ||||
u32 in[MLX5_ST_SZ_DW(dealloc_transport_domain_in)] = {0}; | u32 in[MLX5_ST_SZ_DW(dealloc_transport_domain_in)] = {0}; | ||||
u32 out[MLX5_ST_SZ_DW(dealloc_transport_domain_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(dealloc_transport_domain_out)] = {0}; | ||||
MLX5_SET(dealloc_transport_domain_in, in, opcode, | MLX5_SET(dealloc_transport_domain_in, in, opcode, | ||||
MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN); | MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN); | ||||
MLX5_SET(dealloc_transport_domain_in, in, transport_domain, tdn); | MLX5_SET(dealloc_transport_domain_in, in, transport_domain, tdn); | ||||
MLX5_SET(dealloc_transport_domain_in, in, uid, uid); | |||||
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | ||||
} | } | ||||
int mlx5_core_create_rq(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rqn) | int mlx5_core_create_rq(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rqn) | ||||
{ | { | ||||
u32 out[MLX5_ST_SZ_DW(create_rq_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(create_rq_out)] = {0}; | ||||
int err; | int err; | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | int mlx5_core_create_tir(struct mlx5_core_dev *dev, u32 *in, int inlen, | ||||
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); | err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); | ||||
if (!err) | if (!err) | ||||
*tirn = MLX5_GET(create_tir_out, out, tirn); | *tirn = MLX5_GET(create_tir_out, out, tirn); | ||||
return err; | return err; | ||||
} | } | ||||
void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn) | void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn, u32 uid) | ||||
{ | { | ||||
u32 in[MLX5_ST_SZ_DW(destroy_tir_in)] = {0}; | u32 in[MLX5_ST_SZ_DW(destroy_tir_in)] = {0}; | ||||
u32 out[MLX5_ST_SZ_DW(destroy_tir_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(destroy_tir_out)] = {0}; | ||||
MLX5_SET(destroy_tir_in, in, opcode, MLX5_CMD_OP_DESTROY_TIR); | MLX5_SET(destroy_tir_in, in, opcode, MLX5_CMD_OP_DESTROY_TIR); | ||||
MLX5_SET(destroy_tir_in, in, uid, uid); | |||||
MLX5_SET(destroy_tir_in, in, tirn, tirn); | MLX5_SET(destroy_tir_in, in, tirn, tirn); | ||||
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | ||||
} | } | ||||
int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen, | int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen, | ||||
u32 *tisn) | u32 *tisn) | ||||
{ | { | ||||
Show All 15 Lines | int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in, | ||||
u32 out[MLX5_ST_SZ_DW(modify_tis_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(modify_tis_out)] = {0}; | ||||
MLX5_SET(modify_tis_in, in, tisn, tisn); | MLX5_SET(modify_tis_in, in, tisn, tisn); | ||||
MLX5_SET(modify_tis_in, in, opcode, MLX5_CMD_OP_MODIFY_TIS); | MLX5_SET(modify_tis_in, in, opcode, MLX5_CMD_OP_MODIFY_TIS); | ||||
return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); | return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); | ||||
} | } | ||||
void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn) | void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn, u32 uid) | ||||
{ | { | ||||
u32 in[MLX5_ST_SZ_DW(destroy_tis_in)] = {0}; | u32 in[MLX5_ST_SZ_DW(destroy_tis_in)] = {0}; | ||||
u32 out[MLX5_ST_SZ_DW(destroy_tis_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(destroy_tis_out)] = {0}; | ||||
MLX5_SET(destroy_tis_in, in, opcode, MLX5_CMD_OP_DESTROY_TIS); | MLX5_SET(destroy_tis_in, in, opcode, MLX5_CMD_OP_DESTROY_TIS); | ||||
MLX5_SET(destroy_tis_in, in, uid, uid); | |||||
MLX5_SET(destroy_tis_in, in, tisn, tisn); | MLX5_SET(destroy_tis_in, in, tisn, tisn); | ||||
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | ||||
} | } | ||||
int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rmpn) | int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rmpn) | ||||
{ | { | ||||
u32 out[MLX5_ST_SZ_DW(create_rmp_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(create_rmp_out)] = {0}; | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | int mlx5_core_modify_rqt(struct mlx5_core_dev *dev, u32 rqtn, u32 *in, | ||||
u32 out[MLX5_ST_SZ_DW(modify_rqt_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(modify_rqt_out)] = {0}; | ||||
MLX5_SET(modify_rqt_in, in, rqtn, rqtn); | MLX5_SET(modify_rqt_in, in, rqtn, rqtn); | ||||
MLX5_SET(modify_rqt_in, in, opcode, MLX5_CMD_OP_MODIFY_RQT); | MLX5_SET(modify_rqt_in, in, opcode, MLX5_CMD_OP_MODIFY_RQT); | ||||
return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); | return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); | ||||
} | } | ||||
void mlx5_core_destroy_rqt(struct mlx5_core_dev *dev, u32 rqtn) | void mlx5_core_destroy_rqt(struct mlx5_core_dev *dev, u32 rqtn, u32 uid) | ||||
{ | { | ||||
u32 in[MLX5_ST_SZ_DW(destroy_rqt_in)] = {0}; | u32 in[MLX5_ST_SZ_DW(destroy_rqt_in)] = {0}; | ||||
u32 out[MLX5_ST_SZ_DW(destroy_rqt_out)] = {0}; | u32 out[MLX5_ST_SZ_DW(destroy_rqt_out)] = {0}; | ||||
MLX5_SET(destroy_rqt_in, in, opcode, MLX5_CMD_OP_DESTROY_RQT); | MLX5_SET(destroy_rqt_in, in, opcode, MLX5_CMD_OP_DESTROY_RQT); | ||||
MLX5_SET(destroy_rqt_in, in, uid, uid); | |||||
MLX5_SET(destroy_rqt_in, in, rqtn, rqtn); | MLX5_SET(destroy_rqt_in, in, rqtn, rqtn); | ||||
mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); | ||||
} | } |