Skip to content

Commit 6c0ec7a

Browse files
author
Paolo Abeni
committed
Merge branch 'bnxt_en-bug-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes This patchset has the following fixes for bnxt_en: 1. Add missing VNIC ID parameter in the FW message when getting an updated RSS configuration from the FW. 2. Fix a warning when doing ethtool reset on newer chips. 3. Fix VLAN issue on a VF when a default VLAN is assigned. 4. Fix a problem during DPC (Downstream Port containment) scenario. 5. Fix a NULL pointer dereference when receiving a PTP event from FW. 6. Fix VXLAN/Geneve UDP port delete/add with newer FW. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 182620a + 1eb4ef1 commit 6c0ec7a

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

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

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,9 @@ static int bnxt_async_event_process(struct bnxt *bp,
23652365
struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
23662366
u64 ns;
23672367

2368+
if (!ptp)
2369+
goto async_event_process_exit;
2370+
23682371
spin_lock_bh(&ptp->ptp_lock);
23692372
bnxt_ptp_update_current_time(bp);
23702373
ns = (((u64)BNXT_EVENT_PHC_RTC_UPDATE(data1) <<
@@ -4763,6 +4766,9 @@ int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap, int bmap_size,
47634766
if (event_id == ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY &&
47644767
!(bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY))
47654768
continue;
4769+
if (event_id == ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE &&
4770+
!bp->ptp_cfg)
4771+
continue;
47664772
__set_bit(bnxt_async_events_arr[i], async_events_bmap);
47674773
}
47684774
if (bmap && bmap_size) {
@@ -5350,6 +5356,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)
53505356
if (hwrm_req_init(bp, req, HWRM_VNIC_RSS_QCFG))
53515357
return;
53525358

5359+
req->vnic_id = cpu_to_le16(vnic->fw_vnic_id);
53535360
/* all contexts configured to same hash_type, zero always exists */
53545361
req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]);
53555362
resp = hwrm_req_hold(bp, req);
@@ -8812,6 +8819,9 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
88128819
goto err_out;
88138820
}
88148821

8822+
if (BNXT_VF(bp))
8823+
bnxt_hwrm_func_qcfg(bp);
8824+
88158825
rc = bnxt_setup_vnic(bp, 0);
88168826
if (rc)
88178827
goto err_out;
@@ -11598,6 +11608,7 @@ static void bnxt_tx_timeout(struct net_device *dev, unsigned int txqueue)
1159811608
static void bnxt_fw_health_check(struct bnxt *bp)
1159911609
{
1160011610
struct bnxt_fw_health *fw_health = bp->fw_health;
11611+
struct pci_dev *pdev = bp->pdev;
1160111612
u32 val;
1160211613

1160311614
if (!fw_health->enabled || test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
@@ -11611,15 +11622,15 @@ static void bnxt_fw_health_check(struct bnxt *bp)
1161111622
}
1161211623

1161311624
val = bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG);
11614-
if (val == fw_health->last_fw_heartbeat) {
11625+
if (val == fw_health->last_fw_heartbeat && pci_device_is_present(pdev)) {
1161511626
fw_health->arrests++;
1161611627
goto fw_reset;
1161711628
}
1161811629

1161911630
fw_health->last_fw_heartbeat = val;
1162011631

1162111632
val = bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG);
11622-
if (val != fw_health->last_fw_reset_cnt) {
11633+
if (val != fw_health->last_fw_reset_cnt && pci_device_is_present(pdev)) {
1162311634
fw_health->discoveries++;
1162411635
goto fw_reset;
1162511636
}
@@ -13025,26 +13036,37 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp)
1302513036

1302613037
#endif /* CONFIG_RFS_ACCEL */
1302713038

13028-
static int bnxt_udp_tunnel_sync(struct net_device *netdev, unsigned int table)
13039+
static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,
13040+
unsigned int entry, struct udp_tunnel_info *ti)
1302913041
{
1303013042
struct bnxt *bp = netdev_priv(netdev);
13031-
struct udp_tunnel_info ti;
1303213043
unsigned int cmd;
1303313044

13034-
udp_tunnel_nic_get_port(netdev, table, 0, &ti);
13035-
if (ti.type == UDP_TUNNEL_TYPE_VXLAN)
13045+
if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
1303613046
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
1303713047
else
1303813048
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
1303913049

13040-
if (ti.port)
13041-
return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti.port, cmd);
13050+
return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti->port, cmd);
13051+
}
13052+
13053+
static int bnxt_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table,
13054+
unsigned int entry, struct udp_tunnel_info *ti)
13055+
{
13056+
struct bnxt *bp = netdev_priv(netdev);
13057+
unsigned int cmd;
13058+
13059+
if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
13060+
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
13061+
else
13062+
cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
1304213063

1304313064
return bnxt_hwrm_tunnel_dst_port_free(bp, cmd);
1304413065
}
1304513066

1304613067
static const struct udp_tunnel_nic_info bnxt_udp_tunnels = {
13047-
.sync_table = bnxt_udp_tunnel_sync,
13068+
.set_port = bnxt_udp_tunnel_set_port,
13069+
.unset_port = bnxt_udp_tunnel_unset_port,
1304813070
.flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP |
1304913071
UDP_TUNNEL_NIC_INFO_OPEN_ONLY,
1305013072
.tables = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3831,7 +3831,7 @@ static int bnxt_reset(struct net_device *dev, u32 *flags)
38313831
}
38323832
}
38333833

3834-
if (req & BNXT_FW_RESET_AP) {
3834+
if (!BNXT_CHIP_P4_PLUS(bp) && (req & BNXT_FW_RESET_AP)) {
38353835
/* This feature is not supported in older firmware versions */
38363836
if (bp->hwrm_spec_code >= 0x10803) {
38373837
if (!bnxt_firmware_reset_ap(dev)) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg)
952952
bnxt_ptp_timecounter_init(bp, true);
953953
bnxt_ptp_adjfine_rtc(bp, 0);
954954
}
955+
bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, true);
955956

956957
ptp->ptp_info = bnxt_ptp_caps;
957958
if ((bp->fw_cap & BNXT_FW_CAP_PTP_PPS)) {

0 commit comments

Comments
 (0)