mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
Merge branch 'bnge-fixes'
Vikas Gupta says: ==================== bnge fixes This series fixes RSS indirection table and context sizing for large RX ring counts. Patch 1 caps the hardware RSS context count and RX rings to the RSS table size, preventing out-of-bounds writes and an oversized memset(). Patch 2 fixes the indirection table sizing so rings above the table size still receive default RSS traffic. ==================== Link: https://patch.msgid.link/20261026092757.9168-1-vikas.gupta@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
267d47e2d0
|
|
@ -182,8 +182,9 @@ int bnge_cal_nr_rss_ctxs(u16 rx_rings)
|
|||
if (!rx_rings)
|
||||
return 0;
|
||||
|
||||
return bnge_adjust_pow_two(rx_rings - 1,
|
||||
BNGE_RSS_TABLE_ENTRIES);
|
||||
return min_t(int, bnge_adjust_pow_two(rx_rings - 1,
|
||||
BNGE_RSS_TABLE_ENTRIES),
|
||||
BNGE_RSS_TABLE_MAX_TBL);
|
||||
}
|
||||
|
||||
static u16 bnge_rss_ctxs_in_use(struct bnge_dev *bd,
|
||||
|
|
@ -459,6 +460,7 @@ static void _bnge_get_max_rings(struct bnge_dev *bd, u16 *max_rx,
|
|||
}
|
||||
|
||||
*max_rx = min_t(int, *max_rx, max_ring_grps);
|
||||
*max_rx = min_t(int, *max_rx, BNGE_MAX_RSS_TABLE_ENTRIES);
|
||||
}
|
||||
|
||||
static int bnge_get_max_rings(struct bnge_dev *bd, u16 *max_rx,
|
||||
|
|
|
|||
|
|
@ -81,13 +81,10 @@ bnge_adjust_pow_two(u32 total_ent, u16 ent_per_blk)
|
|||
{
|
||||
u32 blks = total_ent / ent_per_blk;
|
||||
|
||||
if (blks == 0 || blks == 1)
|
||||
return ++blks;
|
||||
if (!blks)
|
||||
return 1;
|
||||
|
||||
if (!is_power_of_2(blks))
|
||||
blks = roundup_pow_of_two(blks);
|
||||
|
||||
return blks;
|
||||
return roundup_pow_of_two(blks + 1);
|
||||
}
|
||||
|
||||
#define BNGE_MAX_ROCE_MSIX 64
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user