mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
RDMA/mlx5: Get ECE options from FW during create QP
Supported ECE options are returned from FW in the create_qp phase and zero means that field is not valid. Such default value allows us to reuse reserved field without worries about comp_mask. Update create QP API to return ECE options. Link: https://lore.kernel.org/r/20200526115440.205922-3-leon@kernel.org Reviewed-by: Mark Zhang <markz@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
8094ba0ace
commit
3e09a427ae
4 changed files with 18 additions and 12 deletions
|
@ -1842,6 +1842,7 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
|
|||
struct ib_qp_init_attr *attr = params->attr;
|
||||
u32 uidx = params->uidx;
|
||||
struct mlx5_ib_resources *devr = &dev->devr;
|
||||
u32 out[MLX5_ST_SZ_DW(create_qp_out)] = {};
|
||||
int inlen = MLX5_ST_SZ_BYTES(create_qp_in);
|
||||
struct mlx5_core_dev *mdev = dev->mdev;
|
||||
struct mlx5_ib_qp_base *base;
|
||||
|
@ -1894,13 +1895,14 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
|
|||
}
|
||||
|
||||
base = &qp->trans_qp.base;
|
||||
err = mlx5_core_create_qp(dev, &base->mqp, in, inlen);
|
||||
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
|
||||
kvfree(in);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
base->container_mibqp = qp;
|
||||
base->mqp.event = mlx5_ib_qp_event;
|
||||
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
|
||||
|
||||
spin_lock_irqsave(&dev->reset_flow_resource_lock, flags);
|
||||
list_add_tail(&qp->qps_list, &dev->qp_list);
|
||||
|
@ -1916,6 +1918,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
|
|||
{
|
||||
struct ib_qp_init_attr *init_attr = params->attr;
|
||||
struct mlx5_ib_create_qp *ucmd = params->ucmd;
|
||||
u32 out[MLX5_ST_SZ_DW(create_qp_out)] = {};
|
||||
struct ib_udata *udata = params->udata;
|
||||
u32 uidx = params->uidx;
|
||||
struct mlx5_ib_resources *devr = &dev->devr;
|
||||
|
@ -2065,7 +2068,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
|
|||
err = create_raw_packet_qp(dev, qp, in, inlen, pd, udata,
|
||||
¶ms->resp);
|
||||
} else
|
||||
err = mlx5_core_create_qp(dev, &base->mqp, in, inlen);
|
||||
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
|
||||
|
||||
kvfree(in);
|
||||
if (err)
|
||||
|
@ -2073,6 +2076,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
|
|||
|
||||
base->container_mibqp = qp;
|
||||
base->mqp.event = mlx5_ib_qp_event;
|
||||
params->resp.ece_options = MLX5_GET(create_qp_out, out, ece);
|
||||
|
||||
get_cqs(qp->type, init_attr->send_cq, init_attr->recv_cq,
|
||||
&send_cq, &recv_cq);
|
||||
|
@ -2105,6 +2109,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
|
|||
struct ib_qp_init_attr *attr = params->attr;
|
||||
u32 uidx = params->uidx;
|
||||
struct mlx5_ib_resources *devr = &dev->devr;
|
||||
u32 out[MLX5_ST_SZ_DW(create_qp_out)] = {};
|
||||
int inlen = MLX5_ST_SZ_BYTES(create_qp_in);
|
||||
struct mlx5_core_dev *mdev = dev->mdev;
|
||||
struct mlx5_ib_cq *send_cq;
|
||||
|
@ -2195,7 +2200,7 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
|
|||
if (qp->flags & IB_QP_CREATE_IPOIB_UD_LSO)
|
||||
MLX5_SET(qpc, qpc, ulp_stateless_offload_mode, 1);
|
||||
|
||||
err = mlx5_core_create_qp(dev, &base->mqp, in, inlen);
|
||||
err = mlx5_qpc_create_qp(dev, &base->mqp, in, inlen, out);
|
||||
kvfree(in);
|
||||
if (err)
|
||||
goto err_create;
|
||||
|
@ -2779,12 +2784,13 @@ static int create_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd,
|
|||
qp->ibqp.qp_num = qp->trans_qp.base.mqp.qpn;
|
||||
|
||||
mlx5_ib_dbg(dev,
|
||||
"QP type %d, ib qpn 0x%X, mlx qpn 0x%x, rcqn 0x%x, scqn 0x%x\n",
|
||||
"QP type %d, ib qpn 0x%X, mlx qpn 0x%x, rcqn 0x%x, scqn 0x%x, ece 0x%x\n",
|
||||
qp->type, qp->ibqp.qp_num, qp->trans_qp.base.mqp.qpn,
|
||||
params->attr->recv_cq ? to_mcq(params->attr->recv_cq)->mcq.cqn :
|
||||
-1,
|
||||
params->attr->send_cq ? to_mcq(params->attr->send_cq)->mcq.cqn :
|
||||
-1);
|
||||
-1,
|
||||
params->resp.ece_options);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ void mlx5_cleanup_qp_table(struct mlx5_ib_dev *dev);
|
|||
|
||||
int mlx5_core_create_dct(struct mlx5_ib_dev *dev, struct mlx5_core_dct *qp,
|
||||
u32 *in, int inlen, u32 *out, int outlen);
|
||||
int mlx5_core_create_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp,
|
||||
u32 *in, int inlen);
|
||||
int mlx5_qpc_create_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp,
|
||||
u32 *in, int inlen, u32 *out);
|
||||
int mlx5_core_qp_modify(struct mlx5_ib_dev *dev, u16 opcode, u32 opt_param_mask,
|
||||
void *qpc, struct mlx5_core_qp *qp);
|
||||
int mlx5_core_destroy_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp);
|
||||
|
|
|
@ -236,16 +236,16 @@ int mlx5_core_create_dct(struct mlx5_ib_dev *dev, struct mlx5_core_dct *dct,
|
|||
return err;
|
||||
}
|
||||
|
||||
int mlx5_core_create_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp,
|
||||
u32 *in, int inlen)
|
||||
int mlx5_qpc_create_qp(struct mlx5_ib_dev *dev, struct mlx5_core_qp *qp,
|
||||
u32 *in, int inlen, u32 *out)
|
||||
{
|
||||
u32 out[MLX5_ST_SZ_DW(create_qp_out)] = {};
|
||||
u32 din[MLX5_ST_SZ_DW(destroy_qp_in)] = {};
|
||||
int err;
|
||||
|
||||
MLX5_SET(create_qp_in, in, opcode, MLX5_CMD_OP_CREATE_QP);
|
||||
|
||||
err = mlx5_cmd_exec(dev->mdev, in, inlen, out, sizeof(out));
|
||||
err = mlx5_cmd_exec(dev->mdev, in, inlen, out,
|
||||
MLX5_ST_SZ_BYTES(create_qp_out));
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
|
@ -371,7 +371,7 @@ enum mlx5_ib_create_qp_resp_mask {
|
|||
|
||||
struct mlx5_ib_create_qp_resp {
|
||||
__u32 bfreg_index;
|
||||
__u32 reserved;
|
||||
__u32 ece_options;
|
||||
__u32 comp_mask;
|
||||
__u32 tirn;
|
||||
__u32 tisn;
|
||||
|
|
Loading…
Reference in a new issue