git: 7da85a0db999 - stable/13 - ibcore: Fail early if unsupported QP is provided.
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Jul 26 16:13:34 UTC 2021
The branch stable/13 has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=7da85a0db999e7ff0b00bb41460b274fd9341a83
commit 7da85a0db999e7ff0b00bb41460b274fd9341a83
Author: Hans Petter Selasky <hselasky at FreeBSD.org>
AuthorDate: 2021-06-16 13:01:44 +0000
Commit: Hans Petter Selasky <hselasky at FreeBSD.org>
CommitDate: 2021-07-26 16:04:30 +0000
ibcore: Fail early if unsupported QP is provided.
When requested QP type is not supported for a {device, port}, return the
error right away before validating all parameters during mad agent
registration time.
Linux commit:
798bba01b44b0ddf8cd6e542635b37cc9a9b739c
Reviewed by: kib
Sponsored by: Mellanox Technologies // NVIDIA Networking
(cherry picked from commit 507389a35a41f5f15592d2156d34039e3ee1c3e5)
---
sys/ofed/drivers/infiniband/core/ib_mad.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sys/ofed/drivers/infiniband/core/ib_mad.c b/sys/ofed/drivers/infiniband/core/ib_mad.c
index 7bb6323a4c53..2f14535688aa 100644
--- a/sys/ofed/drivers/infiniband/core/ib_mad.c
+++ b/sys/ofed/drivers/infiniband/core/ib_mad.c
@@ -219,6 +219,10 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
unsigned long flags;
u8 mgmt_class, vclass;
+ if ((qp_type == IB_QPT_SMI && !rdma_cap_ib_smi(device, port_num)) ||
+ (qp_type == IB_QPT_GSI && !rdma_cap_ib_cm(device, port_num)))
+ return ERR_PTR(-EPROTONOSUPPORT);
+
/* Validate parameters */
qpn = get_spl_qp_index(qp_type);
if (qpn == -1) {
More information about the dev-commits-src-all
mailing list