Skip to content

Commit d99c6fa

Browse files
committed
Merge branch 'bnxt_en-fixes'
Michael Chan says: ==================== bnxt_en: 3 bug fixes. 2 Fixes related to PHY/link settings. The last one fixes the sizing of the completion ring. Please also queue for -stable. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 1df0d89 + 27640ce commit d99c6fa

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,7 +3418,7 @@ void bnxt_set_tpa_flags(struct bnxt *bp)
34183418
*/
34193419
void bnxt_set_ring_params(struct bnxt *bp)
34203420
{
3421-
u32 ring_size, rx_size, rx_space;
3421+
u32 ring_size, rx_size, rx_space, max_rx_cmpl;
34223422
u32 agg_factor = 0, agg_ring_size = 0;
34233423

34243424
/* 8 for CRC and VLAN */
@@ -3474,7 +3474,15 @@ void bnxt_set_ring_params(struct bnxt *bp)
34743474
bp->tx_nr_pages = bnxt_calc_nr_ring_pages(ring_size, TX_DESC_CNT);
34753475
bp->tx_ring_mask = (bp->tx_nr_pages * TX_DESC_CNT) - 1;
34763476

3477-
ring_size = bp->rx_ring_size * (2 + agg_factor) + bp->tx_ring_size;
3477+
max_rx_cmpl = bp->rx_ring_size;
3478+
/* MAX TPA needs to be added because TPA_START completions are
3479+
* immediately recycled, so the TPA completions are not bound by
3480+
* the RX ring size.
3481+
*/
3482+
if (bp->flags & BNXT_FLAG_TPA)
3483+
max_rx_cmpl += bp->max_tpa;
3484+
/* RX and TPA completions are 32-byte, all others are 16-byte */
3485+
ring_size = max_rx_cmpl * 2 + agg_ring_size + bp->tx_ring_size;
34783486
bp->cp_ring_size = ring_size;
34793487

34803488
bp->cp_nr_pages = bnxt_calc_nr_ring_pages(ring_size, CP_DESC_CNT);
@@ -10385,15 +10393,15 @@ static void bnxt_sp_task(struct work_struct *work)
1038510393
&bp->sp_event))
1038610394
bnxt_hwrm_phy_qcaps(bp);
1038710395

10388-
if (test_and_clear_bit(BNXT_LINK_CFG_CHANGE_SP_EVENT,
10389-
&bp->sp_event))
10390-
bnxt_init_ethtool_link_settings(bp);
10391-
1039210396
rc = bnxt_update_link(bp, true);
10393-
mutex_unlock(&bp->link_lock);
1039410397
if (rc)
1039510398
netdev_err(bp->dev, "SP task can't update link (rc: %x)\n",
1039610399
rc);
10400+
10401+
if (test_and_clear_bit(BNXT_LINK_CFG_CHANGE_SP_EVENT,
10402+
&bp->sp_event))
10403+
bnxt_init_ethtool_link_settings(bp);
10404+
mutex_unlock(&bp->link_lock);
1039710405
}
1039810406
if (test_and_clear_bit(BNXT_UPDATE_PHY_SP_EVENT, &bp->sp_event)) {
1039910407
int rc;

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,8 +1765,11 @@ static int bnxt_set_pauseparam(struct net_device *dev,
17651765
if (epause->tx_pause)
17661766
link_info->req_flow_ctrl |= BNXT_LINK_PAUSE_TX;
17671767

1768-
if (netif_running(dev))
1768+
if (netif_running(dev)) {
1769+
mutex_lock(&bp->link_lock);
17691770
rc = bnxt_hwrm_set_pause(bp);
1771+
mutex_unlock(&bp->link_lock);
1772+
}
17701773
return rc;
17711774
}
17721775

0 commit comments

Comments
 (0)