]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
msg/async/rdma: fix error argument to get right qp state
authorChangcheng Liu <changcheng.liu@aliyun.com>
Fri, 28 Jun 2019 06:26:41 +0000 (14:26 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Fri, 23 Aug 2019 02:45:05 +0000 (10:45 +0800)
commit49b8ef074695f349737591f76ef24d98ac7e65f6
tree45dc0e88c5c350dc1b662e0f814b53758244fb03
parentb2d3f5e0970a4afbb82676af9e5b9a12f62a7747
msg/async/rdma: fix error argument to get right qp state

1. It's wrong to use "-1" as argument to query queue state.
In rdma library, ibv_query_qp will call ibv_cmd_query_qp to query
queue state. If "-1" is used as attr_mask, ibv_cmd_query_qp will
return error EOPNOTSUPP which means query failed.

2. In class QueuePair, is_error() could use member function get_state()
to get the queue pair state.

3. It's better to use qp_state as queue pair state according to
ibv_query_qp manual guide.
   struct ibv_qp_attr {
      enum ibv_qp_state       qp_state;            /* Current QP state */
      enum ibv_qp_state       cur_qp_state;        /* Current QP state - irrelevant for ibv_query_qp */
      ...

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/msg/async/rdma/Infiniband.cc