- 26 Sep, 2022 1 commit
-
-
Li Zhijian authored
Most code in send_ack() and send_atomic_ack() are duplicate, move them to a new helper send_common_ack(). In newer IBA spec, some opcodes require acknowledge with a zero-length read response, with this new helper, we can easily implement it later. Link: https://lore.kernel.org/r/1659335010-2-1-git-send-email-lizhijian@fujitsu.comSigned-off-by:
Li Zhijian <lizhijian@fujitsu.com> Signed-off-by:
Jason Gunthorpe <jgg@nvidia.com>
-
- 22 Sep, 2022 8 commits
-
-
Dan Carpenter authored
"&srq->pd->usecnt" and "&pd->usecnt" are different names for the same reference count. Use "&pd->usecnt" consistently for both the increment and decrement. Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YyxFe3Pm0uzRuBkQ@kiliSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mikhael Goikhman authored
Currently ib_srp module does not support devices with more than 256 ports. Switch from u8 to u32 to fix the problem. Fixes: 1fb7f897 ("RDMA: Support more than 255 rdma ports") Reviewed-by:
Shay Drory <shayd@nvidia.com> Signed-off-by:
Mikhael Goikhman <migo@nvidia.com> Link: https://lore.kernel.org/r/7d80d8844f1abb3a54170b7259f0a02be38080a6.1663747327.git.leonro@nvidia.comReviewed-by:
Bart Van Assche <bvanassche@acm.org> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Daisuke Matsuda authored
rxe_mr and ib_mr have interchangeable members. Remove device specific members and use ones in the generic struct. Both 'iova' and 'length' are filled in ib_uverbs or ib_core layer after MR registration. Signed-off-by:
Daisuke Matsuda <matsuda-daisuke@fujitsu.com> Link: https://lore.kernel.org/r/20220921080844.1616883-2-matsuda-daisuke@fujitsu.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Daisuke Matsuda authored
Set 'iova' and 'length' on ib_mr in ib_uverbs and ib_core layers to let all drivers have the members filled. Also, this commit removes redundancy in the respective drivers. Previously, commit 04c0a5fc ("IB/uverbs: Set IOVA on IB MR in uverbs layer") changed to set 'iova', but seems to have missed 'length' and the ib_core layer at that time. Fixes: 04c0a5fc ("IB/uverbs: Set IOVA on IB MR in uverbs layer") Signed-off-by:
Daisuke Matsuda <matsuda-daisuke@fujitsu.com> Link: https://lore.kernel.org/r/20220921080844.1616883-1-matsuda-daisuke@fujitsu.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mark Zhang authored
In inter-subnet cases, when inbound/outbound PRs are available, outbound_PR.dlid is used as the requestor's datapath DLID and inbound_PR.dlid is used as the responder's DLID. The inbound_PR.dlid is passed to responder side with the "ConnectReq.Primary_Local_Port_LID" field. With this solution the PERMISSIVE_LID is no longer used in Primary Local LID field. Signed-off-by:
Mark Zhang <markzhang@nvidia.com> Reviewed-by:
Mark Bloch <mbloch@nvidia.com> Link: https://lore.kernel.org/r/b3f6cac685bce9dde37c610be82e2c19d9e51d9e.1662631201.git.leonro@nvidia.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mark Zhang authored
The responder should always use WC's SLID as the dlid, to follow the IB SPEC section "13.5.4.2 COMMON RESPONSE ACTIONS": A responder always takes the following actions in constructing a response packet: - The SLID of the received packet is used as the DLID in the response packet. Fixes: ac3a949f ("IB/CM: Set appropriate slid and dlid when handling CM request") Signed-off-by:
Mark Zhang <markzhang@nvidia.com> Reviewed-by:
Mark Bloch <mbloch@nvidia.com> Link: https://lore.kernel.org/r/cd17c240231e059d2fc07c17dfe555d548b917eb.1662631201.git.leonro@nvidia.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mark Zhang authored
Support receiving inbound and outbound IB path records (along with GMP PathRecord) from user-space service through the RDMA netlink channel. The LIDs in these 3 PRs can be used in this way: 1. GMP PR: used as the standard local/remote LIDs; 2. DLID of outbound PR: Used as the "dlid" field for outbound traffic; 3. DLID of inbound PR: Used as the "dlid" field for outbound traffic in responder side. This is aimed to support adaptive routing. With current IB routing solution when a packet goes out it's assigned with a fixed DLID per target, meaning a fixed router will be used. The LIDs in inbound/outbound path records can be used to identify group of routers that allow communication with another subnet's entity. With them packets from an inter-subnet connection may travel through any router in the set to reach the target. As confirmed with Jason, when sending a netlink request, kernel uses LS_RESOLVE_PATH_USE_ALL so that the service knows kernel supports multiple PRs. Signed-off-by:
Mark Zhang <markzhang@nvidia.com> Reviewed-by:
Mark Bloch <mbloch@nvidia.com> Link: https://lore.kernel.org/r/2fa2b6c93c4c16c8915bac3cfc4f27be1d60519d.1662631201.git.leonro@nvidia.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mark Zhang authored
This fields means the total number of primary and alternative paths, i.e.,: 0 - No primary nor alternate path is available; 1 - Only primary path is available; 2 - Both primary and alternate path are available. Rename it to avoid confusion as with follow patches primary path will support multiple path records. Signed-off-by:
Mark Zhang <markzhang@nvidia.com> Reviewed-by:
Mark Bloch <mbloch@nvidia.com> Link: https://lore.kernel.org/r/cbe424de63a56207870d70c5edce7c68e45f429e.1662631201.git.leonro@nvidia.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 21 Sep, 2022 1 commit
-
-
Cheng Xu authored
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.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 20 Sep, 2022 12 commits
-
-
Bernard Metzler authored
Delay QP destroy completion until all siw references to QP are dropped. The calling RDMA core will free QP structure after successful return from siw_qp_destroy() call, so siw must not hold any remaining reference to the QP upon return. A use-after-free was encountered in xfstest generic/460, while testing NFSoRDMA. Here, after a TCP connection drop by peer, the triggered siw_cm_work_handler got delayed until after QP destroy call, referencing a QP which has already freed. Fixes: 303ae1cd ("rdma/siw: application interface") Reported-by:
Olga Kornievskaia <kolga@netapp.com> Signed-off-by:
Bernard Metzler <bmt@zurich.ibm.com> Link: https://lore.kernel.org/r/20220920082503.224189-1-bmt@zurich.ibm.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Bernard Metzler authored
For header and trailer/padding processing, siw did not consume new skb data until minimum amount present to fill current header or trailer structure, including potential payload padding. Not consuming any data during upcall may cause a receive stall, since tcp_read_sock() is not upcalling again if no new data arrive. A NFSoRDMA client got stuck at RDMA Write reception of unaligned payload, if the current skb did contain only the expected 3 padding bytes, but not the 4 bytes CRC trailer. Expecting 4 more bytes already arrived in another skb, and not consuming those 3 bytes in the current upcall left the Write incomplete, waiting for the CRC forever. Fixes: 8b6a361b ("rdma/siw: receive path") Reported-by:
Olga Kornievskaia <kolga@netapp.com> Tested-by:
Olga Kornievskaia <kolga@netapp.com> Signed-off-by:
Bernard Metzler <bmt@zurich.ibm.com> Link: https://lore.kernel.org/r/20220920081202.223629-1-bmt@zurich.ibm.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Gaosheng Cui authored
rc_only_opcode and uc_only_opcode have been removed since commit b374e060 ("IB/hfi1: Consolidate pio control masks into single definition"), so remove them. Signed-off-by:
Gaosheng Cui <cuigaosheng1@huawei.com> Link: https://lore.kernel.org/r/20220911092325.3216513-1-cuigaosheng1@huawei.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Hangyu Hua authored
In preparation for FORTIFY_SOURCE performing run-time destination buffer bounds checking for memcpy(), specify the destination output buffer explicitly, instead of asking memcpy() to write past the end of what looked like a fixed-size object. Notice that srp_rsp[] is a pointer to a structure that contains flexible-array member data[]: struct srp_rsp { ... __be32 sense_data_len; __be32 resp_data_len; u8 data[]; }; link: https://github.com/KSPP/linux/issues/201Signed-off-by:
Hangyu Hua <hbh25y@gmail.com> Link: https://lore.kernel.org/r/20220909022943.8896-1-hbh25y@gmail.comReviewed-by:
Bart Van Assche <bvanassche@acm.org> Reviewed-by:
Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Cheng Xu authored
Some opcodes are used in hardware internally, and driver does not care about them. So, we change them to reserved opcodes in driver. Signed-off-by:
Cheng Xu <chengyou@linux.alibaba.com> Link: https://lore.kernel.org/r/20220909093822.33868-4-chengyou@linux.alibaba.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Cheng Xu authored
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.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Cheng Xu authored
erdma_post_cmd_wait does not use the 'u64 *req' input parameter directly. So it is better to define it to 'void *req', and by this we can eliminate the casting when calling erdma_post_cmd_wait. Signed-off-by:
Cheng Xu <chengyou@linux.alibaba.com> Link: https://lore.kernel.org/r/20220909093822.33868-2-chengyou@linux.alibaba.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Bart Van Assche authored
Fix the code for converting a SCSI command pointer into an SRP request pointer. Cc: Xiao Yang <yangx.jy@fujitsu.com> Fixes: ad215aae ("RDMA/srp: Make struct scsi_cmnd and struct srp_request adjacent") Signed-off-by:
Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20220908233139.3042628-1-bvanassche@acm.orgSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
wangjianli authored
Delete the redundant word 'to'. Signed-off-by:
wangjianli <wangjianli@cdjrlc.com> Link: https://lore.kernel.org/r/20220908132036.42355-1-wangjianli@cdjrlc.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
wangjianli authored
Delete the redundant word 'to'. Signed-off-by:
wangjianli <wangjianli@cdjrlc.com> Link: https://lore.kernel.org/r/20220908131824.41106-1-wangjianli@cdjrlc.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Shiraz Saleem authored
Currently ib_copy_from_udata and ib_copy_to_udata could underfill the request and response buffer if the user-space passes an undersized value for udata->inlen or udata->outlen respectively [1] This could lead to undesirable behavior. Zero initing the buffer only goes as far as preventing using the buffer uninitialized. Validate udata->inlen and udata->outlen passed from user-space to ensure they are at least the required minimum size. [1] https://lore.kernel.org/linux-rdma/MWHPR11MB0029F37D40D9D4A993F8F549E9D79@MWHPR11MB0029.namprd11.prod.outlook.com/ Fixes: b48c24c2 ("RDMA/irdma: Implement device supported verb APIs") Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Shiraz Saleem <shiraz.saleem@intel.com> Link: https://lore.kernel.org/r/20220907191324.1173-3-shiraz.saleem@intel.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Sindhu-Devale authored
A number of asynchronous event (AE) ids were not aligned to the correct flush_code and event_type. Fix these up so that the correct IBV error and event codes are returned to application. Also, add handling for new AE ids like IRDMA_AE_INVALID_REQUEST to return the correct WC error code. Fixes: 44d9e529 ("RDMA/irdma: Implement device initialization definitions") Signed-off-by:
Sindhu-Devale <sindhu.devale@intel.com> Signed-off-by:
Shiraz Saleem <shiraz.saleem@intel.com> Link: https://lore.kernel.org/r/20220907191324.1173-2-shiraz.saleem@intel.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 08 Sep, 2022 3 commits
-
-
Daisuke Matsuda authored
The same value is assigned to 'mr->ibmr.length'. Remove redundant one. Signed-off-by:
Daisuke Matsuda <matsuda-daisuke@fujitsu.com> Link: https://lore.kernel.org/r/20220908083058.3993700-1-matsuda-daisuke@fujitsu.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Li Zhijian authored
They could be triggered by user APIs with invalid parameters. Signed-off-by:
Li Zhijian <lizhijian@fujitsu.com> Link: https://lore.kernel.org/r/1662518901-2-2-git-send-email-lizhijian@fujitsu.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Li Zhijian authored
struct ib_qp_cap { u32 max_send_wr; u32 max_recv_wr; u32 max_send_sge; u32 max_recv_sge; u32 max_inline_data; ... To avoid getting a negative value from dmesg: [410580.579965] rdma_rxe: invalid send sge = 65535 > 32 [410580.583818] rdma_rxe: invalid send wr = -1 > 1048576 [410582.771323] rdma_rxe: invalid recv sge = 65535 > 32 [410582.775310] rdma_rxe: invalid recv wr = -1 > 1048576 Signed-off-by:
Li Zhijian <lizhijian@fujitsu.com> Link: https://lore.kernel.org/r/1662518901-2-1-git-send-email-lizhijian@fujitsu.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 06 Sep, 2022 3 commits
-
-
Guoqing Jiang authored
Let's call try_cmpxchg directly for the same purpose. Signed-off-by:
Guoqing Jiang <guoqing.jiang@linux.dev> Link: https://lore.kernel.org/r/20220903040252.29397-1-guoqing.jiang@linux.devSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Guoqing Jiang authored
No need to iterate all paths after find one connected path. Signed-off-by:
Guoqing Jiang <guoqing.jiang@linux.dev> Link: https://lore.kernel.org/r/20220902101922.26273-3-guoqing.jiang@linux.devSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Guoqing Jiang authored
The maximum queue_depth should be 65535 per check_module_params, also update other relevant comments. Signed-off-by:
Guoqing Jiang <guoqing.jiang@linux.dev> Link: https://lore.kernel.org/r/20220902101922.26273-2-guoqing.jiang@linux.devSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 05 Sep, 2022 4 commits
-
-
ye xingchen authored
Return the value set_link_state() directly instead of storing it in another redundant variable. Reported-by:
Zeal Robot <zealci@zte.com.cn> Signed-off-by:
ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/20220901074209.313004-1-ye.xingchen@zte.com.cnSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Leon Romanovsky authored
Perform merge of Mellanox shared branch. * mlx5-next: RDMA/mlx5: Move function mlx5_core_query_ib_ppcnt() to mlx5_ib
-
Chris Mi authored
This patch doesn't change any functionality, but move one function to mlx5_ib because it is not used by mlx5_core. The actual fix is in the next patch. Reviewed-by:
Roi Dayan <roid@nvidia.com> Signed-off-by:
Chris Mi <cmi@nvidia.com> Link: https://lore.kernel.org/r/fd47b9138412bd94ed30f838026cbb4cf3878150.1661763871.git.leonro@nvidia.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
Bodong Wang authored
Query eswitch functions returns information of the external host PF(if it exists). It can be used to check if DEVX is running on ECPF. Reviewed-by:
Erez Shitrit <erezsh@nvidia.com> Reviewed-by:
Saeed Mahameed <saeedm@nvidia.com> Signed-off-by:
Bodong Wang <bodong@mellanox.com> Link: https://lore.kernel.org/r/4265925178ab3224dc1d3e3784bb312d808edca5.1661763785.git.leonro@nvidia.comSigned-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 01 Sep, 2022 1 commit
-
-
Tom Talpey authored
The SoftiWARP Kconfig is missing "select" for CRYPTO and CRYPTO_CRC32C. In addition, it improperly "depends on" LIBCRC32C, this should be a "select", similar to net/sctp and others. As a dependency, SIW fails to appear in generic configurations. Link: https://lore.kernel.org/r/d366bf02-3271-754f-fc68-1a84016d0e19@talpey.comSigned-off-by:
Tom Talpey <tom@talpey.com> Acked-by:
Bernard Metzler <bmt@zurich.ibm.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 31 Aug, 2022 4 commits
-
-
Daisuke Matsuda authored
An incoming Read request causes multiple Read responses. If a user MR to copy data from is unavailable or responder cannot send a reply, then the error messages can be printed for each response attempt, resulting in message overflow. Link: https://lore.kernel.org/r/20220829071218.1639065-1-matsuda-daisuke@fujitsu.comSigned-off-by:
Daisuke Matsuda <matsuda-daisuke@fujitsu.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Zhu Yanjun authored
The member variable obj in struct rxe_task is not needed. So remove it to save memory. Link: https://lore.kernel.org/r/20220822011615.805603-4-yanjun.zhu@linux.devSigned-off-by:
Zhu Yanjun <yanjun.zhu@linux.dev> Reviewed-by:
Li Zhijian <lizhijian@fujitsu.com> Reviewed-by:
Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Zhu Yanjun authored
When sock_create_kern in the function rxe_qp_init_req fails, qp->sk is set to NULL. Then the function rxe_create_qp will call rxe_qp_do_cleanup to handle allocated resource. Before handling qp->sk, this variable should be checked. Fixes: 8700e3e7 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20220822011615.805603-3-yanjun.zhu@linux.devSigned-off-by:
Zhu Yanjun <yanjun.zhu@linux.dev> Reviewed-by:
Li Zhijian <lizhijian@fujitsu.com> Reviewed-by:
Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Zhu Yanjun authored
When rxe_queue_init in the function rxe_qp_init_req fails, both qp->req.task.func and qp->req.task.arg are not initialized. Because of creation of qp fails, the function rxe_create_qp will call rxe_qp_do_cleanup to handle allocated resource. Before calling __rxe_do_task, both qp->req.task.func and qp->req.task.arg should be checked. Fixes: 8700e3e7 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20220822011615.805603-2-yanjun.zhu@linux.dev Reported-by: syzbot+ab99dc4c6e961eed8b8e@syzkaller.appspotmail.com Signed-off-by:
Zhu Yanjun <yanjun.zhu@linux.dev> Reviewed-by:
Li Zhijian <lizhijian@fujitsu.com> Reviewed-by:
Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 30 Aug, 2022 3 commits
-
-
Wenpeng Liang authored
The value of doorbell_qpn is always equal to qpn on current hardware versions. So remove it. Link: https://lore.kernel.org/r/20220829105021.1427804-5-liangwenpeng@huawei.comSigned-off-by:
Wenpeng Liang <liangwenpeng@huawei.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mark Zhang authored
Move the device and service_id match code at the top of cm_insert_listen() and cm_find_listen() into the final else branch. Link: https://lore.kernel.org/r/20220819090859.957943-4-markzhang@nvidia.comSigned-off-by:
Mark Zhang <markzhang@nvidia.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
Mark Zhang authored
The service_mask is always ~cpu_to_be64(0), so the result is always a NOP when it is &'d with a service_id. Remove it for simplicity. Link: https://lore.kernel.org/r/20220819090859.957943-3-markzhang@nvidia.comSigned-off-by:
Mark Zhang <markzhang@nvidia.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-