Add support for LTTng tracing. For now it is used for post_send, post_recv and poll_cq.
Signed-off-by: Xinghai Cen <cenxinghai@h-partners.com>
(cherry picked from commit 76d4645e3b8a9e57b723e3f7297bda62e934d6f2)
mainline inclusion:
libhns: Fix missing fields for SRQ WC
Modify the information of some patch Fixes
Signed-off-by: Xinghai Cen <cenxinghai@h-partners.com>
Fixed several bugs in libhns:
libhns: Add error logs to help diagnosis
libhns: Fix coredump during QP destruction when send_cq == recv_cq
libhns: Fix memory leakage when DCA is enabled
libhns: Fix the exception branch of wr_start() is not locked
libhns: Fix reference to uninitialized cq pointer
libhns: Fix out-of-order issue of requester when setting FENCE
[ Upstream commit 65197a4 ]
Library expects ilog2 of psn_size while calculating the stride.
ilog32 returns log2(v) + 1 and the calculation fails since
the psn size is a power of 2 value. Fix by passing psn_size - 1.
Fixes: 0a0e0d0 ("bnxt_re/lib: Adds MSN table capability for Gen P7 adapters")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
(cherry picked from commit ac4be7ab029ef79b45c1055fb7504643fd129194)
1#2. Replace private patch
3. Remove unused return value
4. Fix several context locks issue
5. libhns: Clean up signed-unsigned mix with relational issue
6. libhns: Fix missing flag when creating qp with hnsdv interface
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit 43ec513a2eec4e13e258257bf1daa1a1b71ff1e4)
These patches support running the roce function in hns roh mode
Signed-off-by: Ke Chen <chenke54@huawei.com>
(cherry picked from commit 1938be0036f3cfe14d1b5a77b03884a06f9009e5)
DCA(Dynamic context attachment) support many RC QPs to share the WQE
buffer in a memory pool, this help reducing the memory consumption
when there are many QPs are inactive.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 994c08d7e68ba906b7f7c16e8528700508af94b1)
When HW is in resetting stage, we could not poll back all the
expected work completions as the HW won't generate cqe anymore.
This patch allows driver to compose the expected wc instead of the HW
during resetting stage. Once the hardware finished resetting, we can
poll cq from hardware again.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 5494e44cf97e65d858c8f7376c0424a833dc8323)
Add support for thread domain (TD) and parent domain (PAD).
When a parent domain holds a thread domain, the associated
data path will be set to lock-free mode to improve performance.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 60b829d79704e6b4611d7040265a7cf852057931)
Add support for configuration of congestion control algorithms in QP
granularity with direct verbs hnsdv_create_qp().
Reference: https://github.com/linux-rdma/rdma-core/pull/1426/commits
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit f4a8396bcf41ea12bf3e7b73793e60bfba097377)
Update version of rdma-core to v50.0.The subsequent maintenance
and upgrade will be performed based on this baseline.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
Add neccessary dependencies for the rdma-core-devel to
avoid missing link to shared object after packaging.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
Separate some functions from the rdma-core main package to reduce the
dependencies required by the main package.
Signed-off-by: 孙苏皖 <sunsuwan3@huawei.com>
Singed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
Currently, there is a repeated judgement in check_qp_congest_type
whenever enable LDCP or HC3, the congest type flags all will be set
on LDCP.
This patch fixes this bug and replace a corrupt patch--0077, which
has a change that directly acts on patch but not code. This act
will disrupt the patch format.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
Currently, if compiler does not support SVE, hns_roce_sve_write512() will
be a empty function, which means that this doorbell will be missed when
HNS_ROCE_QP_CAP_SVE_DIRECT_WQE is set in qp flag.
This patch ensures that driver will at least generate the DB regardless
of whether SVE DWQE is supported or not.
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit e5fcbc2552eda0d654e55ae0758280d6e51804ea)
Correct the return of error code, add init of pthread spinlock and mutex
judgement, remove a repeated init of pthread lock init, fix owner bit
when SQ wrqps.
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 794f3792a7267d0586bfac7d67507a27a5e61305)
Currently the QPC state in HW is modified inside the critical section of
spinlock but the ibv_qp state is modified outside. There will be a short
period when QPC state has been modified to err with ibv_qp state still
remaining RTS. WQEs during this period will still be post-send by RTS-state
ibv_qp but then dropped by err-state HW with no flush CQEs generated.
To fix this problem, the QPC state in HW and ibv_qp state should be both
modified to err inside the critical section of spinlock.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
(cherry picked from commit e221c2d5c69b00dc1f1aca09781cc3ebed23b5f3)
The issues mainly lies in the memory empty check, variable range
inconsistency, parameter verification, and print format.
Signed-off-by: Luoyouming <luoyouming@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 918525387673e173835fd287995470cbaccad784)
As dmac is already resolved in kernel while creating AH, there is no
need to repeat the resolving in userspace. Prioritizes getting dmac
from kernel driver, unless kernel driver didn't response one.
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit e6ea204613586ab8d53dadee2b83eccadde447ec)
For RDMA over UBLink, MAC Layer if replaced by UBLink, and thus the
MAC addr is not nedded. So skip the MAC addr resolving for this mode.
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit 333b7848bd0c6a33c5bcfdef18fa6bae578fd7cc)
driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8A08Z
Compared with normal doorbell, using record doorbell can shorten the
process of ringing the doorbell and reduce the latency.
Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 23f6e3ca5e9fa66b41e3d33a9c4a88429cfc61ab)
In order to improve performance, we allow user-mode drivers to use a
larger page size to allocate WQE buffers, thereby reducing the latency
introduced by HW page switching. User-mode drivers will be allowed to
allocate WQE buffers between 4K to system page size. During
ibv_create_qp(), the driver will dynamically select the appropriate page
size based on ibv_qp_cap, thus reducing memory consumption while improving
performance.
Signed-off-by: Ran Zhou <zhouran10@h-partners.com>
(cherry picked from commit 1a21f45d978a8c469d128838bfd6ef5a72d335e8)
1.libhns: Support reporting wc as software mode
2.libhns: return error when post send in reset state
3.libhns: separate the initialization steps of lock
4.libhns: assign doorbell to zero when allocate it
5.libhns: Fix missing reset notification
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit e1b479184479d826a5f78b43e832c667e138ca72)
According to Annex17_RoCEv2 (A17.4.5.2), for RoCEv2 UD, a CQE should
carry a flag that indicates if the received frame is an IPv4, IPv6 or
RoCE packet. But currently, the values of the flag corresponding to
these packet types haven't been defined yet in WC.
In UCX, 'sl' in ibv_wc for UD is used as the packet type flag, and the
packet type values have already been defined in the UCX patch of
ed28845b88
Therefore, to adapt UCX, add a create flag to hnsdv_create_qp() to allow
users to choose whether they use 'sl' in ibv_wc as service level or
packet type for UD. For the latter, obtain and translate the packet type
from CQE and fill it to 'sl' in ibv_wc.
Singed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit e102d4c9aa2992c125b26ad5cc237ae002bc6541)
1.Fix the owner bit error of sq in new io
2.Fix incorrect post-send with direct wqe of
3.Add a judgment to the congestion control algorithm
Singed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit 092143ba858a7aba0630fadd416faa2a4e7eaf06)
1. The hns hardware logic requires wr->num_sge to be 1 when
performing atomic operations. The code does not judge this
condition, and the current patch adds this constraint.
2. In the sq inline scenario, when num_sge in post_send is not 1, sge
array appears in the for loop without rotation and directly copy
out of bounds.
3. Currently local invalidate operation don't work properly.
Disable it for the time being.
HIP08 and HIP09 hardware does not support this feature, so
delete the associated code.
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit 43c14b73409cf6e63278d5ff68e2694e592e9015)
Some Kunpeng SoCs do not support the DWQE through NEON
instructions. In this case, the IO path works normally,
but the performance will deteriorate.
For these SoCs that do not support NEON DWQE, they support
DWQE through SVE instructions. This patch supports SVE DWQE
to guarantee the performance of these SoCs. In addition, in
this scenario, DWQE only supports acceleration through SVE's
ldr and str instructions. Other load and store instructions
also cause performance degradation.
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit 268e25f9374021fc4c0d6dabd62e0f360193081f)
Added the use of direct verbs to implement QP-level
user-configurable congestion control algorithms. Among them,
the user mode driver mainly provides interfaces for users to
choose, and the kernel mode driver is responsible for filling
the resources of different algorithms and providing the
supported algorithm types for user mode.
At the same time, provide a direct verbs interface for users to
query the type of congestion control algorithm.
Signed-off-by: Juan Zhou <zhoujuan51@h-partners.com>
(cherry picked from commit 48ccef6ba011468fe91056398aad863f998569d2)
Add an interface to the user space, which is used to receive
the kernel reset state. After receiving the reset flag, the
user space stops sending db.
Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
DCA(Dynamic context attachment) support many RC QPs to share the WQE
buffer in a memory pool, this help reducing the memory consumption
when there are many QPs are inactive.
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
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>
Patches for hns DSCP was forgotten to add to be added to the spec. And
some mistake in DSCP patch is fixed.
Fixes: 68f61fd0a1a8 ("Add support for hns DSCP")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Update rdma-core version from 35.1 to 41.0.
Version 41.0 is the latest version in community until
2022/7/27. It includes some new bugfixes and new features,
we choose this version to facilitate future development.
The patches added to this repo has already included in the
new version, so remove them.
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Bugfix for hns SRQ and SGE. And also added all related cleanups and
refactorings.
Signed-off-by: zhengfeng luo <luozhengfeng@h-partners.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>