Backport patches from 41.1

Backport patches from rdma-core 41.1.

And bugfix patches reported by #I5Q3S5 has also been included.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
This commit is contained in:
Chengchang Tang 2022-11-06 23:11:24 +08:00
parent bdba7c90b6
commit 6f27f67e51
15 changed files with 56748 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 6be317e9e2b894d460c4f3422f349895d475ef8d Mon Sep 17 00:00:00 2001
From: Kirill Martynov <k.martynov@yadro.com>
Date: Mon, 20 Jun 2022 16:29:09 +0300
Subject: cma: Release allocated port array
Fix mem leak for allocated port array
Fixes: 1b9125689fec ("cma: Workaround for rdma_ucm kernel bug")
Signed-off-by: Kirill Martynov <k.martynov@yadro.com>
---
librdmacm/cma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/librdmacm/cma.c b/librdmacm/cma.c
index 2bde34a..7b924bd 100644
--- a/librdmacm/cma.c
+++ b/librdmacm/cma.c
@@ -304,6 +304,7 @@ static void remove_cma_dev(struct cma_device *cma_dev)
ibv_dealloc_pd(cma_dev->pd);
if (cma_dev->verbs)
ibv_close_device(cma_dev->verbs);
+ free(cma_dev->port);
list_del_from(&cma_dev_list, &cma_dev->entry);
free(cma_dev);
}
--
2.34.1

View File

@ -0,0 +1,28 @@
From 3704db8f8496ffd967ef8d8840eef2c04b7f4b06 Mon Sep 17 00:00:00 2001
From: Mikhail Sokolovskiy <sokolmish@gmail.com>
Date: Fri, 1 Jul 2022 17:34:24 +0300
Subject: rsockets: Fix allocation size There is memory allocation for (nfds +
1) elements, but actually less space is allocated (1 byte for new element
instead of sizeof(pollfd)). This is caused by operators precedence mistake.
Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
---
librdmacm/rsocket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/librdmacm/rsocket.c b/librdmacm/rsocket.c
index 8c81096..e26a053 100644
--- a/librdmacm/rsocket.c
+++ b/librdmacm/rsocket.c
@@ -3173,7 +3173,7 @@ static struct pollfd *rs_fds_alloc(nfds_t nfds)
else if (rs_pollinit())
return NULL;
- rfds = malloc(sizeof(*rfds) * nfds + 1);
+ rfds = malloc(sizeof(*rfds) * (nfds + 1));
rnfds = rfds ? nfds + 1 : 0;
}
--
2.34.1

View File

@ -0,0 +1,95 @@
From 9cad02f325f48434343970d54bff5a5e897d9be2 Mon Sep 17 00:00:00 2001
From: Wei Xu <xuwei5@hisilicon.com>
Date: Thu, 11 Aug 2022 02:30:56 +0000
Subject: tests/test_mr.py: Change the argument of DmaBufMR to fix the
TypeError
Replaced the argument 'unit' with 'gpu' to fix following error for the DmaBufMRTest:
TypeError: __init__() got an unexpected keyword argument 'unit'
Fixed: ffa97cb59f82 ("tests: Let PyverbsAPITestCase have one default device")
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
---
tests/test_mr.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/test_mr.py b/tests/test_mr.py
index 3ec1fb3..f34b4d0 100644
--- a/tests/test_mr.py
+++ b/tests/test_mr.py
@@ -490,7 +490,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
for f in flags:
len = u.get_mr_length()
for off in [0, len//2]:
- with DmaBufMR(pd, len, f, offset=off, unit=self.gpu,
+ with DmaBufMR(pd, len, f, offset=off, gpu=self.gpu,
gtt=self.gtt) as mr:
pass
@@ -505,7 +505,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
for f in flags:
len = u.get_mr_length()
for off in [0, len//2]:
- with DmaBufMR(pd, len, f, offset=off, unit=self.gpu,
+ with DmaBufMR(pd, len, f, offset=off, gpu=self.gpu,
gtt=self.gtt) as mr:
mr.close()
@@ -520,7 +520,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
for f in flags:
len = u.get_mr_length()
for off in [0, len//2]:
- with DmaBufMR(pd, len, f, offset=off, unit=self.gpu,
+ with DmaBufMR(pd, len, f, offset=off, gpu=self.gpu,
gtt=self.gtt) as mr:
# Pyverbs supports multiple destruction of objects,
# we are not expecting an exception here.
@@ -543,7 +543,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
mr_flags += i.value
try:
DmaBufMR(pd, u.get_mr_length(), mr_flags,
- unit=self.gpu, gtt=self.gtt)
+ gpu=self.gpu, gtt=self.gtt)
except PyverbsRDMAError as err:
assert 'Failed to register a dma-buf MR' in err.args[0]
else:
@@ -562,7 +562,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
for f in flags:
for mr_off in [0, mr_len//2]:
with DmaBufMR(pd, mr_len, f, offset=mr_off,
- unit=self.gpu, gtt=self.gtt) as mr:
+ gpu=self.gpu, gtt=self.gtt) as mr:
write_len = min(random.randint(1, MAX_IO_LEN),
mr_len)
mr.write('a' * write_len, write_len)
@@ -580,7 +580,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
for f in flags:
for mr_off in [0, mr_len//2]:
with DmaBufMR(pd, mr_len, f, offset=mr_off,
- unit=self.gpu, gtt=self.gtt) as mr:
+ gpu=self.gpu, gtt=self.gtt) as mr:
write_len = min(random.randint(1, MAX_IO_LEN),
mr_len)
write_str = 'a' * write_len
@@ -600,7 +600,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
length = u.get_mr_length()
flags = u.get_dmabuf_access_flags(self.ctx)
for f in flags:
- with DmaBufMR(pd, length, f, unit=self.gpu,
+ with DmaBufMR(pd, length, f, gpu=self.gpu,
gtt=self.gtt) as mr:
mr.lkey
@@ -614,7 +614,7 @@ class DmaBufMRTest(PyverbsAPITestCase):
length = u.get_mr_length()
flags = u.get_dmabuf_access_flags(self.ctx)
for f in flags:
- with DmaBufMR(pd, length, f, unit=self.gpu,
+ with DmaBufMR(pd, length, f, gpu=self.gpu,
gtt=self.gtt) as mr:
mr.rkey
--
2.34.1

56073
0016-ABI-Files.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
From 349d850df17e2287bd6b02766e30be79b701cd6e Mon Sep 17 00:00:00 2001
From: Maher Sanalla <msanalla@nvidia.com>
Date: Sun, 19 Jun 2022 13:34:23 +0300
Subject: mlx5: Adjust Crypto BSF size if signature is used
[ Upstream commit b38f3439a983f42dd5ac8f93f0813a969720225f ]
When a Mkey is configured with crypto and signature offload, the crypto
BSF size and signature BSF size should both be set to 128 Bytes.
Currently, when building the crypto BSF, we do not take into account
if signature mode is configured or not, and we set the crypto BSF size to
64 Bytes.
The situation above does not affect crypto configuration on CX6 HCA,
but will obstruct crypto traffic in more recent HCA's such as
CX6Dx and onwards.
Thus, check if signature mode is configured when building crypto bsf,
and set the bsf size accordingly.
Fixes: b5f0a5875380 ("mlx5: Add crypto setter for MKey")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
providers/mlx5/qp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/providers/mlx5/qp.c b/providers/mlx5/qp.c
index d0e5a49..f9f3d1a 100644
--- a/providers/mlx5/qp.c
+++ b/providers/mlx5/qp.c
@@ -2414,7 +2414,8 @@ static int mlx5_umr_fill_crypto_bsf(struct mlx5_crypto_bsf *crypto_bsf,
memset(crypto_bsf, 0, sizeof(*crypto_bsf));
- crypto_bsf->bsf_size_type |= MLX5_BSF_SIZE_WITH_INLINE
+ crypto_bsf->bsf_size_type |= (block ? MLX5_BSF_SIZE_SIG_AND_CRYPTO :
+ MLX5_BSF_SIZE_WITH_INLINE)
<< MLX5_BSF_SIZE_SHIFT;
crypto_bsf->bsf_size_type |= MLX5_BSF_TYPE_CRYPTO;
order = get_crypto_order(attr->encrypt_on_tx,
--
2.34.1

View File

@ -0,0 +1,34 @@
From 202637191a96aa1b8f1ee841d71ac8abdfad82bc Mon Sep 17 00:00:00 2001
From: Muhammad Sammar <muhammads@nvidia.com>
Date: Tue, 21 Jun 2022 12:30:39 +0300
Subject: mlx5: DR, Fix missing comma in matcher builder dump line
[ Upstream commit f50b33a69f12024d0b998d5d5062656a6aee6a92 ]
Add missing comma to matcher builder dump line.
Fixes: 6a1f3b4baa2e ("mlx5: Add support for dr_matcher to the steering dump API")
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Muhammad Sammar <muhammads@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
providers/mlx5/dr_dbg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/providers/mlx5/dr_dbg.c b/providers/mlx5/dr_dbg.c
index 1e82e25..62e3f36 100644
--- a/providers/mlx5/dr_dbg.c
+++ b/providers/mlx5/dr_dbg.c
@@ -410,7 +410,7 @@ static int dr_dump_matcher_builder(FILE *f, struct dr_ste_build *builder,
bool is_match = builder->htbl_type == DR_STE_HTBL_TYPE_MATCH;
int ret;
- ret = fprintf(f, "%d,0x%" PRIx64 "%d,%d,0x%x,%d\n",
+ ret = fprintf(f, "%d,0x%" PRIx64 ",%d,%d,0x%x,%d\n",
DR_DUMP_REC_TYPE_MATCHER_BUILDER,
matcher_id,
index,
--
2.34.1

View File

@ -0,0 +1,58 @@
From f6aa0ecbe50a3141d6a3a03f0282df3ec96b76df Mon Sep 17 00:00:00 2001
From: Benjamin Gilbert <bgilbert@redhat.com>
Date: Tue, 16 Aug 2022 23:20:45 -0400
Subject: Install xprtrdma/svcrdma kmods in redhat/suse dracut modules
[ Upstream commit aa40d6dab34d2a465e520ddb13858bd47c7b1c06 ]
The rdma dracut module installs udev rules that can cause
rdma-load-modules@rdma.service to load kernel modules listed in rdma.conf.
That file mentions the xprtrdma and svcrdma modules (both of which are
aliases for rpcrdma in kernel 5.18) but the dracut module doesn't install
them in the initrd. If they're not installed by other means, this causes
warnings in the journal:
systemd-modules-load[...]: Failed to find module 'xprtrdma'
systemd-modules-load[...]: Failed to find module 'svcrdma'
Before systemd 244, it also causes rdma-load-modules@rdma.service to fail
entirely.
Fix by explicitly installing those modules in the initrd.
See also https://bugzilla.redhat.com/show_bug.cgi?id=2117375.
Fixes: 8bb38f6cb1b2 ("redhat: update dracut setting")
Fixes: 775241089e26 ("suse: fix dracut support")
Signed-off-by: Benjamin Gilbert <bgilbert@redhat.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
redhat/rdma.modules-setup.sh | 2 +-
suse/module-setup.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/redhat/rdma.modules-setup.sh b/redhat/rdma.modules-setup.sh
index 1dabb5d..4dab750 100644
--- a/redhat/rdma.modules-setup.sh
+++ b/redhat/rdma.modules-setup.sh
@@ -29,5 +29,5 @@ install() {
installkernel() {
hostonly='' instmods =drivers/infiniband =drivers/net/ethernet/mellanox =drivers/net/ethernet/chelsio =drivers/net/ethernet/cisco =drivers/net/ethernet/emulex =drivers/target
- hostonly='' instmods crc-t10dif crct10dif_common
+ hostonly='' instmods crc-t10dif crct10dif_common xprtrdma svcrdma
}
diff --git a/suse/module-setup.sh b/suse/module-setup.sh
index 26419bf..1e5c517 100644
--- a/suse/module-setup.sh
+++ b/suse/module-setup.sh
@@ -27,5 +27,5 @@ install() {
installkernel() {
hostonly='' instmods =drivers/infiniband =drivers/net/ethernet/mellanox =drivers/net/ethernet/chelsio =drivers/net/ethernet/cisco =drivers/net/ethernet/emulex =drivers/target
- hostonly='' instmods crc-t10dif crct10dif_common
+ hostonly='' instmods crc-t10dif crct10dif_common xprtrdma svcrdma
}
--
2.34.1

View File

@ -0,0 +1,85 @@
From 94b468fad35b00bd43d28b9e680a4921baaf75c4 Mon Sep 17 00:00:00 2001
From: Sindhu-Devale <sindhu.devale@intel.com>
Date: Thu, 8 Sep 2022 15:44:12 -0400
Subject: providers/irdma: Explicitly set QP modify attributes for reflush
[ Upstream commit 1ffbbce65e60ee031be70a2bfb6ec319306e4378 ]
irdma issues a reflush via a modify QP to ERROR op to report completions for
WR's posted once the QP is in error state.
However, this reflush modify attributes is incorrectly keyed off the last QP
QP attributes by an application which might or might not be a modify to error.
In the later case, a flush WQE is missed.
Explicitly set the attr.qp_state and attr_mask during a reflush modify
to move the QP to error state once its in error state. Remove ibv_qp
attributes from irdma_uqp struct
Fixes: 14a0fc8 ("rdma-core/irdma: Implement device supported verb APIs")
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
providers/irdma/umain.h | 2 --
providers/irdma/uverbs.c | 9 +++------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/providers/irdma/umain.h b/providers/irdma/umain.h
index 9e802fd..109e2f1 100644
--- a/providers/irdma/umain.h
+++ b/providers/irdma/umain.h
@@ -88,7 +88,6 @@ struct irdma_ucq {
struct irdma_uqp {
struct ibv_qp ibv_qp;
- struct ibv_qp_attr attr;
struct irdma_ucq *send_cq;
struct irdma_ucq *recv_cq;
struct verbs_mr vmr;
@@ -103,7 +102,6 @@ struct irdma_uqp {
struct ibv_recv_wr *pend_rx_wr;
struct irdma_qp_uk qp;
enum ibv_qp_type qp_type;
- enum ibv_qp_attr_mask attr_mask;
struct irdma_sge *recv_sges;
};
diff --git a/providers/irdma/uverbs.c b/providers/irdma/uverbs.c
index 040b4ec..c2b326d 100644
--- a/providers/irdma/uverbs.c
+++ b/providers/irdma/uverbs.c
@@ -1416,12 +1416,9 @@ int irdma_umodify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask)
struct irdma_uvcontext *iwctx;
struct irdma_uqp *iwuqp;
-
iwuqp = container_of(qp, struct irdma_uqp, ibv_qp);
iwctx = container_of(qp->context, struct irdma_uvcontext,
ibv_ctx.context);
- iwuqp->attr_mask = attr_mask;
- memcpy(&iwuqp->attr, attr, sizeof(iwuqp->attr));
if (iwuqp->qp.qp_caps & IRDMA_PUSH_MODE &&
attr_mask & IBV_QP_STATE && iwctx->uk_attrs.hw_rev > IRDMA_GEN_1) {
@@ -1464,13 +1461,13 @@ static void irdma_issue_flush(struct ibv_qp *qp, bool sq_flush, bool rq_flush)
{
struct ib_uverbs_ex_modify_qp_resp resp = {};
struct irdma_umodify_qp cmd_ex = {};
- struct irdma_uqp *iwuqp;
+ struct ibv_qp_attr attr = {};
+ attr.qp_state = IBV_QPS_ERR;
cmd_ex.sq_flush = sq_flush;
cmd_ex.rq_flush = rq_flush;
- iwuqp = container_of(qp, struct irdma_uqp, ibv_qp);
- ibv_cmd_modify_qp_ex(qp, &iwuqp->attr, iwuqp->attr_mask,
+ ibv_cmd_modify_qp_ex(qp, &attr, IBV_QP_STATE,
&cmd_ex.ibv_cmd, sizeof(cmd_ex),
&resp, sizeof(resp));
}
--
2.34.1

View File

@ -0,0 +1,38 @@
From 660ac56e1ee71a177554432e9b9994aea1bdd0d4 Mon Sep 17 00:00:00 2001
From: Sindhu-Devale <sindhu.devale@intel.com>
Date: Thu, 8 Sep 2022 17:22:32 -0400
Subject: providers/irdma: Use s/g array in post send only when its valid
[ Upstream commit 7bc6e3b49cdac9776e740e9d886e3676524996f8 ]
Send with invalidate verb call can pass in an
uninitialized s/g array with 0 sge's which is
filled into irdma WQE and causes a HW asynchronous event.
Fix this by using the s/g array in irdma post send only when its valid.
Fixes: 3bebdf5 ("rdma-core/irdma: Add user/kernel shared libraries")
Signed-off-by: Tatyana Nikolova tatyana.e.nikolova@intel.com
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
providers/irdma/uk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/providers/irdma/uk.c b/providers/irdma/uk.c
index beda34b..43ea45a 100644
--- a/providers/irdma/uk.c
+++ b/providers/irdma/uk.c
@@ -476,7 +476,8 @@ enum irdma_status_code irdma_uk_send(struct irdma_qp_uk *qp,
FIELD_PREP(IRDMAQPSQ_IMMDATA, info->imm_data));
i = 0;
} else {
- qp->wqe_ops.iw_set_fragment(wqe, 0, op_info->sg_list,
+ qp->wqe_ops.iw_set_fragment(wqe, 0,
+ frag_cnt ? op_info->sg_list : NULL,
qp->swqe_polarity);
i = 1;
}
--
2.34.1

View File

@ -0,0 +1,52 @@
From b3dd8cf57c07055372f93aba508572274a59f7b5 Mon Sep 17 00:00:00 2001
From: Sindhu-Devale <sindhu.devale@intel.com>
Date: Thu, 8 Sep 2022 17:39:40 -0400
Subject: providers/irdma: Report correct WC errors
[ Upstream commit 7f9761eb541413bf113a6ba841791bd5fd47872e ]
Return specific WC errors for certain type of error
events.
In particular,
Return IBV_WC_REM_INV_REQ_ERR for an invalid
request related asynchronous event.
Fixes: 14a0fc8 ("rdma-core/irdma: Implement device supported verb APIs")
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Sindhu-Devale <sindhu.devale@intel.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
providers/irdma/user.h | 1 +
providers/irdma/uverbs.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/providers/irdma/user.h b/providers/irdma/user.h
index 2506d48..f8bbc27 100644
--- a/providers/irdma/user.h
+++ b/providers/irdma/user.h
@@ -106,6 +106,7 @@ enum irdma_flush_opcode {
FLUSH_FATAL_ERR,
FLUSH_RETRY_EXC_ERR,
FLUSH_MW_BIND_ERR,
+ FLUSH_REM_INV_REQ_ERR,
};
enum irdma_cmpl_status {
diff --git a/providers/irdma/uverbs.c b/providers/irdma/uverbs.c
index c2b326d..1b36bca 100644
--- a/providers/irdma/uverbs.c
+++ b/providers/irdma/uverbs.c
@@ -560,6 +560,8 @@ static enum ibv_wc_status irdma_flush_err_to_ib_wc_status(enum irdma_flush_opcod
return IBV_WC_RETRY_EXC_ERR;
case FLUSH_MW_BIND_ERR:
return IBV_WC_MW_BIND_ERR;
+ case FLUSH_REM_INV_REQ_ERR:
+ return IBV_WC_REM_INV_REQ_ERR;
case FLUSH_FATAL_ERR:
default:
return IBV_WC_FATAL_ERR;
--
2.34.1

View File

@ -0,0 +1,34 @@
From ef27ae99376e5b672c12e856fb72c2d94d8d2cf5 Mon Sep 17 00:00:00 2001
From: Bob Pearson <rpearsonhpe@gmail.com>
Date: Thu, 19 May 2022 10:58:11 -0500
Subject: pyverbs: Increment the correct rkey in test_qpex
[ Upstream commit 0c4d91db686ef4e4364aae2514d22e8462335bd9 ]
The local bind is manipulating the local rkey, not the server rkey. Bind
doesn't check that the high bits are correct so this was missed.
Fixes: 9fca2824b5ec ("tests: Retrieve tests that generates mlx5 CQE errors")
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
tests/test_qpex.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_qpex.py b/tests/test_qpex.py
index 8f3f338..a4c9991 100644
--- a/tests/test_qpex.py
+++ b/tests/test_qpex.py
@@ -300,7 +300,7 @@ class QpExTestCase(RDMATestCase):
if ex.error_code == errno.EOPNOTSUPP:
raise unittest.SkipTest('Memory Window allocation is not supported')
raise ex
- new_key = inc_rkey(server.mr.rkey)
+ new_key = inc_rkey(mw.rkey)
server.qp.wr_bind_mw(mw, new_key, bind_info)
server.qp.wr_complete()
u.poll_cq(server.cq)
--
2.34.1

View File

@ -0,0 +1,88 @@
From 080f7181a2b4d2316d03c702f65640d6e8b1031e Mon Sep 17 00:00:00 2001
From: Kamal Heib <kamalheib1@gmail.com>
Date: Mon, 19 Sep 2022 11:39:15 -0400
Subject: mckey: Use rdma_create_qp_ex only for loopback prevention
[ Upstream commit 926a1158e33d78573859f5dfea399f7a7edcf11f ]
As not all the providers support the rdma_create_qp_ex(), change the
code to use rdma_create_qp_ex() only when loopback prevention is requested.
Fixes: 40806cc22936 ("rdma-core: Add support for multicast loopback prevention to mckey")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
librdmacm/examples/mckey.c | 48 +++++++++++++++++++++++++-------------
1 file changed, 32 insertions(+), 16 deletions(-)
diff --git a/librdmacm/examples/mckey.c b/librdmacm/examples/mckey.c
index 7015ed2..6df53a2 100644
--- a/librdmacm/examples/mckey.c
+++ b/librdmacm/examples/mckey.c
@@ -134,7 +134,8 @@ static int verify_test_params(struct cmatest_node *node)
static int init_node(struct cmatest_node *node)
{
struct ibv_qp_init_attr_ex init_qp_attr_ex;
- int cqe, ret;
+ struct ibv_qp_init_attr init_qp_attr;
+ int cqe, ret = 0;
node->pd = ibv_alloc_pd(node->cma_id->verbs);
if (!node->pd) {
@@ -151,23 +152,38 @@ static int init_node(struct cmatest_node *node)
goto out;
}
- memset(&init_qp_attr_ex, 0, sizeof(init_qp_attr_ex));
- init_qp_attr_ex.cap.max_send_wr = message_count ? message_count : 1;
- init_qp_attr_ex.cap.max_recv_wr = message_count ? message_count : 1;
- init_qp_attr_ex.cap.max_send_sge = 1;
- init_qp_attr_ex.cap.max_recv_sge = 1;
- init_qp_attr_ex.qp_context = node;
- init_qp_attr_ex.sq_sig_all = 0;
- init_qp_attr_ex.qp_type = IBV_QPT_UD;
- init_qp_attr_ex.send_cq = node->cq;
- init_qp_attr_ex.recv_cq = node->cq;
-
- init_qp_attr_ex.comp_mask = IBV_QP_INIT_ATTR_CREATE_FLAGS|IBV_QP_INIT_ATTR_PD;
- init_qp_attr_ex.pd = node->pd;
- if (!loopback)
+ memset(&init_qp_attr, 0, sizeof init_qp_attr);
+ init_qp_attr.cap.max_send_wr = message_count ? message_count : 1;
+ init_qp_attr.cap.max_recv_wr = message_count ? message_count : 1;
+ init_qp_attr.cap.max_send_sge = 1;
+ init_qp_attr.cap.max_recv_sge = 1;
+ init_qp_attr.qp_context = node;
+ init_qp_attr.sq_sig_all = 0;
+ init_qp_attr.qp_type = IBV_QPT_UD;
+ init_qp_attr.send_cq = node->cq;
+ init_qp_attr.recv_cq = node->cq;
+
+ if (!loopback) {
+ memset(&init_qp_attr_ex, 0, sizeof(init_qp_attr_ex));
+ init_qp_attr_ex.cap.max_send_wr = message_count ? message_count : 1;
+ init_qp_attr_ex.cap.max_recv_wr = message_count ? message_count : 1;
+ init_qp_attr_ex.cap.max_send_sge = 1;
+ init_qp_attr_ex.cap.max_recv_sge = 1;
+ init_qp_attr_ex.qp_context = node;
+ init_qp_attr_ex.sq_sig_all = 0;
+ init_qp_attr_ex.qp_type = IBV_QPT_UD;
+ init_qp_attr_ex.send_cq = node->cq;
+ init_qp_attr_ex.recv_cq = node->cq;
+
+ init_qp_attr_ex.comp_mask = IBV_QP_INIT_ATTR_CREATE_FLAGS|IBV_QP_INIT_ATTR_PD;
+ init_qp_attr_ex.pd = node->pd;
init_qp_attr_ex.create_flags = IBV_QP_CREATE_BLOCK_SELF_MCAST_LB;
- ret = rdma_create_qp_ex(node->cma_id, &init_qp_attr_ex);
+ ret = rdma_create_qp_ex(node->cma_id, &init_qp_attr_ex);
+ } else {
+ ret = rdma_create_qp(node->cma_id, node->pd, &init_qp_attr);
+ }
+
if (ret) {
perror("mckey: unable to create QP");
goto out;
--
2.34.1

View File

@ -0,0 +1,35 @@
From 3e56594215ccce88b89638ec16480d970776e3fb Mon Sep 17 00:00:00 2001
From: Benjamin Drung <bdrung@ubuntu.com>
Date: Tue, 27 Sep 2022 12:01:14 +0200
Subject: Fix spelling mistake of underlying
[ Upstream commit 47f3a9fd706c4a407b7bbea12ffd16edd120883e ]
Fixes: cc6eb6dd7b73 ("pyverbs: Add support for memory window creation")
Signed-off-by: Benjamin Drung <bdrung@ubuntu.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
pyverbs/mr.pyx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyverbs/mr.pyx b/pyverbs/mr.pyx
index 72bb181..e7f5f52 100644
--- a/pyverbs/mr.pyx
+++ b/pyverbs/mr.pyx
@@ -314,10 +314,10 @@ cdef class MW(PyverbsCM):
cpdef close(self):
"""
- Closes the underlaying C MW object.
+ Closes the underlying C MW object.
MW may be deleted directly or by deleting its PD, which leaves the
- Python object without the underlaying MW.
- Need to check that the underlaying MW wasn't dealloced before.
+ Python object without the underlying MW.
+ Need to check that the underlying MW wasn't dealloced before.
:return: None
"""
if self.mw is not NULL:
--
2.34.1

View File

@ -0,0 +1,33 @@
From 1a2cad26263190460ed211329d040cb1da8d7ac2 Mon Sep 17 00:00:00 2001
From: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Thu, 13 Oct 2022 09:49:12 +0200
Subject: rdma-ndd: disable systemd ProtectHostName feature
[ Upstream commit 57637df8dd6b92b4bcd3e04cea476012901526d0 ]
ProtectHostName prevents dynamic name changes to be noticed by the service.
This means that on a system with no static hostname, rdma-ndd is started with
a hostname 'localhost' and is not aware of new hostname retreived
through a DHCP lease.
Fixes: 384b75b5f624 ("rdma-ndd: systemd hardening")
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
rdma-ndd/rdma-ndd.service.in | 1 -
1 file changed, 1 deletion(-)
diff --git a/rdma-ndd/rdma-ndd.service.in b/rdma-ndd/rdma-ndd.service.in
index e3f8d11..368deec 100644
--- a/rdma-ndd/rdma-ndd.service.in
+++ b/rdma-ndd/rdma-ndd.service.in
@@ -22,7 +22,6 @@ Restart=always
ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/rdma-ndd --systemd
ProtectSystem=full
ProtectHome=true
-ProtectHostname=true
ProtectKernelLogs=true
# rdma-ndd is automatically wanted by udev when an RDMA device with a node description is present
--
2.34.1

View File

@ -1,6 +1,6 @@
Name: rdma-core
Version: 41.0
Release: 3
Release: 4
Summary: RDMA core userspace libraries and daemons
License: GPLv2 or BSD
Url: https://github.com/linux-rdma/rdma-core
@ -18,6 +18,20 @@ Patch8: 0009-Update-kernel-headers.patch
Patch9: 0010-libhns-Support-cqe-inline.patch
Patch10: 0011-Update-kernel-headers.patch
Patch11: 0012-libhns-Support-DSCP.patch
Patch12: 0013-cma-Release-allocated-port-array.patch
Patch13: 0014-rsockets-Fix-allocation-size-There-is-memory-allocat.patch
Patch14: 0015-tests-test_mr.py-Change-the-argument-of-DmaBufMR-to-.patch
Patch15: 0016-ABI-Files.patch
Patch16: 0017-mlx5-Adjust-Crypto-BSF-size-if-signature-is-used.patch
Patch17: 0018-mlx5-DR-Fix-missing-comma-in-matcher-builder-dump-li.patch
Patch18: 0019-Install-xprtrdma-svcrdma-kmods-in-redhat-suse-dracut.patch
Patch19: 0020-providers-irdma-Explicitly-set-QP-modify-attributes-.patch
Patch20: 0021-providers-irdma-Use-s-g-array-in-post-send-only-when.patch
Patch21: 0022-providers-irdma-Report-correct-WC-errors.patch
Patch22: 0023-pyverbs-Increment-the-correct-rkey-in-test_qpex.patch
Patch23: 0024-mckey-Use-rdma_create_qp_ex-only-for-loopback-preven.patch
Patch24: 0025-Fix-spelling-mistake-of-underlying.patch
Patch25: 0026-rdma-ndd-disable-systemd-ProtectHostName-feature.patch
BuildRequires: binutils cmake >= 2.8.11 gcc libudev-devel pkgconfig pkgconfig(libnl-3.0)
BuildRequires: pkgconfig(libnl-route-3.0) valgrind-devel systemd systemd-devel
@ -262,6 +276,12 @@ fi
%{_mandir}/*
%changelog
* Sun Nov 06 2022 tangchengchang <tangchengchang@huawei.com> - 41.0-4
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: Backport bugfix from rdma-core 41.1
* Sat Oct 29 2022 tangchengchang <tangchengchang@huawei.com> - 41.0-3
- Type: requirement
- ID: NA