提交 1d3ef13d 编写于 作者: M Michael Chan 提交者: David S. Miller

bnxt_en: Adjust default rings for multi-port NICs.

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: NMichael Chan <michael.chan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d4f52de0
...@@ -8393,9 +8393,15 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh) ...@@ -8393,9 +8393,15 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
if (sh) if (sh)
bp->flags |= BNXT_FLAG_SHARED_RINGS; bp->flags |= BNXT_FLAG_SHARED_RINGS;
dflt_rings = netif_get_num_default_rss_queues(); dflt_rings = netif_get_num_default_rss_queues();
/* Reduce default rings to reduce memory usage on multi-port cards */ /* Reduce default rings on multi-port cards so that total default
if (bp->port_count > 1) * rings do not exceed CPU count.
dflt_rings = min_t(int, dflt_rings, 4); */
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); rc = bnxt_get_dflt_rings(bp, &max_rx_rings, &max_tx_rings, sh);
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册