pyverbs/efa: Add processing hints support

Expose work request processing hints setter through pyverbs EFA direct
verbs API.

Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
diff --git a/pyverbs/providers/efa/efa_enums.pxd b/pyverbs/providers/efa/efa_enums.pxd
index 258b978..179f30c 100644
--- a/pyverbs/providers/efa/efa_enums.pxd
+++ b/pyverbs/providers/efa/efa_enums.pxd
@@ -20,6 +20,12 @@
         EFADV_QP_FLAGS_INLINE_WRITE
 
     cpdef enum:
+        EFADV_WR_EX_WITH_PROCESSING_HINTS
+
+    cpdef enum:
+        EFADV_WR_PROCESSING_HINT_BURST_PPS_SENSITIVE
+
+    cpdef enum:
         EFADV_WC_EX_WITH_SGID
         EFADV_WC_EX_WITH_IS_UNSOLICITED
 
diff --git a/pyverbs/providers/efa/efadv.pxd b/pyverbs/providers/efa/efadv.pxd
index 249ce75..e74a722 100644
--- a/pyverbs/providers/efa/efadv.pxd
+++ b/pyverbs/providers/efa/efadv.pxd
@@ -33,7 +33,7 @@
 
 
 cdef class SRDQPEx(QPEx):
-    pass
+    cdef dv.efadv_qp *dv_qp
 
 
 cdef class EfaQPInitAttr(PyverbsObject):
diff --git a/pyverbs/providers/efa/efadv.pyx b/pyverbs/providers/efa/efadv.pyx
index 2f3e04c..ab56f38 100644
--- a/pyverbs/providers/efa/efadv.pyx
+++ b/pyverbs/providers/efa/efadv.pyx
@@ -195,13 +195,21 @@
     def sl(self,val):
         self.qp_init_attr.sl = val
 
+    @property
+    def wr_flags(self):
+        return self.qp_init_attr.wr_flags
+
+    @wr_flags.setter
+    def wr_flags(self, val):
+        self.qp_init_attr.wr_flags = val
+
 
 cdef class SRDQPEx(QPEx):
     """
     Initializes an SRD QPEx according to the user-provided data.
     :param ctx: Context object
-    :param init_attr: QPInitAttrEx object
-    :param dv_init_attr: EFAQPInitAttr object
+    :param attr_ex: QPInitAttrEx object
+    :param efa_init_attr: EFAQPInitAttr object
     :return: An initialized SRDQPEx
     """
     def __init__(self, Context ctx not None, QPInitAttrEx attr_ex not None, EfaQPInitAttr efa_init_attr not None):
@@ -215,6 +223,7 @@
             pd=<PD>attr_ex.pd
             pd.add_ref(self)
         super().__init__(ctx, attr_ex)
+        self.dv_qp = dv.efadv_qp_from_ibv_qp_ex(self.qp_ex)
 
     def _get_comp_mask(self, dst):
         srd_mask = {'INIT': ibv_qp_attr_mask.IBV_QP_PKEY_INDEX | ibv_qp_attr_mask.IBV_QP_PORT | ibv_qp_attr_mask.IBV_QP_QKEY,
@@ -222,6 +231,9 @@
                     'RTS': ibv_qp_attr_mask.IBV_QP_SQ_PSN}
         return srd_mask [dst] | ibv_qp_attr_mask.IBV_QP_STATE
 
+    def wr_set_processing_hints(self, hints):
+        dv.efadv_wr_set_processing_hints(self.dv_qp, hints)
+
 
 cdef class EfaDVCQInitAttr(PyverbsObject):
     """
diff --git a/pyverbs/providers/efa/libefa.pxd b/pyverbs/providers/efa/libefa.pxd
index bf04343..5cd4d1b 100644
--- a/pyverbs/providers/efa/libefa.pxd
+++ b/pyverbs/providers/efa/libefa.pxd
@@ -31,7 +31,11 @@
         uint32_t driver_qp_type;
         uint16_t flags;
         uint8_t sl;
-        uint8_t reserved[1];
+        uint8_t reserved;
+        uint64_t wr_flags;
+
+    cdef struct efadv_qp:
+        uint64_t comp_mask;
 
     cdef struct efadv_cq_init_attr:
         uint64_t comp_mask;
@@ -68,6 +72,8 @@
                                  v.ibv_qp_init_attr_ex *attr_ex,
                                  efadv_qp_init_attr *efa_attr,
                                  uint32_t inlen)
+    efadv_qp *efadv_qp_from_ibv_qp_ex(v.ibv_qp_ex *ibvqpx)
+    void efadv_wr_set_processing_hints(efadv_qp *efadv_qp, uint32_t hints)
     v.ibv_cq_ex *efadv_create_cq(v.ibv_context *ibvctx,
                                  v.ibv_cq_init_attr_ex *attr_ex,
                                  efadv_cq_init_attr *efa_attr,