Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package rdma-core

we (1&1 IONOS SE) are hit by the race in rdma-ndd that is already fixed
in the latest rdma-core release. The rdma-core projects follows a
similar release process than the linux kernel developers. The point
releases only contain backported fixes. I had a look at those commits
and we probably want those fixes as well.

[ Reason ]
This release contains the rdma-ndd race fix.

[ Impact ]
For system with multiple InfiniBand HCAs, only the first HCA is
guaranteed to be detected by kernel and the node description for the
other ports are often not set due to the race.

[ Tests ]
The upstream project has test cases, but our package does not run the
tests, because they rely on having InfiniBand hardware.

[ Risks ]
The package is not a leaf package, but only needed for users with RDMA
hardware. Since we have a good upstream relationship, the code from
upstream is unchanged. In case of a regression, upstream will be
affected as well (with their latest 34.0 release and their upcoming 33.2
point release).

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

unblock rdma-core/33.1+git20210317-1

-- 
Benjamin Drung

Senior DevOps Engineer and Debian & Ubuntu Developer
Compute Platform Operations

1&1 IONOS SE | Greifswalder Str. 207 | 10405 Berlin | Deutschland
E-Mail: benjamin.dr...@ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498

Vorstand: Hüseyin Dogan, Dr. Martin Endreß, Claudia Frese, Henning
Kettler, Arthur Mai, Matthias Steinberg, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke


Member of United Internet
diff -Nru rdma-core-33.1/debian/changelog 
rdma-core-33.1+git20210317/debian/changelog
--- rdma-core-33.1/debian/changelog     2021-01-27 14:32:48.000000000 +0100
+++ rdma-core-33.1+git20210317/debian/changelog 2021-04-12 11:28:57.000000000 
+0200
@@ -1,3 +1,26 @@
+rdma-core (33.1+git20210317-1) unstable; urgency=medium
+
+  * New upstream bug-fix snapshot:
+    - mlx5: Fix uuars to have the 'uar_mmap_offset' data
+    - pyverbs: Fix Mlx5 QP constructor
+    - efa: Fix DV extension clear check
+    - verbs: Fix possible port loop overflow
+    - ibacm: Fix possible port loop overflow
+    - mlx5: DR, Check new cap for isolated VL TC QP
+    - kernel-boot: Fix VF lookup
+    - mlx5: DR, Force QP drain on table creation
+    - libhns: Avoid double release of a pointer
+    - libhns: Correct definition of DB_BYTE_4_TAG_M
+    - libhns: Remove assert to check whether a pointer is NULL
+    - libhns: Remove the unnecessary mask on QPN of CQE
+    - libhns: Remove unnecessary mask of ownerbit
+    - libhns: Remove unnecessary barrier when poll cq
+    - rdma-ndd: fix udev racy issue for system with multiple InfiniBand HCAs
+    - verbs: Fix create CQ comp_mask check
+  * Update my email address
+
+ -- Benjamin Drung <benjamin.dr...@ionos.com>  Mon, 12 Apr 2021 11:28:57 +0200
+
 rdma-core (33.1-1) unstable; urgency=medium
 
   * New upstream bugfix release.
diff -Nru rdma-core-33.1/debian/control 
rdma-core-33.1+git20210317/debian/control
--- rdma-core-33.1/debian/control       2021-01-27 14:32:46.000000000 +0100
+++ rdma-core-33.1+git20210317/debian/control   2021-04-12 11:25:05.000000000 
+0200
@@ -1,5 +1,5 @@
 Source: rdma-core
-Maintainer: Benjamin Drung <benjamin.dr...@cloud.ionos.com>
+Maintainer: Benjamin Drung <benjamin.dr...@ionos.com>
 Section: net
 Priority: optional
 Build-Depends: cmake (>= 2.8.11),
diff -Nru rdma-core-33.1/debian/copyright 
rdma-core-33.1+git20210317/debian/copyright
--- rdma-core-33.1/debian/copyright     2020-04-14 16:06:21.000000000 +0200
+++ rdma-core-33.1+git20210317/debian/copyright 2021-04-12 11:25:21.000000000 
+0200
@@ -12,7 +12,7 @@
 Copyright: 2008, Genome Research Ltd
            2014, Ana Beatriz Guerrero Lopez <a...@debian.org>
            2015-2016, Jason Gunthorpe <jguntho...@obsidianresearch.com>
-           2016-2018, Benjamin Drung <benjamin.dr...@cloud.ionos.com>
+           2016-2021, Benjamin Drung <benjamin.dr...@ionos.com>
            2016-2017, Talat Batheesh <tal...@mellanox.com>
 License: GPL-2+
  This program is free software; you can redistribute it and/or modify
diff -Nru rdma-core-33.1/ibacm/src/acme.c 
rdma-core-33.1+git20210317/ibacm/src/acme.c
--- rdma-core-33.1/ibacm/src/acme.c     2021-01-26 09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/ibacm/src/acme.c 2021-04-06 10:12:51.000000000 
+0200
@@ -461,7 +461,7 @@
        struct ibv_port_attr port_attr;
        int i, index, ret, found_active;
        char host_name[256];
-       uint8_t p;
+       uint32_t p;
 
        ret = gethostname(host_name, sizeof host_name);
        if (ret) {
@@ -481,17 +481,17 @@
                        if (!found_active) {
                                ret = ibv_query_port(verbs[i], p, &port_attr);
                                if (!ret && port_attr.state == IBV_PORT_ACTIVE) 
{
-                                       VPRINT("%s %s %d default\n",
+                                       VPRINT("%s %s %u default\n",
                                                host_name, 
verbs[i]->device->name, p);
-                                       fprintf(f, "%s %s %d default\n",
+                                       fprintf(f, "%s %s %u default\n",
                                                host_name, 
verbs[i]->device->name, p);
                                        found_active = 1;
                                }
                        }
 
-                       VPRINT("%s-%d %s %d default\n",
+                       VPRINT("%s-%d %s %u default\n",
                                host_name, index, verbs[i]->device->name, p);
-                       fprintf(f, "%s-%d %s %d default\n",
+                       fprintf(f, "%s-%d %s %u default\n",
                                host_name, index++, verbs[i]->device->name, p);
                }
        }
diff -Nru rdma-core-33.1/kernel-boot/rdma_rename.c 
rdma-core-33.1+git20210317/kernel-boot/rdma_rename.c
--- rdma-core-33.1/kernel-boot/rdma_rename.c    2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/kernel-boot/rdma_rename.c        2021-04-06 
10:12:51.000000000 +0200
@@ -337,7 +337,8 @@
                        ret = -ENOMEM;
                        goto err_dir;
                }
-               if (vf.func == v.func) {
+               if (vf.func == v.func &&
+                   vf.slot == v.slot) {
                        p->vf = atoi(&dent->d_name[6]);
                        break;
                }
diff -Nru rdma-core-33.1/libibverbs/cmd_cq.c 
rdma-core-33.1+git20210317/libibverbs/cmd_cq.c
--- rdma-core-33.1/libibverbs/cmd_cq.c  2021-01-26 09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/libibverbs/cmd_cq.c      2021-04-06 
10:12:51.000000000 +0200
@@ -151,13 +151,16 @@
                                  resp_size);
        uint32_t flags = 0;
 
-       if (!check_comp_mask(cq_attr->comp_mask, IBV_CQ_INIT_ATTR_MASK_FLAGS))
+       if (!check_comp_mask(cq_attr->comp_mask,
+                            IBV_CQ_INIT_ATTR_MASK_FLAGS |
+                            IBV_CQ_INIT_ATTR_MASK_PD))
                return EOPNOTSUPP;
 
        if (cq_attr->wc_flags & IBV_WC_EX_WITH_COMPLETION_TIMESTAMP)
                flags |= IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION;
 
-       if (cq_attr->flags & IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN)
+       if ((cq_attr->comp_mask & IBV_CQ_INIT_ATTR_MASK_FLAGS) &&
+           cq_attr->flags & IBV_CREATE_CQ_ATTR_IGNORE_OVERRUN)
                flags |= IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN;
 
        return ibv_icmd_create_cq(context, cq_attr->cqe, cq_attr->channel,
diff -Nru rdma-core-33.1/libibverbs/examples/devinfo.c 
rdma-core-33.1+git20210317/libibverbs/examples/devinfo.c
--- rdma-core-33.1/libibverbs/examples/devinfo.c        2021-01-26 
09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/libibverbs/examples/devinfo.c    2021-04-06 
10:12:51.000000000 +0200
@@ -198,7 +198,7 @@
 
 static int print_all_port_gids(struct ibv_context *ctx,
                               struct ibv_port_attr *port_attr,
-                              uint8_t port_num)
+                              uint32_t port_num)
 {
        enum ibv_gid_type_sysfs type;
        union ibv_gid gid;
@@ -210,7 +210,7 @@
        for (i = 0; i < tbl_len; i++) {
                rc = ibv_query_gid(ctx, port_num, i, &gid);
                if (rc) {
-                       fprintf(stderr, "Failed to query gid to port %d, index 
%d\n",
+                       fprintf(stderr, "Failed to query gid to port %u, index 
%d\n",
                               port_num, i);
                        return rc;
                }
@@ -499,7 +499,7 @@
        struct ibv_device_attr_ex device_attr = {};
        struct ibv_port_attr port_attr;
        int rc = 0;
-       uint8_t port;
+       uint32_t port;
        char buf[256];
 
        ctx = ibv_open_device(ib_dev);
@@ -618,7 +618,7 @@
                        fprintf(stderr, "Failed to query port %u props\n", 
port);
                        goto cleanup;
                }
-               printf("\t\tport:\t%d\n", port);
+               printf("\t\tport:\t%u\n", port);
                printf("\t\t\tstate:\t\t\t%s (%d)\n",
                       port_state_str(port_attr.state), port_attr.state);
                printf("\t\t\tmax_mtu:\t\t%s (%d)\n",
diff -Nru rdma-core-33.1/providers/efa/verbs.c 
rdma-core-33.1+git20210317/providers/efa/verbs.c
--- rdma-core-33.1/providers/efa/verbs.c        2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/providers/efa/verbs.c    2021-04-06 
10:12:51.000000000 +0200
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
 /*
- * Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
+ * Copyright 2019-2021 Amazon.com, Inc. or its affiliates. All rights reserved.
  */
 
 #include <assert.h>
@@ -44,7 +44,7 @@
        })
 
 #define is_ext_cleared(ptr, inlen) \
-       is_buf_cleared(ptr + sizeof(*ptr), inlen - sizeof(*ptr))
+       is_buf_cleared((uint8_t *)ptr + sizeof(*ptr), inlen - sizeof(*ptr))
 
 #define is_reserved_cleared(reserved) is_buf_cleared(reserved, 
sizeof(reserved))
 
@@ -1241,7 +1241,7 @@
                              driver_qp_type, inlen) ||
            efa_attr->comp_mask ||
            !is_reserved_cleared(efa_attr->reserved) ||
-           (inlen > sizeof(efa_attr) && !is_ext_cleared(efa_attr, inlen))) {
+           (inlen > sizeof(*efa_attr) && !is_ext_cleared(efa_attr, inlen))) {
                errno = EINVAL;
                return NULL;
        }
diff -Nru rdma-core-33.1/providers/hns/hns_roce_u_db.c 
rdma-core-33.1+git20210317/providers/hns/hns_roce_u_db.c
--- rdma-core-33.1/providers/hns/hns_roce_u_db.c        2021-01-26 
09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/providers/hns/hns_roce_u_db.c    2021-04-06 
10:12:51.000000000 +0200
@@ -85,8 +85,6 @@
 
 static void hns_roce_clear_db_page(struct hns_roce_db_page *page)
 {
-       assert(page);
-
        free(page->bitmap);
        hns_roce_free_buf(&(page->buf));
 }
diff -Nru rdma-core-33.1/providers/hns/hns_roce_u_hw_v2.c 
rdma-core-33.1+git20210317/providers/hns/hns_roce_u_hw_v2.c
--- rdma-core-33.1/providers/hns/hns_roce_u_hw_v2.c     2021-01-26 
09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/providers/hns/hns_roce_u_hw_v2.c 2021-04-06 
10:12:51.000000000 +0200
@@ -288,11 +288,10 @@
 {
        struct hns_roce_db rq_db = {};
 
-       roce_set_field(rq_db.byte_4, DB_BYTE_4_TAG_M, DB_BYTE_4_TAG_S, qpn);
+       rq_db.byte_4 = htole32(qpn);
        roce_set_field(rq_db.byte_4, DB_BYTE_4_CMD_M, DB_BYTE_4_CMD_S,
                       HNS_ROCE_V2_RQ_DB);
-       roce_set_field(rq_db.parameter, DB_PARAM_RQ_PRODUCER_IDX_M,
-                      DB_PARAM_RQ_PRODUCER_IDX_S, rq_head);
+       rq_db.parameter = htole32(rq_head);
 
        hns_roce_write64((uint32_t *)&rq_db, ctx, ROCEE_VF_DB_CFG0_OFFSET);
 }
@@ -303,13 +302,10 @@
 {
        struct hns_roce_db sq_db = {};
 
-       /* cmd: 0 sq db; 1 rq db; 2; 2 srq db; 3 cq db ptr; 4 cq db ntr */
+       sq_db.byte_4 = htole32(qpn);
        roce_set_field(sq_db.byte_4, DB_BYTE_4_CMD_M, DB_BYTE_4_CMD_S,
                       HNS_ROCE_V2_SQ_DB);
-       roce_set_field(sq_db.byte_4, DB_BYTE_4_TAG_M, DB_BYTE_4_TAG_S, qpn);
-
-       roce_set_field(sq_db.parameter, DB_PARAM_SQ_PRODUCER_IDX_M,
-                      DB_PARAM_SQ_PRODUCER_IDX_S, sq_head);
+       sq_db.parameter = htole32(sq_head);
        roce_set_field(sq_db.parameter, DB_PARAM_SL_M, DB_PARAM_SL_S, sl);
 
        hns_roce_write64((uint32_t *)&sq_db, ctx, ROCEE_VF_DB_CFG0_OFFSET);
@@ -646,8 +642,6 @@
        }
 
        if (npolled || err == V2_CQ_POLL_ERR) {
-               mmio_ordered_writes_hack();
-
                if (cq->flags & HNS_ROCE_CQ_FLAG_RECORD_DB)
                        *cq->set_ci_db =
                                cq->cons_index & DB_PARAM_CQ_CONSUMER_IDX_M;
@@ -871,7 +865,7 @@
                udma_to_device_barrier();
 
        roce_set_bit(ud_sq_wqe->rsv_opcode, UD_SQ_WQE_OWNER_S,
-                    ~(((qp->sq.head + nreq) >> qp->sq.shift) & 0x1));
+                    ~((qp->sq.head + nreq) >> qp->sq.shift));
 
        return ret;
 }
@@ -1049,7 +1043,7 @@
                udma_to_device_barrier();
 
        roce_set_bit(rc_sq_wqe->byte_4, RC_SQ_WQE_BYTE_4_OWNER_S,
-                    ~(((qp->sq.head + nreq) >> qp->sq.shift) & 0x1));
+                    ~((qp->sq.head + nreq) >> qp->sq.shift));
 
        return 0;
 }
@@ -1255,8 +1249,8 @@
 
        while ((int) --prod_index - (int) cq->cons_index >= 0) {
                cqe = get_cqe_v2(cq, prod_index & cq->ibv_cq.cqe);
-               if ((roce_get_field(cqe->byte_16, CQE_BYTE_16_LCL_QPN_M,
-                             CQE_BYTE_16_LCL_QPN_S) & 0xffffff) == qpn) {
+               if (roce_get_field(cqe->byte_16, CQE_BYTE_16_LCL_QPN_M,
+                                  CQE_BYTE_16_LCL_QPN_S) == qpn) {
                        is_recv_cqe = roce_get_bit(cqe->byte_4,
                                                   CQE_BYTE_4_S_R_S);
 
diff -Nru rdma-core-33.1/providers/hns/hns_roce_u_hw_v2.h 
rdma-core-33.1+git20210317/providers/hns/hns_roce_u_hw_v2.h
--- rdma-core-33.1/providers/hns/hns_roce_u_hw_v2.h     2021-01-26 
09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/providers/hns/hns_roce_u_hw_v2.h 2021-04-06 
10:12:51.000000000 +0200
@@ -127,36 +127,24 @@
        __le32  parameter;
 };
 #define DB_BYTE_4_TAG_S 0
-#define DB_BYTE_4_TAG_M   (((1UL << 23) - 1) << DB_BYTE_4_TAG_S)
+#define DB_BYTE_4_TAG_M GENMASK(23, 0)
 
 #define DB_BYTE_4_CMD_S 24
-#define DB_BYTE_4_CMD_M   (((1UL << 4) - 1) << DB_BYTE_4_CMD_S)
-
-#define DB_PARAM_SQ_PRODUCER_IDX_S 0
-#define DB_PARAM_SQ_PRODUCER_IDX_M \
-       (((1UL << 16) - 1) << DB_PARAM_SQ_PRODUCER_IDX_S)
-
-#define DB_PARAM_RQ_PRODUCER_IDX_S 0
-#define DB_PARAM_RQ_PRODUCER_IDX_M \
-       (((1UL << 16) - 1) << DB_PARAM_RQ_PRODUCER_IDX_S)
+#define DB_BYTE_4_CMD_M GENMASK(27, 24)
 
 #define DB_PARAM_SRQ_PRODUCER_COUNTER_S 0
-#define DB_PARAM_SRQ_PRODUCER_COUNTER_M \
-       (((1UL << 16) - 1) << DB_PARAM_SRQ_PRODUCER_COUNTER_S)
+#define DB_PARAM_SRQ_PRODUCER_COUNTER_M GENMASK(16, 0)
 
 #define DB_PARAM_SL_S 16
-#define DB_PARAM_SL_M \
-       (((1UL << 3) - 1) << DB_PARAM_SL_S)
+#define DB_PARAM_SL_M GENMASK(18, 16)
 
 #define DB_PARAM_CQ_CONSUMER_IDX_S 0
-#define DB_PARAM_CQ_CONSUMER_IDX_M \
-       (((1UL << 24) - 1) << DB_PARAM_CQ_CONSUMER_IDX_S)
+#define DB_PARAM_CQ_CONSUMER_IDX_M GENMASK(23, 0)
 
 #define DB_PARAM_CQ_NOTIFY_S 24
 
 #define DB_PARAM_CQ_CMD_SN_S 25
-#define DB_PARAM_CQ_CMD_SN_M \
-       (((1UL << 2) - 1) << DB_PARAM_CQ_CMD_SN_S)
+#define DB_PARAM_CQ_CMD_SN_M GENMASK(26, 25)
 
 struct hns_roce_v2_cqe {
        __le32  byte_4;
diff -Nru rdma-core-33.1/providers/hns/hns_roce_u_verbs.c 
rdma-core-33.1+git20210317/providers/hns/hns_roce_u_verbs.c
--- rdma-core-33.1/providers/hns/hns_roce_u_verbs.c     2021-01-26 
09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/providers/hns/hns_roce_u_verbs.c 2021-04-06 
10:12:51.000000000 +0200
@@ -589,10 +589,8 @@
 
        qp->rq_rinl_buf.wqe_list[0].sg_list = calloc(cnt * cap->max_recv_sge,
                                        sizeof(struct hns_roce_rinl_sge));
-       if (!qp->rq_rinl_buf.wqe_list[0].sg_list) {
-               free(qp->rq_rinl_buf.wqe_list);
+       if (!qp->rq_rinl_buf.wqe_list[0].sg_list)
                return ENOMEM;
-       }
 
        for (i = 0; i < cnt; i++) {
                int wqe_size = i * cap->max_recv_sge;
diff -Nru rdma-core-33.1/providers/mlx5/dr_devx.c 
rdma-core-33.1+git20210317/providers/mlx5/dr_devx.c
--- rdma-core-33.1/providers/mlx5/dr_devx.c     2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/providers/mlx5/dr_devx.c 2021-04-06 
10:12:51.000000000 +0200
@@ -178,7 +178,7 @@
        caps->flex_protocols = DEVX_GET(query_hca_cap_out, out,
                                        
capability.cmd_hca_cap.flex_parser_protocols);
        caps->isolate_vl_tc = DEVX_GET(query_hca_cap_out, out,
-                                      capability.cmd_hca_cap.isolate_vl_tc);
+                                      
capability.cmd_hca_cap.isolate_vl_tc_new);
        roce = DEVX_GET(query_hca_cap_out, out, capability.cmd_hca_cap.roce);
 
        caps->sw_format_ver = DEVX_GET(query_hca_cap_out, out,
diff -Nru rdma-core-33.1/providers/mlx5/dr_table.c 
rdma-core-33.1+git20210317/providers/mlx5/dr_table.c
--- rdma-core-33.1/providers/mlx5/dr_table.c    2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/providers/mlx5/dr_table.c        2021-04-06 
10:12:51.000000000 +0200
@@ -190,6 +190,10 @@
                if (ret)
                        goto free_tbl;
 
+               ret = dr_send_ring_force_drain(dmn);
+               if (ret)
+                       goto uninit_tbl;
+
                ret = dr_table_create_devx_tbl(tbl);
                if (ret)
                        goto uninit_tbl;
diff -Nru rdma-core-33.1/providers/mlx5/mlx5_ifc.h 
rdma-core-33.1+git20210317/providers/mlx5/mlx5_ifc.h
--- rdma-core-33.1/providers/mlx5/mlx5_ifc.h    2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/providers/mlx5/mlx5_ifc.h        2021-04-06 
10:12:51.000000000 +0200
@@ -628,13 +628,14 @@
 
        u8         log_max_srq_sz[0x8];
        u8         log_max_qp_sz[0x8];
-       u8         reserved_at_90[0x8];
+       u8         reserved_at_90[0x3];
+       u8         isolate_vl_tc_new[0x1];
+       u8         reserved_at_94[0x4];
        u8         prio_tag_required[0x1];
        u8         reserved_at_99[0x2];
        u8         log_max_qp[0x5];
 
-       u8         reserved_at_a0[0xa];
-       u8         isolate_vl_tc[0x1];
+       u8         reserved_at_a0[0xb];
        u8         log_max_srq[0x5];
        u8         reserved_at_b0[0x10];
 
diff -Nru rdma-core-33.1/providers/mlx5/verbs.c 
rdma-core-33.1+git20210317/providers/mlx5/verbs.c
--- rdma-core-33.1/providers/mlx5/verbs.c       2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/providers/mlx5/verbs.c   2021-04-06 
10:12:51.000000000 +0200
@@ -312,6 +312,8 @@
                        bf->page_id = bf_uar->page_id + index_uar_in_page;
                        bf->uar_handle = bf_uar->uar_handle;
                        bf->nc_mode = bf_uar->nc_mode;
+                       if (bf_uar->dyn_alloc_uar)
+                               bf->uar_mmap_offset = bf_uar->uar_mmap_offset;
                }
                if (bf_uar->qp_dedicated) {
                        ctx->qp_alloc_dedicated_uuars++;
diff -Nru rdma-core-33.1/pyverbs/providers/mlx5/mlx5dv.pyx 
rdma-core-33.1+git20210317/pyverbs/providers/mlx5/mlx5dv.pyx
--- rdma-core-33.1/pyverbs/providers/mlx5/mlx5dv.pyx    2021-01-26 
09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/pyverbs/providers/mlx5/mlx5dv.pyx        
2021-04-06 10:12:51.000000000 +0200
@@ -311,11 +311,11 @@
 
 
 cdef class Mlx5QP(QPEx):
-    def __init__(self, Mlx5Context context, QPInitAttrEx init_attr,
+    def __init__(self, Context context, QPInitAttrEx init_attr,
                  Mlx5DVQPInitAttr dv_init_attr):
         """
         Initializes an mlx5 QP according to the user-provided data.
-        :param context: mlx5 Context object
+        :param context: Context object
         :param init_attr: QPInitAttrEx object
         :param dv_init_attr: Mlx5DVQPInitAttr object
         :return: An initialized Mlx5QP
diff -Nru rdma-core-33.1/rdma-ndd/rdma-ndd.c 
rdma-core-33.1+git20210317/rdma-ndd/rdma-ndd.c
--- rdma-core-33.1/rdma-ndd/rdma-ndd.c  2021-01-26 09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/rdma-ndd/rdma-ndd.c      2021-04-06 
10:12:51.000000000 +0200
@@ -253,7 +253,6 @@
        }
 
        read_hostname(hn_fd, hostname, sizeof(hostname));
-       set_rdma_node_desc((const char *)hostname, 1);
 
        fds[0].fd = hn_fd;
        fds[0].events = 0;
@@ -268,6 +267,8 @@
        if (systemd)
                sd_notify(0, "READY=1");
 
+       set_rdma_node_desc((const char *)hostname, 1);
+
        while (1) {
                if (poll(fds, numfds, -1) <= 0) {
                        syslog(LOG_ERR, "Poll %s failed; exiting\n", 
SYS_HOSTNAME);
diff -Nru rdma-core-33.1/suse/rdma-core.spec 
rdma-core-33.1+git20210317/suse/rdma-core.spec
--- rdma-core-33.1/suse/rdma-core.spec  2021-01-26 09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/suse/rdma-core.spec      2021-04-06 
10:12:51.000000000 +0200
@@ -558,6 +558,8 @@
 
 %post -n rdma-ndd
 %service_add_post rdma-ndd.service
+# we ship udev rules, so trigger an update.
+%{_bindir}/udevadm trigger --subsystem-match=infiniband --action=change || true
 
 %postun -n rdma-ndd
 %service_del_postun rdma-ndd.service
diff -Nru rdma-core-33.1/tests/test_parent_domain.py 
rdma-core-33.1+git20210317/tests/test_parent_domain.py
--- rdma-core-33.1/tests/test_parent_domain.py  2021-01-26 09:06:08.000000000 
+0100
+++ rdma-core-33.1+git20210317/tests/test_parent_domain.py      2021-04-06 
10:12:51.000000000 +0200
@@ -6,7 +6,7 @@
 from pyverbs.pd import ParentDomainInitAttr, ParentDomain, ParentDomainContext
 from tests.base import RCResources, UDResources, RDMATestCase
 from pyverbs.pyverbs_error import PyverbsRDMAError
-from tests.test_cqex import create_ex_cq
+from pyverbs.cq import CqInitAttrEx, CQEX
 import pyverbs.mem_alloc as mem
 import pyverbs.enums as e
 import tests.utils as u
@@ -126,7 +126,16 @@
                          free_func=free_func, with_srq=True)
 
     def create_cq(self):
-        create_ex_cq(self)
+        wc_flags = e.IBV_WC_STANDARD_FLAGS
+        cia = CqInitAttrEx(cqe=2000, wc_flags=wc_flags, parent_domain=self.pd,
+                           comp_mask=e.IBV_CQ_INIT_ATTR_MASK_FLAGS |
+                                     e.IBV_CQ_INIT_ATTR_MASK_PD)
+        try:
+            self.cq = CQEX(self.ctx, cia)
+        except PyverbsRDMAError as ex:
+            if ex.error_code == errno.EOPNOTSUPP:
+                raise unittest.SkipTest('Extended CQ with Parent Domain is not 
supported')
+            raise ex
 
 
 class ParentDomainTrafficTest(RDMATestCase):
diff -Nru rdma-core-33.1/tests/test_rdmacm.py 
rdma-core-33.1+git20210317/tests/test_rdmacm.py
--- rdma-core-33.1/tests/test_rdmacm.py 2021-01-26 09:06:08.000000000 +0100
+++ rdma-core-33.1+git20210317/tests/test_rdmacm.py     2021-04-06 
10:12:51.000000000 +0200
@@ -51,8 +51,16 @@
                                       'passive':False, **resource_kwargs})
         passive.start()
         active.start()
-        passive.join(15)
-        active.join(15)
+        proc_raised_ex = False
+        for i in range(15):
+            if proc_raised_ex:
+                break
+            for proc in [passive, active]:
+                proc.join(1)
+                if not proc.is_alive() and not self.notifier.empty():
+                    proc_raised_ex = True
+                    break
+
         # If the processes is still alive kill them and fail the test.
         proc_killed = False
         for proc in [passive, active]:
@@ -60,10 +68,18 @@
                 proc.terminate()
                 proc_killed = True
         # Check if the test processes raise exceptions.
-        if not self.notifier.empty():
-            res = self.notifier.get()
-            if res is not None:
-                raise PyverbsError(res)
+        proc_res = {}
+        while not self.notifier.empty():
+            res, side = self.notifier.get()
+            proc_res[side] = res
+        for ex in proc_res.values():
+            if isinstance(ex, unittest.case.SkipTest):
+                raise(ex)
+        if proc_res:
+            print(f'Received the following exceptions: {proc_res}')
+            if isinstance(res, Exception):
+                raise(res)
+            raise PyverbsError(res)
         # Raise exeption if the test proceses was terminate.
         if proc_killed:
             raise Exception('RDMA CM test procces is stuck, kill the test')

Reply via email to