Skip to content

Commit

Permalink
bnxt_en: Adjust default rings for multi-port NICs.
Browse files Browse the repository at this point in the history
Change the default ring logic to select default number of rings to be up to
8 per port if the default rings x NIC ports <= total CPUs.

Signed-off-by: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Michael Chan authored and davem330 committed Apr 1, 2018
1 parent d4f52de commit 1d3ef13
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8393,9 +8393,15 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
if (sh)
bp->flags |= BNXT_FLAG_SHARED_RINGS;
dflt_rings = netif_get_num_default_rss_queues();
/* Reduce default rings to reduce memory usage on multi-port cards */
if (bp->port_count > 1)
dflt_rings = min_t(int, dflt_rings, 4);
/* Reduce default rings on multi-port cards so that total default
* rings do not exceed CPU count.
*/
if (bp->port_count > 1) {
int max_rings =
max_t(int, num_online_cpus() / bp->port_count, 1);

dflt_rings = min_t(int, dflt_rings, max_rings);
}
rc = bnxt_get_dflt_rings(bp, &max_rx_rings, &max_tx_rings, sh);
if (rc)
return rc;
Expand Down

0 comments on commit 1d3ef13

Please sign in to comment.