Blame SOURCES/0004-pyverbs-Fix-WC-creation-process.patch

764884
From 252e5a0f63663da5128fe714a1e9ea8a35995696 Mon Sep 17 00:00:00 2001
764884
From: Maxim Chicherin <maximc@mellanox.com>
764884
Date: Mon, 19 Aug 2019 11:11:12 +0300
764884
Subject: [PATCH rdma-core 04/13] pyverbs: Fix WC creation process
764884
764884
[ Upstream commit e83c7ff811544302ca3ecbcec23df0bb5b68d23f ]
764884
764884
In WC constructor, parameters assignment was incorrect and values
764884
were not stored properly.
764884
In addition, imm_data attribute was not initiated. imm_data represents
764884
immediate data in network byte order if wc_flags & IBV_WC_WITH_IMM or
764884
stores the invalidated rkey if wc_flags & IBV_WC_WITH_INV.
764884
764884
Fixes: 32165065ffbe ("pyverbs: Introducing completions related classes")
764884
Signed-off-by: Maxim Chicherin <maximc@mellanox.com>
764884
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
764884
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
764884
---
764884
 pyverbs/cq.pyx | 33 +++++++++++++++++++++------------
764884
 1 file changed, 21 insertions(+), 12 deletions(-)
764884
 mode change 100644 => 100755 pyverbs/cq.pyx
764884
764884
diff --git a/pyverbs/cq.pyx b/pyverbs/cq.pyx
764884
old mode 100644
764884
new mode 100755
764884
index dc09924e..3ac5f704
764884
--- a/pyverbs/cq.pyx
764884
+++ b/pyverbs/cq.pyx
764884
@@ -366,18 +366,19 @@ cdef class WC(PyverbsObject):
764884
     def __cinit__(self, wr_id=0, status=0, opcode=0, vendor_err=0, byte_len=0,
764884
                   qp_num=0, src_qp=0, imm_data=0, wc_flags=0, pkey_index=0,
764884
                   slid=0, sl=0, dlid_path_bits=0):
764884
-        self.wr_id = wr_id
764884
-        self.status = status
764884
-        self.opcode = opcode
764884
-        self.vendor_err = vendor_err
764884
-        self.byte_len = byte_len
764884
-        self.qp_num = qp_num
764884
-        self.src_qp = src_qp
764884
-        self.wc_flags = wc_flags
764884
-        self.pkey_index = pkey_index
764884
-        self.slid = slid
764884
-        self.sl = sl
764884
-        self.dlid_path_bits = dlid_path_bits
764884
+        self.wc.wr_id = wr_id
764884
+        self.wc.status = status
764884
+        self.wc.opcode = opcode
764884
+        self.wc.vendor_err = vendor_err
764884
+        self.wc.byte_len = byte_len
764884
+        self.wc.qp_num = qp_num
764884
+        self.wc.src_qp = src_qp
764884
+        self.wc.wc_flags = wc_flags
764884
+        self.wc.pkey_index = pkey_index
764884
+        self.wc.slid = slid
764884
+        self.wc.imm_data = imm_data
764884
+        self.wc.sl = sl
764884
+        self.wc.dlid_path_bits = dlid_path_bits
764884
 
764884
     @property
764884
     def wr_id(self):
764884
@@ -456,6 +457,13 @@ cdef class WC(PyverbsObject):
764884
     def sl(self, val):
764884
         self.wc.sl = val
764884
 
764884
+    @property
764884
+    def imm_data(self):
764884
+        return self.wc.imm_data
764884
+    @imm_data.setter
764884
+    def imm_data(self, val):
764884
+        self.wc.imm_data = val
764884
+
764884
     @property
764884
     def dlid_path_bits(self):
764884
         return self.wc.dlid_path_bits
764884
@@ -476,6 +484,7 @@ cdef class WC(PyverbsObject):
764884
             print_format.format('pkey index', self.pkey_index) +\
764884
             print_format.format('slid', self.slid) +\
764884
             print_format.format('sl', self.sl) +\
764884
+            print_format.format('imm_data', self.imm_data) +\
764884
             print_format.format('dlid path bits', self.dlid_path_bits)
764884
 
764884
 
764884
-- 
764884
2.20.1
764884