Cheng Xu
b80330f105
RDMA/erdma: Add disassociate ucontext support
...
All IO pages mapped to user space are handled by rdma_user_mmap_io,
so add empty stub for disassociate ucontext.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://patch.msgid.link/20240902112920.58749-3-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-09-09 21:17:09 +03:00
Akiva Goldberger
dd6d7f8574
RDMA: Pass entire uverbs attr bundle to create cq function
...
Changes the create_cq verb signature by sending the entire uverbs attr
bundle as a parameter. This allows drivers to send driver specific attrs
through ioctl for the create_cq verb and access them in their driver
specific code.
Also adds a new enum value for driver specific ioctl attributes for
methods already supporting UHW.
Link: https://lore.kernel.org/r/ed147343987c0d43fd391c1b2f85e2f425747387.1719512393.git.leon@kernel.org
Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com >
Signed-off-by: Leon Romanovsky <leonro@nvidia.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2024-06-27 16:28:21 -03:00
Boshi Yu
fdb09ed15f
RDMA/erdma: Unify the names related to doorbell records
...
There exist two different names for the doorbell records: db_info and
db_record. We use dbrec for cpu address of the doorbell record and
dbrec_dma for dma address of the doorbell recordi uniformly.
Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com >
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com >
Link: https://lore.kernel.org/r/20240311113821.22482-3-boshiyu@alibaba-inc.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-04-01 14:46:01 +03:00
Boshi Yu
f0697bf078
RDMA/erdma: Allocate doorbell records from dma pool
...
Currently, the 8 byte doorbell record is allocated along with the queue
buffer, which may result in waste of dma space when the queue buffer is
page aligned. To address this issue, we introduce a dma pool named
db_pool and allocate doorbell record from it.
Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com >
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com >
Link: https://lore.kernel.org/r/20240311113821.22482-2-boshiyu@alibaba-inc.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-04-01 14:46:01 +03:00
Cheng Xu
63a43a675c
RDMA/erdma: Add hardware statistics support
...
First, we add a new command to query hardware statistics, and then
implement two functions: ib_device_ops.alloc_hw_port_stats and
ib_device_ops.get_hw_stats to allow rdma tool can get the statistics
of erdma device.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20231227084800.99091-3-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-12-30 17:23:17 +02:00
Cheng Xu
ed10435d35
RDMA/erdma: Implement hierarchical MTT
...
Hierarchical MTT allows large MR registration without the need of
continuous physical address. This commit adds the support of hierarchical
MTT support for erdma.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20230817102151.75964-4-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-08-19 14:41:01 +03:00
Cheng Xu
7244b4aa42
RDMA/erdma: Refactor the storage structure of MTT entries
...
Currently our MTT only support inline mtt entries (0 level MTT) and
indirect MTT entries (1 level mtt), which will limit the maximum length
of MRs. In order to implement a multi-level MTT, we refactor the
structure of MTT first.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20230817102151.75964-3-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-08-19 14:40:30 +03:00
Cheng Xu
d7cfbba90b
RDMA/erdma: Renaming variable names and field names of struct erdma_mem
...
Currently, variable names and field names of struct erdma_mem contain
'mtt', which is not accurate. Renaming them with 'xxx_mem' or 'mem'.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20230817102151.75964-2-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-08-19 14:36:29 +03:00
Cheng Xu
3b3dfd58ba
RDMA/erdma: Refactor the original doorbell allocation mechanism
...
The original doorbell allocation mechanism is complex and does not meet
the isolation requirement. So we introduce a new doorbell mechanism and the
original mechanism (only be used with CAP_SYS_RAWIO if hardware does not
support the new mechanism) needs to be kept as simple as possible for
compatibility.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20230606055005.80729-5-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-06-11 11:57:01 +03:00
Cheng Xu
7e9a1dada2
RDMA/erdma: Allocate doorbell resources from hardware
...
Each ucontext will try to allocate doorbell resources in the extended bar
space from hardware. For compatibility, we change nothing for the original
bar space, and it will be used only for applications with CAP_SYS_RAWIO
authority in the older HW/FW environments.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20230606055005.80729-3-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-06-11 11:57:00 +03:00
Cheng Xu
6256aa9ae9
RDMA/erdma: Update default EQ depth to 4096 and max_send_wr to 8192
...
Max EQ depth of hardware is 32K, the current default EQ depth is too small
for some applications, so change the default depth to 4096.
Max send WRs the hardware can support is 8K, but the driver limits the
value to 4K. Remove this limitation.
Fixes: be3cff0f24 ("RDMA/erdma: Add the hardware related definitions")
Fixes: db23ae64ca ("RDMA/erdma: Add verbs header file")
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20230320084652.16807-3-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-03-20 12:53:24 +02:00
Cheng Xu
0edf42cbcc
RDMA/erdma: Notify the latest PI to FW for reflushing when necessary
...
Firmware is responsible for flushing WRs in HW, and it's a little
difficult for firmware to get the latest PI of QPs, especially for RQs
after QP state being changed to ERROR. So we introduce a new CMDQ command,
by which driver can notify to latest PI to FW, and then FW can flush all
posted WRs.
Link: https://lore.kernel.org/r/20221116023107.82835-4-chengyou@linux.alibaba.com
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2022-11-24 14:58:52 -04:00
Cheng Xu
54d8fffc2a
RDMA/erdma: Implement the lifecycle of reflushing work for each QP
...
Each QP has a work for reflushing purpose. In the work, driver will report
the latest pi to hardware.
Link: https://lore.kernel.org/r/20221116023107.82835-3-chengyou@linux.alibaba.com
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2022-11-24 14:58:52 -04:00
Cheng Xu
ece43fad22
RDMA/erdma: Extend access right field of FRMR and REG MR to support atomic
...
To support atomic operations, IB_ACCESS_REMOTE_ATOMIC right should be
passed to hardware for permission check. Since "access mode" field in FRMR
SQE and RegMr command is never used by hw, we remove the "access mode"
field, so that we can then have enough space to extend access fields.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20221107021845.44598-2-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2022-11-07 09:55:04 +02:00
Cheng Xu
9bdb9350f3
RDMA/erdma: Support dynamic mtu
...
Hardware now support jumbo frame for RDMA. So we introduce a new CMDQ
message to support mtu change notification.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20220909093822.33868-5-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2022-09-21 10:31:24 +03:00
Cheng Xu
93aea72cc5
RDMA/erdma: Remove redundant includes
...
Many of erdma's includes are redundant, because they are already included
indirectly by kernel headers or custom headers. So we remove all the
unnecessary direct-includes. Besides, add linux/pci.h to erdma.h because
it's also used in the file.
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Link: https://lore.kernel.org/r/20220909093822.33868-3-chengyou@linux.alibaba.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2022-09-20 14:27:51 +03:00
Cheng Xu
db23ae64ca
RDMA/erdma: Add verbs header file
...
This header file defines the main structures and functions used for RDMA
Verbs, including qp, cq, mr, ucontext, etc,.
Link: https://lore.kernel.org/r/20220727014927.76564-7-chengyou@linux.alibaba.com
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2022-07-27 15:54:39 -03:00