2023-12-12 19:02:37 +08:00
|
|
|
From 12f8951a6a98f82dd1f70afc23d66e328cf1988b Mon Sep 17 00:00:00 2001
|
2023-12-07 10:58:28 +08:00
|
|
|
From: Chengchang Tang <tangchengchang@huawei.com>
|
|
|
|
|
Date: Thu, 7 Dec 2023 09:47:59 +0800
|
2023-12-12 19:02:37 +08:00
|
|
|
Subject: [PATCH] libhns: Fix parent domain unsupported comp mask
|
2023-12-07 10:58:28 +08:00
|
|
|
|
|
|
|
|
driver inclusion
|
|
|
|
|
category: bugfix
|
|
|
|
|
bugzilla: https://gitee.com/src-openeuler/rdma-core/issues/I8MF28
|
|
|
|
|
|
|
|
|
|
Hns do not support any comp mask for parent domain. Driver returns
|
|
|
|
|
EINVAL if any compmask is set.
|
|
|
|
|
|
|
|
|
|
This patch Replace the inappropriate return value EINVAL with
|
|
|
|
|
EOPNOTSUPP.
|
|
|
|
|
|
|
|
|
|
The error is found by testcase test_mem_align_ud_traffic.
|
|
|
|
|
|
|
|
|
|
ERROR: test_mem_align_ud_traffic (tests.test_parent_domain.ParentDomain
|
|
|
|
|
TrafficTest)
|
|
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
Traceback (most recent call last):
|
|
|
|
|
File "./tests/test_parent_domain.py", line 183, in test_mem_align_ud
|
|
|
|
|
_traffic
|
|
|
|
|
self.create_players(parent_domain_ud_res,
|
|
|
|
|
File "./tests/test_parent_domain.py", line 156, in create_players
|
|
|
|
|
self.client = resource(**self.dev_info, **resource_arg)
|
|
|
|
|
File "./tests/test_parent_domain.py", line 90, in __init__
|
|
|
|
|
super().__init__(**kwargs)
|
|
|
|
|
File "./tests/base.py", line 617, in __init__
|
|
|
|
|
super(RoCETrafficResources, self).__init__(dev_name, ib_port,
|
|
|
|
|
gid_index, **kwargs)
|
|
|
|
|
File "./tests/base.py", line 503, in __init__
|
|
|
|
|
super(TrafficResources, self).__init__(dev_name=dev_name,
|
|
|
|
|
File "./tests/base.py", line 477, in __init__
|
|
|
|
|
self.create_pd()
|
|
|
|
|
File "./tests/test_parent_domain.py", line 95, in create_pd
|
|
|
|
|
create_parent_domain_with_allocators(self)
|
|
|
|
|
File "./tests/test_parent_domain.py", line 69, in create_parent_
|
|
|
|
|
domain_with_allocators
|
|
|
|
|
raise ex
|
|
|
|
|
File "./tests/test_parent_domain.py", line 65, in create_parent_
|
|
|
|
|
domain_with_allocators
|
|
|
|
|
res.pd = ParentDomain(res.ctx, attr=pd_attr)
|
|
|
|
|
File "pd.pyx", line 261, in pyverbs.pd.ParentDomain.__init__
|
|
|
|
|
pyverbs.pyverbs_error.PyverbsRDMAError: Failed to allocate Parent
|
|
|
|
|
Domain.Errno: 22, Invalid argument
|
|
|
|
|
|
|
|
|
|
Fixes: cfe548d4c78e ("libhns: Add support for the thread
|
|
|
|
|
domain and the parent domain")
|
|
|
|
|
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
providers/hns/hns_roce_u_verbs.c | 2 +-
|
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c
|
2023-12-12 19:02:37 +08:00
|
|
|
index 34e8d07..ba3fef6 100644
|
2023-12-07 10:58:28 +08:00
|
|
|
--- a/providers/hns/hns_roce_u_verbs.c
|
|
|
|
|
+++ b/providers/hns/hns_roce_u_verbs.c
|
|
|
|
|
@@ -238,7 +238,7 @@ struct ibv_pd *hns_roce_u_alloc_pad(struct ibv_context *context,
|
2023-12-12 19:02:37 +08:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
if (attr->comp_mask) {
|
2023-12-07 10:58:28 +08:00
|
|
|
- errno = EINVAL;
|
|
|
|
|
+ errno = EOPNOTSUPP;
|
2023-12-12 19:02:37 +08:00
|
|
|
return NULL;
|
|
|
|
|
}
|
2023-12-07 10:58:28 +08:00
|
|
|
|
|
|
|
|
--
|
|
|
|
|
2.25.1
|
|
|
|
|
|