Skip to content

Commit

Permalink
Merge branch 'bnxt_en-Updates-for-net-next'
Browse files Browse the repository at this point in the history
Michael Chan says:

====================
bnxt_en: Updates for net-next.

This patch series adds TC Flower tunnel decap and rewrite actions in
the first 4 patches.  The next 3 patches integrates the recently
added error recovery with the RDMA driver by calling the proper
hooks to stop and start.

v2: Fix pointer alignment issue in patch #1.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 31, 2019
2 parents e43ea83 + 6a68749 commit 4471542
Show file tree
Hide file tree
Showing 6 changed files with 483 additions and 23 deletions.
45 changes: 27 additions & 18 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -8762,6 +8762,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
}
if (resc_reinit || fw_reset) {
if (fw_reset) {
if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
bnxt_ulp_stop(bp);
rc = bnxt_fw_init_one(bp);
if (rc) {
set_bit(BNXT_STATE_ABORT_ERR, &bp->state);
Expand Down Expand Up @@ -9224,13 +9226,16 @@ static int bnxt_open(struct net_device *dev)
if (rc) {
bnxt_hwrm_if_change(bp, false);
} else {
if (test_and_clear_bit(BNXT_STATE_FW_RESET_DET, &bp->state) &&
BNXT_PF(bp)) {
struct bnxt_pf_info *pf = &bp->pf;
int n = pf->active_vfs;
if (test_and_clear_bit(BNXT_STATE_FW_RESET_DET, &bp->state)) {
if (BNXT_PF(bp)) {
struct bnxt_pf_info *pf = &bp->pf;
int n = pf->active_vfs;

if (n)
bnxt_cfg_hw_sriov(bp, &n, true);
if (n)
bnxt_cfg_hw_sriov(bp, &n, true);
}
if (!test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
bnxt_ulp_start(bp, 0);
}
bnxt_hwmon_open(bp);
}
Expand Down Expand Up @@ -9927,12 +9932,15 @@ static void bnxt_reset_task(struct bnxt *bp, bool silent)
if (netif_running(bp->dev)) {
int rc;

if (!silent)
if (silent) {
bnxt_close_nic(bp, false, false);
bnxt_open_nic(bp, false, false);
} else {
bnxt_ulp_stop(bp);
bnxt_close_nic(bp, false, false);
rc = bnxt_open_nic(bp, false, false);
if (!silent && !rc)
bnxt_ulp_start(bp);
bnxt_close_nic(bp, true, false);
rc = bnxt_open_nic(bp, true, false);
bnxt_ulp_start(bp, rc);
}
}
}

Expand Down Expand Up @@ -10048,8 +10056,8 @@ static void bnxt_reset(struct bnxt *bp, bool silent)

static void bnxt_fw_reset_close(struct bnxt *bp)
{
bnxt_ulp_stop(bp);
__bnxt_close_nic(bp, true, false);
bnxt_ulp_irq_stop(bp);
bnxt_clear_int_mode(bp);
bnxt_hwrm_func_drv_unrgtr(bp);
bnxt_free_ctx_mem(bp);
Expand Down Expand Up @@ -10731,13 +10739,13 @@ static void bnxt_fw_reset_task(struct work_struct *work)
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
dev_close(bp->dev);
}
bnxt_ulp_irq_restart(bp, rc);
rtnl_unlock();

bp->fw_reset_state = 0;
/* Make sure fw_reset_state is 0 before clearing the flag */
smp_mb__before_atomic();
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
bnxt_ulp_start(bp, rc);
rtnl_unlock();
break;
}
return;
Expand Down Expand Up @@ -10945,7 +10953,7 @@ static int bnxt_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
}
}

static LIST_HEAD(bnxt_block_cb_list);
LIST_HEAD(bnxt_block_cb_list);

static int bnxt_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
Expand Down Expand Up @@ -11893,6 +11901,7 @@ static int bnxt_suspend(struct device *device)
int rc = 0;

rtnl_lock();
bnxt_ulp_stop(bp);
if (netif_running(dev)) {
netif_device_detach(dev);
rc = bnxt_close(dev);
Expand Down Expand Up @@ -11926,6 +11935,7 @@ static int bnxt_resume(struct device *device)
}

resume_exit:
bnxt_ulp_start(bp, rc);
rtnl_unlock();
return rc;
}
Expand Down Expand Up @@ -12005,10 +12015,9 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
if (!err && netif_running(netdev))
err = bnxt_open(netdev);

if (!err) {
if (!err)
result = PCI_ERS_RESULT_RECOVERED;
bnxt_ulp_start(bp);
}
bnxt_ulp_start(bp, err);
}

if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
Expand Down
12 changes: 12 additions & 0 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <linux/firmware/broadcom/tee_bnxt_fw.h>
#endif

extern struct list_head bnxt_block_cb_list;

struct page_pool;

struct tx_bd {
Expand Down Expand Up @@ -1244,6 +1246,14 @@ struct bnxt_tc_flow_stats {
u64 bytes;
};

#ifdef CONFIG_BNXT_FLOWER_OFFLOAD
struct bnxt_flower_indr_block_cb_priv {
struct net_device *tunnel_netdev;
struct bnxt *bp;
struct list_head list;
};
#endif

struct bnxt_tc_info {
bool enabled;

Expand Down Expand Up @@ -1821,6 +1831,8 @@ struct bnxt {
u16 *cfa_code_map; /* cfa_code -> vf_idx map */
u8 switch_id[8];
struct bnxt_tc_info *tc_info;
struct list_head tc_indr_block_list;
struct notifier_block tc_netdev_nb;
struct dentry *debugfs_pdev;
struct device *hwmon_dev;
};
Expand Down
Loading

0 comments on commit 4471542

Please sign in to comment.