Commit d5430d31 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Reduce default rings on multi-port cards.

Reduce default rings from 8 to 4 on multi-port cards to reduce memory
usage.
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 903649e7
...@@ -5795,6 +5795,8 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp) ...@@ -5795,6 +5795,8 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
link_info->support_auto_speeds = link_info->support_auto_speeds =
le16_to_cpu(resp->supported_speeds_auto_mode); le16_to_cpu(resp->supported_speeds_auto_mode);
bp->port_count = resp->port_cnt;
hwrm_phy_qcaps_exit: hwrm_phy_qcaps_exit:
mutex_unlock(&bp->hwrm_cmd_lock); mutex_unlock(&bp->hwrm_cmd_lock);
return rc; return rc;
...@@ -7877,6 +7879,9 @@ static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh) ...@@ -7877,6 +7879,9 @@ 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 */
if (bp->port_count > 1)
dflt_rings = min_t(int, dflt_rings, 4);
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;
...@@ -8049,6 +8054,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8049,6 +8054,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
bnxt_ethtool_init(bp); bnxt_ethtool_init(bp);
bnxt_dcb_init(bp); bnxt_dcb_init(bp);
rc = bnxt_probe_phy(bp);
if (rc)
goto init_err_pci_clean;
bnxt_set_rx_skb_mode(bp, false); bnxt_set_rx_skb_mode(bp, false);
bnxt_set_tpa_flags(bp); bnxt_set_tpa_flags(bp);
bnxt_set_ring_params(bp); bnxt_set_ring_params(bp);
...@@ -8083,10 +8092,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8083,10 +8092,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (dev->hw_features & NETIF_F_HW_VLAN_CTAG_RX) if (dev->hw_features & NETIF_F_HW_VLAN_CTAG_RX)
bp->flags |= BNXT_FLAG_STRIP_VLAN; bp->flags |= BNXT_FLAG_STRIP_VLAN;
rc = bnxt_probe_phy(bp);
if (rc)
goto init_err_pci_clean;
rc = bnxt_init_int_mode(bp); rc = bnxt_init_int_mode(bp);
if (rc) if (rc)
goto init_err_pci_clean; goto init_err_pci_clean;
......
...@@ -1207,6 +1207,7 @@ struct bnxt { ...@@ -1207,6 +1207,7 @@ struct bnxt {
u8 nge_port_cnt; u8 nge_port_cnt;
__le16 nge_fw_dst_port_id; __le16 nge_fw_dst_port_id;
u8 port_partition_type; u8 port_partition_type;
u8 port_count;
u16 br_mode; u16 br_mode;
u16 rx_coal_ticks; u16 rx_coal_ticks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment