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.

Merge branch 'bnxt_en-add-rss-context-resource-check'

Michael Chan says:

====================
bnxt_en: Add RSS context resource check

Add missing logic to check that we have enough RSS contexts. This
will make the recent change to increase the use of RSS contexts for
a larger RSS indirection table more complete.
====================

Link: https://patch.msgid.link/20260207235118.1987301-1-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+32 -15
+32 -15
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 7951 7951 return 1; 7952 7952 } 7953 7953 7954 + static void bnxt_get_total_resources(struct bnxt *bp, struct bnxt_hw_rings *hwr) 7955 + { 7956 + hwr->cp = bnxt_nq_rings_in_use(bp); 7957 + hwr->cp_p5 = 0; 7958 + if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) 7959 + hwr->cp_p5 = bnxt_cp_rings_in_use(bp); 7960 + hwr->tx = bp->tx_nr_rings; 7961 + hwr->rx = bp->rx_nr_rings; 7962 + hwr->grp = hwr->rx; 7963 + hwr->vnic = bnxt_get_total_vnics(bp, hwr->rx); 7964 + hwr->rss_ctx = bnxt_get_total_rss_ctxs(bp, hwr); 7965 + if (bp->flags & BNXT_FLAG_AGG_RINGS) 7966 + hwr->rx <<= 1; 7967 + hwr->stat = bnxt_get_func_stat_ctxs(bp); 7968 + } 7969 + 7954 7970 static bool bnxt_need_reserve_rings(struct bnxt *bp) 7955 7971 { 7956 7972 struct bnxt_hw_resc *hw_resc = &bp->hw_resc; 7957 - int cp = bnxt_cp_rings_in_use(bp); 7958 - int nq = bnxt_nq_rings_in_use(bp); 7959 - int rx = bp->rx_nr_rings, stat; 7960 - int vnic, grp = rx; 7973 + struct bnxt_hw_rings hwr; 7974 + 7975 + bnxt_get_total_resources(bp, &hwr); 7961 7976 7962 7977 /* Old firmware does not need RX ring reservations but we still 7963 7978 * need to setup a default RSS map when needed. With new firmware ··· 7982 7967 if (!BNXT_NEW_RM(bp)) 7983 7968 bnxt_check_rss_tbl_no_rmgr(bp); 7984 7969 7985 - if (hw_resc->resv_tx_rings != bp->tx_nr_rings && 7986 - bp->hwrm_spec_code >= 0x10601) 7970 + if (hw_resc->resv_tx_rings != hwr.tx && bp->hwrm_spec_code >= 0x10601) 7987 7971 return true; 7988 7972 7989 7973 if (!BNXT_NEW_RM(bp)) 7990 7974 return false; 7991 7975 7992 - vnic = bnxt_get_total_vnics(bp, rx); 7993 - 7994 - if (bp->flags & BNXT_FLAG_AGG_RINGS) 7995 - rx <<= 1; 7996 - stat = bnxt_get_func_stat_ctxs(bp); 7997 - if (hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp || 7998 - hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat || 7999 - (hw_resc->resv_hw_ring_grps != grp && 7976 + if (hw_resc->resv_rx_rings != hwr.rx || 7977 + hw_resc->resv_vnics != hwr.vnic || 7978 + hw_resc->resv_stat_ctxs != hwr.stat || 7979 + hw_resc->resv_rsscos_ctxs != hwr.rss_ctx || 7980 + (hw_resc->resv_hw_ring_grps != hwr.grp && 8000 7981 !(bp->flags & BNXT_FLAG_CHIP_P5_PLUS))) 8001 7982 return true; 7983 + if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) { 7984 + if (hw_resc->resv_cp_rings != hwr.cp_p5) 7985 + return true; 7986 + } else if (hw_resc->resv_cp_rings != hwr.cp) { 7987 + return true; 7988 + } 8002 7989 if ((bp->flags & BNXT_FLAG_CHIP_P5_PLUS) && BNXT_PF(bp) && 8003 - hw_resc->resv_irqs != nq) 7990 + hw_resc->resv_irqs != hwr.cp) 8004 7991 return true; 8005 7992 return false; 8006 7993 }