Commit 5d0dc3d9 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe

RDMA/mlx5: Initial separation of RAW_PACKET QP from common flow

Create initial function for IB_QPT_RAW_PACKET flow.

Link: https://lore.kernel.org/r/20200427154636.381474-13-leon@kernel.orgReviewed-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 2dfac92d
...@@ -1634,13 +1634,13 @@ static void destroy_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *q ...@@ -1634,13 +1634,13 @@ static void destroy_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *q
to_mpd(qp->ibqp.pd)->uid); to_mpd(qp->ibqp.pd)->uid);
} }
static int create_rss_raw_qp_tir(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, static int create_rss_raw_qp_tir(struct ib_pd *pd, struct mlx5_ib_qp *qp,
struct ib_pd *pd,
struct ib_qp_init_attr *init_attr, struct ib_qp_init_attr *init_attr,
struct ib_udata *udata) struct ib_udata *udata)
{ {
struct mlx5_ib_ucontext *mucontext = rdma_udata_to_drv_context( struct mlx5_ib_ucontext *mucontext = rdma_udata_to_drv_context(
udata, struct mlx5_ib_ucontext, ibucontext); udata, struct mlx5_ib_ucontext, ibucontext);
struct mlx5_ib_dev *dev = to_mdev(pd->device);
struct mlx5_ib_create_qp_resp resp = {}; struct mlx5_ib_create_qp_resp resp = {};
int inlen; int inlen;
int outlen; int outlen;
...@@ -1996,9 +1996,6 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, ...@@ -1996,9 +1996,6 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
if (mlx5_st < 0) if (mlx5_st < 0)
return -EINVAL; return -EINVAL;
if (init_attr->rwq_ind_tbl)
return create_rss_raw_qp_tir(dev, qp, pd, init_attr, udata);
if (init_attr->create_flags & IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK) { if (init_attr->create_flags & IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK) {
if (!MLX5_CAP_GEN(mdev, block_lb_mc)) { if (!MLX5_CAP_GEN(mdev, block_lb_mc)) {
mlx5_ib_dbg(dev, "block multicast loopback isn't supported\n"); mlx5_ib_dbg(dev, "block multicast loopback isn't supported\n");
...@@ -2712,6 +2709,18 @@ static size_t process_udata_size(struct ib_qp_init_attr *attr, ...@@ -2712,6 +2709,18 @@ static size_t process_udata_size(struct ib_qp_init_attr *attr,
return ucmd; return ucmd;
} }
static int create_raw_qp(struct ib_pd *pd, struct mlx5_ib_qp *qp,
struct ib_qp_init_attr *attr,
struct mlx5_ib_create_qp *ucmd, struct ib_udata *udata)
{
struct mlx5_ib_dev *dev = to_mdev(pd->device);
if (attr->rwq_ind_tbl)
return create_rss_raw_qp_tir(pd, qp, attr, udata);
return create_qp_common(dev, pd, attr, ucmd, udata, qp);
}
struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd, struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd,
struct ib_qp_init_attr *init_attr, struct ib_qp_init_attr *init_attr,
struct ib_udata *udata) struct ib_udata *udata)
...@@ -2768,6 +2777,9 @@ struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd, ...@@ -2768,6 +2777,9 @@ struct ib_qp *mlx5_ib_create_qp(struct ib_pd *pd,
case IB_QPT_DRIVER: case IB_QPT_DRIVER:
err = create_driver_qp(pd, qp, init_attr, &ucmd, udata); err = create_driver_qp(pd, qp, init_attr, &ucmd, udata);
break; break;
case IB_QPT_RAW_PACKET:
err = create_raw_qp(pd, qp, init_attr, &ucmd, udata);
break;
default: default:
err = create_qp_common(dev, pd, init_attr, err = create_qp_common(dev, pd, init_attr,
(udata) ? &ucmd : NULL, udata, qp); (udata) ? &ucmd : NULL, udata, qp);
......
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