diff mbox series

[rdma-core,3/4] pyverbs: Add query QP data in order support

Message ID 20210609155932.218005-4-yishaih@nvidia.com (mailing list archive)
State New
Headers show
Series verbs: Introduce ibv_query_qp_data_in_order() verb | expand

Commit Message

Yishai Hadas June 9, 2021, 3:59 p.m. UTC
From: Shachar Kagan <skagan@nvidia.com>

Add the ability to check if QP data is guaranteed to be in order.

Signed-off-by: Shachar Kagan <skagan@nvidia.com>
Reviewed-by: Ido Kalir <idok@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
---
 pyverbs/libibverbs.pxd | 1 +
 pyverbs/qp.pyx         | 9 +++++++++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/pyverbs/libibverbs.pxd b/pyverbs/libibverbs.pxd
index 35e47aa..4c84c18 100644
--- a/pyverbs/libibverbs.pxd
+++ b/pyverbs/libibverbs.pxd
@@ -723,6 +723,7 @@  cdef extern from 'infiniband/verbs.h':
     int ibv_query_rt_values_ex(ibv_context *context, ibv_values_ex *values)
     int ibv_get_async_event(ibv_context *context, ibv_async_event *event)
     void ibv_ack_async_event(ibv_async_event *event)
+    int ibv_query_qp_data_in_order(ibv_qp *qp, ibv_wr_opcode op, uint32_t flags)
 
 
 cdef extern from 'infiniband/driver.h':
diff --git a/pyverbs/qp.pyx b/pyverbs/qp.pyx
index 0b117df..88516f8 100644
--- a/pyverbs/qp.pyx
+++ b/pyverbs/qp.pyx
@@ -1229,6 +1229,15 @@  cdef class QP(PyverbsCM):
         if rc != 0:
             raise PyverbsRDMAError('Failed to Bind MW', rc)
 
+    def query_data_in_order(self, op, flags=0):
+        """
+        Query if QP data is guaranteed to be in order.
+        :param op: Operation type.
+        :param flags: Extra field for future input. For now must be 0.
+        :return: 1 in case the data is guaranteed to be in order, 0 otherwise.
+        """
+        return v.ibv_query_qp_data_in_order(self.qp, op, flags)
+
     @property
     def qp_type(self):
         return self.qp.qp_type