Skip to content

Commit

Permalink
Merge branch 'bnxt_en-next'
Browse files Browse the repository at this point in the history
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 <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 27, 2020
2 parents db038b1 + 9243991 commit 4d94e43
Show file tree
Hide file tree
Showing 8 changed files with 277 additions and 58 deletions.
33 changes: 33 additions & 0 deletions Documentation/networking/devlink/bnxt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,36 @@ parameters.
- Generic Routing Encapsulation (GRE) version check will be enabled in
the device. If disabled, the device will skip the version check for
incoming packets.

Info versions
=============

The ``bnxt_en`` driver reports the following versions

.. list-table:: devlink info versions implemented
:widths: 5 5 90

* - Name
- Type
- Description
* - ``asic.id``
- fixed
- ASIC design identifier
* - ``asic.rev``
- fixed
- ASIC design revision
* - ``fw.psid``
- stored, running
- Firmware parameter set version of the board
* - ``fw``
- stored, running
- Overall board firmware version
* - ``fw.app``
- stored, running
- Data path firmware version
* - ``fw.mgmt``
- stored, running
- Management firmware version
* - ``fw.roce``
- stored, running
- RoCE management firmware version
6 changes: 6 additions & 0 deletions Documentation/networking/devlink/devlink-info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,9 @@ fw.psid
-------

Unique identifier of the firmware parameter set.

fw.roce
-------

RoCE firmware version which is responsible for handling roce
management.
46 changes: 30 additions & 16 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -6998,7 +6998,6 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)

pf->fw_fid = le16_to_cpu(resp->fid);
pf->port_id = le16_to_cpu(resp->port_id);
bp->dev->dev_port = pf->port_id;
memcpy(pf->mac_addr, resp->mac_address, ETH_ALEN);
pf->first_vf_id = le16_to_cpu(resp->first_vf_id);
pf->max_vfs = le16_to_cpu(resp->max_vfs);
Expand Down Expand Up @@ -7289,6 +7288,7 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
bp->hwrm_max_ext_req_len = HWRM_MAX_REQ_LEN;

bp->chip_num = le16_to_cpu(resp->chip_num);
bp->chip_rev = resp->chip_rev;
if (bp->chip_num == CHIP_NUM_58700 && !resp->chip_rev &&
!resp->chip_metal)
bp->flags |= BNXT_FLAG_CHIP_NITRO_A0;
Expand Down Expand Up @@ -9064,7 +9064,7 @@ static int bnxt_update_phy_setting(struct bnxt *bp)
/* The last close may have shutdown the link, so need to call
* PHY_CFG to bring it back up.
*/
if (!netif_carrier_ok(bp->dev))
if (!bp->link_info.link_up)
update_link = true;

if (!bnxt_eee_config_ok(bp))
Expand Down Expand Up @@ -10041,6 +10041,13 @@ static void bnxt_timer(struct timer_list *t)
bnxt_queue_sp_work(bp);
}

#ifdef CONFIG_RFS_ACCEL
if ((bp->flags & BNXT_FLAG_RFS) && bp->ntp_fltr_count) {
set_bit(BNXT_RX_NTP_FLTR_SP_EVENT, &bp->sp_event);
bnxt_queue_sp_work(bp);
}
#endif /*CONFIG_RFS_ACCEL*/

if (bp->link_info.phy_retry) {
if (time_after(jiffies, bp->link_info.phy_retry_expires)) {
bp->link_info.phy_retry = false;
Expand All @@ -10051,7 +10058,8 @@ static void bnxt_timer(struct timer_list *t)
}
}

if ((bp->flags & BNXT_FLAG_CHIP_P5) && netif_carrier_ok(dev)) {
if ((bp->flags & BNXT_FLAG_CHIP_P5) && !bp->chip_rev &&
netif_carrier_ok(dev)) {
set_bit(BNXT_RING_COAL_NOW_SP_EVENT, &bp->sp_event);
bnxt_queue_sp_work(bp);
}
Expand Down Expand Up @@ -10569,7 +10577,7 @@ static void bnxt_set_dflt_rss_hash_type(struct bnxt *bp)
VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV4 |
VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6 |
VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6;
if (BNXT_CHIP_P4(bp) && bp->hwrm_spec_code >= 0x10501) {
if (BNXT_CHIP_P4_PLUS(bp) && bp->hwrm_spec_code >= 0x10501) {
bp->flags |= BNXT_FLAG_UDP_RSS_CAP;
bp->rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4 |
VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6;
Expand Down Expand Up @@ -11101,6 +11109,7 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
struct ethhdr *eth = (struct ethhdr *)skb_mac_header(skb);
int rc = 0, idx, bit_id, l2_idx = 0;
struct hlist_head *head;
u32 flags;

if (!ether_addr_equal(dev->dev_addr, eth->h_dest)) {
struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
Expand Down Expand Up @@ -11140,8 +11149,9 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
rc = -EPROTONOSUPPORT;
goto err_free;
}
if ((fkeys->control.flags & FLOW_DIS_ENCAPSULATION) &&
bp->hwrm_spec_code < 0x10601) {
flags = fkeys->control.flags;
if (((flags & FLOW_DIS_ENCAPSULATION) &&
bp->hwrm_spec_code < 0x10601) || (flags & FLOW_DIS_IS_FRAGMENT)) {
rc = -EPROTONOSUPPORT;
goto err_free;
}
Expand Down Expand Up @@ -11378,8 +11388,8 @@ int bnxt_get_port_parent_id(struct net_device *dev,
if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID))
return -EOPNOTSUPP;

ppid->id_len = sizeof(bp->switch_id);
memcpy(ppid->id, bp->switch_id, ppid->id_len);
ppid->id_len = sizeof(bp->dsn);
memcpy(ppid->id, bp->dsn, ppid->id_len);

return 0;
}
Expand Down Expand Up @@ -11435,9 +11445,9 @@ static void bnxt_remove_one(struct pci_dev *pdev)
bnxt_sriov_disable(bp);

bnxt_dl_fw_reporters_destroy(bp, true);
bnxt_dl_unregister(bp);
pci_disable_pcie_error_reporting(pdev);
unregister_netdev(dev);
bnxt_dl_unregister(bp);
bnxt_shutdown_tc(bp);
bnxt_cancel_sp_work(bp);
bp->sp_event = 0;
Expand Down Expand Up @@ -11471,6 +11481,9 @@ static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
rc);
return rc;
}
if (!fw_dflt)
return 0;

rc = bnxt_update_link(bp, false);
if (rc) {
netdev_err(bp->dev, "Probe phy can't update link (rc: %x)\n",
Expand All @@ -11484,9 +11497,6 @@ static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
if (link_info->auto_link_speeds && !link_info->support_auto_speeds)
link_info->support_auto_speeds = link_info->support_speeds;

if (!fw_dflt)
return 0;

bnxt_init_ethtool_link_settings(bp);
return 0;
}
Expand Down Expand Up @@ -11860,7 +11870,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

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

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

bnxt_dl_register(bp);

rc = register_netdev(dev);
if (rc)
goto init_err_cleanup_tc;
goto init_err_cleanup;

bnxt_dl_register(bp);
if (BNXT_PF(bp))
devlink_port_type_eth_set(&bp->dl_port, bp->dev);
bnxt_dl_fw_reporters_create(bp);

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

return 0;

init_err_cleanup_tc:
init_err_cleanup:
bnxt_dl_unregister(bp);
bnxt_shutdown_tc(bp);
bnxt_clear_int_mode(bp);

Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/broadcom/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,8 @@ struct bnxt {
#define CHIP_NUM_58804 0xd804
#define CHIP_NUM_58808 0xd808

u8 chip_rev;

#define BNXT_CHIP_NUM_5730X(chip_num) \
((chip_num) >= CHIP_NUM_57301 && \
(chip_num) <= CHIP_NUM_57304)
Expand Down Expand Up @@ -1846,7 +1848,7 @@ struct bnxt {
enum devlink_eswitch_mode eswitch_mode;
struct bnxt_vf_rep **vf_reps; /* array of vf-rep ptrs */
u16 *cfa_code_map; /* cfa_code -> vf_idx map */
u8 switch_id[8];
u8 dsn[8];
struct bnxt_tc_info *tc_info;
struct list_head tc_indr_block_list;
struct notifier_block tc_netdev_nb;
Expand Down
Loading

0 comments on commit 4d94e43

Please sign in to comment.