Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
We got slightly different patches removing a double word
in a comment in net/ipv4/raw.c - picked the version from net.
Simple conflict in drivers/net/ethernet/ibm/ibmvnic.c. Use cached
values instead of VNIC login response buffer (following what
commit 507ebe6444 ("ibmvnic: Fix use-after-free of VNIC login
response buffer") did).
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -2510,8 +2510,10 @@ static int bcm_sysport_probe(struct platform_device *pdev)
|
||||
priv->tx_rings = devm_kcalloc(&pdev->dev, txq,
|
||||
sizeof(struct bcm_sysport_tx_ring),
|
||||
GFP_KERNEL);
|
||||
if (!priv->tx_rings)
|
||||
return -ENOMEM;
|
||||
if (!priv->tx_rings) {
|
||||
ret = -ENOMEM;
|
||||
goto err_free_netdev;
|
||||
}
|
||||
|
||||
priv->is_lite = params->is_lite;
|
||||
priv->num_rx_desc_words = params->num_rx_desc_words;
|
||||
|
||||
@@ -217,7 +217,7 @@ static int bgmac_probe(struct bcma_device *core)
|
||||
/* BCM 471X/535X family */
|
||||
case BCMA_CHIP_ID_BCM4716:
|
||||
bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
|
||||
/* fallthrough */
|
||||
fallthrough;
|
||||
case BCMA_CHIP_ID_BCM47162:
|
||||
bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL2;
|
||||
bgmac->feature_flags |= BGMAC_FEAT_SET_RXQ_CLK;
|
||||
|
||||
@@ -131,7 +131,7 @@ static void bgmac_nicpm_speed_set(struct net_device *net_dev)
|
||||
switch (bgmac->net_dev->phydev->speed) {
|
||||
default:
|
||||
netdev_err(net_dev, "Unsupported speed. Defaulting to 1000Mb\n");
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case SPEED_1000:
|
||||
val |= NICPM_IOMUX_CTRL_SPD_1000M << NICPM_IOMUX_CTRL_SPD_SHIFT;
|
||||
break;
|
||||
|
||||
@@ -1337,13 +1337,13 @@ bnx2_set_mac_link(struct bnx2 *bp)
|
||||
val |= BNX2_EMAC_MODE_PORT_MII_10M;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case SPEED_100:
|
||||
val |= BNX2_EMAC_MODE_PORT_MII;
|
||||
break;
|
||||
case SPEED_2500:
|
||||
val |= BNX2_EMAC_MODE_25G_MODE;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case SPEED_1000:
|
||||
val |= BNX2_EMAC_MODE_PORT_GMII;
|
||||
break;
|
||||
@@ -1995,26 +1995,26 @@ bnx2_remote_phy_event(struct bnx2 *bp)
|
||||
switch (speed) {
|
||||
case BNX2_LINK_STATUS_10HALF:
|
||||
bp->duplex = DUPLEX_HALF;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNX2_LINK_STATUS_10FULL:
|
||||
bp->line_speed = SPEED_10;
|
||||
break;
|
||||
case BNX2_LINK_STATUS_100HALF:
|
||||
bp->duplex = DUPLEX_HALF;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNX2_LINK_STATUS_100BASE_T4:
|
||||
case BNX2_LINK_STATUS_100FULL:
|
||||
bp->line_speed = SPEED_100;
|
||||
break;
|
||||
case BNX2_LINK_STATUS_1000HALF:
|
||||
bp->duplex = DUPLEX_HALF;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNX2_LINK_STATUS_1000FULL:
|
||||
bp->line_speed = SPEED_1000;
|
||||
break;
|
||||
case BNX2_LINK_STATUS_2500HALF:
|
||||
bp->duplex = DUPLEX_HALF;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNX2_LINK_STATUS_2500FULL:
|
||||
bp->line_speed = SPEED_2500;
|
||||
break;
|
||||
@@ -7856,7 +7856,7 @@ bnx2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
case SIOCGMIIPHY:
|
||||
data->phy_id = bp->phy_addr;
|
||||
|
||||
/* fallthru */
|
||||
fallthrough;
|
||||
case SIOCGMIIREG: {
|
||||
u32 mii_regval;
|
||||
|
||||
|
||||
@@ -4712,14 +4712,14 @@ static void bnx2x_sync_link(struct link_params *params,
|
||||
LINK_STATUS_SPEED_AND_DUPLEX_MASK) {
|
||||
case LINK_10THD:
|
||||
vars->duplex = DUPLEX_HALF;
|
||||
/* Fall thru */
|
||||
fallthrough;
|
||||
case LINK_10TFD:
|
||||
vars->line_speed = SPEED_10;
|
||||
break;
|
||||
|
||||
case LINK_100TXHD:
|
||||
vars->duplex = DUPLEX_HALF;
|
||||
/* Fall thru */
|
||||
fallthrough;
|
||||
case LINK_100T4:
|
||||
case LINK_100TXFD:
|
||||
vars->line_speed = SPEED_100;
|
||||
@@ -4727,14 +4727,14 @@ static void bnx2x_sync_link(struct link_params *params,
|
||||
|
||||
case LINK_1000THD:
|
||||
vars->duplex = DUPLEX_HALF;
|
||||
/* Fall thru */
|
||||
fallthrough;
|
||||
case LINK_1000TFD:
|
||||
vars->line_speed = SPEED_1000;
|
||||
break;
|
||||
|
||||
case LINK_2500THD:
|
||||
vars->duplex = DUPLEX_HALF;
|
||||
/* Fall thru */
|
||||
fallthrough;
|
||||
case LINK_2500TFD:
|
||||
vars->line_speed = SPEED_2500;
|
||||
break;
|
||||
@@ -6339,7 +6339,7 @@ int bnx2x_set_led(struct link_params *params,
|
||||
*/
|
||||
if (!vars->link_up)
|
||||
break;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case LED_MODE_ON:
|
||||
if (((params->phy[EXT_PHY1].type ==
|
||||
PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727) ||
|
||||
@@ -12508,13 +12508,13 @@ static void bnx2x_phy_def_cfg(struct link_params *params,
|
||||
switch (link_config & PORT_FEATURE_LINK_SPEED_MASK) {
|
||||
case PORT_FEATURE_LINK_SPEED_10M_HALF:
|
||||
phy->req_duplex = DUPLEX_HALF;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case PORT_FEATURE_LINK_SPEED_10M_FULL:
|
||||
phy->req_line_speed = SPEED_10;
|
||||
break;
|
||||
case PORT_FEATURE_LINK_SPEED_100M_HALF:
|
||||
phy->req_duplex = DUPLEX_HALF;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case PORT_FEATURE_LINK_SPEED_100M_FULL:
|
||||
phy->req_line_speed = SPEED_100;
|
||||
break;
|
||||
|
||||
@@ -8600,11 +8600,11 @@ int bnx2x_set_int_mode(struct bnx2x *bp)
|
||||
bp->num_queues,
|
||||
1 + bp->num_cnic_queues);
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNX2X_INT_MODE_MSI:
|
||||
bnx2x_enable_msi(bp);
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNX2X_INT_MODE_INTX:
|
||||
bp->num_ethernet_queues = 1;
|
||||
bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
|
||||
|
||||
@@ -3258,7 +3258,7 @@ static int bnx2x_mcast_validate_e2(struct bnx2x *bp,
|
||||
/* DEL command deletes all currently configured MACs */
|
||||
case BNX2X_MCAST_CMD_DEL:
|
||||
o->set_registry_size(o, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
/* RESTORE command will restore the entire multicast configuration */
|
||||
case BNX2X_MCAST_CMD_RESTORE:
|
||||
@@ -3592,7 +3592,7 @@ static int bnx2x_mcast_validate_e1(struct bnx2x *bp,
|
||||
/* DEL command deletes all currently configured MACs */
|
||||
case BNX2X_MCAST_CMD_DEL:
|
||||
o->set_registry_size(o, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
|
||||
/* RESTORE command will restore the entire multicast configuration */
|
||||
case BNX2X_MCAST_CMD_RESTORE:
|
||||
|
||||
@@ -1809,7 +1809,7 @@ get_vf:
|
||||
DP(BNX2X_MSG_IOV, "got VF [%d:%d] RSS update ramrod\n",
|
||||
vf->abs_vfid, qidx);
|
||||
bnx2x_vf_handle_rss_update_eqe(bp, vf);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case EVENT_RING_OPCODE_VF_FLR:
|
||||
/* Do nothing for now */
|
||||
return 0;
|
||||
@@ -2207,7 +2207,7 @@ int bnx2x_vf_free(struct bnx2x *bp, struct bnx2x_virtf *vf)
|
||||
rc = bnx2x_vf_close(bp, vf);
|
||||
if (rc)
|
||||
goto op_err;
|
||||
/* Fall through - to release resources */
|
||||
fallthrough; /* to release resources */
|
||||
case VF_ACQUIRED:
|
||||
DP(BNX2X_MSG_IOV, "about to free resources\n");
|
||||
bnx2x_vf_free_resc(bp, vf);
|
||||
|
||||
@@ -1141,6 +1141,9 @@ static int bnxt_discard_rx(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
|
||||
|
||||
static void bnxt_queue_fw_reset_work(struct bnxt *bp, unsigned long delay)
|
||||
{
|
||||
if (!(test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)))
|
||||
return;
|
||||
|
||||
if (BNXT_PF(bp))
|
||||
queue_delayed_work(bnxt_pf_wq, &bp->fw_reset_task, delay);
|
||||
else
|
||||
@@ -1157,10 +1160,12 @@ static void bnxt_queue_sp_work(struct bnxt *bp)
|
||||
|
||||
static void bnxt_cancel_sp_work(struct bnxt *bp)
|
||||
{
|
||||
if (BNXT_PF(bp))
|
||||
if (BNXT_PF(bp)) {
|
||||
flush_workqueue(bnxt_pf_wq);
|
||||
else
|
||||
} else {
|
||||
cancel_work_sync(&bp->sp_task);
|
||||
cancel_delayed_work_sync(&bp->fw_reset_task);
|
||||
}
|
||||
}
|
||||
|
||||
static void bnxt_sched_reset(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
|
||||
@@ -1923,7 +1928,7 @@ u32 bnxt_fw_health_readl(struct bnxt *bp, int reg_idx)
|
||||
break;
|
||||
case BNXT_FW_HEALTH_REG_TYPE_GRC:
|
||||
reg_off = fw_health->mapped_regs[reg_idx];
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNXT_FW_HEALTH_REG_TYPE_BAR0:
|
||||
val = readl(bp->bar0 + reg_off);
|
||||
break;
|
||||
@@ -1966,11 +1971,11 @@ static int bnxt_async_event_process(struct bnxt *bp,
|
||||
}
|
||||
set_bit(BNXT_LINK_SPEED_CHNG_SP_EVENT, &bp->sp_event);
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
|
||||
case ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE:
|
||||
set_bit(BNXT_LINK_CFG_CHANGE_SP_EVENT, &bp->sp_event);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
|
||||
set_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event);
|
||||
break;
|
||||
@@ -6102,6 +6107,21 @@ static int bnxt_get_func_stat_ctxs(struct bnxt *bp)
|
||||
return cp + ulp_stat;
|
||||
}
|
||||
|
||||
/* Check if a default RSS map needs to be setup. This function is only
|
||||
* used on older firmware that does not require reserving RX rings.
|
||||
*/
|
||||
static void bnxt_check_rss_tbl_no_rmgr(struct bnxt *bp)
|
||||
{
|
||||
struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
|
||||
|
||||
/* The RSS map is valid for RX rings set to resv_rx_rings */
|
||||
if (hw_resc->resv_rx_rings != bp->rx_nr_rings) {
|
||||
hw_resc->resv_rx_rings = bp->rx_nr_rings;
|
||||
if (!netif_is_rxfh_configured(bp->dev))
|
||||
bnxt_set_dflt_rss_indir_tbl(bp);
|
||||
}
|
||||
}
|
||||
|
||||
static bool bnxt_need_reserve_rings(struct bnxt *bp)
|
||||
{
|
||||
struct bnxt_hw_resc *hw_resc = &bp->hw_resc;
|
||||
@@ -6110,22 +6130,28 @@ static bool bnxt_need_reserve_rings(struct bnxt *bp)
|
||||
int rx = bp->rx_nr_rings, stat;
|
||||
int vnic = 1, grp = rx;
|
||||
|
||||
if (bp->hwrm_spec_code < 0x10601)
|
||||
return false;
|
||||
|
||||
if (hw_resc->resv_tx_rings != bp->tx_nr_rings)
|
||||
if (hw_resc->resv_tx_rings != bp->tx_nr_rings &&
|
||||
bp->hwrm_spec_code >= 0x10601)
|
||||
return true;
|
||||
|
||||
/* Old firmware does not need RX ring reservations but we still
|
||||
* need to setup a default RSS map when needed. With new firmware
|
||||
* we go through RX ring reservations first and then set up the
|
||||
* RSS map for the successfully reserved RX rings when needed.
|
||||
*/
|
||||
if (!BNXT_NEW_RM(bp)) {
|
||||
bnxt_check_rss_tbl_no_rmgr(bp);
|
||||
return false;
|
||||
}
|
||||
if ((bp->flags & BNXT_FLAG_RFS) && !(bp->flags & BNXT_FLAG_CHIP_P5))
|
||||
vnic = rx + 1;
|
||||
if (bp->flags & BNXT_FLAG_AGG_RINGS)
|
||||
rx <<= 1;
|
||||
stat = bnxt_get_func_stat_ctxs(bp);
|
||||
if (BNXT_NEW_RM(bp) &&
|
||||
(hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp ||
|
||||
hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat ||
|
||||
(hw_resc->resv_hw_ring_grps != grp &&
|
||||
!(bp->flags & BNXT_FLAG_CHIP_P5))))
|
||||
if (hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp ||
|
||||
hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat ||
|
||||
(hw_resc->resv_hw_ring_grps != grp &&
|
||||
!(bp->flags & BNXT_FLAG_CHIP_P5)))
|
||||
return true;
|
||||
if ((bp->flags & BNXT_FLAG_CHIP_P5) && BNXT_PF(bp) &&
|
||||
hw_resc->resv_irqs != nq)
|
||||
@@ -6214,6 +6240,9 @@ static int __bnxt_reserve_rings(struct bnxt *bp)
|
||||
if (!tx || !rx || !cp || !grp || !vnic || !stat)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!netif_is_rxfh_configured(bp->dev))
|
||||
bnxt_set_dflt_rss_indir_tbl(bp);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -8495,9 +8524,6 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
|
||||
rc = bnxt_init_int_mode(bp);
|
||||
bnxt_ulp_irq_restart(bp, rc);
|
||||
}
|
||||
if (!netif_is_rxfh_configured(bp->dev))
|
||||
bnxt_set_dflt_rss_indir_tbl(bp);
|
||||
|
||||
if (rc) {
|
||||
netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc);
|
||||
return rc;
|
||||
@@ -9284,16 +9310,19 @@ static ssize_t bnxt_show_temp(struct device *dev,
|
||||
struct hwrm_temp_monitor_query_input req = {0};
|
||||
struct hwrm_temp_monitor_query_output *resp;
|
||||
struct bnxt *bp = dev_get_drvdata(dev);
|
||||
u32 temp = 0;
|
||||
u32 len = 0;
|
||||
|
||||
resp = bp->hwrm_cmd_resp_addr;
|
||||
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_TEMP_MONITOR_QUERY, -1, -1);
|
||||
mutex_lock(&bp->hwrm_cmd_lock);
|
||||
if (!_hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
|
||||
temp = resp->temp * 1000; /* display millidegree */
|
||||
if (!_hwrm_send_message_silent(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT))
|
||||
len = sprintf(buf, "%u\n", resp->temp * 1000); /* display millidegree */
|
||||
mutex_unlock(&bp->hwrm_cmd_lock);
|
||||
|
||||
return sprintf(buf, "%u\n", temp);
|
||||
if (len)
|
||||
return len;
|
||||
|
||||
return sprintf(buf, "unknown\n");
|
||||
}
|
||||
static SENSOR_DEVICE_ATTR(temp1_input, 0444, bnxt_show_temp, NULL, 0);
|
||||
|
||||
@@ -9475,15 +9504,15 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
|
||||
}
|
||||
}
|
||||
|
||||
bnxt_enable_napi(bp);
|
||||
bnxt_debug_dev_init(bp);
|
||||
|
||||
rc = bnxt_init_nic(bp, irq_re_init);
|
||||
if (rc) {
|
||||
netdev_err(bp->dev, "bnxt_init_nic err: %x\n", rc);
|
||||
goto open_err;
|
||||
goto open_err_irq;
|
||||
}
|
||||
|
||||
bnxt_enable_napi(bp);
|
||||
bnxt_debug_dev_init(bp);
|
||||
|
||||
if (link_re_init) {
|
||||
mutex_lock(&bp->link_lock);
|
||||
rc = bnxt_update_phy_setting(bp);
|
||||
@@ -9514,10 +9543,6 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
|
||||
bnxt_vf_reps_open(bp);
|
||||
return 0;
|
||||
|
||||
open_err:
|
||||
bnxt_debug_dev_exit(bp);
|
||||
bnxt_disable_napi(bp);
|
||||
|
||||
open_err_irq:
|
||||
bnxt_del_napi(bp);
|
||||
|
||||
@@ -9765,7 +9790,7 @@ static int bnxt_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
case SIOCGMIIPHY:
|
||||
mdio->phy_id = bp->link_info.phy_addr;
|
||||
|
||||
/* fallthru */
|
||||
fallthrough;
|
||||
case SIOCGMIIREG: {
|
||||
u16 mii_regval = 0;
|
||||
|
||||
@@ -11022,7 +11047,7 @@ static void bnxt_fw_reset_writel(struct bnxt *bp, int reg_idx)
|
||||
writel(reg_off & BNXT_GRC_BASE_MASK,
|
||||
bp->bar0 + BNXT_GRCPF_REG_WINDOW_BASE_OUT + 4);
|
||||
reg_off = (reg_off & BNXT_GRC_OFFSET_MASK) + 0x2000;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNXT_FW_HEALTH_REG_TYPE_BAR0:
|
||||
writel(val, bp->bar0 + reg_off);
|
||||
break;
|
||||
@@ -11135,7 +11160,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
|
||||
}
|
||||
bp->fw_reset_state = BNXT_FW_RESET_STATE_RESET_FW;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNXT_FW_RESET_STATE_RESET_FW:
|
||||
bnxt_reset_all(bp);
|
||||
bp->fw_reset_state = BNXT_FW_RESET_STATE_ENABLE_DEV;
|
||||
@@ -11158,7 +11183,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
|
||||
}
|
||||
pci_set_master(bp->pdev);
|
||||
bp->fw_reset_state = BNXT_FW_RESET_STATE_POLL_FW;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNXT_FW_RESET_STATE_POLL_FW:
|
||||
bp->hwrm_cmd_timeout = SHORT_HWRM_CMD_TIMEOUT;
|
||||
rc = __bnxt_hwrm_ver_get(bp, true);
|
||||
@@ -11173,7 +11198,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
|
||||
}
|
||||
bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
|
||||
bp->fw_reset_state = BNXT_FW_RESET_STATE_OPENING;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BNXT_FW_RESET_STATE_OPENING:
|
||||
while (!rtnl_trylock()) {
|
||||
bnxt_queue_fw_reset_work(bp, HZ / 10);
|
||||
@@ -11761,6 +11786,7 @@ static void bnxt_remove_one(struct pci_dev *pdev)
|
||||
unregister_netdev(dev);
|
||||
bnxt_dl_unregister(bp);
|
||||
bnxt_shutdown_tc(bp);
|
||||
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
|
||||
bnxt_cancel_sp_work(bp);
|
||||
bp->sp_event = 0;
|
||||
|
||||
@@ -12200,6 +12226,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
if (BNXT_CHIP_P5(bp))
|
||||
bp->flags |= BNXT_FLAG_CHIP_P5;
|
||||
|
||||
rc = bnxt_alloc_rss_indir_tbl(bp);
|
||||
if (rc)
|
||||
goto init_err_pci_clean;
|
||||
|
||||
rc = bnxt_fw_init_one_p2(bp);
|
||||
if (rc)
|
||||
goto init_err_pci_clean;
|
||||
@@ -12304,11 +12334,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
*/
|
||||
bp->tx_nr_rings_per_tc = bp->tx_nr_rings;
|
||||
|
||||
rc = bnxt_alloc_rss_indir_tbl(bp);
|
||||
if (rc)
|
||||
goto init_err_pci_clean;
|
||||
bnxt_set_dflt_rss_indir_tbl(bp);
|
||||
|
||||
if (BNXT_PF(bp)) {
|
||||
if (!bnxt_pf_wq) {
|
||||
bnxt_pf_wq =
|
||||
@@ -12339,6 +12364,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
(long)pci_resource_start(pdev, 0), dev->dev_addr);
|
||||
pcie_print_link_status(pdev);
|
||||
|
||||
pci_save_state(pdev);
|
||||
return 0;
|
||||
|
||||
init_err_cleanup:
|
||||
@@ -12536,6 +12562,8 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
|
||||
"Cannot re-enable PCI device after reset.\n");
|
||||
} else {
|
||||
pci_set_master(pdev);
|
||||
pci_restore_state(pdev);
|
||||
pci_save_state(pdev);
|
||||
|
||||
err = bnxt_hwrm_func_reset(bp);
|
||||
if (!err) {
|
||||
|
||||
@@ -472,20 +472,13 @@ static int bnxt_get_num_tpa_ring_stats(struct bnxt *bp)
|
||||
static int bnxt_get_num_ring_stats(struct bnxt *bp)
|
||||
{
|
||||
int rx, tx, cmn;
|
||||
bool sh = false;
|
||||
|
||||
if (bp->flags & BNXT_FLAG_SHARED_RINGS)
|
||||
sh = true;
|
||||
|
||||
rx = NUM_RING_RX_HW_STATS + NUM_RING_RX_SW_STATS +
|
||||
bnxt_get_num_tpa_ring_stats(bp);
|
||||
tx = NUM_RING_TX_HW_STATS;
|
||||
cmn = NUM_RING_CMN_SW_STATS;
|
||||
if (sh)
|
||||
return (rx + tx + cmn) * bp->cp_nr_rings;
|
||||
else
|
||||
return rx * bp->rx_nr_rings + tx * bp->tx_nr_rings +
|
||||
cmn * bp->cp_nr_rings;
|
||||
return rx * bp->rx_nr_rings + tx * bp->tx_nr_rings +
|
||||
cmn * bp->cp_nr_rings;
|
||||
}
|
||||
|
||||
static int bnxt_get_num_stats(struct bnxt *bp)
|
||||
@@ -806,7 +799,7 @@ static void bnxt_get_channels(struct net_device *dev,
|
||||
int max_tx_sch_inputs;
|
||||
|
||||
/* Get the most up-to-date max_tx_sch_inputs. */
|
||||
if (BNXT_NEW_RM(bp))
|
||||
if (netif_running(dev) && BNXT_NEW_RM(bp))
|
||||
bnxt_hwrm_func_resc_qcaps(bp, false);
|
||||
max_tx_sch_inputs = hw_resc->max_tx_sch_inputs;
|
||||
|
||||
@@ -1073,7 +1066,7 @@ static int bnxt_grxfh(struct bnxt *bp, struct ethtool_rxnfc *cmd)
|
||||
if (bp->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4)
|
||||
cmd->data |= RXH_IP_SRC | RXH_IP_DST |
|
||||
RXH_L4_B_0_1 | RXH_L4_B_2_3;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case SCTP_V4_FLOW:
|
||||
case AH_ESP_V4_FLOW:
|
||||
case AH_V4_FLOW:
|
||||
@@ -1092,7 +1085,7 @@ static int bnxt_grxfh(struct bnxt *bp, struct ethtool_rxnfc *cmd)
|
||||
if (bp->rss_hash_cfg & VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6)
|
||||
cmd->data |= RXH_IP_SRC | RXH_IP_DST |
|
||||
RXH_L4_B_0_1 | RXH_L4_B_2_3;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case SCTP_V6_FLOW:
|
||||
case AH_ESP_V6_FLOW:
|
||||
case AH_V6_FLOW:
|
||||
@@ -2323,6 +2316,9 @@ static int bnxt_get_nvram_directory(struct net_device *dev, u32 len, u8 *data)
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
|
||||
if (!dir_entries || !entry_length)
|
||||
return -EIO;
|
||||
|
||||
/* Insert 2 bytes of directory info (count and size of entries) */
|
||||
if (len < 2)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -201,10 +201,10 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
|
||||
break;
|
||||
default:
|
||||
bpf_warn_invalid_xdp_action(act);
|
||||
/* Fall thru */
|
||||
fallthrough;
|
||||
case XDP_ABORTED:
|
||||
trace_xdp_exception(bp->dev, xdp_prog, act);
|
||||
/* Fall thru */
|
||||
fallthrough;
|
||||
case XDP_DROP:
|
||||
bnxt_reuse_rx_data(rxr, cons, page);
|
||||
break;
|
||||
|
||||
@@ -3311,7 +3311,7 @@ static int cnic_ctl(void *data, struct cnic_ctl_info *info)
|
||||
}
|
||||
case CNIC_CTL_FCOE_STATS_GET_CMD:
|
||||
ulp_type = CNIC_ULP_FCOE;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case CNIC_CTL_ISCSI_STATS_GET_CMD:
|
||||
cnic_hold(dev);
|
||||
cnic_copy_ulp_stats(dev, ulp_type);
|
||||
@@ -4044,7 +4044,7 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
|
||||
l4kcqe->status, l5kcqe->completion_status);
|
||||
opcode = L4_KCQE_OPCODE_VALUE_CLOSE_COMP;
|
||||
}
|
||||
/* Fall through */
|
||||
fallthrough;
|
||||
case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED:
|
||||
case L4_KCQE_OPCODE_VALUE_CLOSE_COMP:
|
||||
case L4_KCQE_OPCODE_VALUE_RESET_COMP:
|
||||
|
||||
@@ -1185,10 +1185,10 @@ static void bcmgenet_update_mib_counters(struct bcmgenet_priv *priv)
|
||||
continue;
|
||||
case BCMGENET_STAT_RUNT:
|
||||
offset += BCMGENET_STAT_OFFSET;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BCMGENET_STAT_MIB_TX:
|
||||
offset += BCMGENET_STAT_OFFSET;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BCMGENET_STAT_MIB_RX:
|
||||
val = bcmgenet_umac_readl(priv,
|
||||
UMAC_MIB_START + j + offset);
|
||||
@@ -1364,7 +1364,7 @@ static int bcmgenet_validate_flow(struct net_device *dev,
|
||||
case ETHER_FLOW:
|
||||
eth_mask = &cmd->fs.m_u.ether_spec;
|
||||
/* don't allow mask which isn't valid */
|
||||
if (VALIDATE_MASK(eth_mask->h_source) ||
|
||||
if (VALIDATE_MASK(eth_mask->h_dest) ||
|
||||
VALIDATE_MASK(eth_mask->h_source) ||
|
||||
VALIDATE_MASK(eth_mask->h_proto)) {
|
||||
netdev_err(dev, "rxnfc: Unsupported mask\n");
|
||||
|
||||
@@ -192,7 +192,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)
|
||||
switch (priv->phy_interface) {
|
||||
case PHY_INTERFACE_MODE_INTERNAL:
|
||||
phy_name = "internal PHY";
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case PHY_INTERFACE_MODE_MOCA:
|
||||
/* Irrespective of the actually configured PHY speed (100 or
|
||||
* 1000) GENETv4 only has an internal GPHY so we will just end
|
||||
|
||||
@@ -715,7 +715,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
|
||||
case TG3_APE_LOCK_GPIO:
|
||||
if (tg3_asic_rev(tp) == ASIC_REV_5761)
|
||||
return 0;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case TG3_APE_LOCK_GRC:
|
||||
case TG3_APE_LOCK_MEM:
|
||||
if (!tp->pci_fn)
|
||||
@@ -776,7 +776,7 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum)
|
||||
case TG3_APE_LOCK_GPIO:
|
||||
if (tg3_asic_rev(tp) == ASIC_REV_5761)
|
||||
return;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case TG3_APE_LOCK_GRC:
|
||||
case TG3_APE_LOCK_MEM:
|
||||
if (!tp->pci_fn)
|
||||
@@ -1586,7 +1586,7 @@ static int tg3_mdio_init(struct tg3 *tp)
|
||||
phydev->dev_flags |= PHY_BRCM_EXT_IBND_RX_ENABLE;
|
||||
if (tg3_flag(tp, RGMII_EXT_IBND_TX_EN))
|
||||
phydev->dev_flags |= PHY_BRCM_EXT_IBND_TX_ENABLE;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case PHY_ID_RTL8211C:
|
||||
phydev->interface = PHY_INTERFACE_MODE_RGMII;
|
||||
break;
|
||||
@@ -2114,7 +2114,7 @@ static int tg3_phy_init(struct tg3 *tp)
|
||||
phy_support_asym_pause(phydev);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
phy_set_max_speed(phydev, SPEED_100);
|
||||
phy_support_asym_pause(phydev);
|
||||
@@ -4390,7 +4390,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
|
||||
MII_TG3_DSP_TAP26_RMRXSTO |
|
||||
MII_TG3_DSP_TAP26_OPCSINPT;
|
||||
tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
|
||||
/* Fall through */
|
||||
fallthrough;
|
||||
case ASIC_REV_5720:
|
||||
case ASIC_REV_5762:
|
||||
if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
|
||||
@@ -4538,7 +4538,7 @@ static int tg3_phy_pull_config(struct tg3 *tp)
|
||||
tp->link_config.speed = SPEED_1000;
|
||||
break;
|
||||
}
|
||||
/* Fall through */
|
||||
fallthrough;
|
||||
default:
|
||||
goto done;
|
||||
}
|
||||
@@ -5209,7 +5209,7 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
|
||||
if (ap->flags & (MR_AN_ENABLE | MR_RESTART_AN))
|
||||
ap->state = ANEG_STATE_AN_ENABLE;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case ANEG_STATE_AN_ENABLE:
|
||||
ap->flags &= ~(MR_AN_COMPLETE | MR_PAGE_RX);
|
||||
if (ap->flags & MR_AN_ENABLE) {
|
||||
@@ -5239,7 +5239,7 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
|
||||
ret = ANEG_TIMER_ENAB;
|
||||
ap->state = ANEG_STATE_RESTART;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case ANEG_STATE_RESTART:
|
||||
delta = ap->cur_time - ap->link_time;
|
||||
if (delta > ANEG_STATE_SETTLE_TIME)
|
||||
@@ -5282,7 +5282,7 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
|
||||
|
||||
ap->state = ANEG_STATE_ACK_DETECT;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case ANEG_STATE_ACK_DETECT:
|
||||
if (ap->ack_match != 0) {
|
||||
if ((ap->rxconfig & ~ANEG_CFG_ACK) ==
|
||||
@@ -7221,8 +7221,8 @@ static inline void tg3_reset_task_schedule(struct tg3 *tp)
|
||||
|
||||
static inline void tg3_reset_task_cancel(struct tg3 *tp)
|
||||
{
|
||||
cancel_work_sync(&tp->reset_task);
|
||||
tg3_flag_clear(tp, RESET_TASK_PENDING);
|
||||
if (test_and_clear_bit(TG3_FLAG_RESET_TASK_PENDING, tp->tg3_flags))
|
||||
cancel_work_sync(&tp->reset_task);
|
||||
tg3_flag_clear(tp, TX_RECOVERY_PENDING);
|
||||
}
|
||||
|
||||
@@ -10720,40 +10720,40 @@ static int tg3_reset_hw(struct tg3 *tp, bool reset_phy)
|
||||
switch (limit) {
|
||||
case 16:
|
||||
tw32(MAC_RCV_RULE_15, 0); tw32(MAC_RCV_VALUE_15, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 15:
|
||||
tw32(MAC_RCV_RULE_14, 0); tw32(MAC_RCV_VALUE_14, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 14:
|
||||
tw32(MAC_RCV_RULE_13, 0); tw32(MAC_RCV_VALUE_13, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 13:
|
||||
tw32(MAC_RCV_RULE_12, 0); tw32(MAC_RCV_VALUE_12, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 12:
|
||||
tw32(MAC_RCV_RULE_11, 0); tw32(MAC_RCV_VALUE_11, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 11:
|
||||
tw32(MAC_RCV_RULE_10, 0); tw32(MAC_RCV_VALUE_10, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 10:
|
||||
tw32(MAC_RCV_RULE_9, 0); tw32(MAC_RCV_VALUE_9, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 9:
|
||||
tw32(MAC_RCV_RULE_8, 0); tw32(MAC_RCV_VALUE_8, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 8:
|
||||
tw32(MAC_RCV_RULE_7, 0); tw32(MAC_RCV_VALUE_7, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 7:
|
||||
tw32(MAC_RCV_RULE_6, 0); tw32(MAC_RCV_VALUE_6, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 6:
|
||||
tw32(MAC_RCV_RULE_5, 0); tw32(MAC_RCV_VALUE_5, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 5:
|
||||
tw32(MAC_RCV_RULE_4, 0); tw32(MAC_RCV_VALUE_4, 0);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case 4:
|
||||
/* tw32(MAC_RCV_RULE_3, 0); tw32(MAC_RCV_VALUE_3, 0); */
|
||||
case 3:
|
||||
@@ -11209,18 +11209,27 @@ static void tg3_reset_task(struct work_struct *work)
|
||||
|
||||
tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
|
||||
err = tg3_init_hw(tp, true);
|
||||
if (err)
|
||||
if (err) {
|
||||
tg3_full_unlock(tp);
|
||||
tp->irq_sync = 0;
|
||||
tg3_napi_enable(tp);
|
||||
/* Clear this flag so that tg3_reset_task_cancel() will not
|
||||
* call cancel_work_sync() and wait forever.
|
||||
*/
|
||||
tg3_flag_clear(tp, RESET_TASK_PENDING);
|
||||
dev_close(tp->dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
tg3_netif_start(tp);
|
||||
|
||||
out:
|
||||
tg3_full_unlock(tp);
|
||||
|
||||
if (!err)
|
||||
tg3_phy_start(tp);
|
||||
|
||||
tg3_flag_clear(tp, RESET_TASK_PENDING);
|
||||
out:
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
@@ -13998,7 +14007,7 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
case SIOCGMIIPHY:
|
||||
data->phy_id = tp->phy_addr;
|
||||
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case SIOCGMIIREG: {
|
||||
u32 mii_regval;
|
||||
|
||||
@@ -17136,7 +17145,7 @@ static u32 tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
|
||||
val |= DMA_RWCTRL_WRITE_BNDRY_64_PCIE;
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
fallthrough;
|
||||
case 128:
|
||||
default:
|
||||
val &= ~DMA_RWCTRL_WRITE_BNDRY_DISAB_PCIE;
|
||||
@@ -17151,28 +17160,28 @@ static u32 tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
|
||||
DMA_RWCTRL_WRITE_BNDRY_16);
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
fallthrough;
|
||||
case 32:
|
||||
if (goal == BOUNDARY_SINGLE_CACHELINE) {
|
||||
val |= (DMA_RWCTRL_READ_BNDRY_32 |
|
||||
DMA_RWCTRL_WRITE_BNDRY_32);
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
fallthrough;
|
||||
case 64:
|
||||
if (goal == BOUNDARY_SINGLE_CACHELINE) {
|
||||
val |= (DMA_RWCTRL_READ_BNDRY_64 |
|
||||
DMA_RWCTRL_WRITE_BNDRY_64);
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
fallthrough;
|
||||
case 128:
|
||||
if (goal == BOUNDARY_SINGLE_CACHELINE) {
|
||||
val |= (DMA_RWCTRL_READ_BNDRY_128 |
|
||||
DMA_RWCTRL_WRITE_BNDRY_128);
|
||||
break;
|
||||
}
|
||||
/* fallthrough */
|
||||
fallthrough;
|
||||
case 256:
|
||||
val |= (DMA_RWCTRL_READ_BNDRY_256 |
|
||||
DMA_RWCTRL_WRITE_BNDRY_256);
|
||||
|
||||
Reference in New Issue
Block a user