From 9c7ba67cc7acd4b183c79a680f5a15aaab9f3530 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Mon, 3 Jun 2019 17:53:37 +0800 Subject: [PATCH] msg/async/rdma: check device_attr->max_srq is not zero Some rdma devices don't support srq(shared receive queue). Check hardware attribute if ceph is configured to use srq. Signed-off-by: Changcheng Liu --- src/msg/async/rdma/Infiniband.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/msg/async/rdma/Infiniband.cc b/src/msg/async/rdma/Infiniband.cc index 4f7b344367a..80c00685919 100644 --- a/src/msg/async/rdma/Infiniband.cc +++ b/src/msg/async/rdma/Infiniband.cc @@ -915,8 +915,10 @@ void Infiniband::init() ceph_assert(NetHandler(cct).set_nonblock(device->ctxt->async_fd) == 0); support_srq = cct->_conf->ms_async_rdma_support_srq; - if (support_srq) + if (support_srq) { + ceph_assert(device->device_attr.max_srq); rx_queue_len = device->device_attr.max_srq_wr; + } else rx_queue_len = device->device_attr.max_qp_wr; if (rx_queue_len > cct->_conf->ms_async_rdma_receive_queue_len) { -- 2.39.5