| 2aa35b24 | 21-Aug-2025 |
Qianfeng Rong <rongqianfeng@vivo.com> |
RDMA/erdma: Use vcalloc() instead of vzalloc()
Replace vzalloc() with vcalloc() in vmalloc_to_dma_addrs(). As noted in the kernel documentation [1], open-coded multiplication in allocator arguments
RDMA/erdma: Use vcalloc() instead of vzalloc()
Replace vzalloc() with vcalloc() in vmalloc_to_dma_addrs(). As noted in the kernel documentation [1], open-coded multiplication in allocator arguments is discouraged because it can lead to integer overflow.
Use vcalloc() to gain built-in overflow protection, making memory allocation safer when calculating allocation size compared to explicit multiplication.
[1]: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Link: https://patch.msgid.link/r/20250821072209.510348-1-rongqianfeng@vivo.com Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| d4ac86b4 | 25-Jul-2025 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Fix unset QPN of GSI QP
The QPN of the GSI QP was not set, which may cause issues. Set the QPN to 1 when creating the GSI QP.
Fixes: 999a0a2e9b87 ("RDMA/erdma: Support UD QPs and UD WRs
RDMA/erdma: Fix unset QPN of GSI QP
The QPN of the GSI QP was not set, which may cause issues. Set the QPN to 1 when creating the GSI QP.
Fixes: 999a0a2e9b87 ("RDMA/erdma: Support UD QPs and UD WRs") Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20250725055410.67520-4-boshiyu@linux.alibaba.com Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| a6c34676 | 26-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Support create_ah/destroy_ah in non-sleepable contexts
The RDMA CM module might invoke erdma_create_ah() or erdma_destroy_ah() in a non-sleepable context. Both of these functions will ca
RDMA/erdma: Support create_ah/destroy_ah in non-sleepable contexts
The RDMA CM module might invoke erdma_create_ah() or erdma_destroy_ah() in a non-sleepable context. Both of these functions will call the erdma_post_cmd_wait(), which can potentially sleep and occasionally lead to a hard lockup. Therefore, post the create_ah and destroy_ah commands in polling mode if the RDMA_CREATE_AH_SLEEPABLE and RDMA_DESTROY_AH_SLEEPABLE flags are not set, respectively.
Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241226084141.74823-5-boshiyu@linux.alibaba.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| 26981e68 | 26-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Support non-sleeping erdma_post_cmd_wait()
Several scenarios require posting commands to the cmdq in a non-sleepable context. For example, the cm_alloc_msg() might call erdma_create_ah()
RDMA/erdma: Support non-sleeping erdma_post_cmd_wait()
Several scenarios require posting commands to the cmdq in a non-sleepable context. For example, the cm_alloc_msg() might call erdma_create_ah() while still holding a spinlock. So we add support for non-sleeping erdma_post_cmd_wait().
Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241226084141.74823-4-boshiyu@linux.alibaba.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| 3761e0ad | 26-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Fix incorrect response returned from query_qp
The erdma_post_cmd_wait() function returns the cmdq response only when both resp0 and resp1 are not NULL.
Reviewed-by: Cheng Xu <chengyou@l
RDMA/erdma: Fix incorrect response returned from query_qp
The erdma_post_cmd_wait() function returns the cmdq response only when both resp0 and resp1 are not NULL.
Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241226084141.74823-3-boshiyu@linux.alibaba.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| 18eb2bf3 | 22-Nov-2024 |
Yuyu Li <liyuyu6@huawei.com> |
RDMA/erdma: Remove deliver net device event
Since the netdev events of link status is now handled in ib_core, remove the related code in drivers.
In addition, remove dev->state as it is only used i
RDMA/erdma: Remove deliver net device event
Since the netdev events of link status is now handled in ib_core, remove the related code in drivers.
In addition, remove dev->state as it is only used in erdma_query_port(), and it can be replaced by ib_get_curr_port_state().
Signed-off-by: Yuyu Li <liyuyu6@huawei.com> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| 999a0a2e | 11-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Support UD QPs and UD WRs
The iWARP protocol supports only RC QPs previously. Now we add UD QPs and UD WRs support for the RoCEv2 protocol.
Signed-off-by: Boshi Yu <boshiyu@linux.alibab
RDMA/erdma: Support UD QPs and UD WRs
The iWARP protocol supports only RC QPs previously. Now we add UD QPs and UD WRs support for the RoCEv2 protocol.
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241211020930.68833-9-boshiyu@linux.alibaba.com Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| 1cccbd3e | 11-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Add the query_qp command to the cmdq
Certian QP attributes, such as sq_draining, can only be obtained by querying the hardware on the erdma RoCEv2 device. To address this, we add the que
RDMA/erdma: Add the query_qp command to the cmdq
Certian QP attributes, such as sq_draining, can only be obtained by querying the hardware on the erdma RoCEv2 device. To address this, we add the query_qp command to the cmdq and parse the response to retrieve corresponding QP attributes.
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241211020930.68833-8-boshiyu@linux.alibaba.com Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| de5b8008 | 11-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Refactor the code of the modify_qp interface
The procedure for modifying QP is similar for both the iWARP and RoCEv2 protocols. Therefore, we unify the code and provide the erdma_modify_
RDMA/erdma: Refactor the code of the modify_qp interface
The procedure for modifying QP is similar for both the iWARP and RoCEv2 protocols. Therefore, we unify the code and provide the erdma_modify_qp() interface for both protocols.
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241211020930.68833-7-boshiyu@linux.alibaba.com Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|
| 9566cf6a | 11-Dec-2024 |
Boshi Yu <boshiyu@linux.alibaba.com> |
RDMA/erdma: Add erdma_modify_qp_rocev2() interface
The QP state machines in the RoCEv2 and iWARP protocols are different. To handle these differences for the erdma RoCEv2 device, we provide the erdm
RDMA/erdma: Add erdma_modify_qp_rocev2() interface
The QP state machines in the RoCEv2 and iWARP protocols are different. To handle these differences for the erdma RoCEv2 device, we provide the erdma_modify_qp_rocev2() interface, which transitions the QP state and modifies QP attributes accordingly.
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com> Link: https://patch.msgid.link/20241211020930.68833-6-boshiyu@linux.alibaba.com Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
show more ...
|