History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller: 1) mlx4 driver bug fixes (TX queue wakeups, csum complete indications) from Ido Shamay, Eran Ben Elisha, and Or Gerlitz. 2) Missing unlock in error path of PTP support in renesas driver, from Dan Carpenter. 3) Add Vitesse 8641 phy IDs to vitesse PHY driver, from Shaohui Xie. 4) Bnx2x driver bug fixes (linearization of encap packets, scratchpad parity error notifications, flow-control and speed settings) from Yuval Mintz, Manish Chopra, Shahed Shaikh, and Ariel Elior. 5) ipv6 extension header parsing in the igb chip has a HW errata, disable it. Frm Todd Fujinaka. 6) Fix PCI link state locking issue in e1000e driver, from Yanir Lubetkin. 7) Cure panics during MTU change in i40e, from Mitch Williams. 8) Don't leak promisc refs in DSA slave driver, from Gilad Ben-Yossef. 9) Add missing HAS_DMA dep to VIA Rhine driver, from Geery Uytterhoeven. 10) Make sure DMA map/unmap calls are symmetric in bnx2x driver, from Michal Schmidt. 11) Workaround for MDIO access problems in bcm7xxx devices, from FLorian Fainelli. 12) Fix races in SCTP protocol between OTTB responses and route removals, from Alexander Sverdlin. 13) Fix jumbo frame checksum issue with some mvneta devices, from Simon Guinot. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (58 commits) sock_diag: don't broadcast kernel sockets net: mvneta: disable IP checksum with jumbo frames for Armada 370 ARM: mvebu: update Ethernet compatible string for Armada XP net: mvneta: introduce compatible string "marvell, armada-xp-neta" api: fix compatibility of linux/in.h with netinet/in.h net: icplus: fix typo in constant name sis900: Trivial: Fix typos in enums stmmac: Trivial: fix typo in constant name sctp: Fix race between OOTB responce and route removal net-Liquidio: Delete unnecessary checks before the function call "vfree" vmxnet3: Bump up driver version number amd-xgbe: Add the __GFP_NOWARN flag to Rx buffer allocation net: phy: mdio-bcm-unimac: workaround initial read failures for integrated PHYs net: bcmgenet: workaround initial read failures for integrated PHYs net: phy: bcm7xxx: workaround MDIO management controller initial read bnx2x: fix DMA API usage net: via: VIA_RHINE and VIA_VELOCITY should depend on HAS_DMA net/phy: tune get_phy_c45_ids to support more c45 phy bnx2x: fix lockdep splat net: fec: don't access RACC register when not available ...

Linus Torvalds committed 11 years ago

Commit 47ebed92 parents 44b061f b92262269 files · +701 −376Browse files

Unified · Split

69 files
  1. Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt +1 −1
  2. arch/arm/boot/dts/armada-370-xp.dtsi +0 −2
  3. arch/arm/boot/dts/armada-370.dtsi +8 −0
  4. arch/arm/boot/dts/armada-xp-mv78260.dtsi +1 −1
  5. arch/arm/boot/dts/armada-xp-mv78460.dtsi +1 −1
  6. arch/arm/boot/dts/armada-xp.dtsi +9 −1
  7. drivers/net/ethernet/amd/xgbe/xgbe-desc.c +1 −1
  8. drivers/net/ethernet/apm/xgene/xgene_enet_main.c +1 −1
  9. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +7 −5
  10. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +17 −15
  11. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +2 −10
  12. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +43 −15
  13. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +32 −11
  14. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +41 −19
  15. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +1 −1
  16. drivers/net/ethernet/broadcom/genet/bcmgenet.h +1 −0
  17. drivers/net/ethernet/broadcom/genet/bcmmii.c +50 −4
  18. drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +3 −2
  19. drivers/net/ethernet/cavium/liquidio/octeon_device.c +3 −8
  20. drivers/net/ethernet/cavium/liquidio/octeon_droq.c +1 −3
  21. drivers/net/ethernet/cavium/liquidio/request_manager.c +1 −2
  22. drivers/net/ethernet/cisco/enic/enic_main.c +2 −2
  23. drivers/net/ethernet/cisco/enic/vnic_rq.h +27 −64
  24. drivers/net/ethernet/freescale/Kconfig +2 −2
  25. drivers/net/ethernet/freescale/fec.h +2 −0
  26. drivers/net/ethernet/freescale/fec_main.c +17 −13
  27. drivers/net/ethernet/icplus/ipg.c +1 −1
  28. drivers/net/ethernet/icplus/ipg.h +1 −1
  29. drivers/net/ethernet/intel/e1000e/ich8lan.c +98 −28
  30. drivers/net/ethernet/intel/e1000e/netdev.c +34 −4
  31. drivers/net/ethernet/intel/i40evf/i40e_txrx.c +4 −0
  32. drivers/net/ethernet/intel/i40evf/i40evf.h +0 −1
  33. drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +4 −2
  34. drivers/net/ethernet/intel/i40evf/i40evf_main.c +47 −63
  35. drivers/net/ethernet/intel/igb/e1000_82575.c +8 −4
  36. drivers/net/ethernet/intel/igb/e1000_defines.h +2 −1
  37. drivers/net/ethernet/intel/igb/igb_main.c +1 −1
  38. drivers/net/ethernet/marvell/mvneta.c +26 −1
  39. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +0 −4
  40. drivers/net/ethernet/mellanox/mlx4/en_rx.c +6 −11
  41. drivers/net/ethernet/mellanox/mlx4/en_tx.c +12 −8
  42. drivers/net/ethernet/mellanox/mlx4/intf.c +7 −1
  43. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +1 −1
  44. drivers/net/ethernet/renesas/ravb_ptp.c +3 −1
  45. drivers/net/ethernet/sis/sis900.h +2 −2
  46. drivers/net/ethernet/stmicro/stmmac/mmc_core.c +2 −2
  47. drivers/net/ethernet/via/Kconfig +2 −0
  48. drivers/net/phy/bcm7xxx.c +7 −0
  49. drivers/net/phy/mdio-bcm-unimac.c +43 −0
  50. drivers/net/phy/phy_device.c +17 −8
  51. drivers/net/phy/vitesse.c +14 −0
  52. drivers/net/vmxnet3/vmxnet3_int.h +2 −2
  53. drivers/net/xen-netfront.c +0 −7
  54. include/net/ax25.h +15 −1
  55. include/net/sock.h +0 −2
  56. include/uapi/linux/in.h +13 −3
  57. include/uapi/linux/libc-compat.h +22 −0
  58. net/ax25/af_ax25.c +15 −15
  59. net/ax25/ax25_in.c +1 −1
  60. net/core/flow_dissector.c +1 −1
  61. net/core/sock.c +1 −2
  62. net/dsa/slave.c +1 −1
  63. net/ipv4/fib_semantics.c +2 −2
  64. net/sched/cls_flower.c +2 −2
  65. net/sctp/output.c +3 −1
  66. net/sctp/socket.c +0 −6
  67. net/tipc/bcast.c +5 −0
  68. net/tipc/link.c +1 −1
  69. net/tipc/link.h +1 −0
Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt+1−1
@@ -1,7 +1,7 @@
1* Marvell Armada 370 / Armada XP Ethernet Controller (NETA)1* Marvell Armada 370 / Armada XP Ethernet Controller (NETA)
2 2
3Required properties:3Required properties:
4- compatible: should be "marvell,armada-370-neta".4- compatible: "marvell,armada-370-neta" or "marvell,armada-xp-neta".
5- reg: address and length of the register set for the device.5- reg: address and length of the register set for the device.
6- interrupts: interrupt for the device6- interrupts: interrupt for the device
7- phy: See ethernet.txt file in the same directory.7- phy: See ethernet.txt file in the same directory.
arch/arm/boot/dts/armada-370-xp.dtsi+0−2
@@ -268,7 +268,6 @@ · 267 unmodified lines
268 };268 };
269 269
270 eth0: ethernet@70000 {270 eth0: ethernet@70000 {
271 compatible = "marvell,armada-370-neta";
272 reg = <0x70000 0x4000>;271 reg = <0x70000 0x4000>;
273 interrupts = <8>;272 interrupts = <8>;
274 clocks = <&gateclk 4>;273 clocks = <&gateclk 4>;
@@ -284,7 +283,6 @@ · 9 unmodified lines
284 };283 };
285 284
286 eth1: ethernet@74000 {285 eth1: ethernet@74000 {
287 compatible = "marvell,armada-370-neta";
288 reg = <0x74000 0x4000>;286 reg = <0x74000 0x4000>;
289 interrupts = <10>;287 interrupts = <10>;
290 clocks = <&gateclk 3>;288 clocks = <&gateclk 3>;
arch/arm/boot/dts/armada-370.dtsi+8−0
@@ -311,6 +311,14 @@ · 310 unmodified lines
311 dmacap,memset;311 dmacap,memset;
312 };312 };
313 };313 };
314
315 ethernet@70000 {
316 compatible = "marvell,armada-370-neta";
317 };
318
319 ethernet@74000 {
320 compatible = "marvell,armada-370-neta";
321 };
314 };322 };
315 };323 };
316};324};
arch/arm/boot/dts/armada-xp-mv78260.dtsi+1−1
@@ -318,7 +318,7 @@ · 317 unmodified lines
318 };318 };
319 319
320 eth3: ethernet@34000 {320 eth3: ethernet@34000 {
321 compatible = "marvell,armada-370-neta";321 compatible = "marvell,armada-xp-neta";
322 reg = <0x34000 0x4000>;322 reg = <0x34000 0x4000>;
323 interrupts = <14>;323 interrupts = <14>;
324 clocks = <&gateclk 1>;324 clocks = <&gateclk 1>;
arch/arm/boot/dts/armada-xp-mv78460.dtsi+1−1
@@ -356,7 +356,7 @@ · 355 unmodified lines
356 };356 };
357 357
358 eth3: ethernet@34000 {358 eth3: ethernet@34000 {
359 compatible = "marvell,armada-370-neta";359 compatible = "marvell,armada-xp-neta";
360 reg = <0x34000 0x4000>;360 reg = <0x34000 0x4000>;
361 interrupts = <14>;361 interrupts = <14>;
362 clocks = <&gateclk 1>;362 clocks = <&gateclk 1>;
arch/arm/boot/dts/armada-xp.dtsi+9−1
@@ -185,7 +185,7 @@ · 184 unmodified lines
185 };185 };
186 186
187 eth2: ethernet@30000 {187 eth2: ethernet@30000 {
188 compatible = "marvell,armada-370-neta";188 compatible = "marvell,armada-xp-neta";
189 reg = <0x30000 0x4000>;189 reg = <0x30000 0x4000>;
190 interrupts = <12>;190 interrupts = <12>;
191 clocks = <&gateclk 2>;191 clocks = <&gateclk 2>;
@@ -228,6 +228,14 @@ · 36 unmodified lines
228 };228 };
229 };229 };
230 230
231 ethernet@70000 {
232 compatible = "marvell,armada-xp-neta";
233 };
234
235 ethernet@74000 {
236 compatible = "marvell,armada-xp-neta";
237 };
238
231 xor@f0900 {239 xor@f0900 {
232 compatible = "marvell,orion-xor";240 compatible = "marvell,orion-xor";
233 reg = <0xF0900 0x100241 reg = <0xF0900 0x100
drivers/net/ethernet/amd/xgbe/xgbe-desc.c+1−1
@@ -268,7 +268,7 @@ static int xgbe_alloc_pages(struct xgbe_prv_data *pdata, · 267 unmodified lines
268 int ret;268 int ret;
269 269
270 /* Try to obtain pages, decreasing order if necessary */270 /* Try to obtain pages, decreasing order if necessary */
271 gfp |= __GFP_COLD | __GFP_COMP;271 gfp |= __GFP_COLD | __GFP_COMP | __GFP_NOWARN;
272 while (order >= 0) {272 while (order >= 0) {
273 pages = alloc_pages(gfp, order);273 pages = alloc_pages(gfp, order);
274 if (pages)274 if (pages)
drivers/net/ethernet/apm/xgene/xgene_enet_main.c+1−1
@@ -948,7 +948,7 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) · 947 unmodified lines
948 struct resource *res;948 struct resource *res;
949 void __iomem *base_addr;949 void __iomem *base_addr;
950 u32 offset;950 u32 offset;
951 int ret;951 int ret = 0;
952 952
953 pdev = pdata->pdev;953 pdev = pdata->pdev;
954 dev = &pdev->dev;954 dev = &pdev->dev;
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+7−5
@@ -530,7 +530,6 @@ enum bnx2x_tpa_mode_t { · 529 unmodified lines
530 530
531struct bnx2x_alloc_pool {531struct bnx2x_alloc_pool {
532 struct page *page;532 struct page *page;
533 dma_addr_t dma;
534 unsigned int offset;533 unsigned int offset;
535};534};
536 535
@@ -2418,10 +2417,13 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, · 1881 unmodified lines
2418 AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR | \2417 AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR | \
2419 AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR)2418 AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR)
2420 2419
2421#define HW_PRTY_ASSERT_SET_3 (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \2420#define HW_PRTY_ASSERT_SET_3_WITHOUT_SCPAD \
2422 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \2421 (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \
2423 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY | \2422 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \
2424 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY)2423 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY)
2424
2425#define HW_PRTY_ASSERT_SET_3 (HW_PRTY_ASSERT_SET_3_WITHOUT_SCPAD | \
2426 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY)
2425 2427
2426#define HW_PRTY_ASSERT_SET_4 (AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR | \2428#define HW_PRTY_ASSERT_SET_4 (AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR | \
2427 AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR)2429 AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+17−15
@@ -563,23 +563,20 @@ static int bnx2x_alloc_rx_sge(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 562 unmodified lines
563 return -ENOMEM;563 return -ENOMEM;
564 }564 }
565 565
566 pool->dma = dma_map_page(&bp->pdev->dev, pool->page, 0,
567 PAGE_SIZE, DMA_FROM_DEVICE);
568 if (unlikely(dma_mapping_error(&bp->pdev->dev,
569 pool->dma))) {
570 __free_pages(pool->page, PAGES_PER_SGE_SHIFT);
571 pool->page = NULL;
572 BNX2X_ERR("Can't map sge\n");
573 return -ENOMEM;
574 }
575 pool->offset = 0;566 pool->offset = 0;
576 }567 }
577 568
569 mapping = dma_map_page(&bp->pdev->dev, pool->page,
570 pool->offset, SGE_PAGE_SIZE, DMA_FROM_DEVICE);
571 if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
572 BNX2X_ERR("Can't map sge\n");
573 return -ENOMEM;
574 }
575
578 get_page(pool->page);576 get_page(pool->page);
579 sw_buf->page = pool->page;577 sw_buf->page = pool->page;
580 sw_buf->offset = pool->offset;578 sw_buf->offset = pool->offset;
581 579
582 mapping = pool->dma + sw_buf->offset;
583 dma_unmap_addr_set(sw_buf, mapping, mapping);580 dma_unmap_addr_set(sw_buf, mapping, mapping);
584 581
585 sge->addr_hi = cpu_to_le32(U64_HI(mapping));582 sge->addr_hi = cpu_to_le32(U64_HI(mapping));
@@ -648,9 +645,9 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 62 unmodified lines
648 return err;645 return err;
649 }646 }
650 647
651 dma_unmap_single(&bp->pdev->dev,648 dma_unmap_page(&bp->pdev->dev,
652 dma_unmap_addr(&old_rx_pg, mapping),649 dma_unmap_addr(&old_rx_pg, mapping),
653 SGE_PAGE_SIZE, DMA_FROM_DEVICE);650 SGE_PAGE_SIZE, DMA_FROM_DEVICE);
654 /* Add one frag and update the appropriate fields in the skb */651 /* Add one frag and update the appropriate fields in the skb */
655 if (fp->mode == TPA_MODE_LRO)652 if (fp->mode == TPA_MODE_LRO)
656 skb_fill_page_desc(skb, j, old_rx_pg.page,653 skb_fill_page_desc(skb, j, old_rx_pg.page,
@@ -3421,8 +3418,13 @@ static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, · 2764 unmodified lines
3421 u32 wnd_sum = 0;3418 u32 wnd_sum = 0;
3422 3419
3423 /* Headers length */3420 /* Headers length */
3424 hlen = (int)(skb_transport_header(skb) - skb->data) +3421 if (xmit_type & XMIT_GSO_ENC)
3425 tcp_hdrlen(skb);3422 hlen = (int)(skb_inner_transport_header(skb) -
3423 skb->data) +
3424 inner_tcp_hdrlen(skb);
3425 else
3426 hlen = (int)(skb_transport_header(skb) -
3427 skb->data) + tcp_hdrlen(skb);
3426 3428
3427 /* Amount of data (w/o headers) on linear part of SKB*/3429 /* Amount of data (w/o headers) on linear part of SKB*/
3428 first_bd_sz = skb_headlen(skb) - hlen;3430 first_bd_sz = skb_headlen(skb) - hlen;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+2−10
@@ -807,8 +807,8 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp, · 806 unmodified lines
807 /* Since many fragments can share the same page, make sure to807 /* Since many fragments can share the same page, make sure to
808 * only unmap and free the page once.808 * only unmap and free the page once.
809 */809 */
810 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(sw_buf, mapping),810 dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(sw_buf, mapping),
811 SGE_PAGE_SIZE, DMA_FROM_DEVICE);811 SGE_PAGE_SIZE, DMA_FROM_DEVICE);
812 812
813 put_page(page);813 put_page(page);
814 814
@@ -974,14 +974,6 @@ static inline void bnx2x_free_rx_mem_pool(struct bnx2x *bp, · 159 unmodified lines
974 if (!pool->page)974 if (!pool->page)
975 return;975 return;
976 976
977 /* Page was not fully fragmented. Unmap unused space */
978 if (pool->offset < PAGE_SIZE) {
979 dma_addr_t dma = pool->dma + pool->offset;
980 int size = PAGE_SIZE - pool->offset;
981
982 dma_unmap_single(&bp->pdev->dev, dma, size, DMA_FROM_DEVICE);
983 }
984
985 put_page(pool->page);977 put_page(pool->page);
986 978
987 pool->page = NULL;979 pool->page = NULL;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+43−15
@@ -257,14 +257,15 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 256 unmodified lines
257{257{
258 struct bnx2x *bp = netdev_priv(dev);258 struct bnx2x *bp = netdev_priv(dev);
259 int cfg_idx = bnx2x_get_link_cfg_idx(bp);259 int cfg_idx = bnx2x_get_link_cfg_idx(bp);
260 u32 media_type;
260 261
261 /* Dual Media boards present all available port types */262 /* Dual Media boards present all available port types */
262 cmd->supported = bp->port.supported[cfg_idx] |263 cmd->supported = bp->port.supported[cfg_idx] |
263 (bp->port.supported[cfg_idx ^ 1] &264 (bp->port.supported[cfg_idx ^ 1] &
264 (SUPPORTED_TP | SUPPORTED_FIBRE));265 (SUPPORTED_TP | SUPPORTED_FIBRE));
265 cmd->advertising = bp->port.advertising[cfg_idx];266 cmd->advertising = bp->port.advertising[cfg_idx];
266 if (bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type ==267 media_type = bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type;
267 ETH_PHY_SFP_1G_FIBER) {268 if (media_type == ETH_PHY_SFP_1G_FIBER) {
268 cmd->supported &= ~(SUPPORTED_10000baseT_Full);269 cmd->supported &= ~(SUPPORTED_10000baseT_Full);
269 cmd->advertising &= ~(ADVERTISED_10000baseT_Full);270 cmd->advertising &= ~(ADVERTISED_10000baseT_Full);
270 }271 }
@@ -312,12 +313,26 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 41 unmodified lines
312 cmd->lp_advertising |= ADVERTISED_100baseT_Full;313 cmd->lp_advertising |= ADVERTISED_100baseT_Full;
313 if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE)314 if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE)
314 cmd->lp_advertising |= ADVERTISED_1000baseT_Half;315 cmd->lp_advertising |= ADVERTISED_1000baseT_Half;
315 if (status & LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE)316 if (status & LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE) {
316 cmd->lp_advertising |= ADVERTISED_1000baseT_Full;317 if (media_type == ETH_PHY_KR) {
318 cmd->lp_advertising |=
319 ADVERTISED_1000baseKX_Full;
320 } else {
321 cmd->lp_advertising |=
322 ADVERTISED_1000baseT_Full;
323 }
324 }
317 if (status & LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE)325 if (status & LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE)
318 cmd->lp_advertising |= ADVERTISED_2500baseX_Full;326 cmd->lp_advertising |= ADVERTISED_2500baseX_Full;
319 if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE)327 if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE) {
320 cmd->lp_advertising |= ADVERTISED_10000baseT_Full;328 if (media_type == ETH_PHY_KR) {
329 cmd->lp_advertising |=
330 ADVERTISED_10000baseKR_Full;
331 } else {
332 cmd->lp_advertising |=
333 ADVERTISED_10000baseT_Full;
334 }
335 }
321 if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE)336 if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE)
322 cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full;337 cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full;
323 }338 }
@@ -564,15 +579,20 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 240 unmodified lines
564 return -EINVAL;579 return -EINVAL;
565 }580 }
566 581
567 if (!(bp->port.supported[cfg_idx] &582 if (bp->port.supported[cfg_idx] &
568 SUPPORTED_1000baseT_Full)) {583 SUPPORTED_1000baseT_Full) {
584 advertising = (ADVERTISED_1000baseT_Full |
585 ADVERTISED_TP);
586
587 } else if (bp->port.supported[cfg_idx] &
588 SUPPORTED_1000baseKX_Full) {
589 advertising = ADVERTISED_1000baseKX_Full;
590 } else {
569 DP(BNX2X_MSG_ETHTOOL,591 DP(BNX2X_MSG_ETHTOOL,
570 "1G full not supported\n");592 "1G full not supported\n");
571 return -EINVAL;593 return -EINVAL;
572 }594 }
573 595
574 advertising = (ADVERTISED_1000baseT_Full |
575 ADVERTISED_TP);
576 break;596 break;
577 597
578 case SPEED_2500:598 case SPEED_2500:
@@ -600,17 +620,22 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 21 unmodified lines
600 return -EINVAL;620 return -EINVAL;
601 }621 }
602 phy_idx = bnx2x_get_cur_phy_idx(bp);622 phy_idx = bnx2x_get_cur_phy_idx(bp);
603 if (!(bp->port.supported[cfg_idx]623 if ((bp->port.supported[cfg_idx] &
604 & SUPPORTED_10000baseT_Full) ||624 SUPPORTED_10000baseT_Full) &&
605 (bp->link_params.phy[phy_idx].media_type ==625 (bp->link_params.phy[phy_idx].media_type !=
606 ETH_PHY_SFP_1G_FIBER)) {626 ETH_PHY_SFP_1G_FIBER)) {
627 advertising = (ADVERTISED_10000baseT_Full |
628 ADVERTISED_FIBRE);
629 } else if (bp->port.supported[cfg_idx] &
630 SUPPORTED_10000baseKR_Full) {
631 advertising = (ADVERTISED_10000baseKR_Full |
632 ADVERTISED_FIBRE);
633 } else {
607 DP(BNX2X_MSG_ETHTOOL,634 DP(BNX2X_MSG_ETHTOOL,
608 "10G full not supported\n");635 "10G full not supported\n");
609 return -EINVAL;636 return -EINVAL;
610 }637 }
611 638
612 advertising = (ADVERTISED_10000baseT_Full |
613 ADVERTISED_FIBRE);
614 break;639 break;
615 640
616 default:641 default:
@@ -633,6 +658,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 16 unmodified lines
633 bp->link_params.multi_phy_config = new_multi_phy_config;658 bp->link_params.multi_phy_config = new_multi_phy_config;
634 if (netif_running(dev)) {659 if (netif_running(dev)) {
635 bnx2x_stats_handle(bp, STATS_EVENT_STOP);660 bnx2x_stats_handle(bp, STATS_EVENT_STOP);
661 bnx2x_force_link_reset(bp);
636 bnx2x_link_set(bp);662 bnx2x_link_set(bp);
637 }663 }
638 664
@@ -1204,6 +1230,7 @@ static int bnx2x_acquire_nvram_lock(struct bnx2x *bp) · 565 unmodified lines
1204 if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) {1230 if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) {
1205 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,1231 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
1206 "cannot get access to nvram interface\n");1232 "cannot get access to nvram interface\n");
1233 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_NVRAM);
1207 return -EBUSY;1234 return -EBUSY;
1208 }1235 }
1209 1236
@@ -1944,6 +1971,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev, · 734 unmodified lines
1944 1971
1945 if (netif_running(dev)) {1972 if (netif_running(dev)) {
1946 bnx2x_stats_handle(bp, STATS_EVENT_STOP);1973 bnx2x_stats_handle(bp, STATS_EVENT_STOP);
1974 bnx2x_force_link_reset(bp);
1947 bnx2x_link_set(bp);1975 bnx2x_link_set(bp);
1948 }1976 }
1949 1977
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+32−11
@@ -3392,9 +3392,9 @@ static void bnx2x_calc_ieee_aneg_adv(struct bnx2x_phy *phy, · 3391 unmodified lines
3392 case BNX2X_FLOW_CTRL_AUTO:3392 case BNX2X_FLOW_CTRL_AUTO:
3393 switch (params->req_fc_auto_adv) {3393 switch (params->req_fc_auto_adv) {
3394 case BNX2X_FLOW_CTRL_BOTH:3394 case BNX2X_FLOW_CTRL_BOTH:
3395 case BNX2X_FLOW_CTRL_RX:
3395 *ieee_fc |= MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH;3396 *ieee_fc |= MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH;
3396 break;3397 break;
3397 case BNX2X_FLOW_CTRL_RX:
3398 case BNX2X_FLOW_CTRL_TX:3398 case BNX2X_FLOW_CTRL_TX:
3399 *ieee_fc |=3399 *ieee_fc |=
3400 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC;3400 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC;
@@ -3488,14 +3488,21 @@ static void bnx2x_ext_phy_set_pause(struct link_params *params, · 87 unmodified lines
3488 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_ADV_PAUSE, val);3488 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_ADV_PAUSE, val);
3489}3489}
3490 3490
3491static void bnx2x_pause_resolve(struct link_vars *vars, u32 pause_result)3491static void bnx2x_pause_resolve(struct bnx2x_phy *phy,
3492{ /* LD LP */3492 struct link_params *params,
3493 struct link_vars *vars,
3494 u32 pause_result)
3495{
3496 struct bnx2x *bp = params->bp;
3497 /* LD LP */
3493 switch (pause_result) { /* ASYM P ASYM P */3498 switch (pause_result) { /* ASYM P ASYM P */
3494 case 0xb: /* 1 0 1 1 */3499 case 0xb: /* 1 0 1 1 */
3500 DP(NETIF_MSG_LINK, "Flow Control: TX only\n");
3495 vars->flow_ctrl = BNX2X_FLOW_CTRL_TX;3501 vars->flow_ctrl = BNX2X_FLOW_CTRL_TX;
3496 break;3502 break;
3497 3503
3498 case 0xe: /* 1 1 1 0 */3504 case 0xe: /* 1 1 1 0 */
3505 DP(NETIF_MSG_LINK, "Flow Control: RX only\n");
3499 vars->flow_ctrl = BNX2X_FLOW_CTRL_RX;3506 vars->flow_ctrl = BNX2X_FLOW_CTRL_RX;
3500 break;3507 break;
3501 3508
@@ -3503,10 +3510,22 @@ static void bnx2x_pause_resolve(struct link_vars *vars, u32 pause_result) · 1 unmodified line
3503 case 0x7: /* 0 1 1 1 */3510 case 0x7: /* 0 1 1 1 */
3504 case 0xd: /* 1 1 0 1 */3511 case 0xd: /* 1 1 0 1 */
3505 case 0xf: /* 1 1 1 1 */3512 case 0xf: /* 1 1 1 1 */
3506 vars->flow_ctrl = BNX2X_FLOW_CTRL_BOTH;3513 /* If the user selected to advertise RX ONLY,
3514 * although we advertised both, need to enable
3515 * RX only.
3516 */
3517 if (params->req_fc_auto_adv == BNX2X_FLOW_CTRL_BOTH) {
3518 DP(NETIF_MSG_LINK, "Flow Control: RX & TX\n");
3519 vars->flow_ctrl = BNX2X_FLOW_CTRL_BOTH;
3520 } else {
3521 DP(NETIF_MSG_LINK, "Flow Control: RX only\n");
3522 vars->flow_ctrl = BNX2X_FLOW_CTRL_RX;
3523 }
3507 break;3524 break;
3508 3525
3509 default:3526 default:
3527 DP(NETIF_MSG_LINK, "Flow Control: None\n");
3528 vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE;
3510 break;3529 break;
3511 }3530 }
3512 if (pause_result & (1<<0))3531 if (pause_result & (1<<0))
@@ -3567,7 +3586,7 @@ static void bnx2x_ext_phy_update_adv_fc(struct bnx2x_phy *phy, · 54 unmodified lines
3567 pause_result |= (lp_pause &3586 pause_result |= (lp_pause &
3568 MDIO_AN_REG_ADV_PAUSE_MASK) >> 10;3587 MDIO_AN_REG_ADV_PAUSE_MASK) >> 10;
3569 DP(NETIF_MSG_LINK, "Ext PHY pause result 0x%x\n", pause_result);3588 DP(NETIF_MSG_LINK, "Ext PHY pause result 0x%x\n", pause_result);
3570 bnx2x_pause_resolve(vars, pause_result);3589 bnx2x_pause_resolve(phy, params, vars, pause_result);
3571 3590
3572}3591}
3573 3592
@@ -5396,7 +5415,7 @@ static void bnx2x_update_adv_fc(struct bnx2x_phy *phy, · 1822 unmodified lines
5396 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK)>>7;5415 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK)>>7;
5397 DP(NETIF_MSG_LINK, "pause_result CL37 0x%x\n", pause_result);5416 DP(NETIF_MSG_LINK, "pause_result CL37 0x%x\n", pause_result);
5398 }5417 }
5399 bnx2x_pause_resolve(vars, pause_result);5418 bnx2x_pause_resolve(phy, params, vars, pause_result);
5400 5419
5401}5420}
5402 5421
@@ -7129,7 +7148,7 @@ static void bnx2x_8073_resolve_fc(struct bnx2x_phy *phy, · 1726 unmodified lines
7129 pause_result |= (lp_pause &7148 pause_result |= (lp_pause &
7130 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH) >> 7;7149 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH) >> 7;
7131 7150
7132 bnx2x_pause_resolve(vars, pause_result);7151 bnx2x_pause_resolve(phy, params, vars, pause_result);
7133 DP(NETIF_MSG_LINK, "Ext PHY CL37 pause result 0x%x\n",7152 DP(NETIF_MSG_LINK, "Ext PHY CL37 pause result 0x%x\n",
7134 pause_result);7153 pause_result);
7135 }7154 }
@@ -11474,7 +11493,9 @@ static const struct bnx2x_phy phy_warpcore = { · 4338 unmodified lines
11474 SUPPORTED_100baseT_Half |11493 SUPPORTED_100baseT_Half |
11475 SUPPORTED_100baseT_Full |11494 SUPPORTED_100baseT_Full |
11476 SUPPORTED_1000baseT_Full |11495 SUPPORTED_1000baseT_Full |
11496 SUPPORTED_1000baseKX_Full |
11477 SUPPORTED_10000baseT_Full |11497 SUPPORTED_10000baseT_Full |
11498 SUPPORTED_10000baseKR_Full |
11478 SUPPORTED_20000baseKR2_Full |11499 SUPPORTED_20000baseKR2_Full |
11479 SUPPORTED_20000baseMLD2_Full |11500 SUPPORTED_20000baseMLD2_Full |
11480 SUPPORTED_FIBRE |11501 SUPPORTED_FIBRE |
@@ -11980,8 +12001,8 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, · 499 unmodified lines
11980 break;12001 break;
11981 case PORT_HW_CFG_NET_SERDES_IF_KR:12002 case PORT_HW_CFG_NET_SERDES_IF_KR:
11982 phy->media_type = ETH_PHY_KR;12003 phy->media_type = ETH_PHY_KR;
11983 phy->supported &= (SUPPORTED_1000baseT_Full |12004 phy->supported &= (SUPPORTED_1000baseKX_Full |
11984 SUPPORTED_10000baseT_Full |12005 SUPPORTED_10000baseKR_Full |
11985 SUPPORTED_FIBRE |12006 SUPPORTED_FIBRE |
11986 SUPPORTED_Autoneg |12007 SUPPORTED_Autoneg |
11987 SUPPORTED_Pause |12008 SUPPORTED_Pause |
@@ -11999,8 +12020,8 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, · 11 unmodified lines
11999 phy->media_type = ETH_PHY_KR;12020 phy->media_type = ETH_PHY_KR;
12000 phy->flags |= FLAGS_WC_DUAL_MODE;12021 phy->flags |= FLAGS_WC_DUAL_MODE;
12001 phy->supported &= (SUPPORTED_20000baseKR2_Full |12022 phy->supported &= (SUPPORTED_20000baseKR2_Full |
12002 SUPPORTED_10000baseT_Full |12023 SUPPORTED_10000baseKR_Full |
12003 SUPPORTED_1000baseT_Full |12024 SUPPORTED_1000baseKX_Full |
12004 SUPPORTED_Autoneg |12025 SUPPORTED_Autoneg |
12005 SUPPORTED_FIBRE |12026 SUPPORTED_FIBRE |
12006 SUPPORTED_Pause |12027 SUPPORTED_Pause |
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+41−19
@@ -2287,13 +2287,11 @@ static int bnx2x_set_spio(struct bnx2x *bp, int spio, u32 mode) · 2286 unmodified lines
2287void bnx2x_calc_fc_adv(struct bnx2x *bp)2287void bnx2x_calc_fc_adv(struct bnx2x *bp)
2288{2288{
2289 u8 cfg_idx = bnx2x_get_link_cfg_idx(bp);2289 u8 cfg_idx = bnx2x_get_link_cfg_idx(bp);
2290
2291 bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause |
2292 ADVERTISED_Pause);
2290 switch (bp->link_vars.ieee_fc &2293 switch (bp->link_vars.ieee_fc &
2291 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) {2294 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) {
2292 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE:
2293 bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause |
2294 ADVERTISED_Pause);
2295 break;
2296
2297 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH:2295 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH:
2298 bp->port.advertising[cfg_idx] |= (ADVERTISED_Asym_Pause |2296 bp->port.advertising[cfg_idx] |= (ADVERTISED_Asym_Pause |
2299 ADVERTISED_Pause);2297 ADVERTISED_Pause);
@@ -2304,8 +2302,6 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp) · 4 unmodified lines
2304 break;2302 break;
2305 2303
2306 default:2304 default:
2307 bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause |
2308 ADVERTISED_Pause);
2309 break;2305 break;
2310 }2306 }
2311}2307}
@@ -2351,12 +2347,16 @@ int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) · 39 unmodified lines
2351 if (load_mode == LOAD_DIAG) {2347 if (load_mode == LOAD_DIAG) {
2352 struct link_params *lp = &bp->link_params;2348 struct link_params *lp = &bp->link_params;
2353 lp->loopback_mode = LOOPBACK_XGXS;2349 lp->loopback_mode = LOOPBACK_XGXS;
2354 /* do PHY loopback at 10G speed, if possible */2350 /* Prefer doing PHY loopback at highest speed */
2355 if (lp->req_line_speed[cfx_idx] < SPEED_10000) {2351 if (lp->req_line_speed[cfx_idx] < SPEED_20000) {
2356 if (lp->speed_cap_mask[cfx_idx] &2352 if (lp->speed_cap_mask[cfx_idx] &
2357 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)2353 PORT_HW_CFG_SPEED_CAPABILITY_D0_20G)
2358 lp->req_line_speed[cfx_idx] =2354 lp->req_line_speed[cfx_idx] =
2359 SPEED_10000;2355 SPEED_20000;
2356 else if (lp->speed_cap_mask[cfx_idx] &
2357 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)
2358 lp->req_line_speed[cfx_idx] =
2359 SPEED_10000;
2360 else2360 else
2361 lp->req_line_speed[cfx_idx] =2361 lp->req_line_speed[cfx_idx] =
2362 SPEED_1000;2362 SPEED_1000;
@@ -4867,9 +4867,7 @@ static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp, u32 sig, · 2504 unmodified lines
4867 res = true;4867 res = true;
4868 break;4868 break;
4869 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY:4869 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY:
4870 if (print)4870 (*par_num)++;
4871 _print_next_block((*par_num)++,
4872 "MCP SCPAD");
4873 /* clear latched SCPAD PATIRY from MCP */4871 /* clear latched SCPAD PATIRY from MCP */
4874 REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL,4872 REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL,
4875 1UL << 10);4873 1UL << 10);
@@ -4931,6 +4929,7 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, · 55 unmodified lines
4931 (sig[3] & HW_PRTY_ASSERT_SET_3) ||4929 (sig[3] & HW_PRTY_ASSERT_SET_3) ||
4932 (sig[4] & HW_PRTY_ASSERT_SET_4)) {4930 (sig[4] & HW_PRTY_ASSERT_SET_4)) {
4933 int par_num = 0;4931 int par_num = 0;
4932
4934 DP(NETIF_MSG_HW, "Was parity error: HW block parity attention:\n"4933 DP(NETIF_MSG_HW, "Was parity error: HW block parity attention:\n"
4935 "[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x [4]:0x%08x\n",4934 "[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x [4]:0x%08x\n",
4936 sig[0] & HW_PRTY_ASSERT_SET_0,4935 sig[0] & HW_PRTY_ASSERT_SET_0,
@@ -4938,9 +4937,18 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, · 1 unmodified line
4938 sig[2] & HW_PRTY_ASSERT_SET_2,4937 sig[2] & HW_PRTY_ASSERT_SET_2,
4939 sig[3] & HW_PRTY_ASSERT_SET_3,4938 sig[3] & HW_PRTY_ASSERT_SET_3,
4940 sig[4] & HW_PRTY_ASSERT_SET_4);4939 sig[4] & HW_PRTY_ASSERT_SET_4);
4941 if (print)4940 if (print) {
4942 netdev_err(bp->dev,4941 if (((sig[0] & HW_PRTY_ASSERT_SET_0) ||
4943 "Parity errors detected in blocks: ");4942 (sig[1] & HW_PRTY_ASSERT_SET_1) ||
4943 (sig[2] & HW_PRTY_ASSERT_SET_2) ||
4944 (sig[4] & HW_PRTY_ASSERT_SET_4)) ||
4945 (sig[3] & HW_PRTY_ASSERT_SET_3_WITHOUT_SCPAD)) {
4946 netdev_err(bp->dev,
4947 "Parity errors detected in blocks: ");
4948 } else {
4949 print = false;
4950 }
4951 }
4944 res |= bnx2x_check_blocks_with_parity0(bp,4952 res |= bnx2x_check_blocks_with_parity0(bp,
4945 sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print);4953 sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print);
4946 res |= bnx2x_check_blocks_with_parity1(bp,4954 res |= bnx2x_check_blocks_with_parity1(bp,
@@ -8431,7 +8439,7 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) · 3484 unmodified lines
8431 BNX2X_ETH_MAC, &ramrod_flags);8439 BNX2X_ETH_MAC, &ramrod_flags);
8432 } else { /* vf */8440 } else { /* vf */
8433 return bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr,8441 return bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr,
8434 bp->fp->index, true);8442 bp->fp->index, set);
8435 }8443 }
8436}8444}
8437 8445
@@ -9323,7 +9331,8 @@ unload_error: · 885 unmodified lines
9323 * function stop ramrod is sent, since as part of this ramrod FW access9331 * function stop ramrod is sent, since as part of this ramrod FW access
9324 * PTP registers.9332 * PTP registers.
9325 */9333 */
9326 bnx2x_stop_ptp(bp);9334 if (bp->flags & PTP_SUPPORTED)
9335 bnx2x_stop_ptp(bp);
9327 9336
9328 /* Disable HW interrupts, NAPI */9337 /* Disable HW interrupts, NAPI */
9329 bnx2x_netif_stop(bp, 1);9338 bnx2x_netif_stop(bp, 1);
@@ -11147,6 +11156,12 @@ static void bnx2x_link_settings_requested(struct bnx2x *bp) · 1817 unmodified lines
11147 bp->port.advertising[idx] |=11156 bp->port.advertising[idx] |=
11148 (ADVERTISED_1000baseT_Full |11157 (ADVERTISED_1000baseT_Full |
11149 ADVERTISED_TP);11158 ADVERTISED_TP);
11159 } else if (bp->port.supported[idx] &
11160 SUPPORTED_1000baseKX_Full) {
11161 bp->link_params.req_line_speed[idx] =
11162 SPEED_1000;
11163 bp->port.advertising[idx] |=
11164 ADVERTISED_1000baseKX_Full;
11150 } else {11165 } else {
11151 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",11166 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",
11152 link_config,11167 link_config,
@@ -11179,6 +11194,13 @@ static void bnx2x_link_settings_requested(struct bnx2x *bp) · 26 unmodified lines
11179 bp->port.advertising[idx] |=11194 bp->port.advertising[idx] |=
11180 (ADVERTISED_10000baseT_Full |11195 (ADVERTISED_10000baseT_Full |
11181 ADVERTISED_FIBRE);11196 ADVERTISED_FIBRE);
11197 } else if (bp->port.supported[idx] &
11198 SUPPORTED_10000baseKR_Full) {
11199 bp->link_params.req_line_speed[idx] =
11200 SPEED_10000;
11201 bp->port.advertising[idx] |=
11202 (ADVERTISED_10000baseKR_Full |
11203 ADVERTISED_FIBRE);
11182 } else {11204 } else {
11183 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",11205 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",
11184 link_config,11206 link_config,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c+1−1
@@ -424,7 +424,7 @@ static void __bnx2x_vlan_mac_h_exec_pending(struct bnx2x *bp, · 423 unmodified lines
424 o->head_exe_request = false;424 o->head_exe_request = false;
425 o->saved_ramrod_flags = 0;425 o->saved_ramrod_flags = 0;
426 rc = bnx2x_exe_queue_step(bp, &o->exe_queue, &ramrod_flags);426 rc = bnx2x_exe_queue_step(bp, &o->exe_queue, &ramrod_flags);
427 if (rc != 0) {427 if ((rc != 0) && (rc != 1)) {
428 BNX2X_ERR("execution of pending commands failed with rc %d\n",428 BNX2X_ERR("execution of pending commands failed with rc %d\n",
429 rc);429 rc);
430#ifdef BNX2X_STOP_ON_ERROR430#ifdef BNX2X_STOP_ON_ERROR
drivers/net/ethernet/broadcom/genet/bcmgenet.h+1−0
@@ -594,6 +594,7 @@ struct bcmgenet_priv { · 593 unmodified lines
594 wait_queue_head_t wq;594 wait_queue_head_t wq;
595 struct phy_device *phydev;595 struct phy_device *phydev;
596 struct device_node *phy_dn;596 struct device_node *phy_dn;
597 struct device_node *mdio_dn;
597 struct mii_bus *mii_bus;598 struct mii_bus *mii_bus;
598 u16 gphy_rev;599 u16 gphy_rev;
599 struct clk *clk_eee;600 struct clk *clk_eee;
drivers/net/ethernet/broadcom/genet/bcmmii.c+50−4
@@ -408,6 +408,52 @@ static int bcmgenet_mii_probe(struct net_device *dev) · 407 unmodified lines
408 return 0;408 return 0;
409}409}
410 410
411/* Workaround for integrated BCM7xxx Gigabit PHYs which have a problem with
412 * their internal MDIO management controller making them fail to successfully
413 * be read from or written to for the first transaction. We insert a dummy
414 * BMSR read here to make sure that phy_get_device() and get_phy_id() can
415 * correctly read the PHY MII_PHYSID1/2 registers and successfully register a
416 * PHY device for this peripheral.
417 *
418 * Once the PHY driver is registered, we can workaround subsequent reads from
419 * there (e.g: during system-wide power management).
420 *
421 * bus->reset is invoked before mdiobus_scan during mdiobus_register and is
422 * therefore the right location to stick that workaround. Since we do not want
423 * to read from non-existing PHYs, we either use bus->phy_mask or do a manual
424 * Device Tree scan to limit the search area.
425 */
426static int bcmgenet_mii_bus_reset(struct mii_bus *bus)
427{
428 struct net_device *dev = bus->priv;
429 struct bcmgenet_priv *priv = netdev_priv(dev);
430 struct device_node *np = priv->mdio_dn;
431 struct device_node *child = NULL;
432 u32 read_mask = 0;
433 int addr = 0;
434
435 if (!np) {
436 read_mask = 1 << priv->phy_addr;
437 } else {
438 for_each_available_child_of_node(np, child) {
439 addr = of_mdio_parse_addr(&dev->dev, child);
440 if (addr < 0)
441 continue;
442
443 read_mask |= 1 << addr;
444 }
445 }
446
447 for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
448 if (read_mask & 1 << addr) {
449 dev_dbg(&dev->dev, "Workaround for PHY @ %d\n", addr);
450 mdiobus_read(bus, addr, MII_BMSR);
451 }
452 }
453
454 return 0;
455}
456
411static int bcmgenet_mii_alloc(struct bcmgenet_priv *priv)457static int bcmgenet_mii_alloc(struct bcmgenet_priv *priv)
412{458{
413 struct mii_bus *bus;459 struct mii_bus *bus;
@@ -427,6 +473,7 @@ static int bcmgenet_mii_alloc(struct bcmgenet_priv *priv) · 13 unmodified lines
427 bus->parent = &priv->pdev->dev;473 bus->parent = &priv->pdev->dev;
428 bus->read = bcmgenet_mii_read;474 bus->read = bcmgenet_mii_read;
429 bus->write = bcmgenet_mii_write;475 bus->write = bcmgenet_mii_write;
476 bus->reset = bcmgenet_mii_bus_reset;
430 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d",477 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d",
431 priv->pdev->name, priv->pdev->id);478 priv->pdev->name, priv->pdev->id);
432 479
@@ -443,7 +490,6 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv) · 10 unmodified lines
443{490{
444 struct device_node *dn = priv->pdev->dev.of_node;491 struct device_node *dn = priv->pdev->dev.of_node;
445 struct device *kdev = &priv->pdev->dev;492 struct device *kdev = &priv->pdev->dev;
446 struct device_node *mdio_dn;
447 char *compat;493 char *compat;
448 int ret;494 int ret;
449 495
@@ -451,14 +497,14 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv) · 1 unmodified line
451 if (!compat)497 if (!compat)
452 return -ENOMEM;498 return -ENOMEM;
453 499
454 mdio_dn = of_find_compatible_node(dn, NULL, compat);500 priv->mdio_dn = of_find_compatible_node(dn, NULL, compat);
455 kfree(compat);501 kfree(compat);
456 if (!mdio_dn) {502 if (!priv->mdio_dn) {
457 dev_err(kdev, "unable to find MDIO bus node\n");503 dev_err(kdev, "unable to find MDIO bus node\n");
458 return -ENODEV;504 return -ENODEV;
459 }505 }
460 506
461 ret = of_mdiobus_register(priv->mii_bus, mdio_dn);507 ret = of_mdiobus_register(priv->mii_bus, priv->mdio_dn);
462 if (ret) {508 if (ret) {
463 dev_err(kdev, "failed to register MDIO bus\n");509 dev_err(kdev, "failed to register MDIO bus\n");
464 return ret;510 return ret;
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c+3−2
@@ -434,8 +434,9 @@ static int lio_set_phys_id(struct net_device *netdev, · 433 unmodified lines
434 if (ret)434 if (ret)
435 return ret;435 return ret;
436 436
437 octnet_mdio45_access(lio, 1, LIO68XX_LED_BEACON_ADDR,437 ret = octnet_mdio45_access(lio, 1,
438 &lio->phy_beacon_val);438 LIO68XX_LED_BEACON_ADDR,
439 &lio->phy_beacon_val);
439 if (ret)440 if (ret)
440 return ret;441 return ret;
441 442
drivers/net/ethernet/cavium/liquidio/octeon_device.c+3−8
@@ -650,14 +650,12 @@ void octeon_free_device_mem(struct octeon_device *oct) · 649 unmodified lines
650 650
651 for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES; i++) {651 for (i = 0; i < MAX_OCTEON_OUTPUT_QUEUES; i++) {
652 /* could check mask as well */652 /* could check mask as well */
653 if (oct->droq[i])653 vfree(oct->droq[i]);
654 vfree(oct->droq[i]);
655 }654 }
656 655
657 for (i = 0; i < MAX_OCTEON_INSTR_QUEUES; i++) {656 for (i = 0; i < MAX_OCTEON_INSTR_QUEUES; i++) {
658 /* could check mask as well */657 /* could check mask as well */
659 if (oct->instr_queue[i])658 vfree(oct->instr_queue[i]);
660 vfree(oct->instr_queue[i]);
661 }659 }
662 660
663 i = oct->octeon_id;661 i = oct->octeon_id;
@@ -1078,10 +1076,7 @@ octeon_unregister_dispatch_fn(struct octeon_device *oct, u16 opcode, · 414 unmodified lines
1078 oct->dispatch.count--;1076 oct->dispatch.count--;
1079 1077
1080 spin_unlock_bh(&oct->dispatch.lock);1078 spin_unlock_bh(&oct->dispatch.lock);
1081 1079 vfree(dfree);
1082 if (dfree)
1083 vfree(dfree);
1084
1085 return retval;1080 return retval;
1086}1081}
1087 1082
drivers/net/ethernet/cavium/liquidio/octeon_droq.c+1−3
@@ -216,9 +216,7 @@ int octeon_delete_droq(struct octeon_device *oct, u32 q_no) · 215 unmodified lines
216 dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no);216 dev_dbg(&oct->pci_dev->dev, "%s[%d]\n", __func__, q_no);
217 217
218 octeon_droq_destroy_ring_buffers(oct, droq);218 octeon_droq_destroy_ring_buffers(oct, droq);
219 219 vfree(droq->recv_buf_list);
220 if (droq->recv_buf_list)
221 vfree(droq->recv_buf_list);
222 220
223 if (droq->info_base_addr)221 if (droq->info_base_addr)
224 cnnic_free_aligned_dma(oct->pci_dev, droq->info_list,222 cnnic_free_aligned_dma(oct->pci_dev, droq->info_list,
drivers/net/ethernet/cavium/liquidio/request_manager.c+1−2
@@ -175,8 +175,7 @@ int octeon_delete_instr_queue(struct octeon_device *oct, u32 iq_no) · 174 unmodified lines
175 desc_size =175 desc_size =
176 CFG_GET_IQ_INSTR_TYPE(CHIP_FIELD(oct, cn6xxx, conf));176 CFG_GET_IQ_INSTR_TYPE(CHIP_FIELD(oct, cn6xxx, conf));
177 177
178 if (iq->request_list)178 vfree(iq->request_list);
179 vfree(iq->request_list);
180 179
181 if (iq->base_addr) {180 if (iq->base_addr) {
182 q_size = iq->max_count * desc_size;181 q_size = iq->max_count * desc_size;
drivers/net/ethernet/cisco/enic/enic_main.c+2−2
@@ -1208,7 +1208,7 @@ static int enic_poll(struct napi_struct *napi, int budget) · 1207 unmodified lines
1208 napi_complete(napi);1208 napi_complete(napi);
1209 vnic_intr_unmask(&enic->intr[intr]);1209 vnic_intr_unmask(&enic->intr[intr]);
1210 }1210 }
1211 enic_poll_unlock_napi(&enic->rq[cq_rq]);1211 enic_poll_unlock_napi(&enic->rq[cq_rq], napi);
1212 1212
1213 return rq_work_done;1213 return rq_work_done;
1214}1214}
@@ -1414,7 +1414,7 @@ static int enic_poll_msix_rq(struct napi_struct *napi, int budget) · 199 unmodified lines
1414 */1414 */
1415 enic_calc_int_moderation(enic, &enic->rq[rq]);1415 enic_calc_int_moderation(enic, &enic->rq[rq]);
1416 1416
1417 enic_poll_unlock_napi(&enic->rq[rq]);1417 enic_poll_unlock_napi(&enic->rq[rq], napi);
1418 if (work_done < work_to_do) {1418 if (work_done < work_to_do) {
1419 1419
1420 /* Some work done, but not enough to stay in polling,1420 /* Some work done, but not enough to stay in polling,
drivers/net/ethernet/cisco/enic/vnic_rq.h+27−64
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#define _VNIC_RQ_H_21#define _VNIC_RQ_H_
22 22
23#include <linux/pci.h>23#include <linux/pci.h>
24#include <linux/netdevice.h>
24 25
25#include "vnic_dev.h"26#include "vnic_dev.h"
26#include "vnic_cq.h"27#include "vnic_cq.h"
@@ -75,6 +76,12 @@ struct vnic_rq_buf { · 48 unmodified lines
75 uint64_t wr_id;76 uint64_t wr_id;
76};77};
77 78
79enum enic_poll_state {
80 ENIC_POLL_STATE_IDLE,
81 ENIC_POLL_STATE_NAPI,
82 ENIC_POLL_STATE_POLL
83};
84
78struct vnic_rq {85struct vnic_rq {
79 unsigned int index;86 unsigned int index;
80 struct vnic_dev *vdev;87 struct vnic_dev *vdev;
@@ -86,19 +93,7 @@ struct vnic_rq { · 5 unmodified lines
86 void *os_buf_head;93 void *os_buf_head;
87 unsigned int pkts_outstanding;94 unsigned int pkts_outstanding;
88#ifdef CONFIG_NET_RX_BUSY_POLL95#ifdef CONFIG_NET_RX_BUSY_POLL
89#define ENIC_POLL_STATE_IDLE 096 atomic_t bpoll_state;
90#define ENIC_POLL_STATE_NAPI (1 << 0) /* NAPI owns this poll */
91#define ENIC_POLL_STATE_POLL (1 << 1) /* poll owns this poll */
92#define ENIC_POLL_STATE_NAPI_YIELD (1 << 2) /* NAPI yielded this poll */
93#define ENIC_POLL_STATE_POLL_YIELD (1 << 3) /* poll yielded this poll */
94#define ENIC_POLL_YIELD (ENIC_POLL_STATE_NAPI_YIELD | \
95 ENIC_POLL_STATE_POLL_YIELD)
96#define ENIC_POLL_LOCKED (ENIC_POLL_STATE_NAPI | \
97 ENIC_POLL_STATE_POLL)
98#define ENIC_POLL_USER_PEND (ENIC_POLL_STATE_POLL | \
99 ENIC_POLL_STATE_POLL_YIELD)
100 unsigned int bpoll_state;
101 spinlock_t bpoll_lock;
102#endif /* CONFIG_NET_RX_BUSY_POLL */97#endif /* CONFIG_NET_RX_BUSY_POLL */
103};98};
104 99
@@ -215,76 +210,43 @@ static inline int vnic_rq_fill(struct vnic_rq *rq, · 110 unmodified lines
215#ifdef CONFIG_NET_RX_BUSY_POLL210#ifdef CONFIG_NET_RX_BUSY_POLL
216static inline void enic_busy_poll_init_lock(struct vnic_rq *rq)211static inline void enic_busy_poll_init_lock(struct vnic_rq *rq)
217{212{
218 spin_lock_init(&rq->bpoll_lock);213 atomic_set(&rq->bpoll_state, ENIC_POLL_STATE_IDLE);
219 rq->bpoll_state = ENIC_POLL_STATE_IDLE;
220}214}
221 215
222static inline bool enic_poll_lock_napi(struct vnic_rq *rq)216static inline bool enic_poll_lock_napi(struct vnic_rq *rq)
223{217{
224 bool rc = true;218 int rc = atomic_cmpxchg(&rq->bpoll_state, ENIC_POLL_STATE_IDLE,
225 219 ENIC_POLL_STATE_NAPI);
226 spin_lock(&rq->bpoll_lock);
227 if (rq->bpoll_state & ENIC_POLL_LOCKED) {
228 WARN_ON(rq->bpoll_state & ENIC_POLL_STATE_NAPI);
229 rq->bpoll_state |= ENIC_POLL_STATE_NAPI_YIELD;
230 rc = false;
231 } else {
232 rq->bpoll_state = ENIC_POLL_STATE_NAPI;
233 }
234 spin_unlock(&rq->bpoll_lock);
235 220
236 return rc;221 return (rc == ENIC_POLL_STATE_IDLE);
237}222}
238 223
239static inline bool enic_poll_unlock_napi(struct vnic_rq *rq)224static inline void enic_poll_unlock_napi(struct vnic_rq *rq,
225 struct napi_struct *napi)
240{226{
241 bool rc = false;227 WARN_ON(atomic_read(&rq->bpoll_state) != ENIC_POLL_STATE_NAPI);
242 228 napi_gro_flush(napi, false);
243 spin_lock(&rq->bpoll_lock);229 atomic_set(&rq->bpoll_state, ENIC_POLL_STATE_IDLE);
244 WARN_ON(rq->bpoll_state &
245 (ENIC_POLL_STATE_POLL | ENIC_POLL_STATE_NAPI_YIELD));
246 if (rq->bpoll_state & ENIC_POLL_STATE_POLL_YIELD)
247 rc = true;
248 rq->bpoll_state = ENIC_POLL_STATE_IDLE;
249 spin_unlock(&rq->bpoll_lock);
250
251 return rc;
252}230}
253 231
254static inline bool enic_poll_lock_poll(struct vnic_rq *rq)232static inline bool enic_poll_lock_poll(struct vnic_rq *rq)
255{233{
256 bool rc = true;234 int rc = atomic_cmpxchg(&rq->bpoll_state, ENIC_POLL_STATE_IDLE,
257 235 ENIC_POLL_STATE_POLL);
258 spin_lock_bh(&rq->bpoll_lock);
259 if (rq->bpoll_state & ENIC_POLL_LOCKED) {
260 rq->bpoll_state |= ENIC_POLL_STATE_POLL_YIELD;
261 rc = false;
262 } else {
263 rq->bpoll_state |= ENIC_POLL_STATE_POLL;
264 }
265 spin_unlock_bh(&rq->bpoll_lock);
266 236
267 return rc;237 return (rc == ENIC_POLL_STATE_IDLE);
268}238}
269 239
270static inline bool enic_poll_unlock_poll(struct vnic_rq *rq)
271{
272 bool rc = false;
273 240
274 spin_lock_bh(&rq->bpoll_lock);241static inline void enic_poll_unlock_poll(struct vnic_rq *rq)
275 WARN_ON(rq->bpoll_state & ENIC_POLL_STATE_NAPI);242{
276 if (rq->bpoll_state & ENIC_POLL_STATE_POLL_YIELD)243 WARN_ON(atomic_read(&rq->bpoll_state) != ENIC_POLL_STATE_POLL);
277 rc = true;244 atomic_set(&rq->bpoll_state, ENIC_POLL_STATE_IDLE);
278 rq->bpoll_state = ENIC_POLL_STATE_IDLE;
279 spin_unlock_bh(&rq->bpoll_lock);
280
281 return rc;
282}245}
283 246
284static inline bool enic_poll_busy_polling(struct vnic_rq *rq)247static inline bool enic_poll_busy_polling(struct vnic_rq *rq)
285{248{
286 WARN_ON(!(rq->bpoll_state & ENIC_POLL_LOCKED));249 return atomic_read(&rq->bpoll_state) & ENIC_POLL_STATE_POLL;
287 return rq->bpoll_state & ENIC_POLL_USER_PEND;
288}250}
289 251
290#else252#else
@@ -298,7 +260,8 @@ static inline bool enic_poll_lock_napi(struct vnic_rq *rq) · 7 unmodified lines
298 return true;260 return true;
299}261}
300 262
301static inline bool enic_poll_unlock_napi(struct vnic_rq *rq)263static inline bool enic_poll_unlock_napi(struct vnic_rq *rq,
264 struct napi_struct *napi)
302{265{
303 return false;266 return false;
304}267}
drivers/net/ethernet/freescale/Kconfig+2−2
@@ -83,12 +83,12 @@ config UGETH_TX_ON_DEMAND · 82 unmodified lines
83 83
84config GIANFAR84config GIANFAR
85 tristate "Gianfar Ethernet"85 tristate "Gianfar Ethernet"
86 depends on FSL_SOC
87 select FSL_PQ_MDIO86 select FSL_PQ_MDIO
88 select PHYLIB87 select PHYLIB
89 select CRC3288 select CRC32
90 ---help---89 ---help---
91 This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,90 This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
92 and MPC86xx family of chips, and the FEC on the 8540.91 and MPC86xx family of chips, the eTSEC on LS1021A and the FEC
92 on the 8540.
93 93
94endif # NET_VENDOR_FREESCALE94endif # NET_VENDOR_FREESCALE
drivers/net/ethernet/freescale/fec.h+2−0
@@ -428,6 +428,8 @@ struct bufdesc_ex { · 427 unmodified lines
428#define FEC_QUIRK_BUG_CAPTURE (1 << 10)428#define FEC_QUIRK_BUG_CAPTURE (1 << 10)
429/* Controller has only one MDIO bus */429/* Controller has only one MDIO bus */
430#define FEC_QUIRK_SINGLE_MDIO (1 << 11)430#define FEC_QUIRK_SINGLE_MDIO (1 << 11)
431/* Controller supports RACC register */
432#define FEC_QUIRK_HAS_RACC (1 << 12)
431 433
432struct fec_enet_priv_tx_q {434struct fec_enet_priv_tx_q {
433 int index;435 int index;
drivers/net/ethernet/freescale/fec_main.c+17−13
@@ -85,28 +85,30 @@ static struct platform_device_id fec_devtype[] = { · 84 unmodified lines
85 .driver_data = 0,85 .driver_data = 0,
86 }, {86 }, {
87 .name = "imx25-fec",87 .name = "imx25-fec",
88 .driver_data = FEC_QUIRK_USE_GASKET,88 .driver_data = FEC_QUIRK_USE_GASKET | FEC_QUIRK_HAS_RACC,
89 }, {89 }, {
90 .name = "imx27-fec",90 .name = "imx27-fec",
91 .driver_data = 0,91 .driver_data = FEC_QUIRK_HAS_RACC,
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 FEC_QUIRK_SINGLE_MDIO | FEC_QUIRK_HAS_RACC,
96 }, {96 }, {
97 .name = "imx6q-fec",97 .name = "imx6q-fec",
98 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |98 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
99 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |99 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
100 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358,100 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358 |
101 FEC_QUIRK_HAS_RACC,
101 }, {102 }, {
102 .name = "mvf600-fec",103 .name = "mvf600-fec",
103 .driver_data = FEC_QUIRK_ENET_MAC,104 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_RACC,
104 }, {105 }, {
105 .name = "imx6sx-fec",106 .name = "imx6sx-fec",
106 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |107 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
107 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |108 FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
108 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |109 FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |
109 FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE,110 FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
111 FEC_QUIRK_HAS_RACC,
110 }, {112 }, {
111 /* sentinel */113 /* sentinel */
112 }114 }
@@ -970,13 +972,15 @@ fec_restart(struct net_device *ndev) · 857 unmodified lines
970 writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);972 writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
971 973
972#if !defined(CONFIG_M5272)974#if !defined(CONFIG_M5272)
973 /* set RX checksum */975 if (fep->quirks & FEC_QUIRK_HAS_RACC) {
974 val = readl(fep->hwp + FEC_RACC);976 /* set RX checksum */
975 if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)977 val = readl(fep->hwp + FEC_RACC);
976 val |= FEC_RACC_OPTIONS;978 if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)
977 else979 val |= FEC_RACC_OPTIONS;
978 val &= ~FEC_RACC_OPTIONS;980 else
979 writel(val, fep->hwp + FEC_RACC);981 val &= ~FEC_RACC_OPTIONS;
982 writel(val, fep->hwp + FEC_RACC);
983 }
980#endif984#endif
981 985
982 /*986 /*
drivers/net/ethernet/icplus/ipg.c+1−1
@@ -1028,7 +1028,7 @@ static struct net_device_stats *ipg_nic_get_stats(struct net_device *dev) · 1027 unmodified lines
1028 1028
1029 /* detailed rx_errors */1029 /* detailed rx_errors */
1030 sp->stats.rx_length_errors += ipg_r16(IPG_INRANGELENGTHERRORS) +1030 sp->stats.rx_length_errors += ipg_r16(IPG_INRANGELENGTHERRORS) +
1031 ipg_r16(IPG_FRAMETOOLONGERRRORS);1031 ipg_r16(IPG_FRAMETOOLONGERRORS);
1032 sp->stats.rx_crc_errors += ipg_r16(IPG_FRAMECHECKSEQERRORS);1032 sp->stats.rx_crc_errors += ipg_r16(IPG_FRAMECHECKSEQERRORS);
1033 1033
1034 /* Unutilized IPG statistic registers. */1034 /* Unutilized IPG statistic registers. */
drivers/net/ethernet/icplus/ipg.h+1−1
@@ -102,7 +102,7 @@ enum ipg_regs { · 101 unmodified lines
102#define IPG_MCSTFRAMESRCVDOK 0xB8102#define IPG_MCSTFRAMESRCVDOK 0xB8
103#define IPG_BCSTFRAMESRCVDOK 0xBE103#define IPG_BCSTFRAMESRCVDOK 0xBE
104#define IPG_MACCONTROLFRAMESRCVD 0xC6104#define IPG_MACCONTROLFRAMESRCVD 0xC6
105#define IPG_FRAMETOOLONGERRRORS 0xC8105#define IPG_FRAMETOOLONGERRORS 0xC8
106#define IPG_INRANGELENGTHERRORS 0xCA106#define IPG_INRANGELENGTHERRORS 0xCA
107#define IPG_FRAMECHECKSEQERRORS 0xCC107#define IPG_FRAMECHECKSEQERRORS 0xCC
108#define IPG_FRAMESLOSTRXERRORS 0xCE108#define IPG_FRAMESLOSTRXERRORS 0xCE
drivers/net/ethernet/intel/e1000e/ich8lan.c+98−28
@@ -237,17 +237,19 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) · 236 unmodified lines
237 if (ret_val)237 if (ret_val)
238 return false;238 return false;
239out:239out:
240 if ((hw->mac.type == e1000_pch_lpt) ||240 if ((hw->mac.type == e1000_pch_lpt) || (hw->mac.type == e1000_pch_spt)) {
241 (hw->mac.type == e1000_pch_spt)) {241 /* Only unforce SMBus if ME is not active */
242 /* Unforce SMBus mode in PHY */242 if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
243 e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg);243 /* Unforce SMBus mode in PHY */
244 phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;244 e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg);
245 e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg);245 phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
246 e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg);
246 247
247 /* Unforce SMBus mode in MAC */248 /* Unforce SMBus mode in MAC */
248 mac_reg = er32(CTRL_EXT);249 mac_reg = er32(CTRL_EXT);
249 mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;250 mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
250 ew32(CTRL_EXT, mac_reg);251 ew32(CTRL_EXT, mac_reg);
252 }
251 }253 }
252 254
253 return true;255 return true;
@@ -1087,6 +1089,7 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) · 833 unmodified lines
1087 u32 mac_reg;1089 u32 mac_reg;
1088 s32 ret_val = 0;1090 s32 ret_val = 0;
1089 u16 phy_reg;1091 u16 phy_reg;
1092 u16 oem_reg = 0;
1090 1093
1091 if ((hw->mac.type < e1000_pch_lpt) ||1094 if ((hw->mac.type < e1000_pch_lpt) ||
1092 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) ||1095 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPT_I217_LM) ||
@@ -1128,33 +1131,37 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) · 35 unmodified lines
1128 if (ret_val)1131 if (ret_val)
1129 goto out;1132 goto out;
1130 1133
1134 /* Force SMBus mode in PHY */
1135 ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
1136 if (ret_val)
1137 goto release;
1138 phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
1139 e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
1140
1141 /* Force SMBus mode in MAC */
1142 mac_reg = er32(CTRL_EXT);
1143 mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
1144 ew32(CTRL_EXT, mac_reg);
1145
1131 /* Si workaround for ULP entry flow on i127/rev6 h/w. Enable1146 /* Si workaround for ULP entry flow on i127/rev6 h/w. Enable
1132 * LPLU and disable Gig speed when entering ULP1147 * LPLU and disable Gig speed when entering ULP
1133 */1148 */
1134 if ((hw->phy.type == e1000_phy_i217) && (hw->phy.revision == 6)) {1149 if ((hw->phy.type == e1000_phy_i217) && (hw->phy.revision == 6)) {
1135 ret_val = e1000_read_phy_reg_hv_locked(hw, HV_OEM_BITS,1150 ret_val = e1000_read_phy_reg_hv_locked(hw, HV_OEM_BITS,
1136 &phy_reg);1151 &oem_reg);
1137 if (ret_val)1152 if (ret_val)
1138 goto release;1153 goto release;
1154
1155 phy_reg = oem_reg;
1139 phy_reg |= HV_OEM_BITS_LPLU | HV_OEM_BITS_GBE_DIS;1156 phy_reg |= HV_OEM_BITS_LPLU | HV_OEM_BITS_GBE_DIS;
1157
1140 ret_val = e1000_write_phy_reg_hv_locked(hw, HV_OEM_BITS,1158 ret_val = e1000_write_phy_reg_hv_locked(hw, HV_OEM_BITS,
1141 phy_reg);1159 phy_reg);
1160
1142 if (ret_val)1161 if (ret_val)
1143 goto release;1162 goto release;
1144 }1163 }
1145 1164
1146 /* Force SMBus mode in PHY */
1147 ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
1148 if (ret_val)
1149 goto release;
1150 phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
1151 e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
1152
1153 /* Force SMBus mode in MAC */
1154 mac_reg = er32(CTRL_EXT);
1155 mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
1156 ew32(CTRL_EXT, mac_reg);
1157
1158 /* Set Inband ULP Exit, Reset to SMBus mode and1165 /* Set Inband ULP Exit, Reset to SMBus mode and
1159 * Disable SMBus Release on PERST# in PHY1166 * Disable SMBus Release on PERST# in PHY
1160 */1167 */
@@ -1166,10 +1173,15 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) · 5 unmodified lines
1166 if (to_sx) {1173 if (to_sx) {
1167 if (er32(WUFC) & E1000_WUFC_LNKC)1174 if (er32(WUFC) & E1000_WUFC_LNKC)
1168 phy_reg |= I218_ULP_CONFIG1_WOL_HOST;1175 phy_reg |= I218_ULP_CONFIG1_WOL_HOST;
1176 else
1177 phy_reg &= ~I218_ULP_CONFIG1_WOL_HOST;
1169 1178
1170 phy_reg |= I218_ULP_CONFIG1_STICKY_ULP;1179 phy_reg |= I218_ULP_CONFIG1_STICKY_ULP;
1180 phy_reg &= ~I218_ULP_CONFIG1_INBAND_EXIT;
1171 } else {1181 } else {
1172 phy_reg |= I218_ULP_CONFIG1_INBAND_EXIT;1182 phy_reg |= I218_ULP_CONFIG1_INBAND_EXIT;
1183 phy_reg &= ~I218_ULP_CONFIG1_STICKY_ULP;
1184 phy_reg &= ~I218_ULP_CONFIG1_WOL_HOST;
1173 }1185 }
1174 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);1186 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1175 1187
@@ -1181,6 +1193,15 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) · 5 unmodified lines
1181 /* Commit ULP changes in PHY by starting auto ULP configuration */1193 /* Commit ULP changes in PHY by starting auto ULP configuration */
1182 phy_reg |= I218_ULP_CONFIG1_START;1194 phy_reg |= I218_ULP_CONFIG1_START;
1183 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);1195 e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
1196
1197 if ((hw->phy.type == e1000_phy_i217) && (hw->phy.revision == 6) &&
1198 to_sx && (er32(STATUS) & E1000_STATUS_LU)) {
1199 ret_val = e1000_write_phy_reg_hv_locked(hw, HV_OEM_BITS,
1200 oem_reg);
1201 if (ret_val)
1202 goto release;
1203 }
1204
1184release:1205release:
1185 hw->phy.ops.release(hw);1206 hw->phy.ops.release(hw);
1186out:1207out:
@@ -1379,16 +1400,20 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) · 192 unmodified lines
1379 if (((hw->mac.type == e1000_pch2lan) ||1400 if (((hw->mac.type == e1000_pch2lan) ||
1380 (hw->mac.type == e1000_pch_lpt) ||1401 (hw->mac.type == e1000_pch_lpt) ||
1381 (hw->mac.type == e1000_pch_spt)) && link) {1402 (hw->mac.type == e1000_pch_spt)) && link) {
1382 u32 reg;1403 u16 speed, duplex;
1383 1404
1384 reg = er32(STATUS);1405 e1000e_get_speed_and_duplex_copper(hw, &speed, &duplex);
1385 tipg_reg = er32(TIPG);1406 tipg_reg = er32(TIPG);
1386 tipg_reg &= ~E1000_TIPG_IPGT_MASK;1407 tipg_reg &= ~E1000_TIPG_IPGT_MASK;
1387 1408
1388 if (!(reg & (E1000_STATUS_FD | E1000_STATUS_SPEED_MASK))) {1409 if (duplex == HALF_DUPLEX && speed == SPEED_10) {
1389 tipg_reg |= 0xFF;1410 tipg_reg |= 0xFF;
1390 /* Reduce Rx latency in analog PHY */1411 /* Reduce Rx latency in analog PHY */
1391 emi_val = 0;1412 emi_val = 0;
1413 } else if (hw->mac.type == e1000_pch_spt &&
1414 duplex == FULL_DUPLEX && speed != SPEED_1000) {
1415 tipg_reg |= 0xC;
1416 emi_val = 1;
1392 } else {1417 } else {
1393 1418
1394 /* Roll back the default values */1419 /* Roll back the default values */
@@ -1412,14 +1437,59 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) · 17 unmodified lines
1412 1437
1413 if (ret_val)1438 if (ret_val)
1414 return ret_val;1439 return ret_val;
1440
1441 if (hw->mac.type == e1000_pch_spt) {
1442 u16 data;
1443 u16 ptr_gap;
1444
1445 if (speed == SPEED_1000) {
1446 ret_val = hw->phy.ops.acquire(hw);
1447 if (ret_val)
1448 return ret_val;
1449
1450 ret_val = e1e_rphy_locked(hw,
1451 PHY_REG(776, 20),
1452 &data);
1453 if (ret_val) {
1454 hw->phy.ops.release(hw);
1455 return ret_val;
1456 }
1457
1458 ptr_gap = (data & (0x3FF << 2)) >> 2;
1459 if (ptr_gap < 0x18) {
1460 data &= ~(0x3FF << 2);
1461 data |= (0x18 << 2);
1462 ret_val =
1463 e1e_wphy_locked(hw,
1464 PHY_REG(776, 20),
1465 data);
1466 }
1467 hw->phy.ops.release(hw);
1468 if (ret_val)
1469 return ret_val;
1470 }
1471 }
1472 }
1473
1474 /* I217 Packet Loss issue:
1475 * ensure that FEXTNVM4 Beacon Duration is set correctly
1476 * on power up.
1477 * Set the Beacon Duration for I217 to 8 usec
1478 */
1479 if ((hw->mac.type == e1000_pch_lpt) || (hw->mac.type == e1000_pch_spt)) {
1480 u32 mac_reg;
1481
1482 mac_reg = er32(FEXTNVM4);
1483 mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK;
1484 mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC;
1485 ew32(FEXTNVM4, mac_reg);
1415 }1486 }
1416 1487
1417 /* Work-around I218 hang issue */1488 /* Work-around I218 hang issue */
1418 if ((hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_LM) ||1489 if ((hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_LM) ||
1419 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_V) ||1490 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_V) ||
1420 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM3) ||1491 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM3) ||
1421 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3) ||1492 (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3)) {
1422 (hw->mac.type == e1000_pch_spt)) {
1423 ret_val = e1000_k1_workaround_lpt_lp(hw, link);1493 ret_val = e1000_k1_workaround_lpt_lp(hw, link);
1424 if (ret_val)1494 if (ret_val)
1425 return ret_val;1495 return ret_val;
drivers/net/ethernet/intel/e1000e/netdev.c+34−4
@@ -6354,13 +6354,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) · 6353 unmodified lines
6354}6354}
6355 6355
6356/**6356/**
6357 * e1000e_disable_aspm - Disable ASPM states6357 * __e1000e_disable_aspm - Disable ASPM states
6358 * @pdev: pointer to PCI device struct6358 * @pdev: pointer to PCI device struct
6359 * @state: bit-mask of ASPM states to disable6359 * @state: bit-mask of ASPM states to disable
6360 * @locked: indication if this context holds pci_bus_sem locked.
6360 *6361 *
6361 * Some devices *must* have certain ASPM states disabled per hardware errata.6362 * Some devices *must* have certain ASPM states disabled per hardware errata.
6362 **/6363 **/
6363static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)6364static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state, int locked)
6364{6365{
6365 struct pci_dev *parent = pdev->bus->self;6366 struct pci_dev *parent = pdev->bus->self;
6366 u16 aspm_dis_mask = 0;6367 u16 aspm_dis_mask = 0;
@@ -6399,7 +6400,10 @@ static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state) · 32 unmodified lines
6399 "L1" : "");6400 "L1" : "");
6400 6401
6401#ifdef CONFIG_PCIEASPM6402#ifdef CONFIG_PCIEASPM
6402 pci_disable_link_state_locked(pdev, state);6403 if (locked)
6404 pci_disable_link_state_locked(pdev, state);
6405 else
6406 pci_disable_link_state(pdev, state);
6403 6407
6404 /* Double-check ASPM control. If not disabled by the above, the6408 /* Double-check ASPM control. If not disabled by the above, the
6405 * BIOS is preventing that from happening (or CONFIG_PCIEASPM is6409 * BIOS is preventing that from happening (or CONFIG_PCIEASPM is
@@ -6422,6 +6426,32 @@ static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state) · 16 unmodified lines
6422 aspm_dis_mask);6426 aspm_dis_mask);
6423}6427}
6424 6428
6429/**
6430 * e1000e_disable_aspm - Disable ASPM states.
6431 * @pdev: pointer to PCI device struct
6432 * @state: bit-mask of ASPM states to disable
6433 *
6434 * This function acquires the pci_bus_sem!
6435 * Some devices *must* have certain ASPM states disabled per hardware errata.
6436 **/
6437static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
6438{
6439 __e1000e_disable_aspm(pdev, state, 0);
6440}
6441
6442/**
6443 * e1000e_disable_aspm_locked Disable ASPM states.
6444 * @pdev: pointer to PCI device struct
6445 * @state: bit-mask of ASPM states to disable
6446 *
6447 * This function must be called with pci_bus_sem acquired!
6448 * Some devices *must* have certain ASPM states disabled per hardware errata.
6449 **/
6450static void e1000e_disable_aspm_locked(struct pci_dev *pdev, u16 state)
6451{
6452 __e1000e_disable_aspm(pdev, state, 1);
6453}
6454
6425#ifdef CONFIG_PM6455#ifdef CONFIG_PM
6426static int __e1000_resume(struct pci_dev *pdev)6456static int __e1000_resume(struct pci_dev *pdev)
6427{6457{
@@ -6435,7 +6465,7 @@ static int __e1000_resume(struct pci_dev *pdev) · 7 unmodified lines
6435 if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1)6465 if (adapter->flags2 & FLAG2_DISABLE_ASPM_L1)
6436 aspm_disable_flag |= PCIE_LINK_STATE_L1;6466 aspm_disable_flag |= PCIE_LINK_STATE_L1;
6437 if (aspm_disable_flag)6467 if (aspm_disable_flag)
6438 e1000e_disable_aspm(pdev, aspm_disable_flag);6468 e1000e_disable_aspm_locked(pdev, aspm_disable_flag);
6439 6469
6440 pci_set_master(pdev);6470 pci_set_master(pdev);
6441 6471
drivers/net/ethernet/intel/i40evf/i40e_txrx.c+4−0
@@ -484,6 +484,8 @@ int i40evf_setup_tx_descriptors(struct i40e_ring *tx_ring) · 483 unmodified lines
484 if (!dev)484 if (!dev)
485 return -ENOMEM;485 return -ENOMEM;
486 486
487 /* warn if we are about to overwrite the pointer */
488 WARN_ON(tx_ring->tx_bi);
487 bi_size = sizeof(struct i40e_tx_buffer) * tx_ring->count;489 bi_size = sizeof(struct i40e_tx_buffer) * tx_ring->count;
488 tx_ring->tx_bi = kzalloc(bi_size, GFP_KERNEL);490 tx_ring->tx_bi = kzalloc(bi_size, GFP_KERNEL);
489 if (!tx_ring->tx_bi)491 if (!tx_ring->tx_bi)
@@ -644,6 +646,8 @@ int i40evf_setup_rx_descriptors(struct i40e_ring *rx_ring) · 154 unmodified lines
644 struct device *dev = rx_ring->dev;646 struct device *dev = rx_ring->dev;
645 int bi_size;647 int bi_size;
646 648
649 /* warn if we are about to overwrite the pointer */
650 WARN_ON(rx_ring->rx_bi);
647 bi_size = sizeof(struct i40e_rx_buffer) * rx_ring->count;651 bi_size = sizeof(struct i40e_rx_buffer) * rx_ring->count;
648 rx_ring->rx_bi = kzalloc(bi_size, GFP_KERNEL);652 rx_ring->rx_bi = kzalloc(bi_size, GFP_KERNEL);
649 if (!rx_ring->rx_bi)653 if (!rx_ring->rx_bi)
drivers/net/ethernet/intel/i40evf/i40evf.h+0−1
@@ -264,7 +264,6 @@ extern const char i40evf_driver_version[]; · 263 unmodified lines
264 264
265int i40evf_up(struct i40evf_adapter *adapter);265int i40evf_up(struct i40evf_adapter *adapter);
266void i40evf_down(struct i40evf_adapter *adapter);266void i40evf_down(struct i40evf_adapter *adapter);
267void i40evf_reinit_locked(struct i40evf_adapter *adapter);
268void i40evf_reset(struct i40evf_adapter *adapter);267void i40evf_reset(struct i40evf_adapter *adapter);
269void i40evf_set_ethtool_ops(struct net_device *netdev);268void i40evf_set_ethtool_ops(struct net_device *netdev);
270void i40evf_update_stats(struct i40evf_adapter *adapter);269void i40evf_update_stats(struct i40evf_adapter *adapter);
drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c+4−2
@@ -267,8 +267,10 @@ static int i40evf_set_ringparam(struct net_device *netdev, · 266 unmodified lines
267 adapter->tx_desc_count = new_tx_count;267 adapter->tx_desc_count = new_tx_count;
268 adapter->rx_desc_count = new_rx_count;268 adapter->rx_desc_count = new_rx_count;
269 269
270 if (netif_running(netdev))270 if (netif_running(netdev)) {
271 i40evf_reinit_locked(adapter);271 adapter->flags |= I40EVF_FLAG_RESET_NEEDED;
272 schedule_work(&adapter->reset_task);
273 }
272 274
273 return 0;275 return 0;
274}276}
drivers/net/ethernet/intel/i40evf/i40evf_main.c+47−63
@@ -170,7 +170,8 @@ static void i40evf_tx_timeout(struct net_device *netdev) · 169 unmodified lines
170 struct i40evf_adapter *adapter = netdev_priv(netdev);170 struct i40evf_adapter *adapter = netdev_priv(netdev);
171 171
172 adapter->tx_timeout_count++;172 adapter->tx_timeout_count++;
173 if (!(adapter->flags & I40EVF_FLAG_RESET_PENDING)) {173 if (!(adapter->flags & (I40EVF_FLAG_RESET_PENDING |
174 I40EVF_FLAG_RESET_NEEDED))) {
174 adapter->flags |= I40EVF_FLAG_RESET_NEEDED;175 adapter->flags |= I40EVF_FLAG_RESET_NEEDED;
175 schedule_work(&adapter->reset_task);176 schedule_work(&adapter->reset_task);
176 }177 }
@@ -1460,7 +1461,7 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter) · 1283 unmodified lines
1460 for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {1461 for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
1461 lut = 0;1462 lut = 0;
1462 for (j = 0; j < 4; j++) {1463 for (j = 0; j < 4; j++) {
1463 if (cqueue == adapter->vsi_res->num_queue_pairs)1464 if (cqueue == adapter->num_active_queues)
1464 cqueue = 0;1465 cqueue = 0;
1465 lut |= ((cqueue) << (8 * j));1466 lut |= ((cqueue) << (8 * j));
1466 cqueue++;1467 cqueue++;
@@ -1470,8 +1471,8 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter) · 3 unmodified lines
1470 i40e_flush(hw);1471 i40e_flush(hw);
1471}1472}
1472 1473
1473#define I40EVF_RESET_WAIT_MS 1001474#define I40EVF_RESET_WAIT_MS 10
1474#define I40EVF_RESET_WAIT_COUNT 2001475#define I40EVF_RESET_WAIT_COUNT 500
1475/**1476/**
1476 * i40evf_reset_task - Call-back task to handle hardware reset1477 * i40evf_reset_task - Call-back task to handle hardware reset
1477 * @work: pointer to work_struct1478 * @work: pointer to work_struct
@@ -1495,10 +1496,17 @@ static void i40evf_reset_task(struct work_struct *work) · 17 unmodified lines
1495 &adapter->crit_section))1496 &adapter->crit_section))
1496 usleep_range(500, 1000);1497 usleep_range(500, 1000);
1497 1498
1499 i40evf_misc_irq_disable(adapter);
1498 if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) {1500 if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) {
1499 dev_info(&adapter->pdev->dev, "Requesting reset from PF\n");1501 adapter->flags &= ~I40EVF_FLAG_RESET_NEEDED;
1502 /* Restart the AQ here. If we have been reset but didn't
1503 * detect it, or if the PF had to reinit, our AQ will be hosed.
1504 */
1505 i40evf_shutdown_adminq(hw);
1506 i40evf_init_adminq(hw);
1500 i40evf_request_reset(adapter);1507 i40evf_request_reset(adapter);
1501 }1508 }
1509 adapter->flags |= I40EVF_FLAG_RESET_PENDING;
1502 1510
1503 /* poll until we see the reset actually happen */1511 /* poll until we see the reset actually happen */
1504 for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) {1512 for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) {
@@ -1507,10 +1515,10 @@ static void i40evf_reset_task(struct work_struct *work) · 2 unmodified lines
1507 if ((rstat_val != I40E_VFR_VFACTIVE) &&1515 if ((rstat_val != I40E_VFR_VFACTIVE) &&
1508 (rstat_val != I40E_VFR_COMPLETED))1516 (rstat_val != I40E_VFR_COMPLETED))
1509 break;1517 break;
1510 msleep(I40EVF_RESET_WAIT_MS);1518 usleep_range(500, 1000);
1511 }1519 }
1512 if (i == I40EVF_RESET_WAIT_COUNT) {1520 if (i == I40EVF_RESET_WAIT_COUNT) {
1513 adapter->flags &= ~I40EVF_FLAG_RESET_PENDING;1521 dev_info(&adapter->pdev->dev, "Never saw reset\n");
1514 goto continue_reset; /* act like the reset happened */1522 goto continue_reset; /* act like the reset happened */
1515 }1523 }
1516 1524
@@ -1518,11 +1526,12 @@ static void i40evf_reset_task(struct work_struct *work) · 1 unmodified line
1518 for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) {1526 for (i = 0; i < I40EVF_RESET_WAIT_COUNT; i++) {
1519 rstat_val = rd32(hw, I40E_VFGEN_RSTAT) &1527 rstat_val = rd32(hw, I40E_VFGEN_RSTAT) &
1520 I40E_VFGEN_RSTAT_VFR_STATE_MASK;1528 I40E_VFGEN_RSTAT_VFR_STATE_MASK;
1521 if ((rstat_val == I40E_VFR_VFACTIVE) ||1529 if (rstat_val == I40E_VFR_VFACTIVE)
1522 (rstat_val == I40E_VFR_COMPLETED))
1523 break;1530 break;
1524 msleep(I40EVF_RESET_WAIT_MS);1531 msleep(I40EVF_RESET_WAIT_MS);
1525 }1532 }
1533 /* extra wait to make sure minimum wait is met */
1534 msleep(I40EVF_RESET_WAIT_MS);
1526 if (i == I40EVF_RESET_WAIT_COUNT) {1535 if (i == I40EVF_RESET_WAIT_COUNT) {
1527 struct i40evf_mac_filter *f, *ftmp;1536 struct i40evf_mac_filter *f, *ftmp;
1528 struct i40evf_vlan_filter *fv, *fvtmp;1537 struct i40evf_vlan_filter *fv, *fvtmp;
@@ -1534,11 +1543,10 @@ static void i40evf_reset_task(struct work_struct *work) · 5 unmodified lines
1534 1543
1535 if (netif_running(adapter->netdev)) {1544 if (netif_running(adapter->netdev)) {
1536 set_bit(__I40E_DOWN, &adapter->vsi.state);1545 set_bit(__I40E_DOWN, &adapter->vsi.state);
1537 i40evf_irq_disable(adapter);
1538 i40evf_napi_disable_all(adapter);
1539 netif_tx_disable(netdev);
1540 netif_tx_stop_all_queues(netdev);
1541 netif_carrier_off(netdev);1546 netif_carrier_off(netdev);
1547 netif_tx_disable(netdev);
1548 i40evf_napi_disable_all(adapter);
1549 i40evf_irq_disable(adapter);
1542 i40evf_free_traffic_irqs(adapter);1550 i40evf_free_traffic_irqs(adapter);
1543 i40evf_free_all_tx_resources(adapter);1551 i40evf_free_all_tx_resources(adapter);
1544 i40evf_free_all_rx_resources(adapter);1552 i40evf_free_all_rx_resources(adapter);
@@ -1550,6 +1558,7 @@ static void i40evf_reset_task(struct work_struct *work) · 5 unmodified lines
1550 list_del(&f->list);1558 list_del(&f->list);
1551 kfree(f);1559 kfree(f);
1552 }1560 }
1561
1553 list_for_each_entry_safe(fv, fvtmp, &adapter->vlan_filter_list,1562 list_for_each_entry_safe(fv, fvtmp, &adapter->vlan_filter_list,
1554 list) {1563 list) {
1555 list_del(&fv->list);1564 list_del(&fv->list);
@@ -1564,22 +1573,27 @@ static void i40evf_reset_task(struct work_struct *work) · 8 unmodified lines
1564 i40evf_shutdown_adminq(hw);1573 i40evf_shutdown_adminq(hw);
1565 adapter->netdev->flags &= ~IFF_UP;1574 adapter->netdev->flags &= ~IFF_UP;
1566 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);1575 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
1576 adapter->flags &= ~I40EVF_FLAG_RESET_PENDING;
1577 dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n");
1567 return; /* Do not attempt to reinit. It's dead, Jim. */1578 return; /* Do not attempt to reinit. It's dead, Jim. */
1568 }1579 }
1569 1580
1570continue_reset:1581continue_reset:
1571 adapter->flags &= ~I40EVF_FLAG_RESET_PENDING;
1572
1573 i40evf_irq_disable(adapter);
1574
1575 if (netif_running(adapter->netdev)) {1582 if (netif_running(adapter->netdev)) {
1576 i40evf_napi_disable_all(adapter);
1577 netif_tx_disable(netdev);
1578 netif_tx_stop_all_queues(netdev);
1579 netif_carrier_off(netdev);1583 netif_carrier_off(netdev);
1584 netif_tx_stop_all_queues(netdev);
1585 i40evf_napi_disable_all(adapter);
1580 }1586 }
1587 i40evf_irq_disable(adapter);
1581 1588
1582 adapter->state = __I40EVF_RESETTING;1589 adapter->state = __I40EVF_RESETTING;
1590 adapter->flags &= ~I40EVF_FLAG_RESET_PENDING;
1591
1592 /* free the Tx/Rx rings and descriptors, might be better to just
1593 * re-use them sometime in the future
1594 */
1595 i40evf_free_all_rx_resources(adapter);
1596 i40evf_free_all_tx_resources(adapter);
1583 1597
1584 /* kill and reinit the admin queue */1598 /* kill and reinit the admin queue */
1585 if (i40evf_shutdown_adminq(hw))1599 if (i40evf_shutdown_adminq(hw))
@@ -1603,6 +1617,7 @@ continue_reset: · 17 unmodified lines
1603 adapter->aq_required = I40EVF_FLAG_AQ_ADD_MAC_FILTER;1617 adapter->aq_required = I40EVF_FLAG_AQ_ADD_MAC_FILTER;
1604 adapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;1618 adapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;
1605 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);1619 clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
1620 i40evf_misc_irq_enable(adapter);
1606 1621
1607 mod_timer(&adapter->watchdog_timer, jiffies + 2);1622 mod_timer(&adapter->watchdog_timer, jiffies + 2);
1608 1623
@@ -1624,7 +1639,10 @@ continue_reset: · 15 unmodified lines
1624 goto reset_err;1639 goto reset_err;
1625 1640
1626 i40evf_irq_enable(adapter, true);1641 i40evf_irq_enable(adapter, true);
1642 } else {
1643 adapter->state = __I40EVF_DOWN;
1627 }1644 }
1645
1628 return;1646 return;
1629reset_err:1647reset_err:
1630 dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");1648 dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
@@ -1667,6 +1685,11 @@ static void i40evf_adminq_task(struct work_struct *work) · 36 unmodified lines
1667 memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);1685 memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);
1668 } while (pending);1686 } while (pending);
1669 1687
1688 if ((adapter->flags &
1689 (I40EVF_FLAG_RESET_PENDING | I40EVF_FLAG_RESET_NEEDED)) ||
1690 adapter->state == __I40EVF_RESETTING)
1691 goto freedom;
1692
1670 /* check for error indications */1693 /* check for error indications */
1671 val = rd32(hw, hw->aq.arq.len);1694 val = rd32(hw, hw->aq.arq.len);
1672 oldval = val;1695 oldval = val;
@@ -1702,6 +1725,7 @@ static void i40evf_adminq_task(struct work_struct *work) · 29 unmodified lines
1702 if (oldval != val)1725 if (oldval != val)
1703 wr32(hw, hw->aq.asq.len, val);1726 wr32(hw, hw->aq.asq.len, val);
1704 1727
1728freedom:
1705 kfree(event.msg_buf);1729 kfree(event.msg_buf);
1706out:1730out:
1707 /* re-enable Admin queue interrupt cause */1731 /* re-enable Admin queue interrupt cause */
@@ -1896,47 +1920,6 @@ static struct net_device_stats *i40evf_get_stats(struct net_device *netdev) · 188 unmodified lines
1896 return &adapter->net_stats;1920 return &adapter->net_stats;
1897}1921}
1898 1922
1899/**
1900 * i40evf_reinit_locked - Software reinit
1901 * @adapter: board private structure
1902 *
1903 * Reinititalizes the ring structures in response to a software configuration
1904 * change. Roughly the same as close followed by open, but skips releasing
1905 * and reallocating the interrupts.
1906 **/
1907void i40evf_reinit_locked(struct i40evf_adapter *adapter)
1908{
1909 struct net_device *netdev = adapter->netdev;
1910 int err;
1911
1912 WARN_ON(in_interrupt());
1913
1914 i40evf_down(adapter);
1915
1916 /* allocate transmit descriptors */
1917 err = i40evf_setup_all_tx_resources(adapter);
1918 if (err)
1919 goto err_reinit;
1920
1921 /* allocate receive descriptors */
1922 err = i40evf_setup_all_rx_resources(adapter);
1923 if (err)
1924 goto err_reinit;
1925
1926 i40evf_configure(adapter);
1927
1928 err = i40evf_up_complete(adapter);
1929 if (err)
1930 goto err_reinit;
1931
1932 i40evf_irq_enable(adapter, true);
1933 return;
1934
1935err_reinit:
1936 dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
1937 i40evf_close(netdev);
1938}
1939
1940/**1923/**
1941 * i40evf_change_mtu - Change the Maximum Transfer Unit1924 * i40evf_change_mtu - Change the Maximum Transfer Unit
1942 * @netdev: network interface device structure1925 * @netdev: network interface device structure
@@ -1952,9 +1935,10 @@ static int i40evf_change_mtu(struct net_device *netdev, int new_mtu) · 9 unmodified lines
1952 if ((new_mtu < 68) || (max_frame > I40E_MAX_RXBUFFER))1935 if ((new_mtu < 68) || (max_frame > I40E_MAX_RXBUFFER))
1953 return -EINVAL;1936 return -EINVAL;
1954 1937
1955 /* must set new MTU before calling down or up */
1956 netdev->mtu = new_mtu;1938 netdev->mtu = new_mtu;
1957 i40evf_reinit_locked(adapter);1939 adapter->flags |= I40EVF_FLAG_RESET_NEEDED;
1940 schedule_work(&adapter->reset_task);
1941
1958 return 0;1942 return 0;
1959}1943}
1960 1944
drivers/net/ethernet/intel/igb/e1000_82575.c+8−4
@@ -1,5 +1,5 @@
1/* Intel(R) Gigabit Ethernet Linux driver1/* Intel(R) Gigabit Ethernet Linux driver
2 * Copyright(c) 2007-2014 Intel Corporation.2 * Copyright(c) 2007-2015 Intel Corporation.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify it4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,5 * under the terms and conditions of the GNU General Public License,
@@ -1900,8 +1900,8 @@ static void igb_clear_hw_cntrs_82575(struct e1000_hw *hw) · 1894 unmodified lines
1900 * igb_rx_fifo_flush_82575 - Clean rx fifo after RX enable1900 * igb_rx_fifo_flush_82575 - Clean rx fifo after RX enable
1901 * @hw: pointer to the HW structure1901 * @hw: pointer to the HW structure
1902 *1902 *
1903 * After rx enable if managability is enabled then there is likely some1903 * After rx enable if manageability is enabled then there is likely some
1904 * bad data at the start of the fifo and possibly in the DMA fifo. This1904 * bad data at the start of the fifo and possibly in the DMA fifo. This
1905 * function clears the fifos and flushes any packets that came in as rx was1905 * function clears the fifos and flushes any packets that came in as rx was
1906 * being enabled.1906 * being enabled.
1907 **/1907 **/
@@ -1910,6 +1910,11 @@ void igb_rx_fifo_flush_82575(struct e1000_hw *hw) · 2 unmodified lines
1910 u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled;1910 u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled;
1911 int i, ms_wait;1911 int i, ms_wait;
1912 1912
1913 /* disable IPv6 options as per hardware errata */
1914 rfctl = rd32(E1000_RFCTL);
1915 rfctl |= E1000_RFCTL_IPV6_EX_DIS;
1916 wr32(E1000_RFCTL, rfctl);
1917
1913 if (hw->mac.type != e1000_82575 ||1918 if (hw->mac.type != e1000_82575 ||
1914 !(rd32(E1000_MANC) & E1000_MANC_RCV_TCO_EN))1919 !(rd32(E1000_MANC) & E1000_MANC_RCV_TCO_EN))
1915 return;1920 return;
@@ -1937,7 +1942,6 @@ void igb_rx_fifo_flush_82575(struct e1000_hw *hw) · 21 unmodified lines
1937 * incoming packets are rejected. Set enable and wait 2ms so that1942 * incoming packets are rejected. Set enable and wait 2ms so that
1938 * any packet that was coming in as RCTL.EN was set is flushed1943 * any packet that was coming in as RCTL.EN was set is flushed
1939 */1944 */
1940 rfctl = rd32(E1000_RFCTL);
1941 wr32(E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF);1945 wr32(E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF);
1942 1946
1943 rlpml = rd32(E1000_RLPML);1947 rlpml = rd32(E1000_RLPML);
drivers/net/ethernet/intel/igb/e1000_defines.h+2−1
@@ -344,7 +344,8 @@ · 343 unmodified lines
344#define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */344#define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */
345 345
346/* Header split receive */346/* Header split receive */
347#define E1000_RFCTL_LEF 0x00040000347#define E1000_RFCTL_IPV6_EX_DIS 0x00010000
348#define E1000_RFCTL_LEF 0x00040000
348 349
349/* Collision related configuration parameters */350/* Collision related configuration parameters */
350#define E1000_COLLISION_THRESHOLD 15351#define E1000_COLLISION_THRESHOLD 15
drivers/net/ethernet/intel/igb/igb_main.c+1−1
@@ -58,7 +58,7 @@ · 57 unmodified lines
58 58
59#define MAJ 559#define MAJ 5
60#define MIN 260#define MIN 2
61#define BUILD 1561#define BUILD 18
62#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \62#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
63__stringify(BUILD) "-k"63__stringify(BUILD) "-k"
64char igb_driver_name[] = "igb";64char igb_driver_name[] = "igb";
drivers/net/ethernet/marvell/mvneta.c+26−1
@@ -310,6 +310,7 @@ struct mvneta_port { · 309 unmodified lines
310 unsigned int link;310 unsigned int link;
311 unsigned int duplex;311 unsigned int duplex;
312 unsigned int speed;312 unsigned int speed;
313 unsigned int tx_csum_limit;
313 int use_inband_status:1;314 int use_inband_status:1;
314};315};
315 316
@@ -2508,8 +2509,10 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) · 2192 unmodified lines
2508 2509
2509 dev->mtu = mtu;2510 dev->mtu = mtu;
2510 2511
2511 if (!netif_running(dev))2512 if (!netif_running(dev)) {
2513 netdev_update_features(dev);
2512 return 0;2514 return 0;
2515 }
2513 2516
2514 /* The interface is running, so we have to force a2517 /* The interface is running, so we have to force a
2515 * reallocation of the queues2518 * reallocation of the queues
@@ -2538,9 +2541,26 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) · 22 unmodified lines
2538 mvneta_start_dev(pp);2541 mvneta_start_dev(pp);
2539 mvneta_port_up(pp);2542 mvneta_port_up(pp);
2540 2543
2544 netdev_update_features(dev);
2545
2541 return 0;2546 return 0;
2542}2547}
2543 2548
2549static netdev_features_t mvneta_fix_features(struct net_device *dev,
2550 netdev_features_t features)
2551{
2552 struct mvneta_port *pp = netdev_priv(dev);
2553
2554 if (pp->tx_csum_limit && dev->mtu > pp->tx_csum_limit) {
2555 features &= ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
2556 netdev_info(dev,
2557 "Disable IP checksum for MTU greater than %dB\n",
2558 pp->tx_csum_limit);
2559 }
2560
2561 return features;
2562}
2563
2544/* Get mac address */2564/* Get mac address */
2545static void mvneta_get_mac_addr(struct mvneta_port *pp, unsigned char *addr)2565static void mvneta_get_mac_addr(struct mvneta_port *pp, unsigned char *addr)
2546{2566{
@@ -2862,6 +2882,7 @@ static const struct net_device_ops mvneta_netdev_ops = { · 315 unmodified lines
2862 .ndo_set_rx_mode = mvneta_set_rx_mode,2882 .ndo_set_rx_mode = mvneta_set_rx_mode,
2863 .ndo_set_mac_address = mvneta_set_mac_addr,2883 .ndo_set_mac_address = mvneta_set_mac_addr,
2864 .ndo_change_mtu = mvneta_change_mtu,2884 .ndo_change_mtu = mvneta_change_mtu,
2885 .ndo_fix_features = mvneta_fix_features,
2865 .ndo_get_stats64 = mvneta_get_stats64,2886 .ndo_get_stats64 = mvneta_get_stats64,
2866 .ndo_do_ioctl = mvneta_ioctl,2887 .ndo_do_ioctl = mvneta_ioctl,
2867};2888};
@@ -3107,6 +3128,9 @@ static int mvneta_probe(struct platform_device *pdev) · 239 unmodified lines
3107 }3128 }
3108 }3129 }
3109 3130
3131 if (of_device_is_compatible(dn, "marvell,armada-370-neta"))
3132 pp->tx_csum_limit = 1600;
3133
3110 pp->tx_ring_size = MVNETA_MAX_TXD;3134 pp->tx_ring_size = MVNETA_MAX_TXD;
3111 pp->rx_ring_size = MVNETA_MAX_RXD;3135 pp->rx_ring_size = MVNETA_MAX_RXD;
3112 3136
@@ -3185,6 +3209,7 @@ static int mvneta_remove(struct platform_device *pdev) · 72 unmodified lines
3185 3209
3186static const struct of_device_id mvneta_match[] = {3210static const struct of_device_id mvneta_match[] = {
3187 { .compatible = "marvell,armada-370-neta" },3211 { .compatible = "marvell,armada-370-neta" },
3212 { .compatible = "marvell,armada-xp-neta" },
3188 { }3213 { }
3189};3214};
3190MODULE_DEVICE_TABLE(of, mvneta_match);3215MODULE_DEVICE_TABLE(of, mvneta_match);
drivers/net/ethernet/mellanox/mlx4/en_netdev.c+0−4
@@ -1977,10 +1977,6 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv) · 1976 unmodified lines
1977 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]);1977 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]);
1978 }1978 }
1979 1979
1980 if (priv->base_tx_qpn) {
1981 mlx4_qp_release_range(priv->mdev->dev, priv->base_tx_qpn, priv->tx_ring_num);
1982 priv->base_tx_qpn = 0;
1983 }
1984}1980}
1985 1981
1986int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)1982int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
drivers/net/ethernet/mellanox/mlx4/en_rx.c+6−11
@@ -718,7 +718,7 @@ static int get_fixed_ipv6_csum(__wsum hw_checksum, struct sk_buff *skb, · 717 unmodified lines
718}718}
719#endif719#endif
720static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, void *va,720static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, void *va,
721 int hwtstamp_rx_filter)721 netdev_features_t dev_features)
722{722{
723 __wsum hw_checksum = 0;723 __wsum hw_checksum = 0;
724 724
@@ -726,14 +726,8 @@ static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, void *va, · 1 unmodified line
726 726
727 hw_checksum = csum_unfold((__force __sum16)cqe->checksum);727 hw_checksum = csum_unfold((__force __sum16)cqe->checksum);
728 728
729 if (((struct ethhdr *)va)->h_proto == htons(ETH_P_8021Q) &&729 if (cqe->vlan_my_qpn & cpu_to_be32(MLX4_CQE_VLAN_PRESENT_MASK) &&
730 hwtstamp_rx_filter != HWTSTAMP_FILTER_NONE) {730 !(dev_features & NETIF_F_HW_VLAN_CTAG_RX)) {
731 /* next protocol non IPv4 or IPv6 */
732 if (((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto
733 != htons(ETH_P_IP) &&
734 ((struct vlan_hdr *)hdr)->h_vlan_encapsulated_proto
735 != htons(ETH_P_IPV6))
736 return -1;
737 hw_checksum = get_fixed_vlan_csum(hw_checksum, hdr);731 hw_checksum = get_fixed_vlan_csum(hw_checksum, hdr);
738 hdr += sizeof(struct vlan_hdr);732 hdr += sizeof(struct vlan_hdr);
739 }733 }
@@ -896,7 +890,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · 156 unmodified lines
896 890
897 if (ip_summed == CHECKSUM_COMPLETE) {891 if (ip_summed == CHECKSUM_COMPLETE) {
898 void *va = skb_frag_address(skb_shinfo(gro_skb)->frags);892 void *va = skb_frag_address(skb_shinfo(gro_skb)->frags);
899 if (check_csum(cqe, gro_skb, va, ring->hwtstamp_rx_filter)) {893 if (check_csum(cqe, gro_skb, va,
894 dev->features)) {
900 ip_summed = CHECKSUM_NONE;895 ip_summed = CHECKSUM_NONE;
901 ring->csum_none++;896 ring->csum_none++;
902 ring->csum_complete--;897 ring->csum_complete--;
@@ -951,7 +946,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud · 48 unmodified lines
951 }946 }
952 947
953 if (ip_summed == CHECKSUM_COMPLETE) {948 if (ip_summed == CHECKSUM_COMPLETE) {
954 if (check_csum(cqe, skb, skb->data, ring->hwtstamp_rx_filter)) {949 if (check_csum(cqe, skb, skb->data, dev->features)) {
955 ip_summed = CHECKSUM_NONE;950 ip_summed = CHECKSUM_NONE;
956 ring->csum_complete--;951 ring->csum_complete--;
957 ring->csum_none++;952 ring->csum_none++;
drivers/net/ethernet/mellanox/mlx4/en_tx.c+12−8
@@ -66,6 +66,7 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, · 65 unmodified lines
66 ring->size = size;66 ring->size = size;
67 ring->size_mask = size - 1;67 ring->size_mask = size - 1;
68 ring->stride = stride;68 ring->stride = stride;
69 ring->full_size = ring->size - HEADROOM - MAX_DESC_TXBBS;
69 70
70 tmp = size * sizeof(struct mlx4_en_tx_info);71 tmp = size * sizeof(struct mlx4_en_tx_info);
71 ring->tx_info = kmalloc_node(tmp, GFP_KERNEL | __GFP_NOWARN, node);72 ring->tx_info = kmalloc_node(tmp, GFP_KERNEL | __GFP_NOWARN, node);
@@ -180,6 +181,7 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv, · 108 unmodified lines
180 mlx4_bf_free(mdev->dev, &ring->bf);181 mlx4_bf_free(mdev->dev, &ring->bf);
181 mlx4_qp_remove(mdev->dev, &ring->qp);182 mlx4_qp_remove(mdev->dev, &ring->qp);
182 mlx4_qp_free(mdev->dev, &ring->qp);183 mlx4_qp_free(mdev->dev, &ring->qp);
184 mlx4_qp_release_range(priv->mdev->dev, ring->qpn, 1);
183 mlx4_en_unmap_buffer(&ring->wqres.buf);185 mlx4_en_unmap_buffer(&ring->wqres.buf);
184 mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);186 mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
185 kfree(ring->bounce_buf);187 kfree(ring->bounce_buf);
@@ -231,6 +233,11 @@ void mlx4_en_deactivate_tx_ring(struct mlx4_en_priv *priv, · 45 unmodified lines
231 MLX4_QP_STATE_RST, NULL, 0, 0, &ring->qp);233 MLX4_QP_STATE_RST, NULL, 0, 0, &ring->qp);
232}234}
233 235
236static inline bool mlx4_en_is_tx_ring_full(struct mlx4_en_tx_ring *ring)
237{
238 return ring->prod - ring->cons > ring->full_size;
239}
240
234static void mlx4_en_stamp_wqe(struct mlx4_en_priv *priv,241static void mlx4_en_stamp_wqe(struct mlx4_en_priv *priv,
235 struct mlx4_en_tx_ring *ring, int index,242 struct mlx4_en_tx_ring *ring, int index,
236 u8 owner)243 u8 owner)
@@ -473,11 +480,10 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev, · 236 unmodified lines
473 480
474 netdev_tx_completed_queue(ring->tx_queue, packets, bytes);481 netdev_tx_completed_queue(ring->tx_queue, packets, bytes);
475 482
476 /*483 /* Wakeup Tx queue if this stopped, and ring is not full.
477 * Wakeup Tx queue if this stopped, and at least 1 packet
478 * was completed
479 */484 */
480 if (netif_tx_queue_stopped(ring->tx_queue) && txbbs_skipped > 0) {485 if (netif_tx_queue_stopped(ring->tx_queue) &&
486 !mlx4_en_is_tx_ring_full(ring)) {
481 netif_tx_wake_queue(ring->tx_queue);487 netif_tx_wake_queue(ring->tx_queue);
482 ring->wake_queue++;488 ring->wake_queue++;
483 }489 }
@@ -921,8 +927,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) · 437 unmodified lines
921 skb_tx_timestamp(skb);927 skb_tx_timestamp(skb);
922 928
923 /* Check available TXBBs And 2K spare for prefetch */929 /* Check available TXBBs And 2K spare for prefetch */
924 stop_queue = (int)(ring->prod - ring_cons) >930 stop_queue = mlx4_en_is_tx_ring_full(ring);
925 ring->size - HEADROOM - MAX_DESC_TXBBS;
926 if (unlikely(stop_queue)) {931 if (unlikely(stop_queue)) {
927 netif_tx_stop_queue(ring->tx_queue);932 netif_tx_stop_queue(ring->tx_queue);
928 ring->queue_stopped++;933 ring->queue_stopped++;
@@ -991,8 +996,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) · 62 unmodified lines
991 smp_rmb();996 smp_rmb();
992 997
993 ring_cons = ACCESS_ONCE(ring->cons);998 ring_cons = ACCESS_ONCE(ring->cons);
994 if (unlikely(((int)(ring->prod - ring_cons)) <=999 if (unlikely(!mlx4_en_is_tx_ring_full(ring))) {
995 ring->size - HEADROOM - MAX_DESC_TXBBS)) {
996 netif_tx_wake_queue(ring->tx_queue);1000 netif_tx_wake_queue(ring->tx_queue);
997 ring->wake_queue++;1001 ring->wake_queue++;
998 }1002 }
drivers/net/ethernet/mellanox/mlx4/intf.c+7−1
@@ -93,8 +93,14 @@ int mlx4_register_interface(struct mlx4_interface *intf) · 92 unmodified lines
93 mutex_lock(&intf_mutex);93 mutex_lock(&intf_mutex);
94 94
95 list_add_tail(&intf->list, &intf_list);95 list_add_tail(&intf->list, &intf_list);
96 list_for_each_entry(priv, &dev_list, dev_list)96 list_for_each_entry(priv, &dev_list, dev_list) {
97 if (mlx4_is_mfunc(&priv->dev) && (intf->flags & MLX4_INTFF_BONDING)) {
98 mlx4_dbg(&priv->dev,
99 "SRIOV, disabling HA mode for intf proto %d\n", intf->protocol);
100 intf->flags &= ~MLX4_INTFF_BONDING;
101 }
97 mlx4_add_device(intf, priv);102 mlx4_add_device(intf, priv);
103 }
98 104
99 mutex_unlock(&intf_mutex);105 mutex_unlock(&intf_mutex);
100 106
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+1−1
@@ -279,6 +279,7 @@ struct mlx4_en_tx_ring { · 278 unmodified lines
279 u32 size; /* number of TXBBs */279 u32 size; /* number of TXBBs */
280 u32 size_mask;280 u32 size_mask;
281 u16 stride;281 u16 stride;
282 u32 full_size;
282 u16 cqn; /* index of port CQ associated with this ring */283 u16 cqn; /* index of port CQ associated with this ring */
283 u32 buf_size;284 u32 buf_size;
284 __be32 doorbell_qpn;285 __be32 doorbell_qpn;
@@ -580,7 +581,6 @@ struct mlx4_en_priv { · 295 unmodified lines
580 int vids[128];581 int vids[128];
581 bool wol;582 bool wol;
582 struct device *ddev;583 struct device *ddev;
583 int base_tx_qpn;
584 struct hlist_head mac_hash[MLX4_EN_MAC_HASH_SIZE];584 struct hlist_head mac_hash[MLX4_EN_MAC_HASH_SIZE];
585 struct hwtstamp_config hwtstamp_config;585 struct hwtstamp_config hwtstamp_config;
586 u32 counter_index;586 u32 counter_index;
drivers/net/ethernet/renesas/ravb_ptp.c+3−1
@@ -116,8 +116,10 @@ static int ravb_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb) · 115 unmodified lines
116 priv->ptp.current_addend = addend;116 priv->ptp.current_addend = addend;
117 117
118 gccr = ravb_read(ndev, GCCR);118 gccr = ravb_read(ndev, GCCR);
119 if (gccr & GCCR_LTI)119 if (gccr & GCCR_LTI) {
120 spin_unlock_irqrestore(&priv->lock, flags);
120 return -EBUSY;121 return -EBUSY;
122 }
121 ravb_write(ndev, addend & GTI_TIV, GTI);123 ravb_write(ndev, addend & GTI_TIV, GTI);
122 ravb_write(ndev, gccr | GCCR_LTI, GCCR);124 ravb_write(ndev, gccr | GCCR_LTI, GCCR);
123 125
drivers/net/ethernet/sis/sis900.h+2−2
@@ -56,7 +56,7 @@ enum sis900_configuration_register_bits { · 55 unmodified lines
56 EDB_MASTER_EN = 0x0000200056 EDB_MASTER_EN = 0x00002000
57};57};
58 58
59enum sis900_eeprom_access_reigster_bits {59enum sis900_eeprom_access_register_bits {
60 MDC = 0x00000040, MDDIR = 0x00000020, MDIO = 0x00000010, /* 7016 specific */60 MDC = 0x00000040, MDDIR = 0x00000020, MDIO = 0x00000010, /* 7016 specific */
61 EECS = 0x00000008, EECLK = 0x00000004, EEDO = 0x00000002,61 EECS = 0x00000008, EECLK = 0x00000004, EEDO = 0x00000002,
62 EEDI = 0x0000000162 EEDI = 0x00000001
@@ -73,7 +73,7 @@ enum sis900_interrupt_register_bits { · 10 unmodified lines
73 RxERR = 0x00000004, RxDESC = 0x00000002, RxOK = 0x0000000173 RxERR = 0x00000004, RxDESC = 0x00000002, RxOK = 0x00000001
74};74};
75 75
76enum sis900_interrupt_enable_reigster_bits {76enum sis900_interrupt_enable_register_bits {
77 IE = 0x0000000177 IE = 0x00000001
78};78};
79 79
drivers/net/ethernet/stmicro/stmmac/mmc_core.c+2−2
@@ -73,7 +73,7 @@ · 72 unmodified lines
73#define MMC_RX_OCTETCOUNT_G 0x0000018873#define MMC_RX_OCTETCOUNT_G 0x00000188
74#define MMC_RX_BROADCASTFRAME_G 0x0000018c74#define MMC_RX_BROADCASTFRAME_G 0x0000018c
75#define MMC_RX_MULTICASTFRAME_G 0x0000019075#define MMC_RX_MULTICASTFRAME_G 0x00000190
76#define MMC_RX_CRC_ERRROR 0x0000019476#define MMC_RX_CRC_ERROR 0x00000194
77#define MMC_RX_ALIGN_ERROR 0x0000019877#define MMC_RX_ALIGN_ERROR 0x00000198
78#define MMC_RX_RUN_ERROR 0x0000019C78#define MMC_RX_RUN_ERROR 0x0000019C
79#define MMC_RX_JABBER_ERROR 0x000001A079#define MMC_RX_JABBER_ERROR 0x000001A0
@@ -196,7 +196,7 @@ void dwmac_mmc_read(void __iomem *ioaddr, struct stmmac_counters *mmc) · 116 unmodified lines
196 mmc->mmc_rx_octetcount_g += readl(ioaddr + MMC_RX_OCTETCOUNT_G);196 mmc->mmc_rx_octetcount_g += readl(ioaddr + MMC_RX_OCTETCOUNT_G);
197 mmc->mmc_rx_broadcastframe_g += readl(ioaddr + MMC_RX_BROADCASTFRAME_G);197 mmc->mmc_rx_broadcastframe_g += readl(ioaddr + MMC_RX_BROADCASTFRAME_G);
198 mmc->mmc_rx_multicastframe_g += readl(ioaddr + MMC_RX_MULTICASTFRAME_G);198 mmc->mmc_rx_multicastframe_g += readl(ioaddr + MMC_RX_MULTICASTFRAME_G);
199 mmc->mmc_rx_crc_error += readl(ioaddr + MMC_RX_CRC_ERRROR);199 mmc->mmc_rx_crc_error += readl(ioaddr + MMC_RX_CRC_ERROR);
200 mmc->mmc_rx_align_error += readl(ioaddr + MMC_RX_ALIGN_ERROR);200 mmc->mmc_rx_align_error += readl(ioaddr + MMC_RX_ALIGN_ERROR);
201 mmc->mmc_rx_run_error += readl(ioaddr + MMC_RX_RUN_ERROR);201 mmc->mmc_rx_run_error += readl(ioaddr + MMC_RX_RUN_ERROR);
202 mmc->mmc_rx_jabber_error += readl(ioaddr + MMC_RX_JABBER_ERROR);202 mmc->mmc_rx_jabber_error += readl(ioaddr + MMC_RX_JABBER_ERROR);
drivers/net/ethernet/via/Kconfig+2−0
@@ -18,6 +18,7 @@ if NET_VENDOR_VIA · 17 unmodified lines
18config VIA_RHINE18config VIA_RHINE
19 tristate "VIA Rhine support"19 tristate "VIA Rhine support"
20 depends on (PCI || OF_IRQ)20 depends on (PCI || OF_IRQ)
21 depends on HAS_DMA
21 select CRC3222 select CRC32
22 select MII23 select MII
23 ---help---24 ---help---
@@ -42,6 +43,7 @@ config VIA_RHINE_MMIO · 18 unmodified lines
42config VIA_VELOCITY43config VIA_VELOCITY
43 tristate "VIA Velocity support"44 tristate "VIA Velocity support"
44 depends on (PCI || (OF_ADDRESS && OF_IRQ))45 depends on (PCI || (OF_ADDRESS && OF_IRQ))
46 depends on HAS_DMA
45 select CRC3247 select CRC32
46 select CRC_CCITT48 select CRC_CCITT
47 select MII49 select MII
drivers/net/phy/bcm7xxx.c+7−0
@@ -246,6 +246,13 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev) · 245 unmodified lines
246 pr_info_once("%s: %s PHY revision: 0x%02x, patch: %d\n",246 pr_info_once("%s: %s PHY revision: 0x%02x, patch: %d\n",
247 dev_name(&phydev->dev), phydev->drv->name, rev, patch);247 dev_name(&phydev->dev), phydev->drv->name, rev, patch);
248 248
249 /* Dummy read to a register to workaround an issue upon reset where the
250 * internal inverter may not allow the first MDIO transaction to pass
251 * the MDIO management controller and make us return 0xffff for such
252 * reads.
253 */
254 phy_read(phydev, MII_BMSR);
255
249 switch (rev) {256 switch (rev) {
250 case 0xb0:257 case 0xb0:
251 ret = bcm7xxx_28nm_b0_afe_config_init(phydev);258 ret = bcm7xxx_28nm_b0_afe_config_init(phydev);
drivers/net/phy/mdio-bcm-unimac.c+43−0
@@ -120,6 +120,48 @@ static int unimac_mdio_write(struct mii_bus *bus, int phy_id, · 119 unmodified lines
120 return 0;120 return 0;
121}121}
122 122
123/* Workaround for integrated BCM7xxx Gigabit PHYs which have a problem with
124 * their internal MDIO management controller making them fail to successfully
125 * be read from or written to for the first transaction. We insert a dummy
126 * BMSR read here to make sure that phy_get_device() and get_phy_id() can
127 * correctly read the PHY MII_PHYSID1/2 registers and successfully register a
128 * PHY device for this peripheral.
129 *
130 * Once the PHY driver is registered, we can workaround subsequent reads from
131 * there (e.g: during system-wide power management).
132 *
133 * bus->reset is invoked before mdiobus_scan during mdiobus_register and is
134 * therefore the right location to stick that workaround. Since we do not want
135 * to read from non-existing PHYs, we either use bus->phy_mask or do a manual
136 * Device Tree scan to limit the search area.
137 */
138static int unimac_mdio_reset(struct mii_bus *bus)
139{
140 struct device_node *np = bus->dev.of_node;
141 struct device_node *child;
142 u32 read_mask = 0;
143 int addr;
144
145 if (!np) {
146 read_mask = ~bus->phy_mask;
147 } else {
148 for_each_available_child_of_node(np, child) {
149 addr = of_mdio_parse_addr(&bus->dev, child);
150 if (addr < 0)
151 continue;
152
153 read_mask |= 1 << addr;
154 }
155 }
156
157 for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
158 if (read_mask & 1 << addr)
159 mdiobus_read(bus, addr, MII_BMSR);
160 }
161
162 return 0;
163}
164
123static int unimac_mdio_probe(struct platform_device *pdev)165static int unimac_mdio_probe(struct platform_device *pdev)
124{166{
125 struct unimac_mdio_priv *priv;167 struct unimac_mdio_priv *priv;
@@ -155,6 +197,7 @@ static int unimac_mdio_probe(struct platform_device *pdev) · 29 unmodified lines
155 bus->parent = &pdev->dev;197 bus->parent = &pdev->dev;
156 bus->read = unimac_mdio_read;198 bus->read = unimac_mdio_read;
157 bus->write = unimac_mdio_write;199 bus->write = unimac_mdio_write;
200 bus->reset = unimac_mdio_reset;
158 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", pdev->name);201 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", pdev->name);
159 202
160 bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);203 bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);
drivers/net/phy/phy_device.c+17−8
@@ -230,7 +230,7 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id, · 229 unmodified lines
230 for (i = 1;230 for (i = 1;
231 i < num_ids && c45_ids->devices_in_package == 0;231 i < num_ids && c45_ids->devices_in_package == 0;
232 i++) {232 i++) {
233 reg_addr = MII_ADDR_C45 | i << 16 | MDIO_DEVS2;233retry: reg_addr = MII_ADDR_C45 | i << 16 | MDIO_DEVS2;
234 phy_reg = mdiobus_read(bus, addr, reg_addr);234 phy_reg = mdiobus_read(bus, addr, reg_addr);
235 if (phy_reg < 0)235 if (phy_reg < 0)
236 return -EIO;236 return -EIO;
@@ -242,12 +242,20 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr, u32 *phy_id, · 5 unmodified lines
242 return -EIO;242 return -EIO;
243 c45_ids->devices_in_package |= (phy_reg & 0xffff);243 c45_ids->devices_in_package |= (phy_reg & 0xffff);
244 244
245 /* If mostly Fs, there is no device there,
246 * let's get out of here.
247 */
248 if ((c45_ids->devices_in_package & 0x1fffffff) == 0x1fffffff) {245 if ((c45_ids->devices_in_package & 0x1fffffff) == 0x1fffffff) {
249 *phy_id = 0xffffffff;246 if (i) {
250 return 0;247 /* If mostly Fs, there is no device there,
248 * then let's continue to probe more, as some
249 * 10G PHYs have zero Devices In package,
250 * e.g. Cortina CS4315/CS4340 PHY.
251 */
252 i = 0;
253 goto retry;
254 } else {
255 /* no device there, let's get out of here */
256 *phy_id = 0xffffffff;
257 return 0;
258 }
251 }259 }
252 }260 }
253 261
@@ -796,10 +804,11 @@ static int genphy_config_advert(struct phy_device *phydev) · 542 unmodified lines
796 if (phydev->supported & (SUPPORTED_1000baseT_Half |804 if (phydev->supported & (SUPPORTED_1000baseT_Half |
797 SUPPORTED_1000baseT_Full)) {805 SUPPORTED_1000baseT_Full)) {
798 adv |= ethtool_adv_to_mii_ctrl1000_t(advertise);806 adv |= ethtool_adv_to_mii_ctrl1000_t(advertise);
799 if (adv != oldadv)
800 changed = 1;
801 }807 }
802 808
809 if (adv != oldadv)
810 changed = 1;
811
803 err = phy_write(phydev, MII_CTRL1000, adv);812 err = phy_write(phydev, MII_CTRL1000, adv);
804 if (err < 0)813 if (err < 0)
805 return err;814 return err;
drivers/net/phy/vitesse.c+14−0
@@ -66,6 +66,7 @@ · 65 unmodified lines
66#define PHY_ID_VSC8244 0x000fc6c066#define PHY_ID_VSC8244 0x000fc6c0
67#define PHY_ID_VSC8514 0x0007067067#define PHY_ID_VSC8514 0x00070670
68#define PHY_ID_VSC8574 0x000704a068#define PHY_ID_VSC8574 0x000704a0
69#define PHY_ID_VSC8641 0x00070431
69#define PHY_ID_VSC8662 0x0007066070#define PHY_ID_VSC8662 0x00070660
70#define PHY_ID_VSC8221 0x000fc55071#define PHY_ID_VSC8221 0x000fc550
71#define PHY_ID_VSC8211 0x000fc4b072#define PHY_ID_VSC8211 0x000fc4b0
@@ -271,6 +272,18 @@ static struct phy_driver vsc82xx_driver[] = { · 199 unmodified lines
271 .ack_interrupt = &vsc824x_ack_interrupt,272 .ack_interrupt = &vsc824x_ack_interrupt,
272 .config_intr = &vsc82xx_config_intr,273 .config_intr = &vsc82xx_config_intr,
273 .driver = { .owner = THIS_MODULE,},274 .driver = { .owner = THIS_MODULE,},
275}, {
276 .phy_id = PHY_ID_VSC8641,
277 .name = "Vitesse VSC8641",
278 .phy_id_mask = 0x000ffff0,
279 .features = PHY_GBIT_FEATURES,
280 .flags = PHY_HAS_INTERRUPT,
281 .config_init = &vsc824x_config_init,
282 .config_aneg = &vsc82x4_config_aneg,
283 .read_status = &genphy_read_status,
284 .ack_interrupt = &vsc824x_ack_interrupt,
285 .config_intr = &vsc82xx_config_intr,
286 .driver = { .owner = THIS_MODULE,},
274}, {287}, {
275 .phy_id = PHY_ID_VSC8662,288 .phy_id = PHY_ID_VSC8662,
276 .name = "Vitesse VSC8662",289 .name = "Vitesse VSC8662",
@@ -318,6 +331,7 @@ static struct mdio_device_id __maybe_unused vitesse_tbl[] = { · 41 unmodified lines
318 { PHY_ID_VSC8244, 0x000fffc0 },331 { PHY_ID_VSC8244, 0x000fffc0 },
319 { PHY_ID_VSC8514, 0x000ffff0 },332 { PHY_ID_VSC8514, 0x000ffff0 },
320 { PHY_ID_VSC8574, 0x000ffff0 },333 { PHY_ID_VSC8574, 0x000ffff0 },
334 { PHY_ID_VSC8641, 0x000ffff0 },
321 { PHY_ID_VSC8662, 0x000ffff0 },335 { PHY_ID_VSC8662, 0x000ffff0 },
322 { PHY_ID_VSC8221, 0x000ffff0 },336 { PHY_ID_VSC8221, 0x000ffff0 },
323 { PHY_ID_VSC8211, 0x000ffff0 },337 { PHY_ID_VSC8211, 0x000ffff0 },
drivers/net/vmxnet3/vmxnet3_int.h+2−2
@@ -69,10 +69,10 @@ · 68 unmodified lines
69/*69/*
70 * Version numbers70 * Version numbers
71 */71 */
72#define VMXNET3_DRIVER_VERSION_STRING "1.3.5.0-k"72#define VMXNET3_DRIVER_VERSION_STRING "1.4.2.0-k"
73 73
74/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */74/* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
75#define VMXNET3_DRIVER_VERSION_NUM 0x0103050075#define VMXNET3_DRIVER_VERSION_NUM 0x01040200
76 76
77#if defined(CONFIG_PCI_MSI)77#if defined(CONFIG_PCI_MSI)
78 /* RSS only makes sense if MSI-X is supported. */78 /* RSS only makes sense if MSI-X is supported. */
drivers/net/xen-netfront.c+0−7
@@ -1244,10 +1244,6 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) · 1243 unmodified lines
1244 np = netdev_priv(netdev);1244 np = netdev_priv(netdev);
1245 np->xbdev = dev;1245 np->xbdev = dev;
1246 1246
1247 /* No need to use rtnl_lock() before the call below as it
1248 * happens before register_netdev().
1249 */
1250 netif_set_real_num_tx_queues(netdev, 0);
1251 np->queues = NULL;1247 np->queues = NULL;
1252 1248
1253 err = -ENOMEM;1249 err = -ENOMEM;
@@ -1899,9 +1895,6 @@ abort_transaction_no_dev_fatal: · 645 unmodified lines
1899 xennet_disconnect_backend(info);1895 xennet_disconnect_backend(info);
1900 kfree(info->queues);1896 kfree(info->queues);
1901 info->queues = NULL;1897 info->queues = NULL;
1902 rtnl_lock();
1903 netif_set_real_num_tx_queues(info->netdev, 0);
1904 rtnl_unlock();
1905 out:1898 out:
1906 return err;1899 return err;
1907}1900}
include/net/ax25.h+15−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
13#include <linux/slab.h>13#include <linux/slab.h>
14#include <linux/atomic.h>14#include <linux/atomic.h>
15#include <net/neighbour.h>15#include <net/neighbour.h>
16#include <net/sock.h>
16 17
17#define AX25_T1CLAMPLO 118#define AX25_T1CLAMPLO 1
18#define AX25_T1CLAMPHI (30 * HZ)19#define AX25_T1CLAMPHI (30 * HZ)
@@ -246,7 +247,20 @@ typedef struct ax25_cb { · 227 unmodified lines
246 atomic_t refcount;247 atomic_t refcount;
247} ax25_cb;248} ax25_cb;
248 249
249#define ax25_sk(__sk) ((ax25_cb *)(__sk)->sk_protinfo)250struct ax25_sock {
251 struct sock sk;
252 struct ax25_cb *cb;
253};
254
255static inline struct ax25_sock *ax25_sk(const struct sock *sk)
256{
257 return (struct ax25_sock *) sk;
258}
259
260static inline struct ax25_cb *sk_to_ax25(const struct sock *sk)
261{
262 return ax25_sk(sk)->cb;
263}
250 264
251#define ax25_for_each(__ax25, list) \265#define ax25_for_each(__ax25, list) \
252 hlist_for_each_entry(__ax25, list, ax25_node)266 hlist_for_each_entry(__ax25, list, ax25_node)
include/net/sock.h+0−2
@@ -277,7 +277,6 @@ struct cg_proto; · 276 unmodified lines
277 * @sk_incoming_cpu: record cpu processing incoming packets277 * @sk_incoming_cpu: record cpu processing incoming packets
278 * @sk_txhash: computed flow hash for use on transmit278 * @sk_txhash: computed flow hash for use on transmit
279 * @sk_filter: socket filtering instructions279 * @sk_filter: socket filtering instructions
280 * @sk_protinfo: private area, net family specific, when not using slab
281 * @sk_timer: sock cleanup timer280 * @sk_timer: sock cleanup timer
282 * @sk_stamp: time stamp of last packet received281 * @sk_stamp: time stamp of last packet received
283 * @sk_tsflags: SO_TIMESTAMPING socket options282 * @sk_tsflags: SO_TIMESTAMPING socket options
@@ -416,7 +415,6 @@ struct sock { · 132 unmodified lines
416 const struct cred *sk_peer_cred;415 const struct cred *sk_peer_cred;
417 long sk_rcvtimeo;416 long sk_rcvtimeo;
418 long sk_sndtimeo;417 long sk_sndtimeo;
419 void *sk_protinfo;
420 struct timer_list sk_timer;418 struct timer_list sk_timer;
421 ktime_t sk_stamp;419 ktime_t sk_stamp;
422 u16 sk_tsflags;420 u16 sk_tsflags;
include/uapi/linux/in.h+13−3
@@ -19,8 +19,10 @@ · 18 unmodified lines
19#define _UAPI_LINUX_IN_H19#define _UAPI_LINUX_IN_H
20 20
21#include <linux/types.h>21#include <linux/types.h>
22#include <linux/libc-compat.h>
22#include <linux/socket.h>23#include <linux/socket.h>
23 24
25#if __UAPI_DEF_IN_IPPROTO
24/* Standard well-defined IP protocols. */26/* Standard well-defined IP protocols. */
25enum {27enum {
26 IPPROTO_IP = 0, /* Dummy protocol for TCP */28 IPPROTO_IP = 0, /* Dummy protocol for TCP */
@@ -75,12 +77,14 @@ enum { · 48 unmodified lines
75#define IPPROTO_RAW IPPROTO_RAW77#define IPPROTO_RAW IPPROTO_RAW
76 IPPROTO_MAX78 IPPROTO_MAX
77};79};
80#endif
78 81
79 82#if __UAPI_DEF_IN_ADDR
80/* Internet address. */83/* Internet address. */
81struct in_addr {84struct in_addr {
82 __be32 s_addr;85 __be32 s_addr;
83};86};
87#endif
84 88
85#define IP_TOS 189#define IP_TOS 1
86#define IP_TTL 290#define IP_TTL 2
@@ -158,6 +162,7 @@ struct in_addr { · 71 unmodified lines
158 162
159/* Request struct for multicast socket ops */163/* Request struct for multicast socket ops */
160 164
165#if __UAPI_DEF_IP_MREQ
161struct ip_mreq {166struct ip_mreq {
162 struct in_addr imr_multiaddr; /* IP multicast address of group */167 struct in_addr imr_multiaddr; /* IP multicast address of group */
163 struct in_addr imr_interface; /* local IP address of interface */168 struct in_addr imr_interface; /* local IP address of interface */
@@ -209,14 +214,18 @@ struct group_filter { · 45 unmodified lines
209#define GROUP_FILTER_SIZE(numsrc) \214#define GROUP_FILTER_SIZE(numsrc) \
210 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \215 (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
211 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))216 + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
217#endif
212 218
219#if __UAPI_DEF_IN_PKTINFO
213struct in_pktinfo {220struct in_pktinfo {
214 int ipi_ifindex;221 int ipi_ifindex;
215 struct in_addr ipi_spec_dst;222 struct in_addr ipi_spec_dst;
216 struct in_addr ipi_addr;223 struct in_addr ipi_addr;
217};224};
225#endif
218 226
219/* Structure describing an Internet (IP) socket address. */227/* Structure describing an Internet (IP) socket address. */
228#if __UAPI_DEF_SOCKADDR_IN
220#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */229#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
221struct sockaddr_in {230struct sockaddr_in {
222 __kernel_sa_family_t sin_family; /* Address family */231 __kernel_sa_family_t sin_family; /* Address family */
@@ -228,8 +237,9 @@ struct sockaddr_in { · 5 unmodified lines
228 sizeof(unsigned short int) - sizeof(struct in_addr)];237 sizeof(unsigned short int) - sizeof(struct in_addr)];
229};238};
230#define sin_zero __pad /* for BSD UNIX comp. -FvK */239#define sin_zero __pad /* for BSD UNIX comp. -FvK */
240#endif
231 241
232 242#if __UAPI_DEF_IN_CLASS
233/*243/*
234 * Definitions of the bits in an Internet address integer.244 * Definitions of the bits in an Internet address integer.
235 * On subnets, host and network parts are found according245 * On subnets, host and network parts are found according
@@ -280,7 +290,7 @@ struct sockaddr_in { · 44 unmodified lines
280#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */290#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
281#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */291#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
282#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */292#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
283 293#endif
284 294
285/* <asm/byteorder.h> contains the htonl type stuff.. */295/* <asm/byteorder.h> contains the htonl type stuff.. */
286#include <asm/byteorder.h> 296#include <asm/byteorder.h>
include/uapi/linux/libc-compat.h+22−0
@@ -56,6 +56,13 @@ · 55 unmodified lines
56 56
57/* GLIBC headers included first so don't define anything57/* GLIBC headers included first so don't define anything
58 * that would already be defined. */58 * that would already be defined. */
59#define __UAPI_DEF_IN_ADDR 0
60#define __UAPI_DEF_IN_IPPROTO 0
61#define __UAPI_DEF_IN_PKTINFO 0
62#define __UAPI_DEF_IP_MREQ 0
63#define __UAPI_DEF_SOCKADDR_IN 0
64#define __UAPI_DEF_IN_CLASS 0
65
59#define __UAPI_DEF_IN6_ADDR 066#define __UAPI_DEF_IN6_ADDR 0
60/* The exception is the in6_addr macros which must be defined67/* The exception is the in6_addr macros which must be defined
61 * if the glibc code didn't define them. This guard matches68 * if the glibc code didn't define them. This guard matches
@@ -78,6 +85,13 @@ · 16 unmodified lines
78/* Linux headers included first, and we must define everything85/* Linux headers included first, and we must define everything
79 * we need. The expectation is that glibc will check the86 * we need. The expectation is that glibc will check the
80 * __UAPI_DEF_* defines and adjust appropriately. */87 * __UAPI_DEF_* defines and adjust appropriately. */
88#define __UAPI_DEF_IN_ADDR 1
89#define __UAPI_DEF_IN_IPPROTO 1
90#define __UAPI_DEF_IN_PKTINFO 1
91#define __UAPI_DEF_IP_MREQ 1
92#define __UAPI_DEF_SOCKADDR_IN 1
93#define __UAPI_DEF_IN_CLASS 1
94
81#define __UAPI_DEF_IN6_ADDR 195#define __UAPI_DEF_IN6_ADDR 1
82/* We unconditionally define the in6_addr macros and glibc must96/* We unconditionally define the in6_addr macros and glibc must
83 * coordinate. */97 * coordinate. */
@@ -103,6 +117,14 @@ · 19 unmodified lines
103 * that we need. */117 * that we need. */
104#else /* !defined(__GLIBC__) */118#else /* !defined(__GLIBC__) */
105 119
120/* Definitions for in.h */
121#define __UAPI_DEF_IN_ADDR 1
122#define __UAPI_DEF_IN_IPPROTO 1
123#define __UAPI_DEF_IN_PKTINFO 1
124#define __UAPI_DEF_IP_MREQ 1
125#define __UAPI_DEF_SOCKADDR_IN 1
126#define __UAPI_DEF_IN_CLASS 1
127
106/* Definitions for in6.h */128/* Definitions for in6.h */
107#define __UAPI_DEF_IN6_ADDR 1129#define __UAPI_DEF_IN6_ADDR 1
108#define __UAPI_DEF_IN6_ADDR_ALT 1130#define __UAPI_DEF_IN6_ADDR_ALT 1
net/ax25/af_ax25.c+15−15
@@ -57,7 +57,7 @@ static const struct proto_ops ax25_proto_ops; · 56 unmodified lines
57 57
58static void ax25_free_sock(struct sock *sk)58static void ax25_free_sock(struct sock *sk)
59{59{
60 ax25_cb_put(ax25_sk(sk));60 ax25_cb_put(sk_to_ax25(sk));
61}61}
62 62
63/*63/*
@@ -306,7 +306,7 @@ void ax25_destroy_socket(ax25_cb *ax25) · 242 unmodified lines
306 while ((skb = skb_dequeue(&ax25->sk->sk_receive_queue)) != NULL) {306 while ((skb = skb_dequeue(&ax25->sk->sk_receive_queue)) != NULL) {
307 if (skb->sk != ax25->sk) {307 if (skb->sk != ax25->sk) {
308 /* A pending connection */308 /* A pending connection */
309 ax25_cb *sax25 = ax25_sk(skb->sk);309 ax25_cb *sax25 = sk_to_ax25(skb->sk);
310 310
311 /* Queue the unaccepted socket for death */311 /* Queue the unaccepted socket for death */
312 sock_orphan(skb->sk);312 sock_orphan(skb->sk);
@@ -551,7 +551,7 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname, · 238 unmodified lines
551 return -EFAULT;551 return -EFAULT;
552 552
553 lock_sock(sk);553 lock_sock(sk);
554 ax25 = ax25_sk(sk);554 ax25 = sk_to_ax25(sk);
555 555
556 switch (optname) {556 switch (optname) {
557 case AX25_WINDOW:557 case AX25_WINDOW:
@@ -697,7 +697,7 @@ static int ax25_getsockopt(struct socket *sock, int level, int optname, · 139 unmodified lines
697 length = min_t(unsigned int, maxlen, sizeof(int));697 length = min_t(unsigned int, maxlen, sizeof(int));
698 698
699 lock_sock(sk);699 lock_sock(sk);
700 ax25 = ax25_sk(sk);700 ax25 = sk_to_ax25(sk);
701 701
702 switch (optname) {702 switch (optname) {
703 case AX25_WINDOW:703 case AX25_WINDOW:
@@ -796,7 +796,7 @@ out: · 92 unmodified lines
796static struct proto ax25_proto = {796static struct proto ax25_proto = {
797 .name = "AX25",797 .name = "AX25",
798 .owner = THIS_MODULE,798 .owner = THIS_MODULE,
799 .obj_size = sizeof(struct sock),799 .obj_size = sizeof(struct ax25_sock),
800};800};
801 801
802static int ax25_create(struct net *net, struct socket *sock, int protocol,802static int ax25_create(struct net *net, struct socket *sock, int protocol,
@@ -858,7 +858,7 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol, · 55 unmodified lines
858 if (sk == NULL)858 if (sk == NULL)
859 return -ENOMEM;859 return -ENOMEM;
860 860
861 ax25 = sk->sk_protinfo = ax25_create_cb();861 ax25 = ax25_sk(sk)->cb = ax25_create_cb();
862 if (!ax25) {862 if (!ax25) {
863 sk_free(sk);863 sk_free(sk);
864 return -ENOMEM;864 return -ENOMEM;
@@ -910,7 +910,7 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev) · 45 unmodified lines
910 sk->sk_state = TCP_ESTABLISHED;910 sk->sk_state = TCP_ESTABLISHED;
911 sock_copy_flags(sk, osk);911 sock_copy_flags(sk, osk);
912 912
913 oax25 = ax25_sk(osk);913 oax25 = sk_to_ax25(osk);
914 914
915 ax25->modulus = oax25->modulus;915 ax25->modulus = oax25->modulus;
916 ax25->backoff = oax25->backoff;916 ax25->backoff = oax25->backoff;
@@ -938,7 +938,7 @@ struct sock *ax25_make_new(struct sock *osk, struct ax25_dev *ax25_dev) · 21 unmodified lines
938 }938 }
939 }939 }
940 940
941 sk->sk_protinfo = ax25;941 ax25_sk(sk)->cb = ax25;
942 sk->sk_destruct = ax25_free_sock;942 sk->sk_destruct = ax25_free_sock;
943 ax25->sk = sk;943 ax25->sk = sk;
944 944
@@ -956,7 +956,7 @@ static int ax25_release(struct socket *sock) · 11 unmodified lines
956 sock_hold(sk);956 sock_hold(sk);
957 sock_orphan(sk);957 sock_orphan(sk);
958 lock_sock(sk);958 lock_sock(sk);
959 ax25 = ax25_sk(sk);959 ax25 = sk_to_ax25(sk);
960 960
961 if (sk->sk_type == SOCK_SEQPACKET) {961 if (sk->sk_type == SOCK_SEQPACKET) {
962 switch (ax25->state) {962 switch (ax25->state) {
@@ -1066,7 +1066,7 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) · 103 unmodified lines
1066 1066
1067 lock_sock(sk);1067 lock_sock(sk);
1068 1068
1069 ax25 = ax25_sk(sk);1069 ax25 = sk_to_ax25(sk);
1070 if (!sock_flag(sk, SOCK_ZAPPED)) {1070 if (!sock_flag(sk, SOCK_ZAPPED)) {
1071 err = -EINVAL;1071 err = -EINVAL;
1072 goto out;1072 goto out;
@@ -1113,7 +1113,7 @@ static int __must_check ax25_connect(struct socket *sock, · 40 unmodified lines
1113 struct sockaddr *uaddr, int addr_len, int flags)1113 struct sockaddr *uaddr, int addr_len, int flags)
1114{1114{
1115 struct sock *sk = sock->sk;1115 struct sock *sk = sock->sk;
1116 ax25_cb *ax25 = ax25_sk(sk), *ax25t;1116 ax25_cb *ax25 = sk_to_ax25(sk), *ax25t;
1117 struct full_sockaddr_ax25 *fsa = (struct full_sockaddr_ax25 *)uaddr;1117 struct full_sockaddr_ax25 *fsa = (struct full_sockaddr_ax25 *)uaddr;
1118 ax25_digi *digi = NULL;1118 ax25_digi *digi = NULL;
1119 int ct = 0, err = 0;1119 int ct = 0, err = 0;
@@ -1394,7 +1394,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr, · 274 unmodified lines
1394 1394
1395 memset(fsa, 0, sizeof(*fsa));1395 memset(fsa, 0, sizeof(*fsa));
1396 lock_sock(sk);1396 lock_sock(sk);
1397 ax25 = ax25_sk(sk);1397 ax25 = sk_to_ax25(sk);
1398 1398
1399 if (peer != 0) {1399 if (peer != 0) {
1400 if (sk->sk_state != TCP_ESTABLISHED) {1400 if (sk->sk_state != TCP_ESTABLISHED) {
@@ -1446,7 +1446,7 @@ static int ax25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 45 unmodified lines
1446 return -EINVAL;1446 return -EINVAL;
1447 1447
1448 lock_sock(sk);1448 lock_sock(sk);
1449 ax25 = ax25_sk(sk);1449 ax25 = sk_to_ax25(sk);
1450 1450
1451 if (sock_flag(sk, SOCK_ZAPPED)) {1451 if (sock_flag(sk, SOCK_ZAPPED)) {
1452 err = -EADDRNOTAVAIL;1452 err = -EADDRNOTAVAIL;
@@ -1621,7 +1621,7 @@ static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, · 168 unmodified lines
1621 if (skb == NULL)1621 if (skb == NULL)
1622 goto out;1622 goto out;
1623 1623
1624 if (!ax25_sk(sk)->pidincl)1624 if (!sk_to_ax25(sk)->pidincl)
1625 skb_pull(skb, 1); /* Remove PID */1625 skb_pull(skb, 1); /* Remove PID */
1626 1626
1627 skb_reset_transport_header(skb);1627 skb_reset_transport_header(skb);
@@ -1762,7 +1762,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) · 134 unmodified lines
1762 1762
1763 case SIOCAX25GETINFO:1763 case SIOCAX25GETINFO:
1764 case SIOCAX25GETINFOOLD: {1764 case SIOCAX25GETINFOOLD: {
1765 ax25_cb *ax25 = ax25_sk(sk);1765 ax25_cb *ax25 = sk_to_ax25(sk);
1766 struct ax25_info_struct ax25_info;1766 struct ax25_info_struct ax25_info;
1767 1767
1768 ax25_info.t1 = ax25->t1 / HZ;1768 ax25_info.t1 = ax25->t1 / HZ;
net/ax25/ax25_in.c+1−1
@@ -353,7 +353,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev, · 352 unmodified lines
353 return 0;353 return 0;
354 }354 }
355 355
356 ax25 = ax25_sk(make);356 ax25 = sk_to_ax25(make);
357 skb_set_owner_r(skb, make);357 skb_set_owner_r(skb, make);
358 skb_queue_head(&sk->sk_receive_queue, skb);358 skb_queue_head(&sk->sk_receive_queue, skb);
359 359
net/core/flow_dissector.c+1−1
@@ -129,7 +129,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb, · 128 unmodified lines
129 struct flow_dissector_key_ports *key_ports;129 struct flow_dissector_key_ports *key_ports;
130 struct flow_dissector_key_tags *key_tags;130 struct flow_dissector_key_tags *key_tags;
131 struct flow_dissector_key_keyid *key_keyid;131 struct flow_dissector_key_keyid *key_keyid;
132 u8 ip_proto;132 u8 ip_proto = 0;
133 133
134 if (!data) {134 if (!data) {
135 data = skb->data;135 data = skb->data;
net/core/sock.c+1−2
@@ -1454,7 +1454,7 @@ void sk_destruct(struct sock *sk) · 1453 unmodified lines
1454 1454
1455static void __sk_free(struct sock *sk)1455static void __sk_free(struct sock *sk)
1456{1456{
1457 if (unlikely(sock_diag_has_destroy_listeners(sk)))1457 if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt))
1458 sock_diag_broadcast_destroy(sk);1458 sock_diag_broadcast_destroy(sk);
1459 else1459 else
1460 sk_destruct(sk);1460 sk_destruct(sk);
@@ -2269,7 +2269,6 @@ static void sock_def_write_space(struct sock *sk) · 808 unmodified lines
2269 2269
2270static void sock_def_destruct(struct sock *sk)2270static void sock_def_destruct(struct sock *sk)
2271{2271{
2272 kfree(sk->sk_protinfo);
2273}2272}
2274 2273
2275void sk_send_sigurg(struct sock *sk)2274void sk_send_sigurg(struct sock *sk)
net/dsa/slave.c+1−1
@@ -112,7 +112,7 @@ static int dsa_slave_open(struct net_device *dev) · 111 unmodified lines
112 112
113clear_promisc:113clear_promisc:
114 if (dev->flags & IFF_PROMISC)114 if (dev->flags & IFF_PROMISC)
115 dev_set_promiscuity(master, 0);115 dev_set_promiscuity(master, -1);
116clear_allmulti:116clear_allmulti:
117 if (dev->flags & IFF_ALLMULTI)117 if (dev->flags & IFF_ALLMULTI)
118 dev_set_allmulti(master, -1);118 dev_set_allmulti(master, -1);
net/ipv4/fib_semantics.c+2−2
@@ -1045,7 +1045,7 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, · 1044 unmodified lines
1045 nla_put_u32(skb, RTA_OIF, fi->fib_nh->nh_oif))1045 nla_put_u32(skb, RTA_OIF, fi->fib_nh->nh_oif))
1046 goto nla_put_failure;1046 goto nla_put_failure;
1047 if (fi->fib_nh->nh_flags & RTNH_F_LINKDOWN) {1047 if (fi->fib_nh->nh_flags & RTNH_F_LINKDOWN) {
1048 in_dev = __in_dev_get_rcu(fi->fib_nh->nh_dev);1048 in_dev = __in_dev_get_rtnl(fi->fib_nh->nh_dev);
1049 if (in_dev &&1049 if (in_dev &&
1050 IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev))1050 IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev))
1051 rtm->rtm_flags |= RTNH_F_DEAD;1051 rtm->rtm_flags |= RTNH_F_DEAD;
@@ -1074,7 +1074,7 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, · 22 unmodified lines
1074 1074
1075 rtnh->rtnh_flags = nh->nh_flags & 0xFF;1075 rtnh->rtnh_flags = nh->nh_flags & 0xFF;
1076 if (nh->nh_flags & RTNH_F_LINKDOWN) {1076 if (nh->nh_flags & RTNH_F_LINKDOWN) {
1077 in_dev = __in_dev_get_rcu(nh->nh_dev);1077 in_dev = __in_dev_get_rtnl(nh->nh_dev);
1078 if (in_dev &&1078 if (in_dev &&
1079 IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev))1079 IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev))
1080 rtnh->rtnh_flags |= RTNH_F_DEAD;1080 rtnh->rtnh_flags |= RTNH_F_DEAD;
net/sched/cls_flower.c+2−2
@@ -216,8 +216,8 @@ static const struct nla_policy fl_policy[TCA_FLOWER_MAX + 1] = { · 215 unmodified lines
216 [TCA_FLOWER_KEY_IPV6_DST_MASK] = { .len = sizeof(struct in6_addr) },216 [TCA_FLOWER_KEY_IPV6_DST_MASK] = { .len = sizeof(struct in6_addr) },
217 [TCA_FLOWER_KEY_TCP_SRC] = { .type = NLA_U16 },217 [TCA_FLOWER_KEY_TCP_SRC] = { .type = NLA_U16 },
218 [TCA_FLOWER_KEY_TCP_DST] = { .type = NLA_U16 },218 [TCA_FLOWER_KEY_TCP_DST] = { .type = NLA_U16 },
219 [TCA_FLOWER_KEY_TCP_SRC] = { .type = NLA_U16 },219 [TCA_FLOWER_KEY_UDP_SRC] = { .type = NLA_U16 },
220 [TCA_FLOWER_KEY_TCP_DST] = { .type = NLA_U16 },220 [TCA_FLOWER_KEY_UDP_DST] = { .type = NLA_U16 },
221};221};
222 222
223static void fl_set_key_val(struct nlattr **tb,223static void fl_set_key_val(struct nlattr **tb,
net/sctp/output.c+3−1
@@ -599,7 +599,9 @@ out: · 598 unmodified lines
599 return err;599 return err;
600no_route:600no_route:
601 kfree_skb(nskb);601 kfree_skb(nskb);
602 IP_INC_STATS(sock_net(asoc->base.sk), IPSTATS_MIB_OUTNOROUTES);602
603 if (asoc)
604 IP_INC_STATS(sock_net(asoc->base.sk), IPSTATS_MIB_OUTNOROUTES);
603 605
604 /* FIXME: Returning the 'err' will effect all the associations606 /* FIXME: Returning the 'err' will effect all the associations
605 * associated with a socket, although only one of the paths of the607 * associated with a socket, although only one of the paths of the
net/sctp/socket.c+0−6
@@ -2121,12 +2121,6 @@ static int sctp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 2120 unmodified lines
2121 if (sp->subscribe.sctp_data_io_event)2121 if (sp->subscribe.sctp_data_io_event)
2122 sctp_ulpevent_read_sndrcvinfo(event, msg);2122 sctp_ulpevent_read_sndrcvinfo(event, msg);
2123 2123
2124#if 0
2125 /* FIXME: we should be calling IP/IPv6 layers. */
2126 if (sk->sk_protinfo.af_inet.cmsg_flags)
2127 ip_cmsg_recv(msg, skb);
2128#endif
2129
2130 err = copied;2124 err = copied;
2131 2125
2132 /* If skb's length exceeds the user's buffer, update the skb and2126 /* If skb's length exceeds the user's buffer, update the skb and
net/tipc/bcast.c+5−0
@@ -108,6 +108,11 @@ void tipc_bclink_remove_node(struct net *net, u32 addr) · 107 unmodified lines
108 108
109 tipc_bclink_lock(net);109 tipc_bclink_lock(net);
110 tipc_nmap_remove(&tn->bclink->bcast_nodes, addr);110 tipc_nmap_remove(&tn->bclink->bcast_nodes, addr);
111
112 /* Last node? => reset backlog queue */
113 if (!tn->bclink->bcast_nodes.count)
114 tipc_link_purge_backlog(&tn->bclink->link);
115
111 tipc_bclink_unlock(net);116 tipc_bclink_unlock(net);
112}117}
113 118
net/tipc/link.c+1−1
@@ -404,7 +404,7 @@ void tipc_link_reset_fragments(struct tipc_link *l_ptr) · 403 unmodified lines
404 l_ptr->reasm_buf = NULL;404 l_ptr->reasm_buf = NULL;
405}405}
406 406
407static void tipc_link_purge_backlog(struct tipc_link *l)407void tipc_link_purge_backlog(struct tipc_link *l)
408{408{
409 __skb_queue_purge(&l->backlogq);409 __skb_queue_purge(&l->backlogq);
410 l->backlog[TIPC_LOW_IMPORTANCE].len = 0;410 l->backlog[TIPC_LOW_IMPORTANCE].len = 0;
net/tipc/link.h+1−0
@@ -218,6 +218,7 @@ void tipc_link_reset_fragments(struct tipc_link *l_ptr); · 217 unmodified lines
218int tipc_link_is_up(struct tipc_link *l_ptr);218int tipc_link_is_up(struct tipc_link *l_ptr);
219int tipc_link_is_active(struct tipc_link *l_ptr);219int tipc_link_is_active(struct tipc_link *l_ptr);
220void tipc_link_purge_queues(struct tipc_link *l_ptr);220void tipc_link_purge_queues(struct tipc_link *l_ptr);
221void tipc_link_purge_backlog(struct tipc_link *l);
221void tipc_link_reset_all(struct tipc_node *node);222void tipc_link_reset_all(struct tipc_node *node);
222void tipc_link_reset(struct tipc_link *l_ptr);223void tipc_link_reset(struct tipc_link *l_ptr);
223int tipc_link_xmit_skb(struct net *net, struct sk_buff *skb, u32 dest,224int tipc_link_xmit_skb(struct net *net, struct sk_buff *skb, u32 dest,