1 Star 0 Fork 51

zhangwenlong01/rdma-core

forked from src-openEuler/rdma-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0015-tests-test_mr.py-Change-the-argument-of-DmaBufMR-to-.patch 4.30 KB
一键复制 编辑 原始数据 按行查看 历史
tcc@hello 提交于 2022-11-06 23:11 +08:00 . Backport patches from 41.1
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangwenlong01/rdma-core.git
git@gitee.com:zhangwenlong01/rdma-core.git
zhangwenlong01
rdma-core
rdma-core
master

搜索帮助