diff options
Diffstat (limited to 'drivers/net/ethernet')
32 files changed, 220 insertions, 122 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 | ||