Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bnxt_en: Support for RoCE resources dynamically shared within VFs.

Add support for dynamic RoCE SRIOV resource configuration. Instead of
statically dividing the RoCE resources by the number of VFs, provide
the maximum resources and let the FW dynamically dsitribute to the VFs
on the fly.

Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Anantha Prabhu <anantha.prabhu@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250917040839.1924698-8-michael.chan@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Anantha Prabhu and committed by
Paolo Abeni
48e61962 6f115863

+16 -2
+6 -2
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 9632 9632 9633 9633 static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) 9634 9634 { 9635 + u32 flags, flags_ext, flags_ext2, flags_ext3; 9636 + struct bnxt_hw_resc *hw_resc = &bp->hw_resc; 9635 9637 struct hwrm_func_qcaps_output *resp; 9636 9638 struct hwrm_func_qcaps_input *req; 9637 - struct bnxt_hw_resc *hw_resc = &bp->hw_resc; 9638 - u32 flags, flags_ext, flags_ext2; 9639 9639 int rc; 9640 9640 9641 9641 rc = hwrm_req_init(bp, req, HWRM_FUNC_QCAPS); ··· 9701 9701 if (BNXT_PF(bp) && 9702 9702 (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_ROCE_VF_RESOURCE_MGMT_SUPPORTED)) 9703 9703 bp->fw_cap |= BNXT_FW_CAP_ROCE_VF_RESC_MGMT_SUPPORTED; 9704 + 9705 + flags_ext3 = le32_to_cpu(resp->flags_ext3); 9706 + if (flags_ext3 & FUNC_QCAPS_RESP_FLAGS_EXT3_ROCE_VF_DYN_ALLOC_SUPPORT) 9707 + bp->fw_cap |= BNXT_FW_CAP_ROCE_VF_DYN_ALLOC_SUPPORT; 9704 9708 9705 9709 bp->tx_push_thresh = 0; 9706 9710 if ((flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED) &&
+3
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 2479 2479 #define BNXT_FW_CAP_ENABLE_RDMA_SRIOV BIT_ULL(5) 2480 2480 #define BNXT_FW_CAP_ROCE_VF_RESC_MGMT_SUPPORTED BIT_ULL(6) 2481 2481 #define BNXT_FW_CAP_KONG_MB_CHNL BIT_ULL(7) 2482 + #define BNXT_FW_CAP_ROCE_VF_DYN_ALLOC_SUPPORT BIT_ULL(8) 2482 2483 #define BNXT_FW_CAP_OVS_64BIT_HANDLE BIT_ULL(10) 2483 2484 #define BNXT_FW_CAP_TRUSTED_VF BIT_ULL(11) 2484 2485 #define BNXT_FW_CAP_ERROR_RECOVERY BIT_ULL(13) ··· 2524 2523 #define BNXT_SUPPORTS_MULTI_RSS_CTX(bp) \ 2525 2524 (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \ 2526 2525 ((bp)->rss_cap & BNXT_RSS_CAP_MULTI_RSS_CTX)) 2526 + #define BNXT_ROCE_VF_DYN_ALLOC_CAP(bp) \ 2527 + ((bp)->fw_cap & BNXT_FW_CAP_ROCE_VF_DYN_ALLOC_SUPPORT) 2527 2528 #define BNXT_SUPPORTS_QUEUE_API(bp) \ 2528 2529 (BNXT_PF(bp) && BNXT_SUPPORTS_NTUPLE_VNIC(bp) && \ 2529 2530 ((bp)->fw_cap & BNXT_FW_CAP_VNIC_RE_FLUSH))
+7
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
··· 541 541 if (rc) 542 542 goto err; 543 543 544 + /* In case of VF Dynamic resource allocation, driver will provision 545 + * maximum resources to all the VFs. FW will dynamically allocate 546 + * resources to VFs on the fly, so always divide the resources by 1. 547 + */ 548 + if (BNXT_ROCE_VF_DYN_ALLOC_CAP(bp)) 549 + num_vfs = 1; 550 + 544 551 cfg_req->fid = cpu_to_le16(0xffff); 545 552 cfg_req->enables2 = 546 553 cpu_to_le32(FUNC_CFG_REQ_ENABLES2_ROCE_MAX_AV_PER_VF |