projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
661f385
)
RDMA/rxe: Add check for supported QP types
author
Xiao Yang
<yangx.jy@cn.fujitsu.com>
Wed, 16 Dec 2020 07:17:55 +0000
(15:17 +0800)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Tue, 12 Jan 2021 20:11:35 +0000
(16:11 -0400)
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>
drivers/infiniband/sw/rxe/rxe_qp.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/sw/rxe/rxe_qp.c
b/drivers/infiniband/sw/rxe/rxe_qp.c
index
656a5b4
..
65c8df8
100644
(file)
--- 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;