Xi Wang
395f2e8fd3
RDMA/hns: Fix the unneeded process when getting a general type of CQE error
...
If the hns ROCEE reports a general error CQE (types not specified by the IB
General Specifications), it's no need to change the QP state to error, and
the driver should just skip it.
Fixes: 7c044adca2 ("RDMA/hns: Simplify the cqe code of poll cq")
Link: https://lore.kernel.org/r/1595932941-40613-8-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 15:11:49 -03:00
Lang Cheng
4327bd2c41
RDMA/hns: Fix error during modify qp RTS2RTS
...
One qp state migrations legal configuration was deleted mistakenly.
Fixes: 357f342946 ("RDMA/hns: Simplify the state judgment code of qp")
Link: https://lore.kernel.org/r/1595932941-40613-7-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 15:11:49 -03:00
Lang Cheng
a5531e9b70
RDMA/hns: Delete unnecessary memset when allocating VF resource
...
The hns_roce_cmq_setup_basic_desc() can clear the whole desc, so removes
these redundant memset operations.
Link: https://lore.kernel.org/r/1595932941-40613-6-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 15:11:49 -03:00
Weihang Li
eaaa98dedf
RDMA/hns: Remove redundant parameters in set_rc_wqe()
...
There are some functions called by set_rc_wqe() use two parameters:
"void *wqe" and "struct hns_roce_v2_rc_send_wqe *rc_sq_wqe", but the first
one can be got from the second one. So remove the redundant wqe from
related functions.
Link: https://lore.kernel.org/r/1595932941-40613-5-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 11:31:02 -03:00
Lang Cheng
a247fd28c1
RDMA/hns: Remove support for HIP08_A
...
HIP08_A is an temporary version and all features of it are supported by
HIP08_B. So remove the relevant code.
Link: https://lore.kernel.org/r/1595932941-40613-4-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Yangyang Li <liyangyang20@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 11:31:02 -03:00
Weihang Li
cdc1f3e946
RDMA/hns: Refactor hns_roce_v2_set_hem()
...
The parts about preparing and sending mailbox to hardware is not strongly
related to other codes in hns_roce_v2_set_hem(), and can be encapsulated
into a separate function.
Link: https://lore.kernel.org/r/1595932941-40613-3-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 11:31:02 -03:00
Lang Cheng
57005c96b7
RDMA/hns: Remove redundant hardware opcode definitions
...
HNS_ROCE_SQ_OPCODE_XXXs and HNS_ROCE_V2_WQE_OP_XXXs have same values, so
remove a set of redundant definitions. In addition, remove the suffix of
HNS_ROCE_V2_WQE_OP_BIND_MW_TYPE.
Link: https://lore.kernel.org/r/1595932941-40613-2-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-30 11:31:02 -03:00
Xi Wang
79d5208386
RDMA/hns: Fix wrong PBL offset when VA is not aligned to PAGE_SIZE
...
ROCE uses "VA % buf_page_size" to caclulate the offset in the PBL's first
page, the actual PA corresponding to the MR's VA is equal to MR's PA plus
this offset. The first PA in PBL has already been aligned to PAGE_SIZE
after calling ib_umem_get(), but the MR's VA may not. If the buf_page_size
is smaller than the PAGE_SIZE, this will lead the HW to access the wrong
memory because the offset is smaller than expected.
Fixes: 9b2cf76c9f ("RDMA/hns: Optimize PBL buffer allocation process")
Link: https://lore.kernel.org/r/1594726935-45666-1-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-16 09:55:01 -03:00
Weihang Li
7b9bd73ed1
RDMA/hns: Fix wrong assignment of lp_pktn_ini in QPC
...
The RoCE Engine will schedule to another QP after one has sent
(2 ^ lp_pktn_ini) packets. lp_pktn_ini is set in QPC and should be
calculated from 2 factors:
1. current MTU as a integer
2. the RoCE Engine's maximum slice length 64KB
But the driver use MTU as a enum ib_mtu and the max inline capability, the
lp_pktn_ini will be much bigger than expected which may cause traffic of
some QPs to never get scheduled.
Fixes: b713128de7 ("RDMA/hns: Adjust lp_pktn_ini dynamically")
Link: https://lore.kernel.org/r/1594726138-49294-1-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-16 09:52:14 -03:00
Xi Wang
cc33b23e1e
RDMA/hns: Optimize MTR level-0 addressing to access huge page
...
If hns ROCEE is set to level-0 addressing, the length of the entire buffer
can be used as the page size. The driver needn't to split the buffer into
small units because all pages are continuous.
Link: https://lore.kernel.org/r/1593525696-12570-1-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-07 13:15:10 -03:00
Gal Pressman
42a3b15396
RDMA: Remove the udata parameter from alloc_mr callback
...
Allocating an MR flow can only be initiated by kernel users, and not from
userspace so a udata parameter is redundant.
Link: https://lore.kernel.org/r/20200706120343.10816-4-galpress@amazon.com
Signed-off-by: Gal Pressman <galpress@amazon.com >
Reviewed-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-07-06 19:25:53 -03:00
Maor Gottlieb
9e2a187a93
RDMA: Add a dedicated CQ resource tracker function
...
In order to avoid double multiplexing of the resource when it is a CQ, add
a dedicated callback function.
Link: https://lore.kernel.org/r/20200623113043.1228482-6-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Signed-off-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2020-06-23 11:46:27 -03:00
Yangyang Li
3ec5f54f7a
RDMA/hns: Fix an cmd queue issue when resetting
...
If a IMP reset caused by some hardware errors and hns RoCE driver reset
occurred at the same time, there is a possiblity that the IMP will stop
dealing with command and users can't use the hardware. The logs are as
follows:
hns3 0000:fd:00.1: cleaned 0, need to clean 1
hns3 0000:fd:00.1: firmware version query failed -11
hns3 0000:fd:00.1: Cmd queue init failed
hns3 0000:fd:00.1: Upgrade reset level
hns3 0000:fd:00.1: global reset interrupt
The hns NIC driver divides the reset process into 3 status:
initialization, hardware resetting and softwaring restting. RoCE driver
gets reset status by interfaces provided by NIC driver and commands will
not be sent to the IMP if the driver is in any above status. The main
reason for this issue is that there is a time gap between status 1 and 2,
if the RoCE driver sends commands to the IMP during this gap, the IMP will
stop working because it is not ready.
To eliminate the time gap, the hns NIC driver has added a new interface in
commit a4de02287a ("net: hns3: provide .get_cmdq_stat interface for the
client"), so RoCE driver can ensure that no commands will be sent during
resetting.
Link: https://lore.kernel.org/r/1592314778-52822-1-git-send-email-liweihang@huawei.com
Signed-off-by: Yangyang Li <liyangyang20@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-06-18 10:48:39 -03:00
Yangyang Li
98a6151907
RDMA/hns: Fix a calltrace when registering MR from userspace
...
ibmr.device is assigned after MR is successfully registered, but both
write_mtpt() and frmr_write_mtpt() accesses it during the mr registration
process, which may cause the following error when trying to register MR in
userspace and pbl_hop_num is set to 0.
pc : hns_roce_mtr_find+0xa0/0x200 [hns_roce]
lr : set_mtpt_pbl+0x54/0x118 [hns_roce_hw_v2]
sp : ffff00023e73ba20
x29: ffff00023e73ba20 x28: ffff00023e73bad8
x27: 0000000000000000 x26: 0000000000000000
x25: 0000000000000002 x24: 0000000000000000
x23: ffff00023e73bad0 x22: 0000000000000000
x21: ffff0000094d9000 x20: 0000000000000000
x19: ffff8020a6bdb2c0 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000
x15: 0000000000000000 x14: 0000000000000000
x13: 0140000000000000 x12: 0040000000000041
x11: ffff000240000000 x10: 0000000000001000
x9 : 0000000000000000 x8 : ffff802fb7558480
x7 : ffff802fb7558480 x6 : 000000000003483d
x5 : ffff00023e73bad0 x4 : 0000000000000002
x3 : ffff00023e73bad8 x2 : 0000000000000000
x1 : 0000000000000000 x0 : ffff0000094d9708
Call trace:
hns_roce_mtr_find+0xa0/0x200 [hns_roce]
set_mtpt_pbl+0x54/0x118 [hns_roce_hw_v2]
hns_roce_v2_write_mtpt+0x14c/0x168 [hns_roce_hw_v2]
hns_roce_mr_enable+0x6c/0x148 [hns_roce]
hns_roce_reg_user_mr+0xd8/0x130 [hns_roce]
ib_uverbs_reg_mr+0x14c/0x2e0 [ib_uverbs]
ib_uverbs_write+0x27c/0x3e8 [ib_uverbs]
__vfs_write+0x60/0x190
vfs_write+0xac/0x1c0
ksys_write+0x6c/0xd8
__arm64_sys_write+0x24/0x30
el0_svc_common+0x78/0x130
el0_svc_handler+0x38/0x78
el0_svc+0x8/0xc
Solve above issue by adding a pointer of structure hns_roce_dev as a
parameter of write_mtpt() and frmr_write_mtpt(), so that both of these
functions can access it before finishing MR's registration.
Fixes: 9b2cf76c9f ("RDMA/hns: Optimize PBL buffer allocation process")
Link: https://lore.kernel.org/r/1592314629-51715-1-git-send-email-liweihang@huawei.com
Signed-off-by: Yangyang Li <liyangyang20@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-06-18 10:47:04 -03:00
Masahiro Yamada
a7f7f6248d
treewide: replace '---help---' in Kconfig files with 'help'
...
Since commit 84af7a6194 ("checkpatch: kconfig: prefer 'help' over
'---help---'"), the number of '---help---' has been gradually
decreasing, but there are still more than 2400 instances.
This commit finishes the conversion. While I touched the lines,
I also fixed the indentation.
There are a variety of indentation styles found.
a) 4 spaces + '---help---'
b) 7 spaces + '---help---'
c) 8 spaces + '---help---'
d) 1 space + 1 tab + '---help---'
e) 1 tab + '---help---' (correct indentation)
f) 1 tab + 1 space + '---help---'
g) 1 tab + 2 spaces + '---help---'
In order to convert all of them to 1 tab + 'help', I ran the
following commend:
$ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org >
2020-06-14 01:57:21 +09:00
Dan Carpenter
87d9e56849
RDMA/hns: Uninitialized variable in modify_qp_init_to_rtr()
...
The "dmac" variable is used before it is initialized.
Fixes: 494c3b3122 ("RDMA/hns: Refactor the QP context filling process related to WQE buffer configure")
Link: https://lore.kernel.org/r/20200529083918.GA1298465@mwanda
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Leon Romanovsky <leonro@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-06-02 20:32:54 -03:00
Colin Ian King
48062b0a8b
RDMA/hns: remove duplicate assignment to pointer raq
...
The pointer raq is being assigned twice. Fix this by removing one of the
redundant assignments.
Fixes: 14ba87304b ("RDMA/hns: Remove redundant type cast for general pointers")
Link: https://lore.kernel.org/r/20200528150427.420624-1-colin.king@canonical.com
Addressses-Coverity: ("Evaluation order violation")
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-29 15:19:57 -03:00
Yixian Liu
e1b43f07c0
RDMA/hns: Make the end of sge process more clear
...
Instead of i with the sge number of wr will make the comparision more
clear, that is, when the sge number in wr is small than the maximum
supported sge number in the queue, then a stop sge needed to be filled at
the end of sges in wr.
Link: https://lore.kernel.org/r/1590152579-32364-5-git-send-email-liweihang@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:20:46 -03:00
Lang Cheng
e4aaf4bad4
RDMA/hns: Simplify process related to poll cq
...
Set hns_roce_v2_cq_set_ci to inline type and remove unnecessary
next_cqe_sw_v2().
Link: https://lore.kernel.org/r/1590152579-32364-4-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:20:45 -03:00
Wenpeng Liang
f226f6765f
RDMA/hns: Remove redundant parameters from free_srq/qp_wrid()
...
The redundant parameters "hr_dev" need to be removed from
free_kernel_wrid() and free_srq_wrid().
Link: https://lore.kernel.org/r/1590152579-32364-3-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:20:45 -03:00
Weihang Li
14ba87304b
RDMA/hns: Remove redundant type cast for general pointers
...
There is no need to do a type cast on genernal pointers, they could be
assigned to any type of variables. In addition, optimize initialization of
some variables and adjust order of them.
Link: https://lore.kernel.org/r/1590152579-32364-2-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:20:45 -03:00
Xi Wang
8e029d386b
RDMA/hns: Optimize the usage of MTR
...
Currently, the MTR region is configed before hns_roce_mtr_map() is
invoked, but in some scenarios, the region is configed at MTR creation,
the caller need to store this config and call hns_roce_mtr_map() later. So
optimize the usage by wrapping the MTR region config into MTR.
Link: https://lore.kernel.org/r/1589982799-28728-10-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:13 -03:00
Xi Wang
494c3b3122
RDMA/hns: Refactor the QP context filling process related to WQE buffer configure
...
Split the code related to WQE buffer configure from the QPC filling
process into two functions: config_qp_sq_buf() and config_qp_rq_buf(),
this will make the code more readable.
Link: https://lore.kernel.org/r/1589982799-28728-9-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:13 -03:00
Weihang Li
13aa13dddd
RDMA/hns: Change variables representing quantity to unsigned
...
Number of sge/eqe is always non-negative, they should be defined in type
of unsigned.
Link: https://lore.kernel.org/r/1589982799-28728-8-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:12 -03:00
Weihang Li
82d07a4e46
RDMA/hns: Change all page_shift to unsigned
...
page_shift is used to calculate the page size, it's always non-negative,
and should be in type of unsigned.
Link: https://lore.kernel.org/r/1589982799-28728-7-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:12 -03:00
Xi Wang
e9f2cd2825
RDMA/hns: Rename QP buffer related function
...
Rename the function related to QP buffer to make the code more readable.
Link: https://lore.kernel.org/r/1589982799-28728-6-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:12 -03:00
Yangyang Li
b9c93e3aad
RDMA/hns: Remove unused code about assert
...
The codes related to assert are no longer used and need to be deleted.
Link: https://lore.kernel.org/r/1589982799-28728-5-git-send-email-liweihang@huawei.com
Signed-off-by: Yangyang Li <liyangyang20@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:12 -03:00
Lang Cheng
0db6570947
RDMA/hns: Optimize post and poll process
...
Add unlikely() and likely() to optimize main I/O process code.
Link: https://lore.kernel.org/r/1589982799-28728-4-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:11 -03:00
Lang Cheng
05e6a5a635
RDMA/hns: Add CQ flag instead of independent enable flag
...
It's easier to understand and maintain enable flags of cq using a single
field in type of u32 than defining a field for every flags in the
structure hns_roce_cq, and we can add new flags for features more
conveniently in the future.
Link: https://lore.kernel.org/r/1589982799-28728-3-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:11 -03:00
Lang Cheng
25966e8931
RDMA/hns: Let software PI/CI grow naturally
...
The hardware can truncate PI/CI when posting or polling, the driver does
not need to do truncation. Therefore keep the software's PI/CI consistent
with it in the hardware.
Link: https://lore.kernel.org/r/1589982799-28728-2-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-25 14:02:11 -03:00
Lijun Ou
711195e57d
RDMA/hns: Reserve one sge in order to avoid local length error
...
When rq/srq sge length is smaller than sq sge length, it will produce a
local length error and may cause the bus to hang. Therefore, for rq wqe
and srq wqe, one reserved sge pointing to a reserved mr is used to avoid
this error.
Link: https://lore.kernel.org/r/1588931159-56875-10-git-send-email-liweihang@huawei.com
Signed-off-by: Lijun Ou <oulijun@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:59 -03:00
Xi Wang
9581a356cc
RDMA/hns: Rename macro for defining hns hardware page size
...
Rename the PAGE_ADDR_SHIFT as HNS_HW_PAGE_SHIFT to make code more
readable.
Link: https://lore.kernel.org/r/1588931159-56875-9-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:59 -03:00
Weihang Li
252067e950
RDMA/hns: Remove redundant memcpy()
...
srq_context is a local variables and is only used to get some fields from
buffer of mailbox. It's meaningless to copy mailbox's buffer's contents
back to it.
Link: https://lore.kernel.org/r/1588931159-56875-8-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:58 -03:00
Lang Cheng
7b611d2f6e
RDMA/hns: Store mr len information into mr obj
...
The length information should be stored in the struct ib_mr object,
otherwise the length value of a valid mr object would always be 0.
Link: https://lore.kernel.org/r/1588931159-56875-7-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:58 -03:00
Weihang Li
d4d8138741
RDMA/hns: Fix error with to_hr_hem_entries_count()
...
For ilog2(x), if x is 0 and not a constant variable, it will return
-1. And there will be an error as below:
hns3 0000:7d:00.0 hns_0: Local work queue 0x8 catast error, sub_event type is: 2
So modify to_hr_hem_entries_shift() to return 0 if conut is 0.
Fixes: 54d6638765 ("RDMA/hns: Optimize WQE buffer size calculating process")
Link: https://lore.kernel.org/r/1588931159-56875-6-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:58 -03:00
Weihang Li
6968aeb5aa
RDMA/hns: Fix wrong assignment of SRQ's max_wr
...
srq's attribute max_wr should be 1 less than the total count of wqe.
Fixes: ffb1308b88 ("RDMA/hns: Move SRQ code to the reasonable place")
Link: https://lore.kernel.org/r/1588931159-56875-5-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:58 -03:00
Wenpeng Liang
053c0acf52
RDMA/hns: Fix assignment to ba_pg_sz of eqe
...
When allocating eq buffer, the size of base address page should be defined
by eqe_ba_pg_sz instead of srqwqe_ba_pg_sz.
Fixes: 477a0a3870 ("RDMA/hns: Optimize 0 hop addressing for EQE buffer")
Link: https://lore.kernel.org/r/1588931159-56875-4-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:57 -03:00
Lang Cheng
441c88d5b3
RDMA/hns: Fix cmdq parameter of querying pf timer resource
...
The firmware has reduced the number of descriptions of command
HNS_ROCE_OPC_QUERY_PF_TIMER_RES to 1. The driver needs to adapt, otherwise
the hardware will report error 4(CMD_NEXT_ERR).
Fixes: 0e40dc2f70 ("RDMA/hns: Add timer allocation support for hip08")
Link: https://lore.kernel.org/r/1588931159-56875-3-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:57 -03:00
Lijun Ou
349be27650
RDMA/hns: Bugfix for querying qkey
...
The qkey queried through the query ud qp verb is a fixed value and it
should be read from qp context.
Fixes: 926a01dc00 ("RDMA/hns: Add QP operations support for hip08 SoC")
Link: https://lore.kernel.org/r/1588931159-56875-2-git-send-email-liweihang@huawei.com
Signed-off-by: Lijun Ou <oulijun@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-19 20:54:57 -03:00
Lang Cheng
90ae0b57e4
RDMA/hns: Combine enable flags of qp
...
It's easier to understand and maintain enable flags of qp using a single
field in type of unsigned long than defining a field for every flags in
the structure hns_roce_qp, and we can add new flags for features more
conveniently in the future.
Link: https://lore.kernel.org/r/1588674607-25337-4-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-12 20:37:06 -03:00
Weihang Li
30661322b8
RDMA/hns: Extend capability flags for HIP08_C
...
12 bits is not enough for HIP08_C, so extend a new field in length of 16
bits for it.
Link: https://lore.kernel.org/r/1588674607-25337-3-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-12 20:37:06 -03:00
Wenpeng Liang
e4faa478c6
RDMA/hns: Remove redundant assignment of caps
...
These caps are assigned in query_pf_caps() or set_default_caps(), and
should not be assigned out of these two functions.
Link: https://lore.kernel.org/r/1588242691-12913-4-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:33:20 -03:00
Weihang Li
b713128de7
RDMA/hns: Adjust lp_pktn_ini dynamically
...
lp_pktn_ini means the number of loopback slice packets for long messages,
it should depend on MTU(fixed to 4096B currently) and max size of SQ
inline.
Link: https://lore.kernel.org/r/1588242691-12913-3-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:33:20 -03:00
Weihang Li
23190b8f47
RDMA/hns: Fix comments with non-English symbols
...
There is a comments with some chinese semicolons that cause encoding
issues each time hns_roc_hw_v2.h was modified from a IDE. So fix this by
using correct symbols.
Link: https://lore.kernel.org/r/1588242691-12913-2-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:33:19 -03:00
Xi Wang
67954a6e37
RDMA/hns: Optimize SRQ buffer size calculating process
...
Optimize the SRQ's WQE buffer parameters calculating process to make the
codes more readable by using new functions about multi-hop addressing to
calculating capabilities of SRQ.
Link: https://lore.kernel.org/r/1588071823-40200-6-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:26:44 -03:00
Yixian Liu
ffb1308b88
RDMA/hns: Move SRQ code to the reasonable place
...
Just move the SRQ related code to more reasonable place, and unify format
of some prints.
Link: https://lore.kernel.org/r/1588071823-40200-5-git-send-email-liweihang@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:26:43 -03:00
Xi Wang
54d6638765
RDMA/hns: Optimize WQE buffer size calculating process
...
Optimize the QP's WQE buffer parameters calculating process to make the
codes more readable mainly by merging calculation of extended sge space of
kernel and userspace. In addition, add some inline functions to simply
codes about multi-hop addressing.
Link: https://lore.kernel.org/r/1588071823-40200-4-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:26:43 -03:00
Xi Wang
2929c40f08
RDMA/hns: Remove unused MTT functions
...
The MTT (Memory Translate Table) interface is no longer used to configure
the buffer address to BT (Base Address Table) that requires driver
mapping. Because the MTT is not compatible with multi-hop addressing of
the hip08, it is replaced by MTR (Memory Translate Region) interface, and
all the MTT functions should be removed.
Link: https://lore.kernel.org/r/1588071823-40200-3-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:26:43 -03:00
Xi Wang
9b2cf76c9f
RDMA/hns: Optimize PBL buffer allocation process
...
PBL table has its own implementation for multi-hop addressing currently,
but for the hardware, all table's addressing use the same logic, there is
no need to implement repeatedly. So optimize the PBL buffer allocation
process by using the mtr's interfaces.
Link: https://lore.kernel.org/r/1588071823-40200-2-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com >
Signed-off-by: Lang Cheng <chenglang@huawei.com >
Signed-off-by: Weihang Li <liweihang@huawei.com >
Reported-by: kbuild test robot <lkp@intel.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-06 17:26:43 -03:00
Maor Gottlieb
fa5d010c56
RDMA: Group create AH arguments in struct
...
Following patch adds additional argument to the create AH function, so it
make sense to group ah_attr and flags arguments in struct.
Link: https://lore.kernel.org/r/20200430192146.12863-13-maorg@mellanox.com
Signed-off-by: Maor Gottlieb <maorg@mellanox.com >
Acked-by: Devesh Sharma <devesh.sharma@broadcom.com >
Acked-by: Gal Pressman <galpress@amazon.com >
Acked-by: Weihang Li <liweihang@huawei.com >
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com >
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com >
2020-05-02 20:19:53 -03:00