Skip to content

Commit 4d94e43

Browse files
committed
Merge branch 'bnxt_en-next'
Michael Chan says: ==================== bnxt_en: Updates for net-next. This patch-set includes link up and link initialization improvements, RSS and aRFS improvements, devlink refactoring and registration improvements, devlink info support including documentation. v2: Removed the TC ingress rate limiting patch. The developer Harsha needs to rework some code. Use fw.psid suggested by Jakub Kicinski. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents db038b1 + 9243991 commit 4d94e43

File tree

8 files changed

+277
-58
lines changed

8 files changed

+277
-58
lines changed

Documentation/networking/devlink/bnxt.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,36 @@ parameters.
3939
- Generic Routing Encapsulation (GRE) version check will be enabled in
4040
the device. If disabled, the device will skip the version check for
4141
incoming packets.
42+
43+
Info versions
44+
=============
45+
46+
The ``bnxt_en`` driver reports the following versions
47+
48+
.. list-table:: devlink info versions implemented
49+
:widths: 5 5 90
50+
51+
* - Name
52+
- Type
53+
- Description
54+
* - ``asic.id``
55+
- fixed
56+
- ASIC design identifier
57+
* - ``asic.rev``
58+
- fixed
59+
- ASIC design revision
60+
* - ``fw.psid``
61+
- stored, running
62+
- Firmware parameter set version of the board
63+
* - ``fw``
64+
- stored, running
65+
- Overall board firmware version
66+
* - ``fw.app``
67+
- stored, running
68+
- Data path firmware version
69+
* - ``fw.mgmt``
70+
- stored, running
71+
- Management firmware version
72+
* - ``fw.roce``
73+
- stored, running
74+
- RoCE management firmware version

Documentation/networking/devlink/devlink-info.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ fw.psid
9292
-------
9393

9494
Unique identifier of the firmware parameter set.
95+
96+
fw.roce
97+
-------
98+
99+
RoCE firmware version which is responsible for handling roce
100+
management.

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

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6998,7 +6998,6 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
69986998

69996999
pf->fw_fid = le16_to_cpu(resp->fid);
70007000
pf->port_id = le16_to_cpu(resp->port_id);
7001-
bp->dev->dev_port = pf->port_id;
70027001
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
70037002
pf->first_vf_id = le16_to_cpu(resp->first_vf_id);
70047003
pf->max_vfs = le16_to_cpu(resp->max_vfs);
@@ -7289,6 +7288,7 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
72897288
bp->hwrm_max_ext_req_len = HWRM_MAX_REQ_LEN;
72907289

72917290
bp->chip_num = le16_to_cpu(resp->chip_num);
7291+
bp->chip_rev = resp->chip_rev;
72927292
if (bp->chip_num == CHIP_NUM_58700 && !resp->chip_rev &&
72937293
!resp->chip_metal)
72947294
bp->flags |= BNXT_FLAG_CHIP_NITRO_A0;
@@ -9064,7 +9064,7 @@ static int bnxt_update_phy_setting(struct bnxt *bp)
90649064
/* The last close may have shutdown the link, so need to call
90659065
* PHY_CFG to bring it back up.
90669066
*/
9067-
if (!netif_carrier_ok(bp->dev))
9067+
if (!bp->link_info.link_up)
90689068
update_link = true;
90699069

90709070
if (!bnxt_eee_config_ok(bp))
@@ -10041,6 +10041,13 @@ static void bnxt_timer(struct timer_list *t)
1004110041
bnxt_queue_sp_work(bp);
1004210042
}
1004310043

10044+
#ifdef CONFIG_RFS_ACCEL
10045+
if ((bp->flags & BNXT_FLAG_RFS) && bp->ntp_fltr_count) {
10046+
set_bit(BNXT_RX_NTP_FLTR_SP_EVENT, &bp->sp_event);
10047+
bnxt_queue_sp_work(bp);
10048+
}
10049+
#endif /*CONFIG_RFS_ACCEL*/
10050+
1004410051
if (bp->link_info.phy_retry) {
1004510052
if (time_after(jiffies, bp->link_info.phy_retry_expires)) {
1004610053
bp->link_info.phy_retry = false;
@@ -10051,7 +10058,8 @@ static void bnxt_timer(struct timer_list *t)
1005110058
}
1005210059
}
1005310060

10054-
if ((bp->flags & BNXT_FLAG_CHIP_P5) && netif_carrier_ok(dev)) {
10061+
if ((bp->flags & BNXT_FLAG_CHIP_P5) && !bp->chip_rev &&
10062+
netif_carrier_ok(dev)) {
1005510063
set_bit(BNXT_RING_COAL_NOW_SP_EVENT, &bp->sp_event);
1005610064
bnxt_queue_sp_work(bp);
1005710065
}
@@ -10569,7 +10577,7 @@ static void bnxt_set_dflt_rss_hash_type(struct bnxt *bp)
1056910577
VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV4 |
1057010578
VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6 |
1057110579
VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6;
10572-
if (BNXT_CHIP_P4(bp) && bp->hwrm_spec_code >= 0x10501) {
10580+
if (BNXT_CHIP_P4_PLUS(bp) && bp->hwrm_spec_code >= 0x10501) {
1057310581
bp->flags |= BNXT_FLAG_UDP_RSS_CAP;
1057410582
bp->rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4 |
1057510583
VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6;
@@ -11101,6 +11109,7 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
1110111109
struct ethhdr *eth = (struct ethhdr *)skb_mac_header(skb);
1110211110
int rc = 0, idx, bit_id, l2_idx = 0;
1110311111
struct hlist_head *head;
11112+
u32 flags;
1110411113

1110511114
if (!ether_addr_equal(dev->dev_addr, eth->h_dest)) {
1110611115
struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
@@ -11140,8 +11149,9 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
1114011149
rc = -EPROTONOSUPPORT;
1114111150
goto err_free;
1114211151
}
11143-
if ((fkeys->control.flags & FLOW_DIS_ENCAPSULATION) &&
11144-
bp->hwrm_spec_code < 0x10601) {
11152+
flags = fkeys->control.flags;
11153+
if (((flags & FLOW_DIS_ENCAPSULATION) &&
11154+
bp->hwrm_spec_code < 0x10601) || (flags & FLOW_DIS_IS_FRAGMENT)) {
1114511155
rc = -EPROTONOSUPPORT;
1114611156
goto err_free;
1114711157
}
@@ -11378,8 +11388,8 @@ int bnxt_get_port_parent_id(struct net_device *dev,
1137811388
if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID))
1137911389
return -EOPNOTSUPP;
1138011390

11381-
ppid->id_len = sizeof(bp->switch_id);
11382-
memcpy(ppid->id, bp->switch_id, ppid->id_len);
11391+
ppid->id_len = sizeof(bp->dsn);
11392+
memcpy(ppid->id, bp->dsn, ppid->id_len);
1138311393

1138411394
return 0;
1138511395
}
@@ -11435,9 +11445,9 @@ static void bnxt_remove_one(struct pci_dev *pdev)
1143511445
bnxt_sriov_disable(bp);
1143611446

1143711447
bnxt_dl_fw_reporters_destroy(bp, true);
11438-
bnxt_dl_unregister(bp);
1143911448
pci_disable_pcie_error_reporting(pdev);
1144011449
unregister_netdev(dev);
11450+
bnxt_dl_unregister(bp);
1144111451
bnxt_shutdown_tc(bp);
1144211452
bnxt_cancel_sp_work(bp);
1144311453
bp->sp_event = 0;
@@ -11471,6 +11481,9 @@ static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
1147111481
rc);
1147211482
return rc;
1147311483
}
11484+
if (!fw_dflt)
11485+
return 0;
11486+
1147411487
rc = bnxt_update_link(bp, false);
1147511488
if (rc) {
1147611489
netdev_err(bp->dev, "Probe phy can't update link (rc: %x)\n",
@@ -11484,9 +11497,6 @@ static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
1148411497
if (link_info->auto_link_speeds && !link_info->support_auto_speeds)
1148511498
link_info->support_auto_speeds = link_info->support_speeds;
1148611499

11487-
if (!fw_dflt)
11488-
return 0;
11489-
1149011500
bnxt_init_ethtool_link_settings(bp);
1149111501
return 0;
1149211502
}
@@ -11860,7 +11870,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1186011870

1186111871
if (BNXT_PF(bp)) {
1186211872
/* Read the adapter's DSN to use as the eswitch switch_id */
11863-
bnxt_pcie_dsn_get(bp, bp->switch_id);
11873+
rc = bnxt_pcie_dsn_get(bp, bp->dsn);
1186411874
}
1186511875

1186611876
/* MTU range: 60 - FW defined max */
@@ -11907,11 +11917,14 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1190711917
bnxt_init_tc(bp);
1190811918
}
1190911919

11920+
bnxt_dl_register(bp);
11921+
1191011922
rc = register_netdev(dev);
1191111923
if (rc)
11912-
goto init_err_cleanup_tc;
11924+
goto init_err_cleanup;
1191311925

11914-
bnxt_dl_register(bp);
11926+
if (BNXT_PF(bp))
11927+
devlink_port_type_eth_set(&bp->dl_port, bp->dev);
1191511928
bnxt_dl_fw_reporters_create(bp);
1191611929

1191711930
netdev_info(dev, "%s found at mem %lx, node addr %pM\n",
@@ -11921,7 +11934,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1192111934

1192211935
return 0;
1192311936

11924-
init_err_cleanup_tc:
11937+
init_err_cleanup:
11938+
bnxt_dl_unregister(bp);
1192511939
bnxt_shutdown_tc(bp);
1192611940
bnxt_clear_int_mode(bp);
1192711941

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,8 @@ struct bnxt {
14571457
#define CHIP_NUM_58804 0xd804
14581458
#define CHIP_NUM_58808 0xd808
14591459

1460+
u8 chip_rev;
1461+
14601462
#define BNXT_CHIP_NUM_5730X(chip_num) \
14611463
((chip_num) >= CHIP_NUM_57301 && \
14621464
(chip_num) <= CHIP_NUM_57304)
@@ -1846,7 +1848,7 @@ struct bnxt {
18461848
enum devlink_eswitch_mode eswitch_mode;
18471849
struct bnxt_vf_rep **vf_reps; /* array of vf-rep ptrs */
18481850
u16 *cfa_code_map; /* cfa_code -> vf_idx map */
1849-
u8 switch_id[8];
1851+
u8 dsn[8];
18501852
struct bnxt_tc_info *tc_info;
18511853
struct list_head tc_indr_block_list;
18521854
struct notifier_block tc_netdev_nb;

0 commit comments

Comments
 (0)