aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorXiao Yang <yangx.jy@cn.fujitsu.com>2020-12-16 15:17:55 +0800
committerJason Gunthorpe <jgg@nvidia.com>2021-01-12 16:11:35 -0400
commitbad07664a5a15948ff959a5dbdb5211d3655baea (patch)
tree0c226f19ba0921f0f054eefc45f2ac86230df481 /drivers
parentRDMA/siw: Fix handling of zero-sized Read and Receive Queues. (diff)
downloadlinux-dev-bad07664a5a15948ff959a5dbdb5211d3655baea.tar.xz
linux-dev-bad07664a5a15948ff959a5dbdb5211d3655baea.zip
RDMA/rxe: Add check for supported QP types
Current rdma_rxe only supports five QP types, attempting to create any others should return an error - the type check was missed. Link: https://lore.kernel.org/r/20201216071755.149449-2-yangx.jy@cn.fujitsu.com Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_qp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index 656a5b4be847..65c8df812aeb 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -62,6 +62,17 @@ int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init)
struct rxe_port *port;
int port_num = init->port_num;
+ switch(init->qp_type) {
+ case IB_QPT_SMI:
+ case IB_QPT_GSI:
+ case IB_QPT_RC:
+ case IB_QPT_UC:
+ case IB_QPT_UD:
+ break;
+ default:
+ return -EOPNOTSUPP;
+ }
+
if (!init->recv_cq || !init->send_cq) {
pr_warn("missing cq\n");
goto err1;