diff options
Diffstat (limited to 'drivers/net')
47 files changed, 360 insertions, 178 deletions
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 1fcd5568a352..f3470d96837a 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c | |||
@@ -850,8 +850,10 @@ static int emac_probe(struct platform_device *pdev) | |||
850 | } | 850 | } |
851 | 851 | ||
852 | db->clk = devm_clk_get(&pdev->dev, NULL); | 852 | db->clk = devm_clk_get(&pdev->dev, NULL); |
853 | if (IS_ERR(db->clk)) | 853 | if (IS_ERR(db->clk)) { |
854 | ret = PTR_ERR(db->clk); | ||
854 | goto out; | 855 | goto out; |
856 | } | ||
855 | 857 | ||
856 | clk_prepare_enable(db->clk); | 858 | clk_prepare_enable(db->clk); |
857 | 859 | ||
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 3498760dc22a..760c72c6e2ac 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c | |||
@@ -1170,10 +1170,6 @@ tx_request_irq_error: | |||
1170 | init_error: | 1170 | init_error: |
1171 | free_skbufs(dev); | 1171 | free_skbufs(dev); |
1172 | alloc_skbuf_error: | 1172 | alloc_skbuf_error: |
1173 | if (priv->phydev) { | ||
1174 | phy_disconnect(priv->phydev); | ||
1175 | priv->phydev = NULL; | ||
1176 | } | ||
1177 | phy_error: | 1173 | phy_error: |
1178 | return ret; | 1174 | return ret; |
1179 | } | 1175 | } |
@@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev) | |||
1186 | int ret; | 1182 | int ret; |
1187 | unsigned long int flags; | 1183 | unsigned long int flags; |
1188 | 1184 | ||
1189 | /* Stop and disconnect the PHY */ | 1185 | /* Stop the PHY */ |
1190 | if (priv->phydev) { | 1186 | if (priv->phydev) |
1191 | phy_stop(priv->phydev); | 1187 | phy_stop(priv->phydev); |
1192 | phy_disconnect(priv->phydev); | ||
1193 | priv->phydev = NULL; | ||
1194 | } | ||
1195 | 1188 | ||
1196 | netif_stop_queue(dev); | 1189 | netif_stop_queue(dev); |
1197 | napi_disable(&priv->napi); | 1190 | napi_disable(&priv->napi); |
@@ -1525,6 +1518,10 @@ err_free_netdev: | |||
1525 | static int altera_tse_remove(struct platform_device *pdev) | 1518 | static int altera_tse_remove(struct platform_device *pdev) |
1526 | { | 1519 | { |
1527 | struct net_device *ndev = platform_get_drvdata(pdev); | 1520 | struct net_device *ndev = platform_get_drvdata(pdev); |
1521 | struct altera_tse_private *priv = netdev_priv(ndev); | ||
1522 | |||
1523 | if (priv->phydev) | ||
1524 | phy_disconnect(priv->phydev); | ||
1528 | 1525 | ||
1529 | platform_set_drvdata(pdev, NULL); | 1526 | platform_set_drvdata(pdev, NULL); |
1530 | altera_tse_mdio_destroy(ndev); | 1527 | altera_tse_mdio_destroy(ndev); |
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index e398eda07298..c8af3ce3ea38 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c | |||
@@ -184,15 +184,16 @@ static void alx_schedule_reset(struct alx_priv *alx) | |||
184 | schedule_work(&alx->reset_wk); | 184 | schedule_work(&alx->reset_wk); |
185 | } | 185 | } |
186 | 186 | ||
187 | static bool alx_clean_rx_irq(struct alx_priv *alx, int budget) | 187 | static int alx_clean_rx_irq(struct alx_priv *alx, int budget) |
188 | { | 188 | { |
189 | struct alx_rx_queue *rxq = &alx->rxq; | 189 | struct alx_rx_queue *rxq = &alx->rxq; |
190 | struct alx_rrd *rrd; | 190 | struct alx_rrd *rrd; |
191 | struct alx_buffer *rxb; | 191 | struct alx_buffer *rxb; |
192 | struct sk_buff *skb; | 192 | struct sk_buff *skb; |
193 | u16 length, rfd_cleaned = 0; | 193 | u16 length, rfd_cleaned = 0; |
194 | int work = 0; | ||
194 | 195 | ||
195 | while (budget > 0) { | 196 | while (work < budget) { |
196 | rrd = &rxq->rrd[rxq->rrd_read_idx]; | 197 | rrd = &rxq->rrd[rxq->rrd_read_idx]; |
197 | if (!(rrd->word3 & cpu_to_le32(1 << RRD_UPDATED_SHIFT))) | 198 | if (!(rrd->word3 & cpu_to_le32(1 << RRD_UPDATED_SHIFT))) |
198 | break; | 199 | break; |
@@ -203,7 +204,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget) | |||
203 | ALX_GET_FIELD(le32_to_cpu(rrd->word0), | 204 | ALX_GET_FIELD(le32_to_cpu(rrd->word0), |
204 | RRD_NOR) != 1) { | 205 | RRD_NOR) != 1) { |
205 | alx_schedule_reset(alx); | 206 | alx_schedule_reset(alx); |
206 | return 0; | 207 | return work; |
207 | } | 208 | } |
208 | 209 | ||
209 | rxb = &rxq->bufs[rxq->read_idx]; | 210 | rxb = &rxq->bufs[rxq->read_idx]; |
@@ -243,7 +244,7 @@ static bool alx_clean_rx_irq(struct alx_priv *alx, int budget) | |||
243 | } | 244 | } |
244 | 245 | ||
245 | napi_gro_receive(&alx->napi, skb); | 246 | napi_gro_receive(&alx->napi, skb); |
246 | budget--; | 247 | work++; |
247 | 248 | ||
248 | next_pkt: | 249 | next_pkt: |
249 | if (++rxq->read_idx == alx->rx_ringsz) | 250 | if (++rxq->read_idx == alx->rx_ringsz) |
@@ -258,21 +259,22 @@ next_pkt: | |||
258 | if (rfd_cleaned) | 259 | if (rfd_cleaned) |
259 | alx_refill_rx_ring(alx, GFP_ATOMIC); | 260 | alx_refill_rx_ring(alx, GFP_ATOMIC); |
260 | 261 | ||
261 | return budget > 0; | 262 | return work; |
262 | } | 263 | } |
263 | 264 | ||
264 | static int alx_poll(struct napi_struct *napi, int budget) | 265 | static int alx_poll(struct napi_struct *napi, int budget) |
265 | { | 266 | { |
266 | struct alx_priv *alx = container_of(napi, struct alx_priv, napi); | 267 | struct alx_priv *alx = container_of(napi, struct alx_priv, napi); |
267 | struct alx_hw *hw = &alx->hw; | 268 | struct alx_hw *hw = &alx->hw; |
268 | bool complete = true; | ||
269 | unsigned long flags; | 269 | unsigned long flags; |
270 | bool tx_complete; | ||
271 | int work; | ||
270 | 272 | ||
271 | complete = alx_clean_tx_irq(alx) && | 273 | tx_complete = alx_clean_tx_irq(alx); |
272 | alx_clean_rx_irq(alx, budget); | 274 | work = alx_clean_rx_irq(alx, budget); |
273 | 275 | ||
274 | if (!complete) | 276 | if (!tx_complete || work == budget) |
275 | return 1; | 277 | return budget; |
276 | 278 | ||
277 | napi_complete(&alx->napi); | 279 | napi_complete(&alx->napi); |
278 | 280 | ||
@@ -284,7 +286,7 @@ static int alx_poll(struct napi_struct *napi, int budget) | |||
284 | 286 | ||
285 | alx_post_write(hw); | 287 | alx_post_write(hw); |
286 | 288 | ||
287 | return 0; | 289 | return work; |
288 | } | 290 | } |
289 | 291 | ||
290 | static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr) | 292 | static irqreturn_t alx_intr_handle(struct alx_priv *alx, u32 intr) |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 553dcd8a9df2..96bf01ba32dd 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -7413,6 +7413,8 @@ static inline void tg3_netif_start(struct tg3 *tp) | |||
7413 | } | 7413 | } |
7414 | 7414 | ||
7415 | static void tg3_irq_quiesce(struct tg3 *tp) | 7415 | static void tg3_irq_quiesce(struct tg3 *tp) |
7416 | __releases(tp->lock) | ||
7417 | __acquires(tp->lock) | ||
7416 | { | 7418 | { |
7417 | int i; | 7419 | int i; |
7418 | 7420 | ||
@@ -7421,8 +7423,12 @@ static void tg3_irq_quiesce(struct tg3 *tp) | |||
7421 | tp->irq_sync = 1; | 7423 | tp->irq_sync = 1; |
7422 | smp_mb(); | 7424 | smp_mb(); |
7423 | 7425 | ||
7426 | spin_unlock_bh(&tp->lock); | ||
7427 | |||
7424 | for (i = 0; i < tp->irq_cnt; i++) | 7428 | for (i = 0; i < tp->irq_cnt; i++) |
7425 | synchronize_irq(tp->napi[i].irq_vec); | 7429 | synchronize_irq(tp->napi[i].irq_vec); |
7430 | |||
7431 | spin_lock_bh(&tp->lock); | ||
7426 | } | 7432 | } |
7427 | 7433 | ||
7428 | /* Fully shutdown all tg3 driver activity elsewhere in the system. | 7434 | /* Fully shutdown all tg3 driver activity elsewhere in the system. |
@@ -9018,6 +9024,8 @@ static void tg3_restore_clk(struct tg3 *tp) | |||
9018 | 9024 | ||
9019 | /* tp->lock is held. */ | 9025 | /* tp->lock is held. */ |
9020 | static int tg3_chip_reset(struct tg3 *tp) | 9026 | static int tg3_chip_reset(struct tg3 *tp) |
9027 | __releases(tp->lock) | ||
9028 | __acquires(tp->lock) | ||
9021 | { | 9029 | { |
9022 | u32 val; | 9030 | u32 val; |
9023 | void (*write_op)(struct tg3 *, u32, u32); | 9031 | void (*write_op)(struct tg3 *, u32, u32); |
@@ -9073,9 +9081,13 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
9073 | } | 9081 | } |
9074 | smp_mb(); | 9082 | smp_mb(); |
9075 | 9083 | ||
9084 | tg3_full_unlock(tp); | ||
9085 | |||
9076 | for (i = 0; i < tp->irq_cnt; i++) | 9086 | for (i = 0; i < tp->irq_cnt; i++) |
9077 | synchronize_irq(tp->napi[i].irq_vec); | 9087 | synchronize_irq(tp->napi[i].irq_vec); |
9078 | 9088 | ||
9089 | tg3_full_lock(tp, 0); | ||
9090 | |||
9079 | if (tg3_asic_rev(tp) == ASIC_REV_57780) { | 9091 | if (tg3_asic_rev(tp) == ASIC_REV_57780) { |
9080 | val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN; | 9092 | val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN; |
9081 | tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS); | 9093 | tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS); |
@@ -10903,11 +10915,13 @@ static void tg3_timer(unsigned long __opaque) | |||
10903 | { | 10915 | { |
10904 | struct tg3 *tp = (struct tg3 *) __opaque; | 10916 | struct tg3 *tp = (struct tg3 *) __opaque; |
10905 | 10917 | ||
10906 | if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) | ||
10907 | goto restart_timer; | ||
10908 | |||
10909 | spin_lock(&tp->lock); | 10918 | spin_lock(&tp->lock); |
10910 | 10919 | ||
10920 | if (tp->irq_sync || tg3_flag(tp, RESET_TASK_PENDING)) { | ||
10921 | spin_unlock(&tp->lock); | ||
10922 | goto restart_timer; | ||
10923 | } | ||
10924 | |||
10911 | if (tg3_asic_rev(tp) == ASIC_REV_5717 || | 10925 | if (tg3_asic_rev(tp) == ASIC_REV_5717 || |
10912 | tg3_flag(tp, 57765_CLASS)) | 10926 | tg3_flag(tp, 57765_CLASS)) |
10913 | tg3_chk_missed_msi(tp); | 10927 | tg3_chk_missed_msi(tp); |
@@ -11101,11 +11115,13 @@ static void tg3_reset_task(struct work_struct *work) | |||
11101 | struct tg3 *tp = container_of(work, struct tg3, reset_task); | 11115 | struct tg3 *tp = container_of(work, struct tg3, reset_task); |
11102 | int err; | 11116 | int err; |
11103 | 11117 | ||
11118 | rtnl_lock(); | ||
11104 | tg3_full_lock(tp, 0); | 11119 | tg3_full_lock(tp, 0); |
11105 | 11120 | ||
11106 | if (!netif_running(tp->dev)) { | 11121 | if (!netif_running(tp->dev)) { |
11107 | tg3_flag_clear(tp, RESET_TASK_PENDING); | 11122 | tg3_flag_clear(tp, RESET_TASK_PENDING); |
11108 | tg3_full_unlock(tp); | 11123 | tg3_full_unlock(tp); |
11124 | rtnl_unlock(); | ||
11109 | return; | 11125 | return; |
11110 | } | 11126 | } |
11111 | 11127 | ||
@@ -11138,6 +11154,7 @@ out: | |||
11138 | tg3_phy_start(tp); | 11154 | tg3_phy_start(tp); |
11139 | 11155 | ||
11140 | tg3_flag_clear(tp, RESET_TASK_PENDING); | 11156 | tg3_flag_clear(tp, RESET_TASK_PENDING); |
11157 | rtnl_unlock(); | ||
11141 | } | 11158 | } |
11142 | 11159 | ||
11143 | static int tg3_request_irq(struct tg3 *tp, int irq_num) | 11160 | static int tg3_request_irq(struct tg3 *tp, int irq_num) |
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c index 55eb7f2af2b4..7ef55f5fa664 100644 --- a/drivers/net/ethernet/cadence/at91_ether.c +++ b/drivers/net/ethernet/cadence/at91_ether.c | |||
@@ -340,7 +340,7 @@ static int __init at91ether_probe(struct platform_device *pdev) | |||
340 | res = PTR_ERR(lp->pclk); | 340 | res = PTR_ERR(lp->pclk); |
341 | goto err_free_dev; | 341 | goto err_free_dev; |
342 | } | 342 | } |
343 | clk_enable(lp->pclk); | 343 | clk_prepare_enable(lp->pclk); |
344 | 344 | ||
345 | lp->hclk = ERR_PTR(-ENOENT); | 345 | lp->hclk = ERR_PTR(-ENOENT); |
346 | lp->tx_clk = ERR_PTR(-ENOENT); | 346 | lp->tx_clk = ERR_PTR(-ENOENT); |
@@ -406,7 +406,7 @@ static int __init at91ether_probe(struct platform_device *pdev) | |||
406 | err_out_unregister_netdev: | 406 | err_out_unregister_netdev: |
407 | unregister_netdev(dev); | 407 | unregister_netdev(dev); |
408 | err_disable_clock: | 408 | err_disable_clock: |
409 | clk_disable(lp->pclk); | 409 | clk_disable_unprepare(lp->pclk); |
410 | err_free_dev: | 410 | err_free_dev: |
411 | free_netdev(dev); | 411 | free_netdev(dev); |
412 | return res; | 412 | return res; |
@@ -424,7 +424,7 @@ static int at91ether_remove(struct platform_device *pdev) | |||
424 | kfree(lp->mii_bus->irq); | 424 | kfree(lp->mii_bus->irq); |
425 | mdiobus_free(lp->mii_bus); | 425 | mdiobus_free(lp->mii_bus); |
426 | unregister_netdev(dev); | 426 | unregister_netdev(dev); |
427 | clk_disable(lp->pclk); | 427 | clk_disable_unprepare(lp->pclk); |
428 | free_netdev(dev); | 428 | free_netdev(dev); |
429 | 429 | ||
430 | return 0; | 430 | return 0; |
@@ -440,7 +440,7 @@ static int at91ether_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
440 | netif_stop_queue(net_dev); | 440 | netif_stop_queue(net_dev); |
441 | netif_device_detach(net_dev); | 441 | netif_device_detach(net_dev); |
442 | 442 | ||
443 | clk_disable(lp->pclk); | 443 | clk_disable_unprepare(lp->pclk); |
444 | } | 444 | } |
445 | return 0; | 445 | return 0; |
446 | } | 446 | } |
@@ -451,7 +451,7 @@ static int at91ether_resume(struct platform_device *pdev) | |||
451 | struct macb *lp = netdev_priv(net_dev); | 451 | struct macb *lp = netdev_priv(net_dev); |
452 | 452 | ||
453 | if (netif_running(net_dev)) { | 453 | if (netif_running(net_dev)) { |
454 | clk_enable(lp->pclk); | 454 | clk_prepare_enable(lp->pclk); |
455 | 455 | ||
456 | netif_device_attach(net_dev); | 456 | netif_device_attach(net_dev); |
457 | netif_start_queue(net_dev); | 457 | netif_start_queue(net_dev); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 2215d432a059..a936ee8958c7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -2430,7 +2430,7 @@ static void cfg_queues(struct adapter *adapter) | |||
2430 | */ | 2430 | */ |
2431 | n10g = 0; | 2431 | n10g = 0; |
2432 | for_each_port(adapter, pidx) | 2432 | for_each_port(adapter, pidx) |
2433 | n10g += is_10g_port(&adap2pinfo(adapter, pidx)->link_cfg); | 2433 | n10g += is_x_10g_port(&adap2pinfo(adapter, pidx)->link_cfg); |
2434 | 2434 | ||
2435 | /* | 2435 | /* |
2436 | * We default to 1 queue per non-10G port and up to # of cores queues | 2436 | * We default to 1 queue per non-10G port and up to # of cores queues |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c index 21dc9a20308c..60426cf890a7 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c | |||
@@ -323,6 +323,8 @@ int t4vf_port_init(struct adapter *adapter, int pidx) | |||
323 | return v; | 323 | return v; |
324 | 324 | ||
325 | v = be32_to_cpu(port_rpl.u.info.lstatus_to_modtype); | 325 | v = be32_to_cpu(port_rpl.u.info.lstatus_to_modtype); |
326 | pi->mdio_addr = (v & FW_PORT_CMD_MDIOCAP_F) ? | ||
327 | FW_PORT_CMD_MDIOADDR_G(v) : -1; | ||
326 | pi->port_type = FW_PORT_CMD_PTYPE_G(v); | 328 | pi->port_type = FW_PORT_CMD_PTYPE_G(v); |
327 | pi->mod_type = FW_PORT_MOD_TYPE_NA; | 329 | pi->mod_type = FW_PORT_MOD_TYPE_NA; |
328 | 330 | ||
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 705f334ebb85..b29e027c476e 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -1616,7 +1616,7 @@ static int enic_open(struct net_device *netdev) | |||
1616 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { | 1616 | if (vnic_rq_desc_used(&enic->rq[i]) == 0) { |
1617 | netdev_err(netdev, "Unable to alloc receive buffers\n"); | 1617 | netdev_err(netdev, "Unable to alloc receive buffers\n"); |
1618 | err = -ENOMEM; | 1618 | err = -ENOMEM; |
1619 | goto err_out_notify_unset; | 1619 | goto err_out_free_rq; |
1620 | } | 1620 | } |
1621 | } | 1621 | } |
1622 | 1622 | ||
@@ -1649,7 +1649,9 @@ static int enic_open(struct net_device *netdev) | |||
1649 | 1649 | ||
1650 | return 0; | 1650 | return 0; |
1651 | 1651 | ||
1652 | err_out_notify_unset: | 1652 | err_out_free_rq: |
1653 | for (i = 0; i < enic->rq_count; i++) | ||
1654 | vnic_rq_clean(&enic->rq[i], enic_free_rq_buf); | ||
1653 | enic_dev_notify_unset(enic); | 1655 | enic_dev_notify_unset(enic); |
1654 | err_out_free_intr: | 1656 | err_out_free_intr: |
1655 | enic_free_intr(enic); | 1657 | enic_free_intr(enic); |
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c index a379c3e4b57f..13d00a38a5bd 100644 --- a/drivers/net/ethernet/dnet.c +++ b/drivers/net/ethernet/dnet.c | |||
@@ -398,13 +398,8 @@ static int dnet_poll(struct napi_struct *napi, int budget) | |||
398 | * break out of while loop if there are no more | 398 | * break out of while loop if there are no more |
399 | * packets waiting | 399 | * packets waiting |
400 | */ | 400 | */ |
401 | if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16)) { | 401 | if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16)) |
402 | napi_complete(napi); | 402 | break; |
403 | int_enable = dnet_readl(bp, INTR_ENB); | ||
404 | int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF; | ||
405 | dnet_writel(bp, int_enable, INTR_ENB); | ||
406 | return 0; | ||
407 | } | ||
408 | 403 | ||
409 | cmd_word = dnet_readl(bp, RX_LEN_FIFO); | 404 | cmd_word = dnet_readl(bp, RX_LEN_FIFO); |
410 | pkt_len = cmd_word & 0xFFFF; | 405 | pkt_len = cmd_word & 0xFFFF; |
@@ -433,20 +428,17 @@ static int dnet_poll(struct napi_struct *napi, int budget) | |||
433 | "size %u.\n", dev->name, pkt_len); | 428 | "size %u.\n", dev->name, pkt_len); |
434 | } | 429 | } |
435 | 430 | ||
436 | budget -= npackets; | ||
437 | |||
438 | if (npackets < budget) { | 431 | if (npackets < budget) { |
439 | /* We processed all packets available. Tell NAPI it can | 432 | /* We processed all packets available. Tell NAPI it can |
440 | * stop polling then re-enable rx interrupts */ | 433 | * stop polling then re-enable rx interrupts. |
434 | */ | ||
441 | napi_complete(napi); | 435 | napi_complete(napi); |
442 | int_enable = dnet_readl(bp, INTR_ENB); | 436 | int_enable = dnet_readl(bp, INTR_ENB); |
443 | int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF; | 437 | int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF; |
444 | dnet_writel(bp, int_enable, INTR_ENB); | 438 | dnet_writel(bp, int_enable, INTR_ENB); |
445 | return 0; | ||
446 | } | 439 | } |
447 | 440 | ||
448 | /* There are still packets waiting */ | 441 | return npackets; |
449 | return 1; | ||
450 | } | 442 | } |
451 | 443 | ||
452 | static irqreturn_t dnet_interrupt(int irq, void *dev_id) | 444 | static irqreturn_t dnet_interrupt(int irq, void *dev_id) |
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 469691ad4a1e..40132929daf7 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h | |||
@@ -424,6 +424,8 @@ struct bufdesc_ex { | |||
424 | * (40ns * 6). | 424 | * (40ns * 6). |
425 | */ | 425 | */ |
426 | #define FEC_QUIRK_BUG_CAPTURE (1 << 10) | 426 | #define FEC_QUIRK_BUG_CAPTURE (1 << 10) |
427 | /* Controller has only one MDIO bus */ | ||
428 | #define FEC_QUIRK_SINGLE_MDIO (1 << 11) | ||
427 | 429 | ||
428 | struct fec_enet_priv_tx_q { | 430 | struct fec_enet_priv_tx_q { |
429 | int index; | 431 | int index; |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 5ebdf8dc8a31..bba87775419d 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -91,7 +91,8 @@ static struct platform_device_id fec_devtype[] = { | |||
91 | .driver_data = 0, | 91 | .driver_data = 0, |
92 | }, { | 92 | }, { |
93 | .name = "imx28-fec", | 93 | .name = "imx28-fec", |
94 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME, | 94 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME | |
95 | FEC_QUIRK_SINGLE_MDIO, | ||
95 | }, { | 96 | }, { |
96 | .name = "imx6q-fec", | 97 | .name = "imx6q-fec", |
97 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | | 98 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | |
@@ -1937,7 +1938,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) | |||
1937 | int err = -ENXIO, i; | 1938 | int err = -ENXIO, i; |
1938 | 1939 | ||
1939 | /* | 1940 | /* |
1940 | * The dual fec interfaces are not equivalent with enet-mac. | 1941 | * The i.MX28 dual fec interfaces are not equal. |
1941 | * Here are the differences: | 1942 | * Here are the differences: |
1942 | * | 1943 | * |
1943 | * - fec0 supports MII & RMII modes while fec1 only supports RMII | 1944 | * - fec0 supports MII & RMII modes while fec1 only supports RMII |
@@ -1952,7 +1953,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) | |||
1952 | * mdio interface in board design, and need to be configured by | 1953 | * mdio interface in board design, and need to be configured by |
1953 | * fec0 mii_bus. | 1954 | * fec0 mii_bus. |
1954 | */ | 1955 | */ |
1955 | if ((fep->quirks & FEC_QUIRK_ENET_MAC) && fep->dev_id > 0) { | 1956 | if ((fep->quirks & FEC_QUIRK_SINGLE_MDIO) && fep->dev_id > 0) { |
1956 | /* fec1 uses fec0 mii_bus */ | 1957 | /* fec1 uses fec0 mii_bus */ |
1957 | if (mii_cnt && fec0_mii_bus) { | 1958 | if (mii_cnt && fec0_mii_bus) { |
1958 | fep->mii_bus = fec0_mii_bus; | 1959 | fep->mii_bus = fec0_mii_bus; |
@@ -2015,7 +2016,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) | |||
2015 | mii_cnt++; | 2016 | mii_cnt++; |
2016 | 2017 | ||
2017 | /* save fec0 mii_bus */ | 2018 | /* save fec0 mii_bus */ |
2018 | if (fep->quirks & FEC_QUIRK_ENET_MAC) | 2019 | if (fep->quirks & FEC_QUIRK_SINGLE_MDIO) |
2019 | fec0_mii_bus = fep->mii_bus; | 2020 | fec0_mii_bus = fep->mii_bus; |
2020 | 2021 | ||
2021 | return 0; | 2022 | return 0; |
@@ -3129,6 +3130,7 @@ fec_probe(struct platform_device *pdev) | |||
3129 | pdev->id_entry = of_id->data; | 3130 | pdev->id_entry = of_id->data; |
3130 | fep->quirks = pdev->id_entry->driver_data; | 3131 | fep->quirks = pdev->id_entry->driver_data; |
3131 | 3132 | ||
3133 | fep->netdev = ndev; | ||
3132 | fep->num_rx_queues = num_rx_qs; | 3134 | fep->num_rx_queues = num_rx_qs; |
3133 | fep->num_tx_queues = num_tx_qs; | 3135 | fep->num_tx_queues = num_tx_qs; |
3134 | 3136 | ||
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig index 5b8300a32bf5..4d61ef50b465 100644 --- a/drivers/net/ethernet/intel/Kconfig +++ b/drivers/net/ethernet/intel/Kconfig | |||
@@ -281,6 +281,17 @@ config I40E_DCB | |||
281 | 281 | ||
282 | If unsure, say N. | 282 | If unsure, say N. |
283 | 283 | ||
284 | config I40E_FCOE | ||
285 | bool "Fibre Channel over Ethernet (FCoE)" | ||
286 | default n | ||
287 | depends on I40E && DCB && FCOE | ||
288 | ---help--- | ||
289 | Say Y here if you want to use Fibre Channel over Ethernet (FCoE) | ||
290 | in the driver. This will create new netdev for exclusive FCoE | ||
291 | use with XL710 FCoE offloads enabled. | ||
292 | |||
293 | If unsure, say N. | ||
294 | |||
284 | config I40EVF | 295 | config I40EVF |
285 | tristate "Intel(R) XL710 X710 Virtual Function Ethernet support" | 296 | tristate "Intel(R) XL710 X710 Virtual Function Ethernet support" |
286 | depends on PCI_MSI | 297 | depends on PCI_MSI |
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 781065eb5431..e9c3a87e5b11 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c | |||
@@ -1543,7 +1543,7 @@ static int e100_phy_init(struct nic *nic) | |||
1543 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); | 1543 | mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); |
1544 | } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && | 1544 | } else if ((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && |
1545 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && | 1545 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && |
1546 | !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { | 1546 | (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) { |
1547 | /* enable/disable MDI/MDI-X auto-switching. */ | 1547 | /* enable/disable MDI/MDI-X auto-switching. */ |
1548 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, | 1548 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, |
1549 | nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); | 1549 | nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); |
diff --git a/drivers/net/ethernet/intel/i40e/Makefile b/drivers/net/ethernet/intel/i40e/Makefile index 4b94ddb29c24..c40581999121 100644 --- a/drivers/net/ethernet/intel/i40e/Makefile +++ b/drivers/net/ethernet/intel/i40e/Makefile | |||
@@ -44,4 +44,4 @@ i40e-objs := i40e_main.o \ | |||
44 | i40e_virtchnl_pf.o | 44 | i40e_virtchnl_pf.o |
45 | 45 | ||
46 | i40e-$(CONFIG_I40E_DCB) += i40e_dcb.o i40e_dcb_nl.o | 46 | i40e-$(CONFIG_I40E_DCB) += i40e_dcb.o i40e_dcb_nl.o |
47 | i40e-$(CONFIG_FCOE:m=y) += i40e_fcoe.o | 47 | i40e-$(CONFIG_I40E_FCOE) += i40e_fcoe.o |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index 433a55886ad2..cb0de455683e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c | |||
@@ -829,7 +829,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, | |||
829 | if (desc_n >= ring->count || desc_n < 0) { | 829 | if (desc_n >= ring->count || desc_n < 0) { |
830 | dev_info(&pf->pdev->dev, | 830 | dev_info(&pf->pdev->dev, |
831 | "descriptor %d not found\n", desc_n); | 831 | "descriptor %d not found\n", desc_n); |
832 | return; | 832 | goto out; |
833 | } | 833 | } |
834 | if (!is_rx_ring) { | 834 | if (!is_rx_ring) { |
835 | txd = I40E_TX_DESC(ring, desc_n); | 835 | txd = I40E_TX_DESC(ring, desc_n); |
@@ -855,6 +855,8 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, | |||
855 | } else { | 855 | } else { |
856 | dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); | 856 | dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
857 | } | 857 | } |
858 | |||
859 | out: | ||
858 | kfree(ring); | 860 | kfree(ring); |
859 | } | 861 | } |
860 | 862 | ||
diff --git a/drivers/net/ethernet/intel/i40e/i40e_osdep.h b/drivers/net/ethernet/intel/i40e/i40e_osdep.h index 045b5c4b98b3..ad802dd0f67a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_osdep.h +++ b/drivers/net/ethernet/intel/i40e/i40e_osdep.h | |||
@@ -78,7 +78,7 @@ do { \ | |||
78 | } while (0) | 78 | } while (0) |
79 | 79 | ||
80 | typedef enum i40e_status_code i40e_status; | 80 | typedef enum i40e_status_code i40e_status; |
81 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 81 | #ifdef CONFIG_I40E_FCOE |
82 | #define I40E_FCOE | 82 | #define I40E_FCOE |
83 | #endif /* CONFIG_FCOE or CONFIG_FCOE_MODULE */ | 83 | #endif |
84 | #endif /* _I40E_OSDEP_H_ */ | 84 | #endif /* _I40E_OSDEP_H_ */ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 04b441460bbd..cecb340898fe 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -658,6 +658,8 @@ static inline u32 i40e_get_head(struct i40e_ring *tx_ring) | |||
658 | return le32_to_cpu(*(volatile __le32 *)head); | 658 | return le32_to_cpu(*(volatile __le32 *)head); |
659 | } | 659 | } |
660 | 660 | ||
661 | #define WB_STRIDE 0x3 | ||
662 | |||
661 | /** | 663 | /** |
662 | * i40e_clean_tx_irq - Reclaim resources after transmit completes | 664 | * i40e_clean_tx_irq - Reclaim resources after transmit completes |
663 | * @tx_ring: tx ring to clean | 665 | * @tx_ring: tx ring to clean |
@@ -759,6 +761,18 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget) | |||
759 | tx_ring->q_vector->tx.total_bytes += total_bytes; | 761 | tx_ring->q_vector->tx.total_bytes += total_bytes; |
760 | tx_ring->q_vector->tx.total_packets += total_packets; | 762 | tx_ring->q_vector->tx.total_packets += total_packets; |
761 | 763 | ||
764 | /* check to see if there are any non-cache aligned descriptors | ||
765 | * waiting to be written back, and kick the hardware to force | ||
766 | * them to be written back in case of napi polling | ||
767 | */ | ||
768 | if (budget && | ||
769 | !((i & WB_STRIDE) == WB_STRIDE) && | ||
770 | !test_bit(__I40E_DOWN, &tx_ring->vsi->state) && | ||
771 | (I40E_DESC_UNUSED(tx_ring) != tx_ring->count)) | ||
772 | tx_ring->arm_wb = true; | ||
773 | else | ||
774 | tx_ring->arm_wb = false; | ||
775 | |||
762 | if (check_for_tx_hang(tx_ring) && i40e_check_tx_hang(tx_ring)) { | 776 | if (check_for_tx_hang(tx_ring) && i40e_check_tx_hang(tx_ring)) { |
763 | /* schedule immediate reset if we believe we hung */ | 777 | /* schedule immediate reset if we believe we hung */ |
764 | dev_info(tx_ring->dev, "Detected Tx Unit Hang\n" | 778 | dev_info(tx_ring->dev, "Detected Tx Unit Hang\n" |
@@ -777,13 +791,16 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget) | |||
777 | netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index); | 791 | netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index); |
778 | 792 | ||
779 | dev_info(tx_ring->dev, | 793 | dev_info(tx_ring->dev, |
780 | "tx hang detected on queue %d, resetting adapter\n", | 794 | "tx hang detected on queue %d, reset requested\n", |
781 | tx_ring->queue_index); | 795 | tx_ring->queue_index); |
782 | 796 | ||
783 | tx_ring->netdev->netdev_ops->ndo_tx_timeout(tx_ring->netdev); | 797 | /* do not fire the reset immediately, wait for the stack to |
798 | * decide we are truly stuck, also prevents every queue from | ||
799 | * simultaneously requesting a reset | ||
800 | */ | ||
784 | 801 | ||
785 | /* the adapter is about to reset, no point in enabling stuff */ | 802 | /* the adapter is about to reset, no point in enabling polling */ |
786 | return true; | 803 | budget = 1; |
787 | } | 804 | } |
788 | 805 | ||
789 | netdev_tx_completed_queue(netdev_get_tx_queue(tx_ring->netdev, | 806 | netdev_tx_completed_queue(netdev_get_tx_queue(tx_ring->netdev, |
@@ -806,7 +823,25 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget) | |||
806 | } | 823 | } |
807 | } | 824 | } |
808 | 825 | ||
809 | return budget > 0; | 826 | return !!budget; |
827 | } | ||
828 | |||
829 | /** | ||
830 | * i40e_force_wb - Arm hardware to do a wb on noncache aligned descriptors | ||
831 | * @vsi: the VSI we care about | ||
832 | * @q_vector: the vector on which to force writeback | ||
833 | * | ||
834 | **/ | ||
835 | static void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector) | ||
836 | { | ||
837 | u32 val = I40E_PFINT_DYN_CTLN_INTENA_MASK | | ||
838 | I40E_PFINT_DYN_CTLN_SWINT_TRIG_MASK | | ||
839 | I40E_PFINT_DYN_CTLN_SW_ITR_INDX_ENA_MASK | ||
840 | /* allow 00 to be written to the index */; | ||
841 | |||
842 | wr32(&vsi->back->hw, | ||
843 | I40E_PFINT_DYN_CTLN(q_vector->v_idx + vsi->base_vector - 1), | ||
844 | val); | ||
810 | } | 845 | } |
811 | 846 | ||
812 | /** | 847 | /** |
@@ -1290,9 +1325,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
1290 | * so the total length of IPv4 header is IHL*4 bytes | 1325 | * so the total length of IPv4 header is IHL*4 bytes |
1291 | * The UDP_0 bit *may* bet set if the *inner* header is UDP | 1326 | * The UDP_0 bit *may* bet set if the *inner* header is UDP |
1292 | */ | 1327 | */ |
1293 | if (ipv4_tunnel && | 1328 | if (ipv4_tunnel) { |
1294 | (decoded.inner_prot != I40E_RX_PTYPE_INNER_PROT_UDP) && | ||
1295 | !(rx_status & (1 << I40E_RX_DESC_STATUS_UDP_0_SHIFT))) { | ||
1296 | skb->transport_header = skb->mac_header + | 1329 | skb->transport_header = skb->mac_header + |
1297 | sizeof(struct ethhdr) + | 1330 | sizeof(struct ethhdr) + |
1298 | (ip_hdr(skb)->ihl * 4); | 1331 | (ip_hdr(skb)->ihl * 4); |
@@ -1302,15 +1335,19 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
1302 | skb->protocol == htons(ETH_P_8021AD)) | 1335 | skb->protocol == htons(ETH_P_8021AD)) |
1303 | ? VLAN_HLEN : 0; | 1336 | ? VLAN_HLEN : 0; |
1304 | 1337 | ||
1305 | rx_udp_csum = udp_csum(skb); | 1338 | if ((ip_hdr(skb)->protocol == IPPROTO_UDP) && |
1306 | iph = ip_hdr(skb); | 1339 | (udp_hdr(skb)->check != 0)) { |
1307 | csum = csum_tcpudp_magic( | 1340 | rx_udp_csum = udp_csum(skb); |
1308 | iph->saddr, iph->daddr, | 1341 | iph = ip_hdr(skb); |
1309 | (skb->len - skb_transport_offset(skb)), | 1342 | csum = csum_tcpudp_magic( |
1310 | IPPROTO_UDP, rx_udp_csum); | 1343 | iph->saddr, iph->daddr, |
1344 | (skb->len - skb_transport_offset(skb)), | ||
1345 | IPPROTO_UDP, rx_udp_csum); | ||
1311 | 1346 | ||
1312 | if (udp_hdr(skb)->check != csum) | 1347 | if (udp_hdr(skb)->check != csum) |
1313 | goto checksum_fail; | 1348 | goto checksum_fail; |
1349 | |||
1350 | } /* else its GRE and so no outer UDP header */ | ||
1314 | } | 1351 | } |
1315 | 1352 | ||
1316 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1353 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -1581,6 +1618,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) | |||
1581 | struct i40e_vsi *vsi = q_vector->vsi; | 1618 | struct i40e_vsi *vsi = q_vector->vsi; |
1582 | struct i40e_ring *ring; | 1619 | struct i40e_ring *ring; |
1583 | bool clean_complete = true; | 1620 | bool clean_complete = true; |
1621 | bool arm_wb = false; | ||
1584 | int budget_per_ring; | 1622 | int budget_per_ring; |
1585 | 1623 | ||
1586 | if (test_bit(__I40E_DOWN, &vsi->state)) { | 1624 | if (test_bit(__I40E_DOWN, &vsi->state)) { |
@@ -1591,8 +1629,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) | |||
1591 | /* Since the actual Tx work is minimal, we can give the Tx a larger | 1629 | /* Since the actual Tx work is minimal, we can give the Tx a larger |
1592 | * budget and be more aggressive about cleaning up the Tx descriptors. | 1630 | * budget and be more aggressive about cleaning up the Tx descriptors. |
1593 | */ | 1631 | */ |
1594 | i40e_for_each_ring(ring, q_vector->tx) | 1632 | i40e_for_each_ring(ring, q_vector->tx) { |
1595 | clean_complete &= i40e_clean_tx_irq(ring, vsi->work_limit); | 1633 | clean_complete &= i40e_clean_tx_irq(ring, vsi->work_limit); |
1634 | arm_wb |= ring->arm_wb; | ||
1635 | } | ||
1596 | 1636 | ||
1597 | /* We attempt to distribute budget to each Rx queue fairly, but don't | 1637 | /* We attempt to distribute budget to each Rx queue fairly, but don't |
1598 | * allow the budget to go below 1 because that would exit polling early. | 1638 | * allow the budget to go below 1 because that would exit polling early. |
@@ -1603,8 +1643,11 @@ int i40e_napi_poll(struct napi_struct *napi, int budget) | |||
1603 | clean_complete &= i40e_clean_rx_irq(ring, budget_per_ring); | 1643 | clean_complete &= i40e_clean_rx_irq(ring, budget_per_ring); |
1604 | 1644 | ||
1605 | /* If work not completed, return budget and polling will return */ | 1645 | /* If work not completed, return budget and polling will return */ |
1606 | if (!clean_complete) | 1646 | if (!clean_complete) { |
1647 | if (arm_wb) | ||
1648 | i40e_force_wb(vsi, q_vector); | ||
1607 | return budget; | 1649 | return budget; |
1650 | } | ||
1608 | 1651 | ||
1609 | /* Work is done so exit the polling mode and re-enable the interrupt */ | 1652 | /* Work is done so exit the polling mode and re-enable the interrupt */ |
1610 | napi_complete(napi); | 1653 | napi_complete(napi); |
@@ -1840,17 +1883,16 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
1840 | if (err < 0) | 1883 | if (err < 0) |
1841 | return err; | 1884 | return err; |
1842 | 1885 | ||
1843 | if (protocol == htons(ETH_P_IP)) { | 1886 | iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); |
1844 | iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); | 1887 | ipv6h = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb); |
1888 | |||
1889 | if (iph->version == 4) { | ||
1845 | tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); | 1890 | tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); |
1846 | iph->tot_len = 0; | 1891 | iph->tot_len = 0; |
1847 | iph->check = 0; | 1892 | iph->check = 0; |
1848 | tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, | 1893 | tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, |
1849 | 0, IPPROTO_TCP, 0); | 1894 | 0, IPPROTO_TCP, 0); |
1850 | } else if (skb_is_gso_v6(skb)) { | 1895 | } else if (ipv6h->version == 6) { |
1851 | |||
1852 | ipv6h = skb->encapsulation ? inner_ipv6_hdr(skb) | ||
1853 | : ipv6_hdr(skb); | ||
1854 | tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); | 1896 | tcph = skb->encapsulation ? inner_tcp_hdr(skb) : tcp_hdr(skb); |
1855 | ipv6h->payload_len = 0; | 1897 | ipv6h->payload_len = 0; |
1856 | tcph->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, | 1898 | tcph->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, |
@@ -1946,13 +1988,9 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 tx_flags, | |||
1946 | I40E_TX_CTX_EXT_IP_IPV4_NO_CSUM; | 1988 | I40E_TX_CTX_EXT_IP_IPV4_NO_CSUM; |
1947 | } | 1989 | } |
1948 | } else if (tx_flags & I40E_TX_FLAGS_IPV6) { | 1990 | } else if (tx_flags & I40E_TX_FLAGS_IPV6) { |
1949 | if (tx_flags & I40E_TX_FLAGS_TSO) { | 1991 | *cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV6; |
1950 | *cd_tunneling |= I40E_TX_CTX_EXT_IP_IPV6; | 1992 | if (tx_flags & I40E_TX_FLAGS_TSO) |
1951 | ip_hdr(skb)->check = 0; | 1993 | ip_hdr(skb)->check = 0; |
1952 | } else { | ||
1953 | *cd_tunneling |= | ||
1954 | I40E_TX_CTX_EXT_IP_IPV4_NO_CSUM; | ||
1955 | } | ||
1956 | } | 1994 | } |
1957 | 1995 | ||
1958 | /* Now set the ctx descriptor fields */ | 1996 | /* Now set the ctx descriptor fields */ |
@@ -1962,7 +2000,10 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 tx_flags, | |||
1962 | ((skb_inner_network_offset(skb) - | 2000 | ((skb_inner_network_offset(skb) - |
1963 | skb_transport_offset(skb)) >> 1) << | 2001 | skb_transport_offset(skb)) >> 1) << |
1964 | I40E_TXD_CTX_QW0_NATLEN_SHIFT; | 2002 | I40E_TXD_CTX_QW0_NATLEN_SHIFT; |
1965 | 2003 | if (this_ip_hdr->version == 6) { | |
2004 | tx_flags &= ~I40E_TX_FLAGS_IPV4; | ||
2005 | tx_flags |= I40E_TX_FLAGS_IPV6; | ||
2006 | } | ||
1966 | } else { | 2007 | } else { |
1967 | network_hdr_len = skb_network_header_len(skb); | 2008 | network_hdr_len = skb_network_header_len(skb); |
1968 | this_ip_hdr = ip_hdr(skb); | 2009 | this_ip_hdr = ip_hdr(skb); |
@@ -2198,7 +2239,6 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
2198 | /* Place RS bit on last descriptor of any packet that spans across the | 2239 | /* Place RS bit on last descriptor of any packet that spans across the |
2199 | * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline. | 2240 | * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline. |
2200 | */ | 2241 | */ |
2201 | #define WB_STRIDE 0x3 | ||
2202 | if (((i & WB_STRIDE) != WB_STRIDE) && | 2242 | if (((i & WB_STRIDE) != WB_STRIDE) && |
2203 | (first <= &tx_ring->tx_bi[i]) && | 2243 | (first <= &tx_ring->tx_bi[i]) && |
2204 | (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) { | 2244 | (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) { |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h index e60d3accb2e2..18b00231d2f1 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h | |||
@@ -241,6 +241,7 @@ struct i40e_ring { | |||
241 | unsigned long last_rx_timestamp; | 241 | unsigned long last_rx_timestamp; |
242 | 242 | ||
243 | bool ring_active; /* is ring online or not */ | 243 | bool ring_active; /* is ring online or not */ |
244 | bool arm_wb; /* do something to arm write back */ | ||
244 | 245 | ||
245 | /* stats structs */ | 246 | /* stats structs */ |
246 | struct i40e_queue_stats stats; | 247 | struct i40e_queue_stats stats; |
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 051ea94bdcd3..0f69ef81751a 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c | |||
@@ -1125,7 +1125,7 @@ static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask) | |||
1125 | u32 swmask = mask; | 1125 | u32 swmask = mask; |
1126 | u32 fwmask = mask << 16; | 1126 | u32 fwmask = mask << 16; |
1127 | s32 ret_val = 0; | 1127 | s32 ret_val = 0; |
1128 | s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ | 1128 | s32 i = 0, timeout = 200; |
1129 | 1129 | ||
1130 | while (i < timeout) { | 1130 | while (i < timeout) { |
1131 | if (igb_get_hw_semaphore(hw)) { | 1131 | if (igb_get_hw_semaphore(hw)) { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 943cbd47d832..03e9eb0dc761 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -1829,7 +1829,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
1829 | err = mlx4_dev_cap(dev, &dev_cap); | 1829 | err = mlx4_dev_cap(dev, &dev_cap); |
1830 | if (err) { | 1830 | if (err) { |
1831 | mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); | 1831 | mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting\n"); |
1832 | goto err_stop_fw; | 1832 | return err; |
1833 | } | 1833 | } |
1834 | 1834 | ||
1835 | choose_steering_mode(dev, &dev_cap); | 1835 | choose_steering_mode(dev, &dev_cap); |
@@ -1860,7 +1860,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
1860 | &init_hca); | 1860 | &init_hca); |
1861 | if ((long long) icm_size < 0) { | 1861 | if ((long long) icm_size < 0) { |
1862 | err = icm_size; | 1862 | err = icm_size; |
1863 | goto err_stop_fw; | 1863 | return err; |
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; | 1866 | dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; |
@@ -1874,7 +1874,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
1874 | 1874 | ||
1875 | err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); | 1875 | err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); |
1876 | if (err) | 1876 | if (err) |
1877 | goto err_stop_fw; | 1877 | return err; |
1878 | 1878 | ||
1879 | err = mlx4_INIT_HCA(dev, &init_hca); | 1879 | err = mlx4_INIT_HCA(dev, &init_hca); |
1880 | if (err) { | 1880 | if (err) { |
@@ -1886,7 +1886,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
1886 | err = mlx4_query_func(dev, &dev_cap); | 1886 | err = mlx4_query_func(dev, &dev_cap); |
1887 | if (err < 0) { | 1887 | if (err < 0) { |
1888 | mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); | 1888 | mlx4_err(dev, "QUERY_FUNC command failed, aborting.\n"); |
1889 | goto err_stop_fw; | 1889 | goto err_close; |
1890 | } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { | 1890 | } else if (err & MLX4_QUERY_FUNC_NUM_SYS_EQS) { |
1891 | dev->caps.num_eqs = dev_cap.max_eqs; | 1891 | dev->caps.num_eqs = dev_cap.max_eqs; |
1892 | dev->caps.reserved_eqs = dev_cap.reserved_eqs; | 1892 | dev->caps.reserved_eqs = dev_cap.reserved_eqs; |
@@ -2006,11 +2006,6 @@ err_free_icm: | |||
2006 | if (!mlx4_is_slave(dev)) | 2006 | if (!mlx4_is_slave(dev)) |
2007 | mlx4_free_icms(dev); | 2007 | mlx4_free_icms(dev); |
2008 | 2008 | ||
2009 | err_stop_fw: | ||
2010 | if (!mlx4_is_slave(dev)) { | ||
2011 | mlx4_UNMAP_FA(dev); | ||
2012 | mlx4_free_icm(dev, priv->fw.fw_icm, 0); | ||
2013 | } | ||
2014 | return err; | 2009 | return err; |
2015 | } | 2010 | } |
2016 | 2011 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index d6f549685c0f..7094a9c70fd5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c | |||
@@ -584,6 +584,7 @@ EXPORT_SYMBOL_GPL(mlx4_mr_free); | |||
584 | void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) | 584 | void mlx4_mr_rereg_mem_cleanup(struct mlx4_dev *dev, struct mlx4_mr *mr) |
585 | { | 585 | { |
586 | mlx4_mtt_cleanup(dev, &mr->mtt); | 586 | mlx4_mtt_cleanup(dev, &mr->mtt); |
587 | mr->mtt.order = -1; | ||
587 | } | 588 | } |
588 | EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); | 589 | EXPORT_SYMBOL_GPL(mlx4_mr_rereg_mem_cleanup); |
589 | 590 | ||
@@ -593,14 +594,14 @@ int mlx4_mr_rereg_mem_write(struct mlx4_dev *dev, struct mlx4_mr *mr, | |||
593 | { | 594 | { |
594 | int err; | 595 | int err; |
595 | 596 | ||
596 | mpt_entry->start = cpu_to_be64(iova); | ||
597 | mpt_entry->length = cpu_to_be64(size); | ||
598 | mpt_entry->entity_size = cpu_to_be32(page_shift); | ||
599 | |||
600 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); | 597 | err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); |
601 | if (err) | 598 | if (err) |
602 | return err; | 599 | return err; |
603 | 600 | ||
601 | mpt_entry->start = cpu_to_be64(mr->iova); | ||
602 | mpt_entry->length = cpu_to_be64(mr->size); | ||
603 | mpt_entry->entity_size = cpu_to_be32(mr->mtt.page_shift); | ||
604 | |||
604 | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | | 605 | mpt_entry->pd_flags &= cpu_to_be32(MLX4_MPT_PD_MASK | |
605 | MLX4_MPT_PD_FLAG_EN_INV); | 606 | MLX4_MPT_PD_FLAG_EN_INV); |
606 | mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | | 607 | mpt_entry->flags &= cpu_to_be32(MLX4_MPT_FLAG_FREE | |
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c index af099057f0e9..71af98bb72cb 100644 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c | |||
@@ -4033,8 +4033,10 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4033 | (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | 4033 | (void)pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); |
4034 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), | 4034 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), |
4035 | &mgp->cmd_bus, GFP_KERNEL); | 4035 | &mgp->cmd_bus, GFP_KERNEL); |
4036 | if (mgp->cmd == NULL) | 4036 | if (!mgp->cmd) { |
4037 | status = -ENOMEM; | ||
4037 | goto abort_with_enabled; | 4038 | goto abort_with_enabled; |
4039 | } | ||
4038 | 4040 | ||
4039 | mgp->board_span = pci_resource_len(pdev, 0); | 4041 | mgp->board_span = pci_resource_len(pdev, 0); |
4040 | mgp->iomem_base = pci_resource_start(pdev, 0); | 4042 | mgp->iomem_base = pci_resource_start(pdev, 0); |
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index c2f09af5c25b..4847713211ca 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c | |||
@@ -146,10 +146,7 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev) | |||
146 | { | 146 | { |
147 | int i = 0; | 147 | int i = 0; |
148 | 148 | ||
149 | while (i < 10) { | 149 | do { |
150 | if (i) | ||
151 | ssleep(1); | ||
152 | |||
153 | if (ql_sem_lock(qdev, | 150 | if (ql_sem_lock(qdev, |
154 | QL_DRVR_SEM_MASK, | 151 | QL_DRVR_SEM_MASK, |
155 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) | 152 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) |
@@ -158,7 +155,8 @@ static int ql_wait_for_drvr_lock(struct ql3_adapter *qdev) | |||
158 | "driver lock acquired\n"); | 155 | "driver lock acquired\n"); |
159 | return 1; | 156 | return 1; |
160 | } | 157 | } |
161 | } | 158 | ssleep(1); |
159 | } while (++i < 10); | ||
162 | 160 | ||
163 | netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); | 161 | netdev_err(qdev->ndev, "Timed out waiting for driver lock...\n"); |
164 | return 0; | 162 | return 0; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 9929b97cfb36..2528c3fb6b90 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -2605,6 +2605,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2605 | } else { | 2605 | } else { |
2606 | dev_err(&pdev->dev, | 2606 | dev_err(&pdev->dev, |
2607 | "%s: failed. Please Reboot\n", __func__); | 2607 | "%s: failed. Please Reboot\n", __func__); |
2608 | err = -ENODEV; | ||
2608 | goto err_out_free_hw; | 2609 | goto err_out_free_hw; |
2609 | } | 2610 | } |
2610 | 2611 | ||
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index c29ba80ae02b..37583a9d8853 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -473,6 +473,7 @@ static struct sh_eth_cpu_data r8a777x_data = { | |||
473 | .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE | | 473 | .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE | |
474 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | | 474 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | |
475 | EESR_ECI, | 475 | EESR_ECI, |
476 | .fdr_value = 0x00000f0f, | ||
476 | 477 | ||
477 | .apr = 1, | 478 | .apr = 1, |
478 | .mpr = 1, | 479 | .mpr = 1, |
@@ -495,6 +496,7 @@ static struct sh_eth_cpu_data r8a779x_data = { | |||
495 | .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE | | 496 | .eesr_err_check = EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE | |
496 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | | 497 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | |
497 | EESR_ECI, | 498 | EESR_ECI, |
499 | .fdr_value = 0x00000f0f, | ||
498 | 500 | ||
499 | .apr = 1, | 501 | .apr = 1, |
500 | .mpr = 1, | 502 | .mpr = 1, |
@@ -536,6 +538,8 @@ static struct sh_eth_cpu_data sh7724_data = { | |||
536 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | | 538 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | |
537 | EESR_ECI, | 539 | EESR_ECI, |
538 | 540 | ||
541 | .trscer_err_mask = DESC_I_RINT8, | ||
542 | |||
539 | .apr = 1, | 543 | .apr = 1, |
540 | .mpr = 1, | 544 | .mpr = 1, |
541 | .tpauser = 1, | 545 | .tpauser = 1, |
@@ -856,6 +860,9 @@ static void sh_eth_set_default_cpu_data(struct sh_eth_cpu_data *cd) | |||
856 | 860 | ||
857 | if (!cd->eesr_err_check) | 861 | if (!cd->eesr_err_check) |
858 | cd->eesr_err_check = DEFAULT_EESR_ERR_CHECK; | 862 | cd->eesr_err_check = DEFAULT_EESR_ERR_CHECK; |
863 | |||
864 | if (!cd->trscer_err_mask) | ||
865 | cd->trscer_err_mask = DEFAULT_TRSCER_ERR_MASK; | ||
859 | } | 866 | } |
860 | 867 | ||
861 | static int sh_eth_check_reset(struct net_device *ndev) | 868 | static int sh_eth_check_reset(struct net_device *ndev) |
@@ -1294,7 +1301,7 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start) | |||
1294 | /* Frame recv control (enable multiple-packets per rx irq) */ | 1301 | /* Frame recv control (enable multiple-packets per rx irq) */ |
1295 | sh_eth_write(ndev, RMCR_RNC, RMCR); | 1302 | sh_eth_write(ndev, RMCR_RNC, RMCR); |
1296 | 1303 | ||
1297 | sh_eth_write(ndev, DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2, TRSCER); | 1304 | sh_eth_write(ndev, mdp->cd->trscer_err_mask, TRSCER); |
1298 | 1305 | ||
1299 | if (mdp->cd->bculr) | 1306 | if (mdp->cd->bculr) |
1300 | sh_eth_write(ndev, 0x800, BCULR); /* Burst sycle set */ | 1307 | sh_eth_write(ndev, 0x800, BCULR); /* Burst sycle set */ |
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h index 22301bf9c21d..71f5de1171bd 100644 --- a/drivers/net/ethernet/renesas/sh_eth.h +++ b/drivers/net/ethernet/renesas/sh_eth.h | |||
@@ -369,6 +369,8 @@ enum DESC_I_BIT { | |||
369 | DESC_I_RINT1 = 0x0001, | 369 | DESC_I_RINT1 = 0x0001, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | #define DEFAULT_TRSCER_ERR_MASK (DESC_I_RINT8 | DESC_I_RINT5 | DESC_I_TINT2) | ||
373 | |||
372 | /* RPADIR */ | 374 | /* RPADIR */ |
373 | enum RPADIR_BIT { | 375 | enum RPADIR_BIT { |
374 | RPADIR_PADS1 = 0x20000, RPADIR_PADS0 = 0x10000, | 376 | RPADIR_PADS1 = 0x20000, RPADIR_PADS0 = 0x10000, |
@@ -470,6 +472,9 @@ struct sh_eth_cpu_data { | |||
470 | unsigned long tx_check; | 472 | unsigned long tx_check; |
471 | unsigned long eesr_err_check; | 473 | unsigned long eesr_err_check; |
472 | 474 | ||
475 | /* Error mask */ | ||
476 | unsigned long trscer_err_mask; | ||
477 | |||
473 | /* hardware features */ | 478 | /* hardware features */ |
474 | unsigned long irq_flags; /* IRQ configuration flags */ | 479 | unsigned long irq_flags; /* IRQ configuration flags */ |
475 | unsigned no_psr:1; /* EtherC DO NOT have PSR */ | 480 | unsigned no_psr:1; /* EtherC DO NOT have PSR */ |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index c560f9aeb55d..64d1cef4cda1 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -610,7 +610,7 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) | |||
610 | 610 | ||
611 | /* Clear all mcast from ALE */ | 611 | /* Clear all mcast from ALE */ |
612 | cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS << | 612 | cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS << |
613 | priv->host_port); | 613 | priv->host_port, -1); |
614 | 614 | ||
615 | /* Flood All Unicast Packets to Host port */ | 615 | /* Flood All Unicast Packets to Host port */ |
616 | cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); | 616 | cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); |
@@ -634,6 +634,12 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) | |||
634 | static void cpsw_ndo_set_rx_mode(struct net_device *ndev) | 634 | static void cpsw_ndo_set_rx_mode(struct net_device *ndev) |
635 | { | 635 | { |
636 | struct cpsw_priv *priv = netdev_priv(ndev); | 636 | struct cpsw_priv *priv = netdev_priv(ndev); |
637 | int vid; | ||
638 | |||
639 | if (priv->data.dual_emac) | ||
640 | vid = priv->slaves[priv->emac_port].port_vlan; | ||
641 | else | ||
642 | vid = priv->data.default_vlan; | ||
637 | 643 | ||
638 | if (ndev->flags & IFF_PROMISC) { | 644 | if (ndev->flags & IFF_PROMISC) { |
639 | /* Enable promiscuous mode */ | 645 | /* Enable promiscuous mode */ |
@@ -649,7 +655,8 @@ static void cpsw_ndo_set_rx_mode(struct net_device *ndev) | |||
649 | cpsw_ale_set_allmulti(priv->ale, priv->ndev->flags & IFF_ALLMULTI); | 655 | cpsw_ale_set_allmulti(priv->ale, priv->ndev->flags & IFF_ALLMULTI); |
650 | 656 | ||
651 | /* Clear all mcast from ALE */ | 657 | /* Clear all mcast from ALE */ |
652 | cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port); | 658 | cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port, |
659 | vid); | ||
653 | 660 | ||
654 | if (!netdev_mc_empty(ndev)) { | 661 | if (!netdev_mc_empty(ndev)) { |
655 | struct netdev_hw_addr *ha; | 662 | struct netdev_hw_addr *ha; |
@@ -757,6 +764,14 @@ requeue: | |||
757 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) | 764 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) |
758 | { | 765 | { |
759 | struct cpsw_priv *priv = dev_id; | 766 | struct cpsw_priv *priv = dev_id; |
767 | int value = irq - priv->irqs_table[0]; | ||
768 | |||
769 | /* NOTICE: Ending IRQ here. The trick with the 'value' variable above | ||
770 | * is to make sure we will always write the correct value to the EOI | ||
771 | * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2 | ||
772 | * for TX Interrupt and 3 for MISC Interrupt. | ||
773 | */ | ||
774 | cpdma_ctlr_eoi(priv->dma, value); | ||
760 | 775 | ||
761 | cpsw_intr_disable(priv); | 776 | cpsw_intr_disable(priv); |
762 | if (priv->irq_enabled == true) { | 777 | if (priv->irq_enabled == true) { |
@@ -786,8 +801,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget) | |||
786 | int num_tx, num_rx; | 801 | int num_tx, num_rx; |
787 | 802 | ||
788 | num_tx = cpdma_chan_process(priv->txch, 128); | 803 | num_tx = cpdma_chan_process(priv->txch, 128); |
789 | if (num_tx) | ||
790 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
791 | 804 | ||
792 | num_rx = cpdma_chan_process(priv->rxch, budget); | 805 | num_rx = cpdma_chan_process(priv->rxch, budget); |
793 | if (num_rx < budget) { | 806 | if (num_rx < budget) { |
@@ -795,7 +808,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget) | |||
795 | 808 | ||
796 | napi_complete(napi); | 809 | napi_complete(napi); |
797 | cpsw_intr_enable(priv); | 810 | cpsw_intr_enable(priv); |
798 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
799 | prim_cpsw = cpsw_get_slave_priv(priv, 0); | 811 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
800 | if (prim_cpsw->irq_enabled == false) { | 812 | if (prim_cpsw->irq_enabled == false) { |
801 | prim_cpsw->irq_enabled = true; | 813 | prim_cpsw->irq_enabled = true; |
@@ -1310,8 +1322,6 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
1310 | napi_enable(&priv->napi); | 1322 | napi_enable(&priv->napi); |
1311 | cpdma_ctlr_start(priv->dma); | 1323 | cpdma_ctlr_start(priv->dma); |
1312 | cpsw_intr_enable(priv); | 1324 | cpsw_intr_enable(priv); |
1313 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
1314 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
1315 | 1325 | ||
1316 | prim_cpsw = cpsw_get_slave_priv(priv, 0); | 1326 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
1317 | if (prim_cpsw->irq_enabled == false) { | 1327 | if (prim_cpsw->irq_enabled == false) { |
@@ -1578,9 +1588,6 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev) | |||
1578 | cpdma_chan_start(priv->txch); | 1588 | cpdma_chan_start(priv->txch); |
1579 | cpdma_ctlr_int_ctrl(priv->dma, true); | 1589 | cpdma_ctlr_int_ctrl(priv->dma, true); |
1580 | cpsw_intr_enable(priv); | 1590 | cpsw_intr_enable(priv); |
1581 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
1582 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
1583 | |||
1584 | } | 1591 | } |
1585 | 1592 | ||
1586 | static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) | 1593 | static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p) |
@@ -1620,9 +1627,6 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev) | |||
1620 | cpsw_interrupt(ndev->irq, priv); | 1627 | cpsw_interrupt(ndev->irq, priv); |
1621 | cpdma_ctlr_int_ctrl(priv->dma, true); | 1628 | cpdma_ctlr_int_ctrl(priv->dma, true); |
1622 | cpsw_intr_enable(priv); | 1629 | cpsw_intr_enable(priv); |
1623 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
1624 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
1625 | |||
1626 | } | 1630 | } |
1627 | #endif | 1631 | #endif |
1628 | 1632 | ||
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 097ebe7077ac..5246b3a18ff8 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c | |||
@@ -234,7 +234,7 @@ static void cpsw_ale_flush_mcast(struct cpsw_ale *ale, u32 *ale_entry, | |||
234 | cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE); | 234 | cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE); |
235 | } | 235 | } |
236 | 236 | ||
237 | int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask) | 237 | int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid) |
238 | { | 238 | { |
239 | u32 ale_entry[ALE_ENTRY_WORDS]; | 239 | u32 ale_entry[ALE_ENTRY_WORDS]; |
240 | int ret, idx; | 240 | int ret, idx; |
@@ -245,6 +245,14 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask) | |||
245 | if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR) | 245 | if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR) |
246 | continue; | 246 | continue; |
247 | 247 | ||
248 | /* if vid passed is -1 then remove all multicast entry from | ||
249 | * the table irrespective of vlan id, if a valid vlan id is | ||
250 | * passed then remove only multicast added to that vlan id. | ||
251 | * if vlan id doesn't match then move on to next entry. | ||
252 | */ | ||
253 | if (vid != -1 && cpsw_ale_get_vlan_id(ale_entry) != vid) | ||
254 | continue; | ||
255 | |||
248 | if (cpsw_ale_get_mcast(ale_entry)) { | 256 | if (cpsw_ale_get_mcast(ale_entry)) { |
249 | u8 addr[6]; | 257 | u8 addr[6]; |
250 | 258 | ||
diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h index c0d4127aa549..af1e7ecd87c6 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.h +++ b/drivers/net/ethernet/ti/cpsw_ale.h | |||
@@ -92,7 +92,7 @@ void cpsw_ale_stop(struct cpsw_ale *ale); | |||
92 | 92 | ||
93 | int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout); | 93 | int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout); |
94 | int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask); | 94 | int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask); |
95 | int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask); | 95 | int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid); |
96 | int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, | 96 | int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, |
97 | int flags, u16 vid); | 97 | int flags, u16 vid); |
98 | int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port, | 98 | int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port, |
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 9c2d91ea0af4..dbcbf0c5bcfa 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c | |||
@@ -1043,6 +1043,7 @@ static int temac_of_probe(struct platform_device *op) | |||
1043 | lp->regs = of_iomap(op->dev.of_node, 0); | 1043 | lp->regs = of_iomap(op->dev.of_node, 0); |
1044 | if (!lp->regs) { | 1044 | if (!lp->regs) { |
1045 | dev_err(&op->dev, "could not map temac regs.\n"); | 1045 | dev_err(&op->dev, "could not map temac regs.\n"); |
1046 | rc = -ENOMEM; | ||
1046 | goto nodev; | 1047 | goto nodev; |
1047 | } | 1048 | } |
1048 | 1049 | ||
@@ -1062,6 +1063,7 @@ static int temac_of_probe(struct platform_device *op) | |||
1062 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); | 1063 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); |
1063 | if (!np) { | 1064 | if (!np) { |
1064 | dev_err(&op->dev, "could not find DMA node\n"); | 1065 | dev_err(&op->dev, "could not find DMA node\n"); |
1066 | rc = -ENODEV; | ||
1065 | goto err_iounmap; | 1067 | goto err_iounmap; |
1066 | } | 1068 | } |
1067 | 1069 | ||
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index c18a0c637c44..a6d2860b712c 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c | |||
@@ -1501,6 +1501,7 @@ static int axienet_of_probe(struct platform_device *op) | |||
1501 | lp->regs = of_iomap(op->dev.of_node, 0); | 1501 | lp->regs = of_iomap(op->dev.of_node, 0); |
1502 | if (!lp->regs) { | 1502 | if (!lp->regs) { |
1503 | dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); | 1503 | dev_err(&op->dev, "could not map Axi Ethernet regs.\n"); |
1504 | ret = -ENOMEM; | ||
1504 | goto nodev; | 1505 | goto nodev; |
1505 | } | 1506 | } |
1506 | /* Setup checksum offload, but default to off if not specified */ | 1507 | /* Setup checksum offload, but default to off if not specified */ |
@@ -1563,6 +1564,7 @@ static int axienet_of_probe(struct platform_device *op) | |||
1563 | np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); | 1564 | np = of_parse_phandle(op->dev.of_node, "axistream-connected", 0); |
1564 | if (!np) { | 1565 | if (!np) { |
1565 | dev_err(&op->dev, "could not find DMA node\n"); | 1566 | dev_err(&op->dev, "could not find DMA node\n"); |
1567 | ret = -ENODEV; | ||
1566 | goto err_iounmap; | 1568 | goto err_iounmap; |
1567 | } | 1569 | } |
1568 | lp->dma_regs = of_iomap(np, 0); | 1570 | lp->dma_regs = of_iomap(np, 0); |
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 24858799c204..9d4ce388510a 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c | |||
@@ -1109,6 +1109,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev) | |||
1109 | res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); | 1109 | res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); |
1110 | if (!res) { | 1110 | if (!res) { |
1111 | dev_err(dev, "no IRQ found\n"); | 1111 | dev_err(dev, "no IRQ found\n"); |
1112 | rc = -ENXIO; | ||
1112 | goto error; | 1113 | goto error; |
1113 | } | 1114 | } |
1114 | 1115 | ||
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 93e224217e24..f7ff493f1e73 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -629,6 +629,7 @@ static int team_change_mode(struct team *team, const char *kind) | |||
629 | static void team_notify_peers_work(struct work_struct *work) | 629 | static void team_notify_peers_work(struct work_struct *work) |
630 | { | 630 | { |
631 | struct team *team; | 631 | struct team *team; |
632 | int val; | ||
632 | 633 | ||
633 | team = container_of(work, struct team, notify_peers.dw.work); | 634 | team = container_of(work, struct team, notify_peers.dw.work); |
634 | 635 | ||
@@ -636,9 +637,14 @@ static void team_notify_peers_work(struct work_struct *work) | |||
636 | schedule_delayed_work(&team->notify_peers.dw, 0); | 637 | schedule_delayed_work(&team->notify_peers.dw, 0); |
637 | return; | 638 | return; |
638 | } | 639 | } |
640 | val = atomic_dec_if_positive(&team->notify_peers.count_pending); | ||
641 | if (val < 0) { | ||
642 | rtnl_unlock(); | ||
643 | return; | ||
644 | } | ||
639 | call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev); | 645 | call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev); |
640 | rtnl_unlock(); | 646 | rtnl_unlock(); |
641 | if (!atomic_dec_and_test(&team->notify_peers.count_pending)) | 647 | if (val) |
642 | schedule_delayed_work(&team->notify_peers.dw, | 648 | schedule_delayed_work(&team->notify_peers.dw, |
643 | msecs_to_jiffies(team->notify_peers.interval)); | 649 | msecs_to_jiffies(team->notify_peers.interval)); |
644 | } | 650 | } |
@@ -669,6 +675,7 @@ static void team_notify_peers_fini(struct team *team) | |||
669 | static void team_mcast_rejoin_work(struct work_struct *work) | 675 | static void team_mcast_rejoin_work(struct work_struct *work) |
670 | { | 676 | { |
671 | struct team *team; | 677 | struct team *team; |
678 | int val; | ||
672 | 679 | ||
673 | team = container_of(work, struct team, mcast_rejoin.dw.work); | 680 | team = container_of(work, struct team, mcast_rejoin.dw.work); |
674 | 681 | ||
@@ -676,9 +683,14 @@ static void team_mcast_rejoin_work(struct work_struct *work) | |||
676 | schedule_delayed_work(&team->mcast_rejoin.dw, 0); | 683 | schedule_delayed_work(&team->mcast_rejoin.dw, 0); |
677 | return; | 684 | return; |
678 | } | 685 | } |
686 | val = atomic_dec_if_positive(&team->mcast_rejoin.count_pending); | ||
687 | if (val < 0) { | ||
688 | rtnl_unlock(); | ||
689 | return; | ||
690 | } | ||
679 | call_netdevice_notifiers(NETDEV_RESEND_IGMP, team->dev); | 691 | call_netdevice_notifiers(NETDEV_RESEND_IGMP, team->dev); |
680 | rtnl_unlock(); | 692 | rtnl_unlock(); |
681 | if (!atomic_dec_and_test(&team->mcast_rejoin.count_pending)) | 693 | if (val) |
682 | schedule_delayed_work(&team->mcast_rejoin.dw, | 694 | schedule_delayed_work(&team->mcast_rejoin.dw, |
683 | msecs_to_jiffies(team->mcast_rejoin.interval)); | 695 | msecs_to_jiffies(team->mcast_rejoin.interval)); |
684 | } | 696 | } |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index dcb6d33141e0..1e9cdca37014 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -1276,7 +1276,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length) | |||
1276 | awd.done = 0; | 1276 | awd.done = 0; |
1277 | 1277 | ||
1278 | urb->context = &awd; | 1278 | urb->context = &awd; |
1279 | status = usb_submit_urb(urb, GFP_NOIO); | 1279 | status = usb_submit_urb(urb, GFP_ATOMIC); |
1280 | if (status) { | 1280 | if (status) { |
1281 | // something went wrong | 1281 | // something went wrong |
1282 | usb_free_urb(urb); | 1282 | usb_free_urb(urb); |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b8a82b86f909..602dc6668c3a 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -56,6 +56,8 @@ struct qmi_wwan_state { | |||
56 | /* default ethernet address used by the modem */ | 56 | /* default ethernet address used by the modem */ |
57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; | 57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; |
58 | 58 | ||
59 | static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; | ||
60 | |||
59 | /* Make up an ethernet header if the packet doesn't have one. | 61 | /* Make up an ethernet header if the packet doesn't have one. |
60 | * | 62 | * |
61 | * A firmware bug common among several devices cause them to send raw | 63 | * A firmware bug common among several devices cause them to send raw |
@@ -332,10 +334,12 @@ next_desc: | |||
332 | usb_driver_release_interface(driver, info->data); | 334 | usb_driver_release_interface(driver, info->data); |
333 | } | 335 | } |
334 | 336 | ||
335 | /* Never use the same address on both ends of the link, even | 337 | /* Never use the same address on both ends of the link, even if the |
336 | * if the buggy firmware told us to. | 338 | * buggy firmware told us to. Or, if device is assigned the well-known |
339 | * buggy firmware MAC address, replace it with a random address, | ||
337 | */ | 340 | */ |
338 | if (ether_addr_equal(dev->net->dev_addr, default_modem_addr)) | 341 | if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) || |
342 | ether_addr_equal(dev->net->dev_addr, buggy_fw_addr)) | ||
339 | eth_hw_addr_random(dev->net); | 343 | eth_hw_addr_random(dev->net); |
340 | 344 | ||
341 | /* make MAC addr easily distinguishable from an IP header */ | 345 | /* make MAC addr easily distinguishable from an IP header */ |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2d1c77e81836..57ec23e8ccfa 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -1897,6 +1897,22 @@ static void _rtl8152_set_rx_mode(struct net_device *netdev) | |||
1897 | netif_wake_queue(netdev); | 1897 | netif_wake_queue(netdev); |
1898 | } | 1898 | } |
1899 | 1899 | ||
1900 | static netdev_features_t | ||
1901 | rtl8152_features_check(struct sk_buff *skb, struct net_device *dev, | ||
1902 | netdev_features_t features) | ||
1903 | { | ||
1904 | u32 mss = skb_shinfo(skb)->gso_size; | ||
1905 | int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX; | ||
1906 | int offset = skb_transport_offset(skb); | ||
1907 | |||
1908 | if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset) | ||
1909 | features &= ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | ||
1910 | else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz) | ||
1911 | features &= ~NETIF_F_GSO_MASK; | ||
1912 | |||
1913 | return features; | ||
1914 | } | ||
1915 | |||
1900 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, | 1916 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, |
1901 | struct net_device *netdev) | 1917 | struct net_device *netdev) |
1902 | { | 1918 | { |
@@ -3706,6 +3722,7 @@ static const struct net_device_ops rtl8152_netdev_ops = { | |||
3706 | .ndo_set_mac_address = rtl8152_set_mac_address, | 3722 | .ndo_set_mac_address = rtl8152_set_mac_address, |
3707 | .ndo_change_mtu = rtl8152_change_mtu, | 3723 | .ndo_change_mtu = rtl8152_change_mtu, |
3708 | .ndo_validate_addr = eth_validate_addr, | 3724 | .ndo_validate_addr = eth_validate_addr, |
3725 | .ndo_features_check = rtl8152_features_check, | ||
3709 | }; | 3726 | }; |
3710 | 3727 | ||
3711 | static void r8152b_get_version(struct r8152 *tp) | 3728 | static void r8152b_get_version(struct r8152 *tp) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c index e5be2d21868f..a5f9198d5747 100644 --- a/drivers/net/wireless/iwlwifi/iwl-7000.c +++ b/drivers/net/wireless/iwlwifi/iwl-7000.c | |||
@@ -69,8 +69,8 @@ | |||
69 | #include "iwl-agn-hw.h" | 69 | #include "iwl-agn-hw.h" |
70 | 70 | ||
71 | /* Highest firmware API version supported */ | 71 | /* Highest firmware API version supported */ |
72 | #define IWL7260_UCODE_API_MAX 10 | 72 | #define IWL7260_UCODE_API_MAX 12 |
73 | #define IWL3160_UCODE_API_MAX 10 | 73 | #define IWL3160_UCODE_API_MAX 12 |
74 | 74 | ||
75 | /* Oldest version we won't warn about */ | 75 | /* Oldest version we won't warn about */ |
76 | #define IWL7260_UCODE_API_OK 10 | 76 | #define IWL7260_UCODE_API_OK 10 |
@@ -105,7 +105,7 @@ | |||
105 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" | 105 | #define IWL7265_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" |
106 | 106 | ||
107 | #define IWL7265D_FW_PRE "iwlwifi-7265D-" | 107 | #define IWL7265D_FW_PRE "iwlwifi-7265D-" |
108 | #define IWL7265D_MODULE_FIRMWARE(api) IWL7265_FW_PRE __stringify(api) ".ucode" | 108 | #define IWL7265D_MODULE_FIRMWARE(api) IWL7265D_FW_PRE __stringify(api) ".ucode" |
109 | 109 | ||
110 | #define NVM_HW_SECTION_NUM_FAMILY_7000 0 | 110 | #define NVM_HW_SECTION_NUM_FAMILY_7000 0 |
111 | 111 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c index bf0a95cb7153..3668fc57e770 100644 --- a/drivers/net/wireless/iwlwifi/iwl-8000.c +++ b/drivers/net/wireless/iwlwifi/iwl-8000.c | |||
@@ -69,7 +69,7 @@ | |||
69 | #include "iwl-agn-hw.h" | 69 | #include "iwl-agn-hw.h" |
70 | 70 | ||
71 | /* Highest firmware API version supported */ | 71 | /* Highest firmware API version supported */ |
72 | #define IWL8000_UCODE_API_MAX 10 | 72 | #define IWL8000_UCODE_API_MAX 12 |
73 | 73 | ||
74 | /* Oldest version we won't warn about */ | 74 | /* Oldest version we won't warn about */ |
75 | #define IWL8000_UCODE_API_OK 10 | 75 | #define IWL8000_UCODE_API_OK 10 |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h index f2a047f6bb3e..1bbe4fc47b97 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h | |||
@@ -243,6 +243,9 @@ enum iwl_ucode_tlv_flag { | |||
243 | * @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif. | 243 | * @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif. |
244 | * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time | 244 | * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time |
245 | * longer than the passive one, which is essential for fragmented scan. | 245 | * longer than the passive one, which is essential for fragmented scan. |
246 | * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command, | ||
247 | * regardless of the band or the number of the probes. FW will calculate | ||
248 | * the actual dwell time. | ||
246 | */ | 249 | */ |
247 | enum iwl_ucode_tlv_api { | 250 | enum iwl_ucode_tlv_api { |
248 | IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), | 251 | IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), |
@@ -253,6 +256,7 @@ enum iwl_ucode_tlv_api { | |||
253 | IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6), | 256 | IWL_UCODE_TLV_API_LMAC_SCAN = BIT(6), |
254 | IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF = BIT(7), | 257 | IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF = BIT(7), |
255 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8), | 258 | IWL_UCODE_TLV_API_FRAGMENTED_SCAN = BIT(8), |
259 | IWL_UCODE_TLV_API_BASIC_DWELL = BIT(13), | ||
256 | }; | 260 | }; |
257 | 261 | ||
258 | /** | 262 | /** |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h index 1f2acf47bfb2..201846de94e7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | |||
@@ -672,6 +672,7 @@ struct iwl_scan_channel_opt { | |||
672 | * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented | 672 | * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented |
673 | * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report | 673 | * @IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report |
674 | * and DS parameter set IEs into probe requests. | 674 | * and DS parameter set IEs into probe requests. |
675 | * @IWL_MVM_LMAC_SCAN_FLAG_MATCH: Send match found notification on matches | ||
675 | */ | 676 | */ |
676 | enum iwl_mvm_lmac_scan_flags { | 677 | enum iwl_mvm_lmac_scan_flags { |
677 | IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0), | 678 | IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0), |
@@ -681,6 +682,7 @@ enum iwl_mvm_lmac_scan_flags { | |||
681 | IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4), | 682 | IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4), |
682 | IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5), | 683 | IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5), |
683 | IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6), | 684 | IWL_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED = BIT(6), |
685 | IWL_MVM_LMAC_SCAN_FLAG_MATCH = BIT(9), | ||
684 | }; | 686 | }; |
685 | 687 | ||
686 | enum iwl_scan_priority { | 688 | enum iwl_scan_priority { |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index e5294d01181e..ec9a8e7bae1d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -171,15 +171,21 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_ssid_ie *cmd_ssid, | |||
171 | * already included in the probe template, so we need to set only | 171 | * already included in the probe template, so we need to set only |
172 | * req->n_ssids - 1 bits in addition to the first bit. | 172 | * req->n_ssids - 1 bits in addition to the first bit. |
173 | */ | 173 | */ |
174 | static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) | 174 | static u16 iwl_mvm_get_active_dwell(struct iwl_mvm *mvm, |
175 | enum ieee80211_band band, int n_ssids) | ||
175 | { | 176 | { |
177 | if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BASIC_DWELL) | ||
178 | return 10; | ||
176 | if (band == IEEE80211_BAND_2GHZ) | 179 | if (band == IEEE80211_BAND_2GHZ) |
177 | return 20 + 3 * (n_ssids + 1); | 180 | return 20 + 3 * (n_ssids + 1); |
178 | return 10 + 2 * (n_ssids + 1); | 181 | return 10 + 2 * (n_ssids + 1); |
179 | } | 182 | } |
180 | 183 | ||
181 | static u16 iwl_mvm_get_passive_dwell(enum ieee80211_band band) | 184 | static u16 iwl_mvm_get_passive_dwell(struct iwl_mvm *mvm, |
185 | enum ieee80211_band band) | ||
182 | { | 186 | { |
187 | if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BASIC_DWELL) | ||
188 | return 110; | ||
183 | return band == IEEE80211_BAND_2GHZ ? 100 + 20 : 100 + 10; | 189 | return band == IEEE80211_BAND_2GHZ ? 100 + 20 : 100 + 10; |
184 | } | 190 | } |
185 | 191 | ||
@@ -331,7 +337,8 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, | |||
331 | */ | 337 | */ |
332 | if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { | 338 | if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { |
333 | u32 passive_dwell = | 339 | u32 passive_dwell = |
334 | iwl_mvm_get_passive_dwell(IEEE80211_BAND_2GHZ); | 340 | iwl_mvm_get_passive_dwell(mvm, |
341 | IEEE80211_BAND_2GHZ); | ||
335 | params->max_out_time = passive_dwell; | 342 | params->max_out_time = passive_dwell; |
336 | } else { | 343 | } else { |
337 | params->passive_fragmented = true; | 344 | params->passive_fragmented = true; |
@@ -348,8 +355,8 @@ not_bound: | |||
348 | params->dwell[band].passive = frag_passive_dwell; | 355 | params->dwell[band].passive = frag_passive_dwell; |
349 | else | 356 | else |
350 | params->dwell[band].passive = | 357 | params->dwell[band].passive = |
351 | iwl_mvm_get_passive_dwell(band); | 358 | iwl_mvm_get_passive_dwell(mvm, band); |
352 | params->dwell[band].active = iwl_mvm_get_active_dwell(band, | 359 | params->dwell[band].active = iwl_mvm_get_active_dwell(mvm, band, |
353 | n_ssids); | 360 | n_ssids); |
354 | } | 361 | } |
355 | } | 362 | } |
@@ -1448,6 +1455,8 @@ int iwl_mvm_unified_sched_scan_lmac(struct iwl_mvm *mvm, | |||
1448 | 1455 | ||
1449 | if (iwl_mvm_scan_pass_all(mvm, req)) | 1456 | if (iwl_mvm_scan_pass_all(mvm, req)) |
1450 | flags |= IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL; | 1457 | flags |= IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL; |
1458 | else | ||
1459 | flags |= IWL_MVM_LMAC_SCAN_FLAG_MATCH; | ||
1451 | 1460 | ||
1452 | if (req->n_ssids == 1 && req->ssids[0].ssid_len != 0) | 1461 | if (req->n_ssids == 1 && req->ssids[0].ssid_len != 0) |
1453 | flags |= IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION; | 1462 | flags |= IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c index 4f15d9decc81..4333306ccdee 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c | |||
@@ -108,8 +108,12 @@ void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb, | |||
108 | tx_flags &= ~TX_CMD_FLG_SEQ_CTL; | 108 | tx_flags &= ~TX_CMD_FLG_SEQ_CTL; |
109 | } | 109 | } |
110 | 110 | ||
111 | /* tid_tspec will default to 0 = BE when QOS isn't enabled */ | 111 | /* Default to 0 (BE) when tid_spec is set to IWL_TID_NON_QOS */ |
112 | ac = tid_to_mac80211_ac[tx_cmd->tid_tspec]; | 112 | if (tx_cmd->tid_tspec < IWL_MAX_TID_COUNT) |
113 | ac = tid_to_mac80211_ac[tx_cmd->tid_tspec]; | ||
114 | else | ||
115 | ac = tid_to_mac80211_ac[0]; | ||
116 | |||
113 | tx_flags |= iwl_mvm_bt_coex_tx_prio(mvm, hdr, info, ac) << | 117 | tx_flags |= iwl_mvm_bt_coex_tx_prio(mvm, hdr, info, ac) << |
114 | TX_CMD_FLG_BT_PRIO_POS; | 118 | TX_CMD_FLG_BT_PRIO_POS; |
115 | 119 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c index e56e77ef5d2e..917431e30f74 100644 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c | |||
@@ -665,7 +665,7 @@ bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm) | |||
665 | if (num_of_ant(mvm->fw->valid_rx_ant) == 1) | 665 | if (num_of_ant(mvm->fw->valid_rx_ant) == 1) |
666 | return false; | 666 | return false; |
667 | 667 | ||
668 | if (!mvm->cfg->rx_with_siso_diversity) | 668 | if (mvm->cfg->rx_with_siso_diversity) |
669 | return false; | 669 | return false; |
670 | 670 | ||
671 | ieee80211_iterate_active_interfaces_atomic( | 671 | ieee80211_iterate_active_interfaces_atomic( |
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index 2f0c4b170344..d5aadb00dd9e 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -527,8 +527,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
527 | else if (cfg == &iwl7265_n_cfg) | 527 | else if (cfg == &iwl7265_n_cfg) |
528 | cfg_7265d = &iwl7265d_n_cfg; | 528 | cfg_7265d = &iwl7265d_n_cfg; |
529 | if (cfg_7265d && | 529 | if (cfg_7265d && |
530 | (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D) | 530 | (iwl_trans->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_7265D) { |
531 | cfg = cfg_7265d; | 531 | cfg = cfg_7265d; |
532 | iwl_trans->cfg = cfg_7265d; | ||
533 | } | ||
532 | #endif | 534 | #endif |
533 | 535 | ||
534 | pci_set_drvdata(pdev, iwl_trans); | 536 | pci_set_drvdata(pdev, iwl_trans); |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 846a2e6e34d8..c70efb9a6e78 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -666,7 +666,8 @@ tx_status_ok: | |||
666 | } | 666 | } |
667 | 667 | ||
668 | static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, | 668 | static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, |
669 | u8 *entry, int rxring_idx, int desc_idx) | 669 | struct sk_buff *new_skb, u8 *entry, |
670 | int rxring_idx, int desc_idx) | ||
670 | { | 671 | { |
671 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 672 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
672 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 673 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
@@ -674,11 +675,15 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, | |||
674 | u8 tmp_one = 1; | 675 | u8 tmp_one = 1; |
675 | struct sk_buff *skb; | 676 | struct sk_buff *skb; |
676 | 677 | ||
678 | if (likely(new_skb)) { | ||
679 | skb = new_skb; | ||
680 | goto remap; | ||
681 | } | ||
677 | skb = dev_alloc_skb(rtlpci->rxbuffersize); | 682 | skb = dev_alloc_skb(rtlpci->rxbuffersize); |
678 | if (!skb) | 683 | if (!skb) |
679 | return 0; | 684 | return 0; |
680 | rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; | ||
681 | 685 | ||
686 | remap: | ||
682 | /* just set skb->cb to mapping addr for pci_unmap_single use */ | 687 | /* just set skb->cb to mapping addr for pci_unmap_single use */ |
683 | *((dma_addr_t *)skb->cb) = | 688 | *((dma_addr_t *)skb->cb) = |
684 | pci_map_single(rtlpci->pdev, skb_tail_pointer(skb), | 689 | pci_map_single(rtlpci->pdev, skb_tail_pointer(skb), |
@@ -686,6 +691,7 @@ static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, | |||
686 | bufferaddress = *((dma_addr_t *)skb->cb); | 691 | bufferaddress = *((dma_addr_t *)skb->cb); |
687 | if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) | 692 | if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) |
688 | return 0; | 693 | return 0; |
694 | rtlpci->rx_ring[rxring_idx].rx_buf[desc_idx] = skb; | ||
689 | if (rtlpriv->use_new_trx_flow) { | 695 | if (rtlpriv->use_new_trx_flow) { |
690 | rtlpriv->cfg->ops->set_desc(hw, (u8 *)entry, false, | 696 | rtlpriv->cfg->ops->set_desc(hw, (u8 *)entry, false, |
691 | HW_DESC_RX_PREPARE, | 697 | HW_DESC_RX_PREPARE, |
@@ -781,6 +787,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
781 | /*rx pkt */ | 787 | /*rx pkt */ |
782 | struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[ | 788 | struct sk_buff *skb = rtlpci->rx_ring[rxring_idx].rx_buf[ |
783 | rtlpci->rx_ring[rxring_idx].idx]; | 789 | rtlpci->rx_ring[rxring_idx].idx]; |
790 | struct sk_buff *new_skb; | ||
784 | 791 | ||
785 | if (rtlpriv->use_new_trx_flow) { | 792 | if (rtlpriv->use_new_trx_flow) { |
786 | rx_remained_cnt = | 793 | rx_remained_cnt = |
@@ -807,6 +814,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
807 | pci_unmap_single(rtlpci->pdev, *((dma_addr_t *)skb->cb), | 814 | pci_unmap_single(rtlpci->pdev, *((dma_addr_t *)skb->cb), |
808 | rtlpci->rxbuffersize, PCI_DMA_FROMDEVICE); | 815 | rtlpci->rxbuffersize, PCI_DMA_FROMDEVICE); |
809 | 816 | ||
817 | /* get a new skb - if fail, old one will be reused */ | ||
818 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | ||
819 | if (unlikely(!new_skb)) { | ||
820 | pr_err("Allocation of new skb failed in %s\n", | ||
821 | __func__); | ||
822 | goto no_new; | ||
823 | } | ||
810 | if (rtlpriv->use_new_trx_flow) { | 824 | if (rtlpriv->use_new_trx_flow) { |
811 | buffer_desc = | 825 | buffer_desc = |
812 | &rtlpci->rx_ring[rxring_idx].buffer_desc | 826 | &rtlpci->rx_ring[rxring_idx].buffer_desc |
@@ -911,14 +925,16 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
911 | schedule_work(&rtlpriv->works.lps_change_work); | 925 | schedule_work(&rtlpriv->works.lps_change_work); |
912 | } | 926 | } |
913 | end: | 927 | end: |
928 | skb = new_skb; | ||
929 | no_new: | ||
914 | if (rtlpriv->use_new_trx_flow) { | 930 | if (rtlpriv->use_new_trx_flow) { |
915 | _rtl_pci_init_one_rxdesc(hw, (u8 *)buffer_desc, | 931 | _rtl_pci_init_one_rxdesc(hw, skb, (u8 *)buffer_desc, |
916 | rxring_idx, | 932 | rxring_idx, |
917 | rtlpci->rx_ring[rxring_idx].idx); | 933 | rtlpci->rx_ring[rxring_idx].idx); |
918 | } else { | 934 | } else { |
919 | _rtl_pci_init_one_rxdesc(hw, (u8 *)pdesc, rxring_idx, | 935 | _rtl_pci_init_one_rxdesc(hw, skb, (u8 *)pdesc, |
936 | rxring_idx, | ||
920 | rtlpci->rx_ring[rxring_idx].idx); | 937 | rtlpci->rx_ring[rxring_idx].idx); |
921 | |||
922 | if (rtlpci->rx_ring[rxring_idx].idx == | 938 | if (rtlpci->rx_ring[rxring_idx].idx == |
923 | rtlpci->rxringcount - 1) | 939 | rtlpci->rxringcount - 1) |
924 | rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc, | 940 | rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc, |
@@ -1307,7 +1323,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) | |||
1307 | rtlpci->rx_ring[rxring_idx].idx = 0; | 1323 | rtlpci->rx_ring[rxring_idx].idx = 0; |
1308 | for (i = 0; i < rtlpci->rxringcount; i++) { | 1324 | for (i = 0; i < rtlpci->rxringcount; i++) { |
1309 | entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i]; | 1325 | entry = &rtlpci->rx_ring[rxring_idx].buffer_desc[i]; |
1310 | if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, | 1326 | if (!_rtl_pci_init_one_rxdesc(hw, NULL, (u8 *)entry, |
1311 | rxring_idx, i)) | 1327 | rxring_idx, i)) |
1312 | return -ENOMEM; | 1328 | return -ENOMEM; |
1313 | } | 1329 | } |
@@ -1332,7 +1348,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx) | |||
1332 | 1348 | ||
1333 | for (i = 0; i < rtlpci->rxringcount; i++) { | 1349 | for (i = 0; i < rtlpci->rxringcount; i++) { |
1334 | entry = &rtlpci->rx_ring[rxring_idx].desc[i]; | 1350 | entry = &rtlpci->rx_ring[rxring_idx].desc[i]; |
1335 | if (!_rtl_pci_init_one_rxdesc(hw, (u8 *)entry, | 1351 | if (!_rtl_pci_init_one_rxdesc(hw, NULL, (u8 *)entry, |
1336 | rxring_idx, i)) | 1352 | rxring_idx, i)) |
1337 | return -ENOMEM; | 1353 | return -ENOMEM; |
1338 | } | 1354 | } |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index efbaf2ae1999..794204e34fba 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -737,6 +737,7 @@ static void connect(struct backend_info *be) | |||
737 | } | 737 | } |
738 | 738 | ||
739 | queue->remaining_credit = credit_bytes; | 739 | queue->remaining_credit = credit_bytes; |
740 | queue->credit_usec = credit_usec; | ||
740 | 741 | ||
741 | err = connect_rings(be, queue); | 742 | err = connect_rings(be, queue); |
742 | if (err) { | 743 | if (err) { |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 22bcb4e12e2a..d8c10764f130 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -88,10 +88,8 @@ struct netfront_cb { | |||
88 | #define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3) | 88 | #define IRQ_NAME_SIZE (QUEUE_NAME_SIZE + 3) |
89 | 89 | ||
90 | struct netfront_stats { | 90 | struct netfront_stats { |
91 | u64 rx_packets; | 91 | u64 packets; |
92 | u64 tx_packets; | 92 | u64 bytes; |
93 | u64 rx_bytes; | ||
94 | u64 tx_bytes; | ||
95 | struct u64_stats_sync syncp; | 93 | struct u64_stats_sync syncp; |
96 | }; | 94 | }; |
97 | 95 | ||
@@ -160,7 +158,8 @@ struct netfront_info { | |||
160 | struct netfront_queue *queues; | 158 | struct netfront_queue *queues; |
161 | 159 | ||
162 | /* Statistics */ | 160 | /* Statistics */ |
163 | struct netfront_stats __percpu *stats; | 161 | struct netfront_stats __percpu *rx_stats; |
162 | struct netfront_stats __percpu *tx_stats; | ||
164 | 163 | ||
165 | atomic_t rx_gso_checksum_fixup; | 164 | atomic_t rx_gso_checksum_fixup; |
166 | }; | 165 | }; |
@@ -565,7 +564,7 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
565 | { | 564 | { |
566 | unsigned short id; | 565 | unsigned short id; |
567 | struct netfront_info *np = netdev_priv(dev); | 566 | struct netfront_info *np = netdev_priv(dev); |
568 | struct netfront_stats *stats = this_cpu_ptr(np->stats); | 567 | struct netfront_stats *tx_stats = this_cpu_ptr(np->tx_stats); |
569 | struct xen_netif_tx_request *tx; | 568 | struct xen_netif_tx_request *tx; |
570 | char *data = skb->data; | 569 | char *data = skb->data; |
571 | RING_IDX i; | 570 | RING_IDX i; |
@@ -672,10 +671,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
672 | if (notify) | 671 | if (notify) |
673 | notify_remote_via_irq(queue->tx_irq); | 672 | notify_remote_via_irq(queue->tx_irq); |
674 | 673 | ||
675 | u64_stats_update_begin(&stats->syncp); | 674 | u64_stats_update_begin(&tx_stats->syncp); |
676 | stats->tx_bytes += skb->len; | 675 | tx_stats->bytes += skb->len; |
677 | stats->tx_packets++; | 676 | tx_stats->packets++; |
678 | u64_stats_update_end(&stats->syncp); | 677 | u64_stats_update_end(&tx_stats->syncp); |
679 | 678 | ||
680 | /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */ | 679 | /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */ |
681 | xennet_tx_buf_gc(queue); | 680 | xennet_tx_buf_gc(queue); |
@@ -931,7 +930,7 @@ static int checksum_setup(struct net_device *dev, struct sk_buff *skb) | |||
931 | static int handle_incoming_queue(struct netfront_queue *queue, | 930 | static int handle_incoming_queue(struct netfront_queue *queue, |
932 | struct sk_buff_head *rxq) | 931 | struct sk_buff_head *rxq) |
933 | { | 932 | { |
934 | struct netfront_stats *stats = this_cpu_ptr(queue->info->stats); | 933 | struct netfront_stats *rx_stats = this_cpu_ptr(queue->info->rx_stats); |
935 | int packets_dropped = 0; | 934 | int packets_dropped = 0; |
936 | struct sk_buff *skb; | 935 | struct sk_buff *skb; |
937 | 936 | ||
@@ -952,10 +951,10 @@ static int handle_incoming_queue(struct netfront_queue *queue, | |||
952 | continue; | 951 | continue; |
953 | } | 952 | } |
954 | 953 | ||
955 | u64_stats_update_begin(&stats->syncp); | 954 | u64_stats_update_begin(&rx_stats->syncp); |
956 | stats->rx_packets++; | 955 | rx_stats->packets++; |
957 | stats->rx_bytes += skb->len; | 956 | rx_stats->bytes += skb->len; |
958 | u64_stats_update_end(&stats->syncp); | 957 | u64_stats_update_end(&rx_stats->syncp); |
959 | 958 | ||
960 | /* Pass it up. */ | 959 | /* Pass it up. */ |
961 | napi_gro_receive(&queue->napi, skb); | 960 | napi_gro_receive(&queue->napi, skb); |
@@ -1079,18 +1078,22 @@ static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev, | |||
1079 | int cpu; | 1078 | int cpu; |
1080 | 1079 | ||
1081 | for_each_possible_cpu(cpu) { | 1080 | for_each_possible_cpu(cpu) { |
1082 | struct netfront_stats *stats = per_cpu_ptr(np->stats, cpu); | 1081 | struct netfront_stats *rx_stats = per_cpu_ptr(np->rx_stats, cpu); |
1082 | struct netfront_stats *tx_stats = per_cpu_ptr(np->tx_stats, cpu); | ||
1083 | u64 rx_packets, rx_bytes, tx_packets, tx_bytes; | 1083 | u64 rx_packets, rx_bytes, tx_packets, tx_bytes; |
1084 | unsigned int start; | 1084 | unsigned int start; |
1085 | 1085 | ||
1086 | do { | 1086 | do { |
1087 | start = u64_stats_fetch_begin_irq(&stats->syncp); | 1087 | start = u64_stats_fetch_begin_irq(&tx_stats->syncp); |
1088 | tx_packets = tx_stats->packets; | ||
1089 | tx_bytes = tx_stats->bytes; | ||
1090 | } while (u64_stats_fetch_retry_irq(&tx_stats->syncp, start)); | ||
1088 | 1091 | ||
1089 | rx_packets = stats->rx_packets; | 1092 | do { |
1090 | tx_packets = stats->tx_packets; | 1093 | start = u64_stats_fetch_begin_irq(&rx_stats->syncp); |
1091 | rx_bytes = stats->rx_bytes; | 1094 | rx_packets = rx_stats->packets; |
1092 | tx_bytes = stats->tx_bytes; | 1095 | rx_bytes = rx_stats->bytes; |
1093 | } while (u64_stats_fetch_retry_irq(&stats->syncp, start)); | 1096 | } while (u64_stats_fetch_retry_irq(&rx_stats->syncp, start)); |
1094 | 1097 | ||
1095 | tot->rx_packets += rx_packets; | 1098 | tot->rx_packets += rx_packets; |
1096 | tot->tx_packets += tx_packets; | 1099 | tot->tx_packets += tx_packets; |
@@ -1275,6 +1278,15 @@ static const struct net_device_ops xennet_netdev_ops = { | |||
1275 | #endif | 1278 | #endif |
1276 | }; | 1279 | }; |
1277 | 1280 | ||
1281 | static void xennet_free_netdev(struct net_device *netdev) | ||
1282 | { | ||
1283 | struct netfront_info *np = netdev_priv(netdev); | ||
1284 | |||
1285 | free_percpu(np->rx_stats); | ||
1286 | free_percpu(np->tx_stats); | ||
1287 | free_netdev(netdev); | ||
1288 | } | ||
1289 | |||
1278 | static struct net_device *xennet_create_dev(struct xenbus_device *dev) | 1290 | static struct net_device *xennet_create_dev(struct xenbus_device *dev) |
1279 | { | 1291 | { |
1280 | int err; | 1292 | int err; |
@@ -1295,8 +1307,11 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) | |||
1295 | np->queues = NULL; | 1307 | np->queues = NULL; |
1296 | 1308 | ||
1297 | err = -ENOMEM; | 1309 | err = -ENOMEM; |
1298 | np->stats = netdev_alloc_pcpu_stats(struct netfront_stats); | 1310 | np->rx_stats = netdev_alloc_pcpu_stats(struct netfront_stats); |
1299 | if (np->stats == NULL) | 1311 | if (np->rx_stats == NULL) |
1312 | goto exit; | ||
1313 | np->tx_stats = netdev_alloc_pcpu_stats(struct netfront_stats); | ||
1314 | if (np->tx_stats == NULL) | ||
1300 | goto exit; | 1315 | goto exit; |
1301 | 1316 | ||
1302 | netdev->netdev_ops = &xennet_netdev_ops; | 1317 | netdev->netdev_ops = &xennet_netdev_ops; |
@@ -1327,7 +1342,7 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) | |||
1327 | return netdev; | 1342 | return netdev; |
1328 | 1343 | ||
1329 | exit: | 1344 | exit: |
1330 | free_netdev(netdev); | 1345 | xennet_free_netdev(netdev); |
1331 | return ERR_PTR(err); | 1346 | return ERR_PTR(err); |
1332 | } | 1347 | } |
1333 | 1348 | ||
@@ -1369,7 +1384,7 @@ static int netfront_probe(struct xenbus_device *dev, | |||
1369 | return 0; | 1384 | return 0; |
1370 | 1385 | ||
1371 | fail: | 1386 | fail: |
1372 | free_netdev(netdev); | 1387 | xennet_free_netdev(netdev); |
1373 | dev_set_drvdata(&dev->dev, NULL); | 1388 | dev_set_drvdata(&dev->dev, NULL); |
1374 | return err; | 1389 | return err; |
1375 | } | 1390 | } |
@@ -2189,9 +2204,7 @@ static int xennet_remove(struct xenbus_device *dev) | |||
2189 | info->queues = NULL; | 2204 | info->queues = NULL; |
2190 | } | 2205 | } |
2191 | 2206 | ||
2192 | free_percpu(info->stats); | 2207 | xennet_free_netdev(info->netdev); |
2193 | |||
2194 | free_netdev(info->netdev); | ||
2195 | 2208 | ||
2196 | return 0; | 2209 | return 0; |
2197 | } | 2210 | } |