mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-23 10:29:47 +07:00
net/mlx5_core: Add transport domain alloc/dealloc support
Each transport object, namely TIR and TIS, must have a transport domain number (TDN) identifier. The driver wrongly assumed that it is OK to use TDN=0 without explicit TDN allocation from the device. The TDN will also be used for isolating different processes once user mode Ethernet will be supported. Signed-off-by: Achiad Shochat <achiad@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
12be4b2190
commit
56508b5013
@ -34,6 +34,41 @@
|
||||
#include "mlx5_core.h"
|
||||
#include "transobj.h"
|
||||
|
||||
int mlx5_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn)
|
||||
{
|
||||
u32 in[MLX5_ST_SZ_DW(alloc_transport_domain_in)];
|
||||
u32 out[MLX5_ST_SZ_DW(alloc_transport_domain_out)];
|
||||
int err;
|
||||
|
||||
memset(in, 0, sizeof(in));
|
||||
memset(out, 0, sizeof(out));
|
||||
|
||||
MLX5_SET(alloc_transport_domain_in, in, opcode,
|
||||
MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN);
|
||||
|
||||
err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out));
|
||||
if (!err)
|
||||
*tdn = MLX5_GET(alloc_transport_domain_out, out,
|
||||
transport_domain);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void mlx5_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn)
|
||||
{
|
||||
u32 in[MLX5_ST_SZ_DW(dealloc_transport_domain_in)];
|
||||
u32 out[MLX5_ST_SZ_DW(dealloc_transport_domain_out)];
|
||||
|
||||
memset(in, 0, sizeof(in));
|
||||
memset(out, 0, sizeof(out));
|
||||
|
||||
MLX5_SET(dealloc_transport_domain_in, in, opcode,
|
||||
MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN);
|
||||
MLX5_SET(dealloc_transport_domain_in, in, transport_domain, tdn);
|
||||
|
||||
mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out));
|
||||
}
|
||||
|
||||
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)];
|
||||
|
@ -33,6 +33,8 @@
|
||||
#ifndef __TRANSOBJ_H__
|
||||
#define __TRANSOBJ_H__
|
||||
|
||||
int mlx5_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn);
|
||||
void mlx5_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn);
|
||||
int mlx5_core_create_rq(struct mlx5_core_dev *dev, u32 *in, int inlen,
|
||||
u32 *rqn);
|
||||
int mlx5_core_modify_rq(struct mlx5_core_dev *dev, u32 rqn, u32 *in, int inlen);
|
||||
|
Loading…
Reference in New Issue
Block a user