Skip to content

Commit 5dfd7d9

Browse files
author
Paolo Abeni
committed
Merge branch 'bnxt_en-bug-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes This patchset fixes several things: 1. AER recovery for RoCE when NIC interface is down. 2. Set ethtool backplane link modes correctly. 3. Update RSS ring ID during RX queue restart. 4. Crash with XDP and MTU change. 5. PCIe completion timeout when reading PHC after shutdown. ==================== Link: https://patch.msgid.link/20241122224547.984808-1-michael.chan@broadcom.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 9cfb5e7 + 3661c05 commit 5dfd7d9

File tree

4 files changed

+42
-11
lines changed

4 files changed

+42
-11
lines changed

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

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4661,7 +4661,7 @@ int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
46614661
struct net_device *dev = bp->dev;
46624662

46634663
if (page_mode) {
4664-
bp->flags &= ~BNXT_FLAG_AGG_RINGS;
4664+
bp->flags &= ~(BNXT_FLAG_AGG_RINGS | BNXT_FLAG_NO_AGG_RINGS);
46654665
bp->flags |= BNXT_FLAG_RX_PAGE_MODE;
46664666

46674667
if (bp->xdp_prog->aux->xdp_has_frags)
@@ -9296,7 +9296,6 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
92969296
struct hwrm_port_mac_ptp_qcfg_output *resp;
92979297
struct hwrm_port_mac_ptp_qcfg_input *req;
92989298
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
9299-
bool phc_cfg;
93009299
u8 flags;
93019300
int rc;
93029301

@@ -9343,8 +9342,9 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
93439342
rc = -ENODEV;
93449343
goto exit;
93459344
}
9346-
phc_cfg = (flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
9347-
rc = bnxt_ptp_init(bp, phc_cfg);
9345+
ptp->rtc_configured =
9346+
(flags & PORT_MAC_PTP_QCFG_RESP_FLAGS_RTC_CONFIGURED) != 0;
9347+
rc = bnxt_ptp_init(bp);
93489348
if (rc)
93499349
netdev_warn(bp->dev, "PTP initialization failed.\n");
93509350
exit:
@@ -14740,6 +14740,14 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
1474014740
bnxt_close_nic(bp, true, false);
1474114741

1474214742
WRITE_ONCE(dev->mtu, new_mtu);
14743+
14744+
/* MTU change may change the AGG ring settings if an XDP multi-buffer
14745+
* program is attached. We need to set the AGG rings settings and
14746+
* rx_skb_func accordingly.
14747+
*/
14748+
if (READ_ONCE(bp->xdp_prog))
14749+
bnxt_set_rx_skb_mode(bp, true);
14750+
1474314751
bnxt_set_ring_params(bp);
1474414752

1474514753
if (netif_running(dev))
@@ -15477,6 +15485,13 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1547715485

1547815486
for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
1547915487
vnic = &bp->vnic_info[i];
15488+
15489+
rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
15490+
if (rc) {
15491+
netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
15492+
vnic->vnic_id, rc);
15493+
return rc;
15494+
}
1548015495
vnic->mru = bp->dev->mtu + ETH_HLEN + VLAN_HLEN;
1548115496
bnxt_hwrm_vnic_update(bp, vnic,
1548215497
VNIC_UPDATE_REQ_ENABLES_MRU_VALID);
@@ -16230,6 +16245,7 @@ static void bnxt_shutdown(struct pci_dev *pdev)
1623016245
if (netif_running(dev))
1623116246
dev_close(dev);
1623216247

16248+
bnxt_ptp_clear(bp);
1623316249
bnxt_clear_int_mode(bp);
1623416250
pci_disable_device(pdev);
1623516251

@@ -16257,6 +16273,7 @@ static int bnxt_suspend(struct device *device)
1625716273
rc = bnxt_close(dev);
1625816274
}
1625916275
bnxt_hwrm_func_drv_unrgtr(bp);
16276+
bnxt_ptp_clear(bp);
1626016277
pci_disable_device(bp->pdev);
1626116278
bnxt_free_ctx_mem(bp, false);
1626216279
rtnl_unlock();
@@ -16300,6 +16317,10 @@ static int bnxt_resume(struct device *device)
1630016317
if (bp->fw_crash_mem)
1630116318
bnxt_hwrm_crash_dump_mem_cfg(bp);
1630216319

16320+
if (bnxt_ptp_init(bp)) {
16321+
kfree(bp->ptp_cfg);
16322+
bp->ptp_cfg = NULL;
16323+
}
1630316324
bnxt_get_wol_settings(bp);
1630416325
if (netif_running(dev)) {
1630516326
rc = bnxt_open(dev);
@@ -16478,8 +16499,12 @@ static void bnxt_io_resume(struct pci_dev *pdev)
1647816499
rtnl_lock();
1647916500

1648016501
err = bnxt_hwrm_func_qcaps(bp);
16481-
if (!err && netif_running(netdev))
16482-
err = bnxt_open(netdev);
16502+
if (!err) {
16503+
if (netif_running(netdev))
16504+
err = bnxt_open(netdev);
16505+
else
16506+
err = bnxt_reserve_rings(bp, true);
16507+
}
1648316508

1648416509
if (!err)
1648516510
netif_device_attach(netdev);

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,19 +2837,24 @@ static int bnxt_get_link_ksettings(struct net_device *dev,
28372837
}
28382838

28392839
base->port = PORT_NONE;
2840-
if (link_info->media_type == PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP) {
2840+
if (media == BNXT_MEDIA_TP) {
28412841
base->port = PORT_TP;
28422842
linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
28432843
lk_ksettings->link_modes.supported);
28442844
linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT,
28452845
lk_ksettings->link_modes.advertising);
2846+
} else if (media == BNXT_MEDIA_KR) {
2847+
linkmode_set_bit(ETHTOOL_LINK_MODE_Backplane_BIT,
2848+
lk_ksettings->link_modes.supported);
2849+
linkmode_set_bit(ETHTOOL_LINK_MODE_Backplane_BIT,
2850+
lk_ksettings->link_modes.advertising);
28462851
} else {
28472852
linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
28482853
lk_ksettings->link_modes.supported);
28492854
linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
28502855
lk_ksettings->link_modes.advertising);
28512856

2852-
if (link_info->media_type == PORT_PHY_QCFG_RESP_MEDIA_TYPE_DAC)
2857+
if (media == BNXT_MEDIA_CR)
28532858
base->port = PORT_DA;
28542859
else
28552860
base->port = PORT_FIBRE;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ static void bnxt_ptp_free(struct bnxt *bp)
10381038
}
10391039
}
10401040

1041-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
1041+
int bnxt_ptp_init(struct bnxt *bp)
10421042
{
10431043
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
10441044
int rc;
@@ -1061,7 +1061,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
10611061

10621062
if (BNXT_PTP_USE_RTC(bp)) {
10631063
bnxt_ptp_timecounter_init(bp, false);
1064-
rc = bnxt_ptp_init_rtc(bp, phc_cfg);
1064+
rc = bnxt_ptp_init_rtc(bp, ptp->rtc_configured);
10651065
if (rc)
10661066
goto out;
10671067
} else {

drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct bnxt_ptp_cfg {
135135
BNXT_PTP_MSG_PDELAY_REQ | \
136136
BNXT_PTP_MSG_PDELAY_RESP)
137137
u8 tx_tstamp_en:1;
138+
u8 rtc_configured:1;
138139
int rx_filter;
139140
u32 tstamp_filters;
140141

@@ -168,7 +169,7 @@ void bnxt_tx_ts_cmp(struct bnxt *bp, struct bnxt_napi *bnapi,
168169
struct tx_ts_cmp *tscmp);
169170
void bnxt_ptp_rtc_timecounter_init(struct bnxt_ptp_cfg *ptp, u64 ns);
170171
int bnxt_ptp_init_rtc(struct bnxt *bp, bool phc_cfg);
171-
int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg);
172+
int bnxt_ptp_init(struct bnxt *bp);
172173
void bnxt_ptp_clear(struct bnxt *bp);
173174
static inline u64 bnxt_timecounter_cyc2time(struct bnxt_ptp_cfg *ptp, u64 ts)
174175
{

0 commit comments

Comments
 (0)