aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 20:42:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 20:42:22 -0400
commitbe9c6d9169705504296bdb42ffec8f406691d99f (patch)
tree60e25d5f33f80a1c09476e770b89ca4661f2e944
parent03ce3ca4b02bfc1e6567a7851ae231ad3cc9418e (diff)
parent307f2fb95e9b96b3577916e73d92e104f8f26494 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Just a bunch of small fixes and tidy ups: 1) Finish the "busy_poll" renames, from Eliezer Tamir. 2) Fix RCU stalls in IFB driver, from Ding Tianhong. 3) Linearize buffers properly in tun/macvtap zerocopy code. 4) Don't crash on rmmod in vxlan, from Pravin B Shelar. 5) Spinlock used before init in alx driver, from Maarten Lankhorst. 6) A sparse warning fix in bnx2x broke TSO checksums, fix from Dmitry Kravkov. 7) Dummy and ifb driver load failure paths can oops, fixes from Tan Xiaojun and Ding Tianhong. 8) Correct MTU calculations in IP tunnels, from Alexander Duyck. 9) Account all TCP retransmits in SNMP stats properly, from Yuchung Cheng. 10) atl1e and via-rhine do not handle DMA mapping failures properly, from Neil Horman. 11) Various equal-cost multipath route fixes in ipv6 from Hannes Frederic Sowa" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (36 commits) ipv6: only static routes qualify for equal cost multipathing via-rhine: fix dma mapping errors atl1e: fix dma mapping warnings tcp: account all retransmit failures usb/net/r815x: fix cast to restricted __le32 usb/net/r8152: fix integer overflow in expression net: access page->private by using page_private net: strict_strtoul is obsolete, use kstrtoul instead drivers/net/ieee802154: don't use devm_pinctrl_get_select_default() in probe drivers/net/ethernet/cadence: don't use devm_pinctrl_get_select_default() in probe drivers/net/can/c_can: don't use devm_pinctrl_get_select_default() in probe net/usb: add relative mii functions for r815x net/tipc: use %*phC to dump small buffers in hex form qlcnic: Adding Maintainers. gre: Fix MTU sizing check for gretap tunnels pkt_sched: sch_qfq: remove forward declaration of qfq_update_agg_ts pkt_sched: sch_qfq: improve efficiency of make_eligible gso: Update tunnel segmentation to support Tx checksum offload inet: fix spacing in assignment ifb: fix oops when loading the ifb failed ...
-rw-r--r--Documentation/sysctl/net.txt17
-rw-r--r--MAINTAINERS2
-rw-r--r--arch/alpha/include/uapi/asm/socket.h2
-rw-r--r--arch/avr32/include/uapi/asm/socket.h2
-rw-r--r--arch/cris/include/uapi/asm/socket.h2
-rw-r--r--arch/frv/include/uapi/asm/socket.h2
-rw-r--r--arch/h8300/include/uapi/asm/socket.h2
-rw-r--r--arch/ia64/include/uapi/asm/socket.h2
-rw-r--r--arch/m32r/include/uapi/asm/socket.h2
-rw-r--r--arch/mips/include/uapi/asm/socket.h2
-rw-r--r--arch/mn10300/include/uapi/asm/socket.h2
-rw-r--r--arch/parisc/include/uapi/asm/socket.h2
-rw-r--r--arch/powerpc/include/uapi/asm/socket.h2
-rw-r--r--arch/s390/include/uapi/asm/socket.h2
-rw-r--r--arch/sparc/include/uapi/asm/socket.h2
-rw-r--r--arch/xtensa/include/uapi/asm/socket.h2
-rw-r--r--drivers/net/can/c_can/c_can_platform.c7
-rw-r--r--drivers/net/dummy.c4
-rw-r--r--drivers/net/ethernet/atheros/alx/main.c5
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_main.c28
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c10
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c2
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.c11
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c4
-rw-r--r--drivers/net/ethernet/realtek/r8169.c67
-rw-r--r--drivers/net/ethernet/renesas/Kconfig1
-rw-r--r--drivers/net/ethernet/via/via-rhine.c17
-rw-r--r--drivers/net/ieee802154/mrf24j40.c7
-rw-r--r--drivers/net/ifb.c8
-rw-r--r--drivers/net/macvtap.c8
-rw-r--r--drivers/net/phy/at803x.c1
-rw-r--r--drivers/net/tun.c9
-rw-r--r--drivers/net/usb/Makefile2
-rw-r--r--drivers/net/usb/cdc_ether.c9
-rw-r--r--drivers/net/usb/r8152.c3
-rw-r--r--drivers/net/usb/r815x.c234
-rw-r--r--drivers/net/vxlan.c2
-rw-r--r--fs/select.c2
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/net/busy_poll.h (renamed from include/net/ll_poll.h)30
-rw-r--r--include/uapi/asm-generic/socket.h2
-rw-r--r--net/9p/trans_common.c10
-rw-r--r--net/core/datagram.c2
-rw-r--r--net/core/dev.c14
-rw-r--r--net/core/skbuff.c6
-rw-r--r--net/core/sock.c8
-rw-r--r--net/core/sysctl_net_core.c10
-rw-r--r--net/dns_resolver/dns_key.c2
-rw-r--r--net/ipv4/gre_offload.c3
-rw-r--r--net/ipv4/inet_hashtables.c2
-rw-r--r--net/ipv4/ip_tunnel.c2
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/ipv4/tcp_ipv4.c4
-rw-r--r--net/ipv4/tcp_output.c7
-rw-r--r--net/ipv4/udp.c8
-rw-r--r--net/ipv6/ip6_fib.c15
-rw-r--r--net/ipv6/route.c72
-rw-r--r--net/ipv6/tcp_ipv6.c4
-rw-r--r--net/ipv6/udp.c4
-rw-r--r--net/sched/sch_qfq.c127
-rw-r--r--net/socket.c6
-rw-r--r--net/tipc/ib_media.c8
65 files changed, 607 insertions, 241 deletions
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index d69e14c9002c..1c15043aaee4 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -50,26 +50,27 @@ The maximum number of packets that kernel can handle on a NAPI interrupt,
50it's a Per-CPU variable. 50it's a Per-CPU variable.
51Default: 64 51Default: 64
52 52
53low_latency_read 53busy_read
54---------------- 54----------------
55Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL) 55Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL)
56Approximate time in us to busy loop waiting for packets on the device queue. 56Approximate time in us to busy loop waiting for packets on the device queue.
57This sets the default value of the SO_LL socket option. 57This sets the default value of the SO_BUSY_POLL socket option.
58Can be set or overridden per socket by setting socket option SO_LL, which is 58Can be set or overridden per socket by setting socket option SO_BUSY_POLL,
59the preferred method of enabling. 59which is the preferred method of enabling. If you need to enable the feature
60If you need to enable the feature globally via sysctl, a value of 50 is recommended. 60globally via sysctl, a value of 50 is recommended.
61Will increase power usage. 61Will increase power usage.
62Default: 0 (off) 62Default: 0 (off)
63 63
64low_latency_poll 64busy_poll
65---------------- 65----------------
66Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL) 66Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL)
67Approximate time in us to busy loop waiting for events. 67Approximate time in us to busy loop waiting for events.
68Recommended value depends on the number of sockets you poll on. 68Recommended value depends on the number of sockets you poll on.
69For several sockets 50, for several hundreds 100. 69For several sockets 50, for several hundreds 100.
70For more than that you probably want to use epoll. 70For more than that you probably want to use epoll.
71Note that only sockets with SO_LL set will be busy polled, so you want to either 71Note that only sockets with SO_BUSY_POLL set will be busy polled,
72selectively set SO_LL on those sockets or set sysctl.net.low_latency_read globally. 72so you want to either selectively set SO_BUSY_POLL on those sockets or set
73sysctl.net.busy_read globally.
73Will increase power usage. 74Will increase power usage.
74Default: 0 (off) 75Default: 0 (off)
75 76
diff --git a/MAINTAINERS b/MAINTAINERS
index 4d43db629689..bf61e04291ab 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6681,10 +6681,12 @@ F: Documentation/networking/LICENSE.qla3xxx
6681F: drivers/net/ethernet/qlogic/qla3xxx.* 6681F: drivers/net/ethernet/qlogic/qla3xxx.*
6682 6682
6683QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER 6683QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
6684M: Himanshu Madhani <himanshu.madhani@qlogic.com>
6684M: Rajesh Borundia <rajesh.borundia@qlogic.com> 6685M: Rajesh Borundia <rajesh.borundia@qlogic.com>
6685M: Shahed Shaikh <shahed.shaikh@qlogic.com> 6686M: Shahed Shaikh <shahed.shaikh@qlogic.com>
6686M: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> 6687M: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
6687M: Sony Chacko <sony.chacko@qlogic.com> 6688M: Sony Chacko <sony.chacko@qlogic.com>
6689M: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
6688M: linux-driver@qlogic.com 6690M: linux-driver@qlogic.com
6689L: netdev@vger.kernel.org 6691L: netdev@vger.kernel.org
6690S: Supported 6692S: Supported
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index 4885825e498d..467de010ea7e 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -81,6 +81,6 @@
81 81
82#define SO_SELECT_ERR_QUEUE 45 82#define SO_SELECT_ERR_QUEUE 45
83 83
84#define SO_LL 46 84#define SO_BUSY_POLL 46
85 85
86#endif /* _UAPI_ASM_SOCKET_H */ 86#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 79b61798ebf8..11c4259c62fb 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* __ASM_AVR32_SOCKET_H */ 79#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index 47b1ec55092d..eb723e51554e 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -76,7 +76,7 @@
76 76
77#define SO_SELECT_ERR_QUEUE 45 77#define SO_SELECT_ERR_QUEUE 45
78 78
79#define SO_LL 46 79#define SO_BUSY_POLL 46
80 80
81#endif /* _ASM_SOCKET_H */ 81#endif /* _ASM_SOCKET_H */
82 82
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index dbc08520f22c..f0cb1c341163 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -74,7 +74,7 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
80 80
diff --git a/arch/h8300/include/uapi/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h
index a38d38a6520b..9490758c5e2b 100644
--- a/arch/h8300/include/uapi/asm/socket.h
+++ b/arch/h8300/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index d3358b760681..556d0701a155 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -83,6 +83,6 @@
83 83
84#define SO_SELECT_ERR_QUEUE 45 84#define SO_SELECT_ERR_QUEUE 45
85 85
86#define SO_LL 46 86#define SO_BUSY_POLL 46
87 87
88#endif /* _ASM_IA64_SOCKET_H */ 88#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 44aaf4639a4a..24be7c8da86a 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_M32R_SOCKET_H */ 79#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index 6a07992ba6c6..61c01f054d1b 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -92,6 +92,6 @@
92 92
93#define SO_SELECT_ERR_QUEUE 45 93#define SO_SELECT_ERR_QUEUE 45
94 94
95#define SO_LL 46 95#define SO_BUSY_POLL 46
96 96
97#endif /* _UAPI_ASM_SOCKET_H */ 97#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index db80fd3e398b..e2a2b203eb00 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index f866fff9a004..71700e636a8e 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -73,7 +73,7 @@
73 73
74#define SO_SELECT_ERR_QUEUE 0x4026 74#define SO_SELECT_ERR_QUEUE 0x4026
75 75
76#define SO_LL 0x4027 76#define SO_BUSY_POLL 0x4027
77 77
78/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 78/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
79 * have to define SOCK_NONBLOCK to a different value here. 79 * have to define SOCK_NONBLOCK to a different value here.
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
index 405fb09bda94..a6d74467c9ed 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -81,6 +81,6 @@
81 81
82#define SO_SELECT_ERR_QUEUE 45 82#define SO_SELECT_ERR_QUEUE 45
83 83
84#define SO_LL 46 84#define SO_BUSY_POLL 46
85 85
86#endif /* _ASM_POWERPC_SOCKET_H */ 86#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index 0c5105fbaaf3..92494494692e 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -80,6 +80,6 @@
80 80
81#define SO_SELECT_ERR_QUEUE 45 81#define SO_SELECT_ERR_QUEUE 45
82 82
83#define SO_LL 46 83#define SO_BUSY_POLL 46
84 84
85#endif /* _ASM_SOCKET_H */ 85#endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index b46c3fa0b265..4e1d66c3ce71 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -70,7 +70,7 @@
70 70
71#define SO_SELECT_ERR_QUEUE 0x0029 71#define SO_SELECT_ERR_QUEUE 0x0029
72 72
73#define SO_LL 0x0030 73#define SO_BUSY_POLL 0x0030
74 74
75/* Security levels - as per NRL IPv6 - don't actually do anything */ 75/* Security levels - as per NRL IPv6 - don't actually do anything */
76#define SO_SECURITY_AUTHENTICATION 0x5001 76#define SO_SECURITY_AUTHENTICATION 0x5001
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index b21ace4fc9ba..c114483010c1 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -85,6 +85,6 @@
85 85
86#define SO_SELECT_ERR_QUEUE 45 86#define SO_SELECT_ERR_QUEUE 45
87 87
88#define SO_LL 46 88#define SO_BUSY_POLL 46
89 89
90#endif /* _XTENSA_SOCKET_H */ 90#endif /* _XTENSA_SOCKET_H */
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index b918c7329426..c6f838d922a5 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -32,7 +32,6 @@
32#include <linux/clk.h> 32#include <linux/clk.h>
33#include <linux/of.h> 33#include <linux/of.h>
34#include <linux/of_device.h> 34#include <linux/of_device.h>
35#include <linux/pinctrl/consumer.h>
36 35
37#include <linux/can/dev.h> 36#include <linux/can/dev.h>
38 37
@@ -114,7 +113,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
114 struct c_can_priv *priv; 113 struct c_can_priv *priv;
115 const struct of_device_id *match; 114 const struct of_device_id *match;
116 const struct platform_device_id *id; 115 const struct platform_device_id *id;
117 struct pinctrl *pinctrl;
118 struct resource *mem, *res; 116 struct resource *mem, *res;
119 int irq; 117 int irq;
120 struct clk *clk; 118 struct clk *clk;
@@ -131,11 +129,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
131 id = platform_get_device_id(pdev); 129 id = platform_get_device_id(pdev);
132 } 130 }
133 131
134 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
135 if (IS_ERR(pinctrl))
136 dev_warn(&pdev->dev,
137 "failed to configure pins from driver\n");
138
139 /* get the appropriate clk */ 132 /* get the appropriate clk */
140 clk = clk_get(&pdev->dev, NULL); 133 clk = clk_get(&pdev->dev, NULL);
141 if (IS_ERR(clk)) { 134 if (IS_ERR(clk)) {
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 42aa54af6842..b710c6b2d659 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -185,6 +185,8 @@ static int __init dummy_init_module(void)
185 185
186 rtnl_lock(); 186 rtnl_lock();
187 err = __rtnl_link_register(&dummy_link_ops); 187 err = __rtnl_link_register(&dummy_link_ops);
188 if (err < 0)
189 goto out;
188 190
189 for (i = 0; i < numdummies && !err; i++) { 191 for (i = 0; i < numdummies && !err; i++) {
190 err = dummy_init_one(); 192 err = dummy_init_one();
@@ -192,6 +194,8 @@ static int __init dummy_init_module(void)
192 } 194 }
193 if (err < 0) 195 if (err < 0)
194 __rtnl_link_unregister(&dummy_link_ops); 196 __rtnl_link_unregister(&dummy_link_ops);
197
198out:
195 rtnl_unlock(); 199 rtnl_unlock();
196 200
197 return err; 201 return err;
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 0e0b242a9dd4..027398ebbba6 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -1245,6 +1245,8 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1245 1245
1246 SET_NETDEV_DEV(netdev, &pdev->dev); 1246 SET_NETDEV_DEV(netdev, &pdev->dev);
1247 alx = netdev_priv(netdev); 1247 alx = netdev_priv(netdev);
1248 spin_lock_init(&alx->hw.mdio_lock);
1249 spin_lock_init(&alx->irq_lock);
1248 alx->dev = netdev; 1250 alx->dev = netdev;
1249 alx->hw.pdev = pdev; 1251 alx->hw.pdev = pdev;
1250 alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP | 1252 alx->msg_enable = NETIF_MSG_LINK | NETIF_MSG_HW | NETIF_MSG_IFUP |
@@ -1327,9 +1329,6 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1327 1329
1328 INIT_WORK(&alx->link_check_wk, alx_link_check); 1330 INIT_WORK(&alx->link_check_wk, alx_link_check);
1329 INIT_WORK(&alx->reset_wk, alx_reset); 1331 INIT_WORK(&alx->reset_wk, alx_reset);
1330 spin_lock_init(&alx->hw.mdio_lock);
1331 spin_lock_init(&alx->irq_lock);
1332
1333 netif_carrier_off(netdev); 1332 netif_carrier_off(netdev);
1334 1333
1335 err = register_netdev(netdev); 1334 err = register_netdev(netdev);
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 895f5377ad1b..6d1a62a84c9d 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1665,8 +1665,8 @@ check_sum:
1665 return 0; 1665 return 0;
1666} 1666}
1667 1667
1668static void atl1e_tx_map(struct atl1e_adapter *adapter, 1668static int atl1e_tx_map(struct atl1e_adapter *adapter,
1669 struct sk_buff *skb, struct atl1e_tpd_desc *tpd) 1669 struct sk_buff *skb, struct atl1e_tpd_desc *tpd)
1670{ 1670{
1671 struct atl1e_tpd_desc *use_tpd = NULL; 1671 struct atl1e_tpd_desc *use_tpd = NULL;
1672 struct atl1e_tx_buffer *tx_buffer = NULL; 1672 struct atl1e_tx_buffer *tx_buffer = NULL;
@@ -1677,6 +1677,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
1677 u16 nr_frags; 1677 u16 nr_frags;
1678 u16 f; 1678 u16 f;
1679 int segment; 1679 int segment;
1680 int ring_start = adapter->tx_ring.next_to_use;
1680 1681
1681 nr_frags = skb_shinfo(skb)->nr_frags; 1682 nr_frags = skb_shinfo(skb)->nr_frags;
1682 segment = (tpd->word3 >> TPD_SEGMENT_EN_SHIFT) & TPD_SEGMENT_EN_MASK; 1683 segment = (tpd->word3 >> TPD_SEGMENT_EN_SHIFT) & TPD_SEGMENT_EN_MASK;
@@ -1689,6 +1690,9 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
1689 tx_buffer->length = map_len; 1690 tx_buffer->length = map_len;
1690 tx_buffer->dma = pci_map_single(adapter->pdev, 1691 tx_buffer->dma = pci_map_single(adapter->pdev,
1691 skb->data, hdr_len, PCI_DMA_TODEVICE); 1692 skb->data, hdr_len, PCI_DMA_TODEVICE);
1693 if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma))
1694 return -ENOSPC;
1695
1692 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE); 1696 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
1693 mapped_len += map_len; 1697 mapped_len += map_len;
1694 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma); 1698 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
@@ -1715,6 +1719,13 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
1715 tx_buffer->dma = 1719 tx_buffer->dma =
1716 pci_map_single(adapter->pdev, skb->data + mapped_len, 1720 pci_map_single(adapter->pdev, skb->data + mapped_len,
1717 map_len, PCI_DMA_TODEVICE); 1721 map_len, PCI_DMA_TODEVICE);
1722
1723 if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
1724 /* Reset the tx rings next pointer */
1725 adapter->tx_ring.next_to_use = ring_start;
1726 return -ENOSPC;
1727 }
1728
1718 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE); 1729 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_SINGLE);
1719 mapped_len += map_len; 1730 mapped_len += map_len;
1720 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma); 1731 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
@@ -1750,6 +1761,13 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
1750 (i * MAX_TX_BUF_LEN), 1761 (i * MAX_TX_BUF_LEN),
1751 tx_buffer->length, 1762 tx_buffer->length,
1752 DMA_TO_DEVICE); 1763 DMA_TO_DEVICE);
1764
1765 if (dma_mapping_error(&adapter->pdev->dev, tx_buffer->dma)) {
1766 /* Reset the ring next to use pointer */
1767 adapter->tx_ring.next_to_use = ring_start;
1768 return -ENOSPC;
1769 }
1770
1753 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE); 1771 ATL1E_SET_PCIMAP_TYPE(tx_buffer, ATL1E_TX_PCIMAP_PAGE);
1754 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma); 1772 use_tpd->buffer_addr = cpu_to_le64(tx_buffer->dma);
1755 use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) | 1773 use_tpd->word2 = (use_tpd->word2 & (~TPD_BUFLEN_MASK)) |
@@ -1767,6 +1785,7 @@ static void atl1e_tx_map(struct atl1e_adapter *adapter,
1767 /* The last buffer info contain the skb address, 1785 /* The last buffer info contain the skb address,
1768 so it will be free after unmap */ 1786 so it will be free after unmap */
1769 tx_buffer->skb = skb; 1787 tx_buffer->skb = skb;
1788 return 0;
1770} 1789}
1771 1790
1772static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count, 1791static void atl1e_tx_queue(struct atl1e_adapter *adapter, u16 count,
@@ -1834,10 +1853,13 @@ static netdev_tx_t atl1e_xmit_frame(struct sk_buff *skb,
1834 return NETDEV_TX_OK; 1853 return NETDEV_TX_OK;
1835 } 1854 }
1836 1855
1837 atl1e_tx_map(adapter, skb, tpd); 1856 if (atl1e_tx_map(adapter, skb, tpd))
1857 goto out;
1858
1838 atl1e_tx_queue(adapter, tpd_req, tpd); 1859 atl1e_tx_queue(adapter, tpd_req, tpd);
1839 1860
1840 netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */ 1861 netdev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
1862out:
1841 spin_unlock_irqrestore(&adapter->tx_lock, flags); 1863 spin_unlock_irqrestore(&adapter->tx_lock, flags);
1842 return NETDEV_TX_OK; 1864 return NETDEV_TX_OK;
1843} 1865}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index ec3aa1d451e8..ee350bde1818 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -24,7 +24,7 @@
24#include <net/tcp.h> 24#include <net/tcp.h>
25#include <net/ipv6.h> 25#include <net/ipv6.h>
26#include <net/ip6_checksum.h> 26#include <net/ip6_checksum.h>
27#include <net/ll_poll.h> 27#include <net/busy_poll.h>
28#include <linux/prefetch.h> 28#include <linux/prefetch.h>
29#include "bnx2x_cmn.h" 29#include "bnx2x_cmn.h"
30#include "bnx2x_init.h" 30#include "bnx2x_init.h"
@@ -990,7 +990,7 @@ reuse_rx:
990 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), 990 __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
991 le16_to_cpu(cqe_fp->vlan_tag)); 991 le16_to_cpu(cqe_fp->vlan_tag));
992 992
993 skb_mark_ll(skb, &fp->napi); 993 skb_mark_napi_id(skb, &fp->napi);
994 994
995 if (bnx2x_fp_ll_polling(fp)) 995 if (bnx2x_fp_ll_polling(fp))
996 netif_receive_skb(skb); 996 netif_receive_skb(skb);
@@ -3543,9 +3543,9 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
3543 /* outer IP header info */ 3543 /* outer IP header info */
3544 if (xmit_type & XMIT_CSUM_V4) { 3544 if (xmit_type & XMIT_CSUM_V4) {
3545 struct iphdr *iph = ip_hdr(skb); 3545 struct iphdr *iph = ip_hdr(skb);
3546 u16 csum = (__force u16)(~iph->check) - 3546 u32 csum = (__force u32)(~iph->check) -
3547 (__force u16)iph->tot_len - 3547 (__force u32)iph->tot_len -
3548 (__force u16)iph->frag_off; 3548 (__force u32)iph->frag_off;
3549 3549
3550 pbd2->fw_ip_csum_wo_len_flags_frag = 3550 pbd2->fw_ip_csum_wo_len_flags_frag =
3551 bswab16(csum_fold((__force __wsum)csum)); 3551 bswab16(csum_fold((__force __wsum)csum));
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 15a528bda87c..e5da07858a2f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12027,7 +12027,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
12027#endif 12027#endif
12028 12028
12029#ifdef CONFIG_NET_LL_RX_POLL 12029#ifdef CONFIG_NET_LL_RX_POLL
12030 .ndo_ll_poll = bnx2x_low_latency_recv, 12030 .ndo_busy_poll = bnx2x_low_latency_recv,
12031#endif 12031#endif
12032}; 12032};
12033 12033
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 3f1957158a3b..bb5d63fb2e6d 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -29,7 +29,6 @@
29#include <linux/of.h> 29#include <linux/of.h>
30#include <linux/of_device.h> 30#include <linux/of_device.h>
31#include <linux/of_net.h> 31#include <linux/of_net.h>
32#include <linux/pinctrl/consumer.h>
33 32
34#include "macb.h" 33#include "macb.h"
35 34
@@ -309,7 +308,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
309 struct resource *regs; 308 struct resource *regs;
310 struct net_device *dev; 309 struct net_device *dev;
311 struct phy_device *phydev; 310 struct phy_device *phydev;
312 struct pinctrl *pinctrl;
313 struct macb *lp; 311 struct macb *lp;
314 int res; 312 int res;
315 u32 reg; 313 u32 reg;
@@ -319,15 +317,6 @@ static int __init at91ether_probe(struct platform_device *pdev)
319 if (!regs) 317 if (!regs)
320 return -ENOENT; 318 return -ENOENT;
321 319
322 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
323 if (IS_ERR(pinctrl)) {
324 res = PTR_ERR(pinctrl);
325 if (res == -EPROBE_DEFER)
326 return res;
327
328 dev_warn(&pdev->dev, "No pinctrl provided\n");
329 }
330
331 dev = alloc_etherdev(sizeof(struct macb)); 320 dev = alloc_etherdev(sizeof(struct macb));
332 if (!dev) 321 if (!dev)
333 return -ENOMEM; 322 return -ENOMEM;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index fb098b46c6a6..7be725cdfea8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -52,7 +52,7 @@
52#include <linux/dca.h> 52#include <linux/dca.h>
53#endif 53#endif
54 54
55#include <net/ll_poll.h> 55#include <net/busy_poll.h>
56 56
57#ifdef CONFIG_NET_LL_RX_POLL 57#ifdef CONFIG_NET_LL_RX_POLL
58#define LL_EXTENDED_STATS 58#define LL_EXTENDED_STATS
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 047ebaaf0141..bad8f14b1941 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1978,7 +1978,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
1978 } 1978 }
1979 1979
1980#endif /* IXGBE_FCOE */ 1980#endif /* IXGBE_FCOE */
1981 skb_mark_ll(skb, &q_vector->napi); 1981 skb_mark_napi_id(skb, &q_vector->napi);
1982 ixgbe_rx_skb(q_vector, skb); 1982 ixgbe_rx_skb(q_vector, skb);
1983 1983
1984 /* update budget accounting */ 1984 /* update budget accounting */
@@ -7228,7 +7228,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
7228 .ndo_poll_controller = ixgbe_netpoll, 7228 .ndo_poll_controller = ixgbe_netpoll,
7229#endif 7229#endif
7230#ifdef CONFIG_NET_LL_RX_POLL 7230#ifdef CONFIG_NET_LL_RX_POLL
7231 .ndo_ll_poll = ixgbe_low_latency_recv, 7231 .ndo_busy_poll = ixgbe_low_latency_recv,
7232#endif 7232#endif
7233#ifdef IXGBE_FCOE 7233#ifdef IXGBE_FCOE
7234 .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get, 7234 .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get,
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index caf204770569..5eac871399d8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -38,7 +38,7 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/hash.h> 39#include <linux/hash.h>
40#include <net/ip.h> 40#include <net/ip.h>
41#include <net/ll_poll.h> 41#include <net/busy_poll.h>
42 42
43#include <linux/mlx4/driver.h> 43#include <linux/mlx4/driver.h>
44#include <linux/mlx4/device.h> 44#include <linux/mlx4/device.h>
@@ -2141,7 +2141,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
2141 .ndo_rx_flow_steer = mlx4_en_filter_rfs, 2141 .ndo_rx_flow_steer = mlx4_en_filter_rfs,
2142#endif 2142#endif
2143#ifdef CONFIG_NET_LL_RX_POLL 2143#ifdef CONFIG_NET_LL_RX_POLL
2144 .ndo_ll_poll = mlx4_en_low_latency_recv, 2144 .ndo_busy_poll = mlx4_en_low_latency_recv,
2145#endif 2145#endif
2146}; 2146};
2147 2147
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 76997b93fdfe..dec455c8f627 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -31,7 +31,7 @@
31 * 31 *
32 */ 32 */
33 33
34#include <net/ll_poll.h> 34#include <net/busy_poll.h>
35#include <linux/mlx4/cq.h> 35#include <linux/mlx4/cq.h>
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/mlx4/qp.h> 37#include <linux/mlx4/qp.h>
@@ -767,7 +767,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
767 timestamp); 767 timestamp);
768 } 768 }
769 769
770 skb_mark_ll(skb, &cq->napi); 770 skb_mark_napi_id(skb, &cq->napi);
771 771
772 /* Push it up the stack */ 772 /* Push it up the stack */
773 netif_receive_skb(skb); 773 netif_receive_skb(skb);
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 393f961a013c..4106a743ca74 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -46,6 +46,7 @@
46#define FIRMWARE_8105E_1 "rtl_nic/rtl8105e-1.fw" 46#define FIRMWARE_8105E_1 "rtl_nic/rtl8105e-1.fw"
47#define FIRMWARE_8402_1 "rtl_nic/rtl8402-1.fw" 47#define FIRMWARE_8402_1 "rtl_nic/rtl8402-1.fw"
48#define FIRMWARE_8411_1 "rtl_nic/rtl8411-1.fw" 48#define FIRMWARE_8411_1 "rtl_nic/rtl8411-1.fw"
49#define FIRMWARE_8411_2 "rtl_nic/rtl8411-2.fw"
49#define FIRMWARE_8106E_1 "rtl_nic/rtl8106e-1.fw" 50#define FIRMWARE_8106E_1 "rtl_nic/rtl8106e-1.fw"
50#define FIRMWARE_8106E_2 "rtl_nic/rtl8106e-2.fw" 51#define FIRMWARE_8106E_2 "rtl_nic/rtl8106e-2.fw"
51#define FIRMWARE_8168G_2 "rtl_nic/rtl8168g-2.fw" 52#define FIRMWARE_8168G_2 "rtl_nic/rtl8168g-2.fw"
@@ -144,6 +145,7 @@ enum mac_version {
144 RTL_GIGA_MAC_VER_41, 145 RTL_GIGA_MAC_VER_41,
145 RTL_GIGA_MAC_VER_42, 146 RTL_GIGA_MAC_VER_42,
146 RTL_GIGA_MAC_VER_43, 147 RTL_GIGA_MAC_VER_43,
148 RTL_GIGA_MAC_VER_44,
147 RTL_GIGA_MAC_NONE = 0xff, 149 RTL_GIGA_MAC_NONE = 0xff,
148}; 150};
149 151
@@ -276,6 +278,9 @@ static const struct {
276 [RTL_GIGA_MAC_VER_43] = 278 [RTL_GIGA_MAC_VER_43] =
277 _R("RTL8106e", RTL_TD_1, FIRMWARE_8106E_2, 279 _R("RTL8106e", RTL_TD_1, FIRMWARE_8106E_2,
278 JUMBO_1K, true), 280 JUMBO_1K, true),
281 [RTL_GIGA_MAC_VER_44] =
282 _R("RTL8411", RTL_TD_1, FIRMWARE_8411_2,
283 JUMBO_9K, false),
279}; 284};
280#undef _R 285#undef _R
281 286
@@ -394,6 +399,7 @@ enum rtl8168_8101_registers {
394#define CSIAR_FUNC_CARD 0x00000000 399#define CSIAR_FUNC_CARD 0x00000000
395#define CSIAR_FUNC_SDIO 0x00010000 400#define CSIAR_FUNC_SDIO 0x00010000
396#define CSIAR_FUNC_NIC 0x00020000 401#define CSIAR_FUNC_NIC 0x00020000
402#define CSIAR_FUNC_NIC2 0x00010000
397 PMCH = 0x6f, 403 PMCH = 0x6f,
398 EPHYAR = 0x80, 404 EPHYAR = 0x80,
399#define EPHYAR_FLAG 0x80000000 405#define EPHYAR_FLAG 0x80000000
@@ -826,6 +832,7 @@ MODULE_FIRMWARE(FIRMWARE_8168F_1);
826MODULE_FIRMWARE(FIRMWARE_8168F_2); 832MODULE_FIRMWARE(FIRMWARE_8168F_2);
827MODULE_FIRMWARE(FIRMWARE_8402_1); 833MODULE_FIRMWARE(FIRMWARE_8402_1);
828MODULE_FIRMWARE(FIRMWARE_8411_1); 834MODULE_FIRMWARE(FIRMWARE_8411_1);
835MODULE_FIRMWARE(FIRMWARE_8411_2);
829MODULE_FIRMWARE(FIRMWARE_8106E_1); 836MODULE_FIRMWARE(FIRMWARE_8106E_1);
830MODULE_FIRMWARE(FIRMWARE_8106E_2); 837MODULE_FIRMWARE(FIRMWARE_8106E_2);
831MODULE_FIRMWARE(FIRMWARE_8168G_2); 838MODULE_FIRMWARE(FIRMWARE_8168G_2);
@@ -2051,6 +2058,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
2051 int mac_version; 2058 int mac_version;
2052 } mac_info[] = { 2059 } mac_info[] = {
2053 /* 8168G family. */ 2060 /* 8168G family. */
2061 { 0x7cf00000, 0x5c800000, RTL_GIGA_MAC_VER_44 },
2054 { 0x7cf00000, 0x50900000, RTL_GIGA_MAC_VER_42 }, 2062 { 0x7cf00000, 0x50900000, RTL_GIGA_MAC_VER_42 },
2055 { 0x7cf00000, 0x4c100000, RTL_GIGA_MAC_VER_41 }, 2063 { 0x7cf00000, 0x4c100000, RTL_GIGA_MAC_VER_41 },
2056 { 0x7cf00000, 0x4c000000, RTL_GIGA_MAC_VER_40 }, 2064 { 0x7cf00000, 0x4c000000, RTL_GIGA_MAC_VER_40 },
@@ -3651,6 +3659,7 @@ static void rtl_hw_phy_config(struct net_device *dev)
3651 break; 3659 break;
3652 case RTL_GIGA_MAC_VER_42: 3660 case RTL_GIGA_MAC_VER_42:
3653 case RTL_GIGA_MAC_VER_43: 3661 case RTL_GIGA_MAC_VER_43:
3662 case RTL_GIGA_MAC_VER_44:
3654 rtl8168g_2_hw_phy_config(tp); 3663 rtl8168g_2_hw_phy_config(tp);
3655 break; 3664 break;
3656 3665
@@ -3863,6 +3872,7 @@ static void rtl_init_mdio_ops(struct rtl8169_private *tp)
3863 case RTL_GIGA_MAC_VER_41: 3872 case RTL_GIGA_MAC_VER_41:
3864 case RTL_GIGA_MAC_VER_42: 3873 case RTL_GIGA_MAC_VER_42:
3865 case RTL_GIGA_MAC_VER_43: 3874 case RTL_GIGA_MAC_VER_43:
3875 case RTL_GIGA_MAC_VER_44:
3866 ops->write = r8168g_mdio_write; 3876 ops->write = r8168g_mdio_write;
3867 ops->read = r8168g_mdio_read; 3877 ops->read = r8168g_mdio_read;
3868 break; 3878 break;
@@ -3916,6 +3926,7 @@ static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
3916 case RTL_GIGA_MAC_VER_41: 3926 case RTL_GIGA_MAC_VER_41:
3917 case RTL_GIGA_MAC_VER_42: 3927 case RTL_GIGA_MAC_VER_42:
3918 case RTL_GIGA_MAC_VER_43: 3928 case RTL_GIGA_MAC_VER_43:
3929 case RTL_GIGA_MAC_VER_44:
3919 RTL_W32(RxConfig, RTL_R32(RxConfig) | 3930 RTL_W32(RxConfig, RTL_R32(RxConfig) |
3920 AcceptBroadcast | AcceptMulticast | AcceptMyPhys); 3931 AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
3921 break; 3932 break;
@@ -4178,6 +4189,7 @@ static void rtl_init_pll_power_ops(struct rtl8169_private *tp)
4178 case RTL_GIGA_MAC_VER_40: 4189 case RTL_GIGA_MAC_VER_40:
4179 case RTL_GIGA_MAC_VER_41: 4190 case RTL_GIGA_MAC_VER_41:
4180 case RTL_GIGA_MAC_VER_42: 4191 case RTL_GIGA_MAC_VER_42:
4192 case RTL_GIGA_MAC_VER_44:
4181 ops->down = r8168_pll_power_down; 4193 ops->down = r8168_pll_power_down;
4182 ops->up = r8168_pll_power_up; 4194 ops->up = r8168_pll_power_up;
4183 break; 4195 break;
@@ -4224,6 +4236,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
4224 case RTL_GIGA_MAC_VER_41: 4236 case RTL_GIGA_MAC_VER_41:
4225 case RTL_GIGA_MAC_VER_42: 4237 case RTL_GIGA_MAC_VER_42:
4226 case RTL_GIGA_MAC_VER_43: 4238 case RTL_GIGA_MAC_VER_43:
4239 case RTL_GIGA_MAC_VER_44:
4227 RTL_W32(RxConfig, RX128_INT_EN | RX_DMA_BURST | RX_EARLY_OFF); 4240 RTL_W32(RxConfig, RX128_INT_EN | RX_DMA_BURST | RX_EARLY_OFF);
4228 break; 4241 break;
4229 default: 4242 default:
@@ -4384,6 +4397,7 @@ static void rtl_init_jumbo_ops(struct rtl8169_private *tp)
4384 case RTL_GIGA_MAC_VER_41: 4397 case RTL_GIGA_MAC_VER_41:
4385 case RTL_GIGA_MAC_VER_42: 4398 case RTL_GIGA_MAC_VER_42:
4386 case RTL_GIGA_MAC_VER_43: 4399 case RTL_GIGA_MAC_VER_43:
4400 case RTL_GIGA_MAC_VER_44:
4387 default: 4401 default:
4388 ops->disable = NULL; 4402 ops->disable = NULL;
4389 ops->enable = NULL; 4403 ops->enable = NULL;
@@ -4493,6 +4507,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
4493 tp->mac_version == RTL_GIGA_MAC_VER_41 || 4507 tp->mac_version == RTL_GIGA_MAC_VER_41 ||
4494 tp->mac_version == RTL_GIGA_MAC_VER_42 || 4508 tp->mac_version == RTL_GIGA_MAC_VER_42 ||
4495 tp->mac_version == RTL_GIGA_MAC_VER_43 || 4509 tp->mac_version == RTL_GIGA_MAC_VER_43 ||
4510 tp->mac_version == RTL_GIGA_MAC_VER_44 ||
4496 tp->mac_version == RTL_GIGA_MAC_VER_38) { 4511 tp->mac_version == RTL_GIGA_MAC_VER_38) {
4497 RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq); 4512 RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
4498 rtl_udelay_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666); 4513 rtl_udelay_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666);
@@ -4782,6 +4797,29 @@ static u32 r8402_csi_read(struct rtl8169_private *tp, int addr)
4782 RTL_R32(CSIDR) : ~0; 4797 RTL_R32(CSIDR) : ~0;
4783} 4798}
4784 4799
4800static void r8411_csi_write(struct rtl8169_private *tp, int addr, int value)
4801{
4802 void __iomem *ioaddr = tp->mmio_addr;
4803
4804 RTL_W32(CSIDR, value);
4805 RTL_W32(CSIAR, CSIAR_WRITE_CMD | (addr & CSIAR_ADDR_MASK) |
4806 CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT |
4807 CSIAR_FUNC_NIC2);
4808
4809 rtl_udelay_loop_wait_low(tp, &rtl_csiar_cond, 10, 100);
4810}
4811
4812static u32 r8411_csi_read(struct rtl8169_private *tp, int addr)
4813{
4814 void __iomem *ioaddr = tp->mmio_addr;
4815
4816 RTL_W32(CSIAR, (addr & CSIAR_ADDR_MASK) | CSIAR_FUNC_NIC2 |
4817 CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT);
4818
4819 return rtl_udelay_loop_wait_high(tp, &rtl_csiar_cond, 10, 100) ?
4820 RTL_R32(CSIDR) : ~0;
4821}
4822
4785static void rtl_init_csi_ops(struct rtl8169_private *tp) 4823static void rtl_init_csi_ops(struct rtl8169_private *tp)
4786{ 4824{
4787 struct csi_ops *ops = &tp->csi_ops; 4825 struct csi_ops *ops = &tp->csi_ops;
@@ -4811,6 +4849,11 @@ static void rtl_init_csi_ops(struct rtl8169_private *tp)
4811 ops->read = r8402_csi_read; 4849 ops->read = r8402_csi_read;
4812 break; 4850 break;
4813 4851
4852 case RTL_GIGA_MAC_VER_44:
4853 ops->write = r8411_csi_write;
4854 ops->read = r8411_csi_read;
4855 break;
4856
4814 default: 4857 default:
4815 ops->write = r8169_csi_write; 4858 ops->write = r8169_csi_write;
4816 ops->read = r8169_csi_read; 4859 ops->read = r8169_csi_read;
@@ -5255,6 +5298,25 @@ static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
5255 rtl_ephy_init(tp, e_info_8168g_2, ARRAY_SIZE(e_info_8168g_2)); 5298 rtl_ephy_init(tp, e_info_8168g_2, ARRAY_SIZE(e_info_8168g_2));
5256} 5299}
5257 5300
5301static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
5302{
5303 void __iomem *ioaddr = tp->mmio_addr;
5304 static const struct ephy_info e_info_8411_2[] = {
5305 { 0x00, 0x0000, 0x0008 },
5306 { 0x0c, 0x3df0, 0x0200 },
5307 { 0x0f, 0xffff, 0x5200 },
5308 { 0x19, 0x0020, 0x0000 },
5309 { 0x1e, 0x0000, 0x2000 }
5310 };
5311
5312 rtl_hw_start_8168g_1(tp);
5313
5314 /* disable aspm and clock request before access ephy */
5315 RTL_W8(Config2, RTL_R8(Config2) & ~ClkReqEn);
5316 RTL_W8(Config5, RTL_R8(Config5) & ~ASPM_en);
5317 rtl_ephy_init(tp, e_info_8411_2, ARRAY_SIZE(e_info_8411_2));
5318}
5319
5258static void rtl_hw_start_8168(struct net_device *dev) 5320static void rtl_hw_start_8168(struct net_device *dev)
5259{ 5321{
5260 struct rtl8169_private *tp = netdev_priv(dev); 5322 struct rtl8169_private *tp = netdev_priv(dev);
@@ -5361,6 +5423,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
5361 rtl_hw_start_8168g_2(tp); 5423 rtl_hw_start_8168g_2(tp);
5362 break; 5424 break;
5363 5425
5426 case RTL_GIGA_MAC_VER_44:
5427 rtl_hw_start_8411_2(tp);
5428 break;
5429
5364 default: 5430 default:
5365 printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n", 5431 printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
5366 dev->name, tp->mac_version); 5432 dev->name, tp->mac_version);
@@ -6877,6 +6943,7 @@ static void rtl_hw_initialize(struct rtl8169_private *tp)
6877 case RTL_GIGA_MAC_VER_41: 6943 case RTL_GIGA_MAC_VER_41:
6878 case RTL_GIGA_MAC_VER_42: 6944 case RTL_GIGA_MAC_VER_42:
6879 case RTL_GIGA_MAC_VER_43: 6945 case RTL_GIGA_MAC_VER_43:
6946 case RTL_GIGA_MAC_VER_44:
6880 rtl_hw_init_8168g(tp); 6947 rtl_hw_init_8168g(tp);
6881 break; 6948 break;
6882 6949
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 544514e66187..19a8a045e077 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -4,6 +4,7 @@
4 4
5config SH_ETH 5config SH_ETH
6 tristate "Renesas SuperH Ethernet support" 6 tristate "Renesas SuperH Ethernet support"
7 depends on HAS_DMA
7 select CRC32 8 select CRC32
8 select MII 9 select MII
9 select MDIO_BITBANG 10 select MDIO_BITBANG
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index ca98acabf1b4..b75eb9e0e867 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -1171,7 +1171,11 @@ static void alloc_rbufs(struct net_device *dev)
1171 rp->rx_skbuff_dma[i] = 1171 rp->rx_skbuff_dma[i] =
1172 pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz, 1172 pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz,
1173 PCI_DMA_FROMDEVICE); 1173 PCI_DMA_FROMDEVICE);
1174 1174 if (dma_mapping_error(&rp->pdev->dev, rp->rx_skbuff_dma[i])) {
1175 rp->rx_skbuff_dma[i] = 0;
1176 dev_kfree_skb(skb);
1177 break;
1178 }
1175 rp->rx_ring[i].addr = cpu_to_le32(rp->rx_skbuff_dma[i]); 1179 rp->rx_ring[i].addr = cpu_to_le32(rp->rx_skbuff_dma[i]);
1176 rp->rx_ring[i].rx_status = cpu_to_le32(DescOwn); 1180 rp->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
1177 } 1181 }
@@ -1687,6 +1691,12 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
1687 rp->tx_skbuff_dma[entry] = 1691 rp->tx_skbuff_dma[entry] =
1688 pci_map_single(rp->pdev, skb->data, skb->len, 1692 pci_map_single(rp->pdev, skb->data, skb->len,
1689 PCI_DMA_TODEVICE); 1693 PCI_DMA_TODEVICE);
1694 if (dma_mapping_error(&rp->pdev->dev, rp->tx_skbuff_dma[entry])) {
1695 dev_kfree_skb(skb);
1696 rp->tx_skbuff_dma[entry] = 0;
1697 dev->stats.tx_dropped++;
1698 return NETDEV_TX_OK;
1699 }
1690 rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_skbuff_dma[entry]); 1700 rp->tx_ring[entry].addr = cpu_to_le32(rp->tx_skbuff_dma[entry]);
1691 } 1701 }
1692 1702
@@ -1961,6 +1971,11 @@ static int rhine_rx(struct net_device *dev, int limit)
1961 pci_map_single(rp->pdev, skb->data, 1971 pci_map_single(rp->pdev, skb->data,
1962 rp->rx_buf_sz, 1972 rp->rx_buf_sz,
1963 PCI_DMA_FROMDEVICE); 1973 PCI_DMA_FROMDEVICE);
1974 if (dma_mapping_error(&rp->pdev->dev, rp->rx_skbuff_dma[entry])) {
1975 dev_kfree_skb(skb);
1976 rp->rx_skbuff_dma[entry] = 0;
1977 break;
1978 }
1964 rp->rx_ring[entry].addr = cpu_to_le32(rp->rx_skbuff_dma[entry]); 1979 rp->rx_ring[entry].addr = cpu_to_le32(rp->rx_skbuff_dma[entry]);
1965 } 1980 }
1966 rp->rx_ring[entry].rx_status = cpu_to_le32(DescOwn); 1981 rp->rx_ring[entry].rx_status = cpu_to_le32(DescOwn);
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index ede3ce4912f9..42e6deee6db5 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -22,7 +22,6 @@
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/pinctrl/consumer.h>
26#include <net/wpan-phy.h> 25#include <net/wpan-phy.h>
27#include <net/mac802154.h> 26#include <net/mac802154.h>
28#include <net/ieee802154.h> 27#include <net/ieee802154.h>
@@ -627,7 +626,6 @@ static int mrf24j40_probe(struct spi_device *spi)
627 int ret = -ENOMEM; 626 int ret = -ENOMEM;
628 u8 val; 627 u8 val;
629 struct mrf24j40 *devrec; 628 struct mrf24j40 *devrec;
630 struct pinctrl *pinctrl;
631 629
632 printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq); 630 printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq);
633 631
@@ -638,11 +636,6 @@ static int mrf24j40_probe(struct spi_device *spi)
638 if (!devrec->buf) 636 if (!devrec->buf)
639 goto err_buf; 637 goto err_buf;
640 638
641 pinctrl = devm_pinctrl_get_select_default(&spi->dev);
642 if (IS_ERR(pinctrl))
643 dev_warn(&spi->dev,
644 "pinctrl pins are not configured from the driver");
645
646 spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */ 639 spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */
647 if (spi->max_speed_hz > MAX_SPI_SPEED_HZ) 640 if (spi->max_speed_hz > MAX_SPI_SPEED_HZ)
648 spi->max_speed_hz = MAX_SPI_SPEED_HZ; 641 spi->max_speed_hz = MAX_SPI_SPEED_HZ;
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index dc9f6a45515d..a3bed28197d2 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -291,11 +291,17 @@ static int __init ifb_init_module(void)
291 291
292 rtnl_lock(); 292 rtnl_lock();
293 err = __rtnl_link_register(&ifb_link_ops); 293 err = __rtnl_link_register(&ifb_link_ops);
294 if (err < 0)
295 goto out;
294 296
295 for (i = 0; i < numifbs && !err; i++) 297 for (i = 0; i < numifbs && !err; i++) {
296 err = ifb_init_one(i); 298 err = ifb_init_one(i);
299 cond_resched();
300 }
297 if (err) 301 if (err)
298 __rtnl_link_unregister(&ifb_link_ops); 302 __rtnl_link_unregister(&ifb_link_ops);
303
304out:
299 rtnl_unlock(); 305 rtnl_unlock();
300 306
301 return err; 307 return err;
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index f2c4a3b218fc..876c72246ae9 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -712,6 +712,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
712 int vnet_hdr_len = 0; 712 int vnet_hdr_len = 0;
713 int copylen = 0; 713 int copylen = 0;
714 bool zerocopy = false; 714 bool zerocopy = false;
715 size_t linear;
715 716
716 if (q->flags & IFF_VNET_HDR) { 717 if (q->flags & IFF_VNET_HDR) {
717 vnet_hdr_len = q->vnet_hdr_sz; 718 vnet_hdr_len = q->vnet_hdr_sz;
@@ -766,11 +767,14 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m,
766 copylen = vnet_hdr.hdr_len; 767 copylen = vnet_hdr.hdr_len;
767 if (!copylen) 768 if (!copylen)
768 copylen = GOODCOPY_LEN; 769 copylen = GOODCOPY_LEN;
769 } else 770 linear = copylen;
771 } else {
770 copylen = len; 772 copylen = len;
773 linear = vnet_hdr.hdr_len;
774 }
771 775
772 skb = macvtap_alloc_skb(&q->sk, NET_IP_ALIGN, copylen, 776 skb = macvtap_alloc_skb(&q->sk, NET_IP_ALIGN, copylen,
773 vnet_hdr.hdr_len, noblock, &err); 777 linear, noblock, &err);
774 if (!skb) 778 if (!skb)
775 goto err; 779 goto err;
776 780
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 1f7091b3c27c..ac22283aaf23 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -217,6 +217,7 @@ module_exit(atheros_exit);
217 217
218static struct mdio_device_id __maybe_unused atheros_tbl[] = { 218static struct mdio_device_id __maybe_unused atheros_tbl[] = {
219 { 0x004dd076, 0xffffffef }, 219 { 0x004dd076, 0xffffffef },
220 { 0x004dd074, 0xffffffef },
220 { 0x004dd072, 0xffffffef }, 221 { 0x004dd072, 0xffffffef },
221 { } 222 { }
222}; 223};
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7eab5fcd064f..5cdcf92eb310 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1042,7 +1042,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1042{ 1042{
1043 struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) }; 1043 struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
1044 struct sk_buff *skb; 1044 struct sk_buff *skb;
1045 size_t len = total_len, align = NET_SKB_PAD; 1045 size_t len = total_len, align = NET_SKB_PAD, linear;
1046 struct virtio_net_hdr gso = { 0 }; 1046 struct virtio_net_hdr gso = { 0 };
1047 int offset = 0; 1047 int offset = 0;
1048 int copylen; 1048 int copylen;
@@ -1106,10 +1106,13 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1106 copylen = gso.hdr_len; 1106 copylen = gso.hdr_len;
1107 if (!copylen) 1107 if (!copylen)
1108 copylen = GOODCOPY_LEN; 1108 copylen = GOODCOPY_LEN;
1109 } else 1109 linear = copylen;
1110 } else {
1110 copylen = len; 1111 copylen = len;
1112 linear = gso.hdr_len;
1113 }
1111 1114
1112 skb = tun_alloc_skb(tfile, align, copylen, gso.hdr_len, noblock); 1115 skb = tun_alloc_skb(tfile, align, copylen, linear, noblock);
1113 if (IS_ERR(skb)) { 1116 if (IS_ERR(skb)) {
1114 if (PTR_ERR(skb) != -EAGAIN) 1117 if (PTR_ERR(skb) != -EAGAIN)
1115 tun->dev->stats.rx_dropped++; 1118 tun->dev->stats.rx_dropped++;
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
index 9ab5c9d4b45a..e8171784529d 100644
--- a/drivers/net/usb/Makefile
+++ b/drivers/net/usb/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_USB_HSO) += hso.o
11obj-$(CONFIG_USB_NET_AX8817X) += asix.o 11obj-$(CONFIG_USB_NET_AX8817X) += asix.o
12asix-y := asix_devices.o asix_common.o ax88172a.o 12asix-y := asix_devices.o asix_common.o ax88172a.o
13obj-$(CONFIG_USB_NET_AX88179_178A) += ax88179_178a.o 13obj-$(CONFIG_USB_NET_AX88179_178A) += ax88179_178a.o
14obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o 14obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o r815x.o
15obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o 15obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o
16obj-$(CONFIG_USB_NET_DM9601) += dm9601.o 16obj-$(CONFIG_USB_NET_DM9601) += dm9601.o
17obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o 17obj-$(CONFIG_USB_NET_SMSC75XX) += smsc75xx.o
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 4393f1483126..03ad4dc293aa 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -646,13 +646,18 @@ static const struct usb_device_id products [] = {
646}, 646},
647 647
648/* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */ 648/* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */
649#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
650{ 649{
651 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, 650 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM,
652 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), 651 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
653 .driver_info = 0, 652 .driver_info = 0,
654}, 653},
655#endif 654
655/* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */
656{
657 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM,
658 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
659 .driver_info = 0,
660},
656 661
657/* 662/*
658 * WHITELIST!!! 663 * WHITELIST!!!
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index d02bac82fc57..ee13f9eb740c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -934,7 +934,8 @@ static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb,
934 struct r8152 *tp = netdev_priv(netdev); 934 struct r8152 *tp = netdev_priv(netdev);
935 struct net_device_stats *stats = rtl8152_get_stats(netdev); 935 struct net_device_stats *stats = rtl8152_get_stats(netdev);
936 struct tx_desc *tx_desc; 936 struct tx_desc *tx_desc;
937 int len, res; 937 unsigned int len;
938 int res;
938 939
939 netif_stop_queue(netdev); 940 netif_stop_queue(netdev);
940 len = skb->len; 941 len = skb->len;
diff --git a/drivers/net/usb/r815x.c b/drivers/net/usb/r815x.c
new file mode 100644
index 000000000000..852392269718
--- /dev/null
+++ b/drivers/net/usb/r815x.c
@@ -0,0 +1,234 @@
1#include <linux/module.h>
2#include <linux/netdevice.h>
3#include <linux/mii.h>
4#include <linux/usb.h>
5#include <linux/usb/cdc.h>
6#include <linux/usb/usbnet.h>
7
8#define RTL815x_REQT_READ 0xc0
9#define RTL815x_REQT_WRITE 0x40
10#define RTL815x_REQ_GET_REGS 0x05
11#define RTL815x_REQ_SET_REGS 0x05
12
13#define MCU_TYPE_PLA 0x0100
14#define OCP_BASE 0xe86c
15#define BASE_MII 0xa400
16
17#define BYTE_EN_DWORD 0xff
18#define BYTE_EN_WORD 0x33
19#define BYTE_EN_BYTE 0x11
20
21#define R815x_PHY_ID 32
22#define REALTEK_VENDOR_ID 0x0bda
23
24
25static int pla_read_word(struct usb_device *udev, u16 index)
26{
27 int data, ret;
28 u8 shift = index & 2;
29 __le32 ocp_data;
30
31 index &= ~3;
32
33 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
34 RTL815x_REQ_GET_REGS, RTL815x_REQT_READ,
35 index, MCU_TYPE_PLA, &ocp_data, sizeof(ocp_data),
36 500);
37 if (ret < 0)
38 return ret;
39
40 data = __le32_to_cpu(ocp_data);
41 data >>= (shift * 8);
42 data &= 0xffff;
43
44 return data;
45}
46
47static int pla_write_word(struct usb_device *udev, u16 index, u32 data)
48{
49 __le32 ocp_data;
50 u32 mask = 0xffff;
51 u16 byen = BYTE_EN_WORD;
52 u8 shift = index & 2;
53 int ret;
54
55 data &= mask;
56
57 if (shift) {
58 byen <<= shift;
59 mask <<= (shift * 8);
60 data <<= (shift * 8);
61 index &= ~3;
62 }
63
64 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
65 RTL815x_REQ_GET_REGS, RTL815x_REQT_READ,
66 index, MCU_TYPE_PLA, &ocp_data, sizeof(ocp_data),
67 500);
68 if (ret < 0)
69 return ret;
70
71 data |= __le32_to_cpu(ocp_data) & ~mask;
72 ocp_data = __cpu_to_le32(data);
73
74 ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
75 RTL815x_REQ_SET_REGS, RTL815x_REQT_WRITE,
76 index, MCU_TYPE_PLA | byen, &ocp_data,
77 sizeof(ocp_data), 500);
78
79 return ret;
80}
81
82static int ocp_reg_read(struct usbnet *dev, u16 addr)
83{
84 u16 ocp_base, ocp_index;
85 int ret;
86
87 ocp_base = addr & 0xf000;
88 ret = pla_write_word(dev->udev, OCP_BASE, ocp_base);
89 if (ret < 0)
90 goto out;
91
92 ocp_index = (addr & 0x0fff) | 0xb000;
93 ret = pla_read_word(dev->udev, ocp_index);
94
95out:
96 return ret;
97}
98
99static int ocp_reg_write(struct usbnet *dev, u16 addr, u16 data)
100{
101 u16 ocp_base, ocp_index;
102 int ret;
103
104 ocp_base = addr & 0xf000;
105 ret = pla_write_word(dev->udev, OCP_BASE, ocp_base);
106 if (ret < 0)
107 goto out1;
108
109 ocp_index = (addr & 0x0fff) | 0xb000;
110 ret = pla_write_word(dev->udev, ocp_index, data);
111
112out1:
113 return ret;
114}
115
116static int r815x_mdio_read(struct net_device *netdev, int phy_id, int reg)
117{
118 struct usbnet *dev = netdev_priv(netdev);
119
120 if (phy_id != R815x_PHY_ID)
121 return -EINVAL;
122
123 return ocp_reg_read(dev, BASE_MII + reg * 2);
124}
125
126static
127void r815x_mdio_write(struct net_device *netdev, int phy_id, int reg, int val)
128{
129 struct usbnet *dev = netdev_priv(netdev);
130
131 if (phy_id != R815x_PHY_ID)
132 return;
133
134 ocp_reg_write(dev, BASE_MII + reg * 2, val);
135}
136
137static int r8153_bind(struct usbnet *dev, struct usb_interface *intf)
138{
139 int status;
140
141 status = usbnet_cdc_bind(dev, intf);
142 if (status < 0)
143 return status;
144
145 dev->mii.dev = dev->net;
146 dev->mii.mdio_read = r815x_mdio_read;
147 dev->mii.mdio_write = r815x_mdio_write;
148 dev->mii.phy_id_mask = 0x3f;
149 dev->mii.reg_num_mask = 0x1f;
150 dev->mii.phy_id = R815x_PHY_ID;
151 dev->mii.supports_gmii = 1;
152
153 return 0;
154}
155
156static int r8152_bind(struct usbnet *dev, struct usb_interface *intf)
157{
158 int status;
159
160 status = usbnet_cdc_bind(dev, intf);
161 if (status < 0)
162 return status;
163
164 dev->mii.dev = dev->net;
165 dev->mii.mdio_read = r815x_mdio_read;
166 dev->mii.mdio_write = r815x_mdio_write;
167 dev->mii.phy_id_mask = 0x3f;
168 dev->mii.reg_num_mask = 0x1f;
169 dev->mii.phy_id = R815x_PHY_ID;
170 dev->mii.supports_gmii = 0;
171
172 return 0;
173}
174
175static const struct driver_info r8152_info = {
176 .description = "RTL8152 ECM Device",
177 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
178 .bind = r8152_bind,
179 .unbind = usbnet_cdc_unbind,
180 .status = usbnet_cdc_status,
181 .manage_power = usbnet_manage_power,
182};
183
184static const struct driver_info r8153_info = {
185 .description = "RTL8153 ECM Device",
186 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
187 .bind = r8153_bind,
188 .unbind = usbnet_cdc_unbind,
189 .status = usbnet_cdc_status,
190 .manage_power = usbnet_manage_power,
191};
192
193static const struct usb_device_id products[] = {
194{
195 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM,
196 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
197#if defined(CONFIG_USB_RTL8152) || defined(CONFIG_USB_RTL8152_MODULE)
198 .driver_info = 0,
199#else
200 .driver_info = (unsigned long) &r8152_info,
201#endif
202},
203
204{
205 USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM,
206 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
207#if defined(CONFIG_USB_RTL8153) || defined(CONFIG_USB_RTL8153_MODULE)
208 .driver_info = 0,
209#else
210 .driver_info = (unsigned long) &r8153_info,
211#endif
212},
213
214 { }, /* END */
215};
216MODULE_DEVICE_TABLE(usb, products);
217
218static struct usb_driver r815x_driver = {
219 .name = "r815x",
220 .id_table = products,
221 .probe = usbnet_probe,
222 .disconnect = usbnet_disconnect,
223 .suspend = usbnet_suspend,
224 .resume = usbnet_resume,
225 .reset_resume = usbnet_resume,
226 .supports_autosuspend = 1,
227 .disable_hub_initiated_lpm = 1,
228};
229
230module_usb_driver(r815x_driver);
231
232MODULE_AUTHOR("Hayes Wang");
233MODULE_DESCRIPTION("Realtek USB ECM device");
234MODULE_LICENSE("GPL");
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 227b54a1f88a..0ba1e7edbb1b 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1916,9 +1916,9 @@ late_initcall(vxlan_init_module);
1916 1916
1917static void __exit vxlan_cleanup_module(void) 1917static void __exit vxlan_cleanup_module(void)
1918{ 1918{
1919 unregister_pernet_device(&vxlan_net_ops);
1920 rtnl_link_unregister(&vxlan_link_ops); 1919 rtnl_link_unregister(&vxlan_link_ops);
1921 destroy_workqueue(vxlan_wq); 1920 destroy_workqueue(vxlan_wq);
1921 unregister_pernet_device(&vxlan_net_ops);
1922 rcu_barrier(); 1922 rcu_barrier();
1923} 1923}
1924module_exit(vxlan_cleanup_module); 1924module_exit(vxlan_cleanup_module);
diff --git a/fs/select.c b/fs/select.c
index f9f49c40cfd4..35d4adc749d9 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -28,7 +28,7 @@
28#include <linux/hrtimer.h> 28#include <linux/hrtimer.h>
29#include <linux/sched/rt.h> 29#include <linux/sched/rt.h>
30#include <linux/freezer.h> 30#include <linux/freezer.h>
31#include <net/ll_poll.h> 31#include <net/busy_poll.h>
32 32
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34 34
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index bb82871b8494..0741a1e919a5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -974,7 +974,7 @@ struct net_device_ops {
974 void (*ndo_netpoll_cleanup)(struct net_device *dev); 974 void (*ndo_netpoll_cleanup)(struct net_device *dev);
975#endif 975#endif
976#ifdef CONFIG_NET_LL_RX_POLL 976#ifdef CONFIG_NET_LL_RX_POLL
977 int (*ndo_ll_poll)(struct napi_struct *dev); 977 int (*ndo_busy_poll)(struct napi_struct *dev);
978#endif 978#endif
979 int (*ndo_set_vf_mac)(struct net_device *dev, 979 int (*ndo_set_vf_mac)(struct net_device *dev,
980 int queue, u8 *mac); 980 int queue, u8 *mac);
diff --git a/include/net/ll_poll.h b/include/net/busy_poll.h
index 76f034087743..a14339c2985f 100644
--- a/include/net/ll_poll.h
+++ b/include/net/busy_poll.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Low Latency Sockets 2 * net busy poll support
3 * Copyright(c) 2013 Intel Corporation. 3 * Copyright(c) 2013 Intel Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
@@ -21,8 +21,8 @@
21 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 21 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
22 */ 22 */
23 23
24#ifndef _LINUX_NET_LL_POLL_H 24#ifndef _LINUX_NET_BUSY_POLL_H
25#define _LINUX_NET_LL_POLL_H 25#define _LINUX_NET_BUSY_POLL_H
26 26
27#include <linux/netdevice.h> 27#include <linux/netdevice.h>
28#include <net/ip.h> 28#include <net/ip.h>
@@ -30,8 +30,8 @@
30#ifdef CONFIG_NET_LL_RX_POLL 30#ifdef CONFIG_NET_LL_RX_POLL
31 31
32struct napi_struct; 32struct napi_struct;
33extern unsigned int sysctl_net_ll_read __read_mostly; 33extern unsigned int sysctl_net_busy_read __read_mostly;
34extern unsigned int sysctl_net_ll_poll __read_mostly; 34extern unsigned int sysctl_net_busy_poll __read_mostly;
35 35
36/* return values from ndo_ll_poll */ 36/* return values from ndo_ll_poll */
37#define LL_FLUSH_FAILED -1 37#define LL_FLUSH_FAILED -1
@@ -39,7 +39,7 @@ extern unsigned int sysctl_net_ll_poll __read_mostly;
39 39
40static inline bool net_busy_loop_on(void) 40static inline bool net_busy_loop_on(void)
41{ 41{
42 return sysctl_net_ll_poll; 42 return sysctl_net_busy_poll;
43} 43}
44 44
45/* a wrapper to make debug_smp_processor_id() happy 45/* a wrapper to make debug_smp_processor_id() happy
@@ -72,7 +72,7 @@ static inline unsigned long sk_busy_loop_end_time(struct sock *sk)
72/* in poll/select we use the global sysctl_net_ll_poll value */ 72/* in poll/select we use the global sysctl_net_ll_poll value */
73static inline unsigned long busy_loop_end_time(void) 73static inline unsigned long busy_loop_end_time(void)
74{ 74{
75 return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_ll_poll); 75 return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll);
76} 76}
77 77
78static inline bool sk_can_busy_loop(struct sock *sk) 78static inline bool sk_can_busy_loop(struct sock *sk)
@@ -110,11 +110,11 @@ static inline bool sk_busy_loop(struct sock *sk, int nonblock)
110 goto out; 110 goto out;
111 111
112 ops = napi->dev->netdev_ops; 112 ops = napi->dev->netdev_ops;
113 if (!ops->ndo_ll_poll) 113 if (!ops->ndo_busy_poll)
114 goto out; 114 goto out;
115 115
116 do { 116 do {
117 rc = ops->ndo_ll_poll(napi); 117 rc = ops->ndo_busy_poll(napi);
118 118
119 if (rc == LL_FLUSH_FAILED) 119 if (rc == LL_FLUSH_FAILED)
120 break; /* permanent failure */ 120 break; /* permanent failure */
@@ -134,13 +134,14 @@ out:
134} 134}
135 135
136/* used in the NIC receive handler to mark the skb */ 136/* used in the NIC receive handler to mark the skb */
137static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi) 137static inline void skb_mark_napi_id(struct sk_buff *skb,
138 struct napi_struct *napi)
138{ 139{
139 skb->napi_id = napi->napi_id; 140 skb->napi_id = napi->napi_id;
140} 141}
141 142
142/* used in the protocol hanlder to propagate the napi_id to the socket */ 143/* used in the protocol hanlder to propagate the napi_id to the socket */
143static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb) 144static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb)
144{ 145{
145 sk->sk_napi_id = skb->napi_id; 146 sk->sk_napi_id = skb->napi_id;
146} 147}
@@ -166,11 +167,12 @@ static inline bool sk_busy_poll(struct sock *sk, int nonblock)
166 return false; 167 return false;
167} 168}
168 169
169static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi) 170static inline void skb_mark_napi_id(struct sk_buff *skb,
171 struct napi_struct *napi)
170{ 172{
171} 173}
172 174
173static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb) 175static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb)
174{ 176{
175} 177}
176 178
@@ -180,4 +182,4 @@ static inline bool busy_loop_timeout(unsigned long end_time)
180} 182}
181 183
182#endif /* CONFIG_NET_LL_RX_POLL */ 184#endif /* CONFIG_NET_LL_RX_POLL */
183#endif /* _LINUX_NET_LL_POLL_H */ 185#endif /* _LINUX_NET_BUSY_POLL_H */
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index ca3a20d772ac..f04b69b6abf2 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -76,6 +76,6 @@
76 76
77#define SO_SELECT_ERR_QUEUE 45 77#define SO_SELECT_ERR_QUEUE 45
78 78
79#define SO_LL 46 79#define SO_BUSY_POLL 46
80 80
81#endif /* __ASM_GENERIC_SOCKET_H */ 81#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/9p/trans_common.c b/net/9p/trans_common.c
index de8df957867d..2ee3879161b1 100644
--- a/net/9p/trans_common.c
+++ b/net/9p/trans_common.c
@@ -24,11 +24,11 @@
24 */ 24 */
25void p9_release_pages(struct page **pages, int nr_pages) 25void p9_release_pages(struct page **pages, int nr_pages)
26{ 26{
27 int i = 0; 27 int i;
28 while (pages[i] && nr_pages--) { 28
29 put_page(pages[i]); 29 for (i = 0; i < nr_pages; i++)
30 i++; 30 if (pages[i])
31 } 31 put_page(pages[i]);
32} 32}
33EXPORT_SYMBOL(p9_release_pages); 33EXPORT_SYMBOL(p9_release_pages);
34 34
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 6e9ab31e457e..8ab48cd89559 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -56,7 +56,7 @@
56#include <net/sock.h> 56#include <net/sock.h>
57#include <net/tcp_states.h> 57#include <net/tcp_states.h>
58#include <trace/events/skb.h> 58#include <trace/events/skb.h>
59#include <net/ll_poll.h> 59#include <net/busy_poll.h>
60 60
61/* 61/*
62 * Is a socket 'connection oriented' ? 62 * Is a socket 'connection oriented' ?
diff --git a/net/core/dev.c b/net/core/dev.c
index 560dafd83adf..a3d8d44cb7f4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2481,10 +2481,10 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
2481} 2481}
2482 2482
2483static netdev_features_t harmonize_features(struct sk_buff *skb, 2483static netdev_features_t harmonize_features(struct sk_buff *skb,
2484 __be16 protocol, netdev_features_t features) 2484 netdev_features_t features)
2485{ 2485{
2486 if (skb->ip_summed != CHECKSUM_NONE && 2486 if (skb->ip_summed != CHECKSUM_NONE &&
2487 !can_checksum_protocol(features, protocol)) { 2487 !can_checksum_protocol(features, skb_network_protocol(skb))) {
2488 features &= ~NETIF_F_ALL_CSUM; 2488 features &= ~NETIF_F_ALL_CSUM;
2489 } else if (illegal_highdma(skb->dev, skb)) { 2489 } else if (illegal_highdma(skb->dev, skb)) {
2490 features &= ~NETIF_F_SG; 2490 features &= ~NETIF_F_SG;
@@ -2505,20 +2505,18 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
2505 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; 2505 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
2506 protocol = veh->h_vlan_encapsulated_proto; 2506 protocol = veh->h_vlan_encapsulated_proto;
2507 } else if (!vlan_tx_tag_present(skb)) { 2507 } else if (!vlan_tx_tag_present(skb)) {
2508 return harmonize_features(skb, protocol, features); 2508 return harmonize_features(skb, features);
2509 } 2509 }
2510 2510
2511 features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX | 2511 features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |
2512 NETIF_F_HW_VLAN_STAG_TX); 2512 NETIF_F_HW_VLAN_STAG_TX);
2513 2513
2514 if (protocol != htons(ETH_P_8021Q) && protocol != htons(ETH_P_8021AD)) { 2514 if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD))
2515 return harmonize_features(skb, protocol, features);
2516 } else {
2517 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 2515 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
2518 NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX | 2516 NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |
2519 NETIF_F_HW_VLAN_STAG_TX; 2517 NETIF_F_HW_VLAN_STAG_TX;
2520 return harmonize_features(skb, protocol, features); 2518
2521 } 2519 return harmonize_features(skb, features);
2522} 2520}
2523EXPORT_SYMBOL(netif_skb_features); 2521EXPORT_SYMBOL(netif_skb_features);
2524 2522
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 724bb7cb173f..20e02d2605ec 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -824,7 +824,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
824 page = alloc_page(gfp_mask); 824 page = alloc_page(gfp_mask);
825 if (!page) { 825 if (!page) {
826 while (head) { 826 while (head) {
827 struct page *next = (struct page *)head->private; 827 struct page *next = (struct page *)page_private(head);
828 put_page(head); 828 put_page(head);
829 head = next; 829 head = next;
830 } 830 }
@@ -834,7 +834,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
834 memcpy(page_address(page), 834 memcpy(page_address(page),
835 vaddr + f->page_offset, skb_frag_size(f)); 835 vaddr + f->page_offset, skb_frag_size(f));
836 kunmap_atomic(vaddr); 836 kunmap_atomic(vaddr);
837 page->private = (unsigned long)head; 837 set_page_private(page, (unsigned long)head);
838 head = page; 838 head = page;
839 } 839 }
840 840
@@ -848,7 +848,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
848 for (i = num_frags - 1; i >= 0; i--) { 848 for (i = num_frags - 1; i >= 0; i--) {
849 __skb_fill_page_desc(skb, i, head, 0, 849 __skb_fill_page_desc(skb, i, head, 0,
850 skb_shinfo(skb)->frags[i].size); 850 skb_shinfo(skb)->frags[i].size);
851 head = (struct page *)head->private; 851 head = (struct page *)page_private(head);
852 } 852 }
853 853
854 skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY; 854 skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
diff --git a/net/core/sock.c b/net/core/sock.c
index ab06b719f5b1..548d716c5f62 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -139,7 +139,7 @@
139#include <net/tcp.h> 139#include <net/tcp.h>
140#endif 140#endif
141 141
142#include <net/ll_poll.h> 142#include <net/busy_poll.h>
143 143
144static DEFINE_MUTEX(proto_list_mutex); 144static DEFINE_MUTEX(proto_list_mutex);
145static LIST_HEAD(proto_list); 145static LIST_HEAD(proto_list);
@@ -901,7 +901,7 @@ set_rcvbuf:
901 break; 901 break;
902 902
903#ifdef CONFIG_NET_LL_RX_POLL 903#ifdef CONFIG_NET_LL_RX_POLL
904 case SO_LL: 904 case SO_BUSY_POLL:
905 /* allow unprivileged users to decrease the value */ 905 /* allow unprivileged users to decrease the value */
906 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) 906 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN))
907 ret = -EPERM; 907 ret = -EPERM;
@@ -1171,7 +1171,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
1171 break; 1171 break;
1172 1172
1173#ifdef CONFIG_NET_LL_RX_POLL 1173#ifdef CONFIG_NET_LL_RX_POLL
1174 case SO_LL: 1174 case SO_BUSY_POLL:
1175 v.val = sk->sk_ll_usec; 1175 v.val = sk->sk_ll_usec;
1176 break; 1176 break;
1177#endif 1177#endif
@@ -2294,7 +2294,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
2294 2294
2295#ifdef CONFIG_NET_LL_RX_POLL 2295#ifdef CONFIG_NET_LL_RX_POLL
2296 sk->sk_napi_id = 0; 2296 sk->sk_napi_id = 0;
2297 sk->sk_ll_usec = sysctl_net_ll_read; 2297 sk->sk_ll_usec = sysctl_net_busy_read;
2298#endif 2298#endif
2299 2299
2300 /* 2300 /*
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index afc677eadd93..660968616637 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -19,7 +19,7 @@
19#include <net/ip.h> 19#include <net/ip.h>
20#include <net/sock.h> 20#include <net/sock.h>
21#include <net/net_ratelimit.h> 21#include <net/net_ratelimit.h>
22#include <net/ll_poll.h> 22#include <net/busy_poll.h>
23 23
24static int one = 1; 24static int one = 1;
25 25
@@ -300,15 +300,15 @@ static struct ctl_table net_core_table[] = {
300#endif /* CONFIG_NET_FLOW_LIMIT */ 300#endif /* CONFIG_NET_FLOW_LIMIT */
301#ifdef CONFIG_NET_LL_RX_POLL 301#ifdef CONFIG_NET_LL_RX_POLL
302 { 302 {
303 .procname = "low_latency_poll", 303 .procname = "busy_poll",
304 .data = &sysctl_net_ll_poll, 304 .data = &sysctl_net_busy_poll,
305 .maxlen = sizeof(unsigned int), 305 .maxlen = sizeof(unsigned int),
306 .mode = 0644, 306 .mode = 0644,
307 .proc_handler = proc_dointvec 307 .proc_handler = proc_dointvec
308 }, 308 },
309 { 309 {
310 .procname = "low_latency_read", 310 .procname = "busy_read",
311 .data = &sysctl_net_ll_read, 311 .data = &sysctl_net_busy_read,
312 .maxlen = sizeof(unsigned int), 312 .maxlen = sizeof(unsigned int),
313 .mode = 0644, 313 .mode = 0644,
314 .proc_handler = proc_dointvec 314 .proc_handler = proc_dointvec
diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c
index 0a69d0757795..f347a2ca7d7e 100644
--- a/net/dns_resolver/dns_key.c
+++ b/net/dns_resolver/dns_key.c
@@ -118,7 +118,7 @@ dns_resolver_instantiate(struct key *key, struct key_preparsed_payload *prep)
118 if (opt_vlen <= 0) 118 if (opt_vlen <= 0)
119 goto bad_option_value; 119 goto bad_option_value;
120 120
121 ret = strict_strtoul(eq, 10, &derrno); 121 ret = kstrtoul(eq, 10, &derrno);
122 if (ret < 0) 122 if (ret < 0)
123 goto bad_option_value; 123 goto bad_option_value;
124 124
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index 775d5b532ece..55e6bfb3a289 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -100,6 +100,9 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
100 } 100 }
101 __skb_push(skb, tnl_hlen - ghl); 101 __skb_push(skb, tnl_hlen - ghl);
102 102
103 skb_reset_inner_headers(skb);
104 skb->encapsulation = 1;
105
103 skb_reset_mac_header(skb); 106 skb_reset_mac_header(skb);
104 skb_set_network_header(skb, mac_len); 107 skb_set_network_header(skb, mac_len);
105 skb->mac_len = mac_len; 108 skb->mac_len = mac_len;
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index 6af375afeeef..7bd8983dbfcf 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -467,7 +467,7 @@ void inet_unhash(struct sock *sk)
467 lock = inet_ehash_lockp(hashinfo, sk->sk_hash); 467 lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
468 468
469 spin_lock_bh(lock); 469 spin_lock_bh(lock);
470 done =__sk_nulls_del_node_init_rcu(sk); 470 done = __sk_nulls_del_node_init_rcu(sk);
471 if (done) 471 if (done)
472 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 472 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
473 spin_unlock_bh(lock); 473 spin_unlock_bh(lock);
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index 945734b2f209..ca1cb2d5f6e2 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -476,7 +476,7 @@ static int tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
476 struct rtable *rt, __be16 df) 476 struct rtable *rt, __be16 df)
477{ 477{
478 struct ip_tunnel *tunnel = netdev_priv(dev); 478 struct ip_tunnel *tunnel = netdev_priv(dev);
479 int pkt_size = skb->len - tunnel->hlen; 479 int pkt_size = skb->len - tunnel->hlen - dev->hard_header_len;
480 int mtu; 480 int mtu;
481 481
482 if (df) 482 if (df)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 15cbfa94bd8e..5423223e93c2 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -279,7 +279,7 @@
279 279
280#include <asm/uaccess.h> 280#include <asm/uaccess.h>
281#include <asm/ioctls.h> 281#include <asm/ioctls.h>
282#include <net/ll_poll.h> 282#include <net/busy_poll.h>
283 283
284int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT; 284int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT;
285 285
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 35675e46aff8..b299da5ff499 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -75,7 +75,7 @@
75#include <net/netdma.h> 75#include <net/netdma.h>
76#include <net/secure_seq.h> 76#include <net/secure_seq.h>
77#include <net/tcp_memcontrol.h> 77#include <net/tcp_memcontrol.h>
78#include <net/ll_poll.h> 78#include <net/busy_poll.h>
79 79
80#include <linux/inet.h> 80#include <linux/inet.h>
81#include <linux/ipv6.h> 81#include <linux/ipv6.h>
@@ -1994,7 +1994,7 @@ process:
1994 if (sk_filter(sk, skb)) 1994 if (sk_filter(sk, skb))
1995 goto discard_and_relse; 1995 goto discard_and_relse;
1996 1996
1997 sk_mark_ll(sk, skb); 1997 sk_mark_napi_id(sk, skb);
1998 skb->dev = NULL; 1998 skb->dev = NULL;
1999 1999
2000 bh_lock_sock_nested(sk); 2000 bh_lock_sock_nested(sk);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 3d609490f118..92fde8d1aa82 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2407,6 +2407,8 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
2407 * see tcp_input.c tcp_sacktag_write_queue(). 2407 * see tcp_input.c tcp_sacktag_write_queue().
2408 */ 2408 */
2409 TCP_SKB_CB(skb)->ack_seq = tp->snd_nxt; 2409 TCP_SKB_CB(skb)->ack_seq = tp->snd_nxt;
2410 } else {
2411 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
2410 } 2412 }
2411 return err; 2413 return err;
2412} 2414}
@@ -2528,10 +2530,9 @@ begin_fwd:
2528 if (sacked & (TCPCB_SACKED_ACKED|TCPCB_SACKED_RETRANS)) 2530 if (sacked & (TCPCB_SACKED_ACKED|TCPCB_SACKED_RETRANS))
2529 continue; 2531 continue;
2530 2532
2531 if (tcp_retransmit_skb(sk, skb)) { 2533 if (tcp_retransmit_skb(sk, skb))
2532 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL);
2533 return; 2534 return;
2534 } 2535
2535 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2536 NET_INC_STATS_BH(sock_net(sk), mib_idx);
2536 2537
2537 if (tcp_in_cwnd_reduction(sk)) 2538 if (tcp_in_cwnd_reduction(sk))
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 6b270e53c207..766e6bab9113 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -109,7 +109,7 @@
109#include <trace/events/udp.h> 109#include <trace/events/udp.h>
110#include <linux/static_key.h> 110#include <linux/static_key.h>
111#include <trace/events/skb.h> 111#include <trace/events/skb.h>
112#include <net/ll_poll.h> 112#include <net/busy_poll.h>
113#include "udp_impl.h" 113#include "udp_impl.h"
114 114
115struct udp_table udp_table __read_mostly; 115struct udp_table udp_table __read_mostly;
@@ -1713,7 +1713,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1713 if (sk != NULL) { 1713 if (sk != NULL) {
1714 int ret; 1714 int ret;
1715 1715
1716 sk_mark_ll(sk, skb); 1716 sk_mark_napi_id(sk, skb);
1717 ret = udp_queue_rcv_skb(sk, skb); 1717 ret = udp_queue_rcv_skb(sk, skb);
1718 sock_put(sk); 1718 sock_put(sk);
1719 1719
@@ -2323,6 +2323,9 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
2323 struct udphdr *uh; 2323 struct udphdr *uh;
2324 int udp_offset = outer_hlen - tnl_hlen; 2324 int udp_offset = outer_hlen - tnl_hlen;
2325 2325
2326 skb_reset_inner_headers(skb);
2327 skb->encapsulation = 1;
2328
2326 skb->mac_len = mac_len; 2329 skb->mac_len = mac_len;
2327 2330
2328 skb_push(skb, outer_hlen); 2331 skb_push(skb, outer_hlen);
@@ -2345,7 +2348,6 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
2345 uh->check = CSUM_MANGLED_0; 2348 uh->check = CSUM_MANGLED_0;
2346 2349
2347 } 2350 }
2348 skb->ip_summed = CHECKSUM_NONE;
2349 skb->protocol = protocol; 2351 skb->protocol = protocol;
2350 } while ((skb = skb->next)); 2352 } while ((skb = skb->next));
2351out: 2353out:
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 192dd1a0e188..5fc9c7a68d8d 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -632,6 +632,12 @@ insert_above:
632 return ln; 632 return ln;
633} 633}
634 634
635static inline bool rt6_qualify_for_ecmp(struct rt6_info *rt)
636{
637 return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
638 RTF_GATEWAY;
639}
640
635/* 641/*
636 * Insert routing information in a node. 642 * Insert routing information in a node.
637 */ 643 */
@@ -646,6 +652,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
646 int add = (!info->nlh || 652 int add = (!info->nlh ||
647 (info->nlh->nlmsg_flags & NLM_F_CREATE)); 653 (info->nlh->nlmsg_flags & NLM_F_CREATE));
648 int found = 0; 654 int found = 0;
655 bool rt_can_ecmp = rt6_qualify_for_ecmp(rt);
649 656
650 ins = &fn->leaf; 657 ins = &fn->leaf;
651 658
@@ -691,9 +698,8 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
691 * To avoid long list, we only had siblings if the 698 * To avoid long list, we only had siblings if the
692 * route have a gateway. 699 * route have a gateway.
693 */ 700 */
694 if (rt->rt6i_flags & RTF_GATEWAY && 701 if (rt_can_ecmp &&
695 !(rt->rt6i_flags & RTF_EXPIRES) && 702 rt6_qualify_for_ecmp(iter))
696 !(iter->rt6i_flags & RTF_EXPIRES))
697 rt->rt6i_nsiblings++; 703 rt->rt6i_nsiblings++;
698 } 704 }
699 705
@@ -715,7 +721,8 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
715 /* Find the first route that have the same metric */ 721 /* Find the first route that have the same metric */
716 sibling = fn->leaf; 722 sibling = fn->leaf;
717 while (sibling) { 723 while (sibling) {
718 if (sibling->rt6i_metric == rt->rt6i_metric) { 724 if (sibling->rt6i_metric == rt->rt6i_metric &&
725 rt6_qualify_for_ecmp(sibling)) {
719 list_add_tail(&rt->rt6i_siblings, 726 list_add_tail(&rt->rt6i_siblings,
720 &sibling->rt6i_siblings); 727 &sibling->rt6i_siblings);
721 break; 728 break;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index bd5fd7054031..a8c891aa2464 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -65,6 +65,12 @@
65#include <linux/sysctl.h> 65#include <linux/sysctl.h>
66#endif 66#endif
67 67
68enum rt6_nud_state {
69 RT6_NUD_FAIL_HARD = -2,
70 RT6_NUD_FAIL_SOFT = -1,
71 RT6_NUD_SUCCEED = 1
72};
73
68static struct rt6_info *ip6_rt_copy(struct rt6_info *ort, 74static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,
69 const struct in6_addr *dest); 75 const struct in6_addr *dest);
70static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie); 76static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie);
@@ -531,28 +537,29 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
531 return 0; 537 return 0;
532} 538}
533 539
534static inline bool rt6_check_neigh(struct rt6_info *rt) 540static inline enum rt6_nud_state rt6_check_neigh(struct rt6_info *rt)
535{ 541{
536 struct neighbour *neigh; 542 struct neighbour *neigh;
537 bool ret = false; 543 enum rt6_nud_state ret = RT6_NUD_FAIL_HARD;
538 544
539 if (rt->rt6i_flags & RTF_NONEXTHOP || 545 if (rt->rt6i_flags & RTF_NONEXTHOP ||
540 !(rt->rt6i_flags & RTF_GATEWAY)) 546 !(rt->rt6i_flags & RTF_GATEWAY))
541 return true; 547 return RT6_NUD_SUCCEED;
542 548
543 rcu_read_lock_bh(); 549 rcu_read_lock_bh();
544 neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway); 550 neigh = __ipv6_neigh_lookup_noref(rt->dst.dev, &rt->rt6i_gateway);
545 if (neigh) { 551 if (neigh) {
546 read_lock(&neigh->lock); 552 read_lock(&neigh->lock);
547 if (neigh->nud_state & NUD_VALID) 553 if (neigh->nud_state & NUD_VALID)
548 ret = true; 554 ret = RT6_NUD_SUCCEED;
549#ifdef CONFIG_IPV6_ROUTER_PREF 555#ifdef CONFIG_IPV6_ROUTER_PREF
550 else if (!(neigh->nud_state & NUD_FAILED)) 556 else if (!(neigh->nud_state & NUD_FAILED))
551 ret = true; 557 ret = RT6_NUD_SUCCEED;
552#endif 558#endif
553 read_unlock(&neigh->lock); 559 read_unlock(&neigh->lock);
554 } else if (IS_ENABLED(CONFIG_IPV6_ROUTER_PREF)) { 560 } else {
555 ret = true; 561 ret = IS_ENABLED(CONFIG_IPV6_ROUTER_PREF) ?
562 RT6_NUD_SUCCEED : RT6_NUD_FAIL_SOFT;
556 } 563 }
557 rcu_read_unlock_bh(); 564 rcu_read_unlock_bh();
558 565
@@ -566,43 +573,52 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
566 573
567 m = rt6_check_dev(rt, oif); 574 m = rt6_check_dev(rt, oif);
568 if (!m && (strict & RT6_LOOKUP_F_IFACE)) 575 if (!m && (strict & RT6_LOOKUP_F_IFACE))
569 return -1; 576 return RT6_NUD_FAIL_HARD;
570#ifdef CONFIG_IPV6_ROUTER_PREF 577#ifdef CONFIG_IPV6_ROUTER_PREF
571 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; 578 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
572#endif 579#endif
573 if (!rt6_check_neigh(rt) && (strict & RT6_LOOKUP_F_REACHABLE)) 580 if (strict & RT6_LOOKUP_F_REACHABLE) {
574 return -1; 581 int n = rt6_check_neigh(rt);
582 if (n < 0)
583 return n;
584 }
575 return m; 585 return m;
576} 586}
577 587
578static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict, 588static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
579 int *mpri, struct rt6_info *match) 589 int *mpri, struct rt6_info *match,
590 bool *do_rr)
580{ 591{
581 int m; 592 int m;
593 bool match_do_rr = false;
582 594
583 if (rt6_check_expired(rt)) 595 if (rt6_check_expired(rt))
584 goto out; 596 goto out;
585 597
586 m = rt6_score_route(rt, oif, strict); 598 m = rt6_score_route(rt, oif, strict);
587 if (m < 0) 599 if (m == RT6_NUD_FAIL_SOFT && !IS_ENABLED(CONFIG_IPV6_ROUTER_PREF)) {
600 match_do_rr = true;
601 m = 0; /* lowest valid score */
602 } else if (m < 0) {
588 goto out; 603 goto out;
604 }
605
606 if (strict & RT6_LOOKUP_F_REACHABLE)
607 rt6_probe(rt);
589 608
590 if (m > *mpri) { 609 if (m > *mpri) {
591 if (strict & RT6_LOOKUP_F_REACHABLE) 610 *do_rr = match_do_rr;
592 rt6_probe(match);
593 *mpri = m; 611 *mpri = m;
594 match = rt; 612 match = rt;
595 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
596 rt6_probe(rt);
597 } 613 }
598
599out: 614out:
600 return match; 615 return match;
601} 616}
602 617
603static struct rt6_info *find_rr_leaf(struct fib6_node *fn, 618static struct rt6_info *find_rr_leaf(struct fib6_node *fn,
604 struct rt6_info *rr_head, 619 struct rt6_info *rr_head,
605 u32 metric, int oif, int strict) 620 u32 metric, int oif, int strict,
621 bool *do_rr)
606{ 622{
607 struct rt6_info *rt, *match; 623 struct rt6_info *rt, *match;
608 int mpri = -1; 624 int mpri = -1;
@@ -610,10 +626,10 @@ static struct rt6_info *find_rr_leaf(struct fib6_node *fn,
610 match = NULL; 626 match = NULL;
611 for (rt = rr_head; rt && rt->rt6i_metric == metric; 627 for (rt = rr_head; rt && rt->rt6i_metric == metric;
612 rt = rt->dst.rt6_next) 628 rt = rt->dst.rt6_next)
613 match = find_match(rt, oif, strict, &mpri, match); 629 match = find_match(rt, oif, strict, &mpri, match, do_rr);
614 for (rt = fn->leaf; rt && rt != rr_head && rt->rt6i_metric == metric; 630 for (rt = fn->leaf; rt && rt != rr_head && rt->rt6i_metric == metric;
615 rt = rt->dst.rt6_next) 631 rt = rt->dst.rt6_next)
616 match = find_match(rt, oif, strict, &mpri, match); 632 match = find_match(rt, oif, strict, &mpri, match, do_rr);
617 633
618 return match; 634 return match;
619} 635}
@@ -622,15 +638,16 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
622{ 638{
623 struct rt6_info *match, *rt0; 639 struct rt6_info *match, *rt0;
624 struct net *net; 640 struct net *net;
641 bool do_rr = false;
625 642
626 rt0 = fn->rr_ptr; 643 rt0 = fn->rr_ptr;
627 if (!rt0) 644 if (!rt0)
628 fn->rr_ptr = rt0 = fn->leaf; 645 fn->rr_ptr = rt0 = fn->leaf;
629 646
630 match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict); 647 match = find_rr_leaf(fn, rt0, rt0->rt6i_metric, oif, strict,
648 &do_rr);
631 649
632 if (!match && 650 if (do_rr) {
633 (strict & RT6_LOOKUP_F_REACHABLE)) {
634 struct rt6_info *next = rt0->dst.rt6_next; 651 struct rt6_info *next = rt0->dst.rt6_next;
635 652
636 /* no entries matched; do round-robin */ 653 /* no entries matched; do round-robin */
@@ -1080,10 +1097,13 @@ static void ip6_link_failure(struct sk_buff *skb)
1080 1097
1081 rt = (struct rt6_info *) skb_dst(skb); 1098 rt = (struct rt6_info *) skb_dst(skb);
1082 if (rt) { 1099 if (rt) {
1083 if (rt->rt6i_flags & RTF_CACHE) 1100 if (rt->rt6i_flags & RTF_CACHE) {
1084 rt6_update_expires(rt, 0); 1101 dst_hold(&rt->dst);
1085 else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT)) 1102 if (ip6_del_rt(rt))
1103 dst_free(&rt->dst);
1104 } else if (rt->rt6i_node && (rt->rt6i_flags & RTF_DEFAULT)) {
1086 rt->rt6i_node->fn_sernum = -1; 1105 rt->rt6i_node->fn_sernum = -1;
1106 }
1087 } 1107 }
1088} 1108}
1089 1109
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5cffa5c3e6b8..6e1649d58533 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -63,7 +63,7 @@
63#include <net/inet_common.h> 63#include <net/inet_common.h>
64#include <net/secure_seq.h> 64#include <net/secure_seq.h>
65#include <net/tcp_memcontrol.h> 65#include <net/tcp_memcontrol.h>
66#include <net/ll_poll.h> 66#include <net/busy_poll.h>
67 67
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69 69
@@ -1499,7 +1499,7 @@ process:
1499 if (sk_filter(sk, skb)) 1499 if (sk_filter(sk, skb))
1500 goto discard_and_relse; 1500 goto discard_and_relse;
1501 1501
1502 sk_mark_ll(sk, skb); 1502 sk_mark_napi_id(sk, skb);
1503 skb->dev = NULL; 1503 skb->dev = NULL;
1504 1504
1505 bh_lock_sock_nested(sk); 1505 bh_lock_sock_nested(sk);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index b6f31437a1f8..f4058150262b 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -46,7 +46,7 @@
46#include <net/ip6_checksum.h> 46#include <net/ip6_checksum.h>
47#include <net/xfrm.h> 47#include <net/xfrm.h>
48#include <net/inet6_hashtables.h> 48#include <net/inet6_hashtables.h>
49#include <net/ll_poll.h> 49#include <net/busy_poll.h>
50 50
51#include <linux/proc_fs.h> 51#include <linux/proc_fs.h>
52#include <linux/seq_file.h> 52#include <linux/seq_file.h>
@@ -844,7 +844,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
844 if (sk != NULL) { 844 if (sk != NULL) {
845 int ret; 845 int ret;
846 846
847 sk_mark_ll(sk, skb); 847 sk_mark_napi_id(sk, skb);
848 ret = udpv6_queue_rcv_skb(sk, skb); 848 ret = udpv6_queue_rcv_skb(sk, skb);
849 sock_put(sk); 849 sock_put(sk);
850 850
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
index 7c195d972bf0..a7ab323849b6 100644
--- a/net/sched/sch_qfq.c
+++ b/net/sched/sch_qfq.c
@@ -821,7 +821,14 @@ static void qfq_make_eligible(struct qfq_sched *q)
821 unsigned long old_vslot = q->oldV >> q->min_slot_shift; 821 unsigned long old_vslot = q->oldV >> q->min_slot_shift;
822 822
823 if (vslot != old_vslot) { 823 if (vslot != old_vslot) {
824 unsigned long mask = (1ULL << fls(vslot ^ old_vslot)) - 1; 824 unsigned long mask;
825 int last_flip_pos = fls(vslot ^ old_vslot);
826
827 if (last_flip_pos > 31) /* higher than the number of groups */
828 mask = ~0UL; /* make all groups eligible */
829 else
830 mask = (1UL << last_flip_pos) - 1;
831
825 qfq_move_groups(q, mask, IR, ER); 832 qfq_move_groups(q, mask, IR, ER);
826 qfq_move_groups(q, mask, IB, EB); 833 qfq_move_groups(q, mask, IB, EB);
827 } 834 }
@@ -1003,9 +1010,61 @@ static inline void charge_actual_service(struct qfq_aggregate *agg)
1003 agg->F = agg->S + (u64)service_received * agg->inv_w; 1010 agg->F = agg->S + (u64)service_received * agg->inv_w;
1004} 1011}
1005 1012
1006static inline void qfq_update_agg_ts(struct qfq_sched *q, 1013/* Assign a reasonable start time for a new aggregate in group i.
1007 struct qfq_aggregate *agg, 1014 * Admissible values for \hat(F) are multiples of \sigma_i
1008 enum update_reason reason); 1015 * no greater than V+\sigma_i . Larger values mean that
1016 * we had a wraparound so we consider the timestamp to be stale.
1017 *
1018 * If F is not stale and F >= V then we set S = F.
1019 * Otherwise we should assign S = V, but this may violate
1020 * the ordering in EB (see [2]). So, if we have groups in ER,
1021 * set S to the F_j of the first group j which would be blocking us.
1022 * We are guaranteed not to move S backward because
1023 * otherwise our group i would still be blocked.
1024 */
1025static void qfq_update_start(struct qfq_sched *q, struct qfq_aggregate *agg)
1026{
1027 unsigned long mask;
1028 u64 limit, roundedF;
1029 int slot_shift = agg->grp->slot_shift;
1030
1031 roundedF = qfq_round_down(agg->F, slot_shift);
1032 limit = qfq_round_down(q->V, slot_shift) + (1ULL << slot_shift);
1033
1034 if (!qfq_gt(agg->F, q->V) || qfq_gt(roundedF, limit)) {
1035 /* timestamp was stale */
1036 mask = mask_from(q->bitmaps[ER], agg->grp->index);
1037 if (mask) {
1038 struct qfq_group *next = qfq_ffs(q, mask);
1039 if (qfq_gt(roundedF, next->F)) {
1040 if (qfq_gt(limit, next->F))
1041 agg->S = next->F;
1042 else /* preserve timestamp correctness */
1043 agg->S = limit;
1044 return;
1045 }
1046 }
1047 agg->S = q->V;
1048 } else /* timestamp is not stale */
1049 agg->S = agg->F;
1050}
1051
1052/* Update the timestamps of agg before scheduling/rescheduling it for
1053 * service. In particular, assign to agg->F its maximum possible
1054 * value, i.e., the virtual finish time with which the aggregate
1055 * should be labeled if it used all its budget once in service.
1056 */
1057static inline void
1058qfq_update_agg_ts(struct qfq_sched *q,
1059 struct qfq_aggregate *agg, enum update_reason reason)
1060{
1061 if (reason != requeue)
1062 qfq_update_start(q, agg);
1063 else /* just charge agg for the service received */
1064 agg->S = agg->F;
1065
1066 agg->F = agg->S + (u64)agg->budgetmax * agg->inv_w;
1067}
1009 1068
1010static void qfq_schedule_agg(struct qfq_sched *q, struct qfq_aggregate *agg); 1069static void qfq_schedule_agg(struct qfq_sched *q, struct qfq_aggregate *agg);
1011 1070
@@ -1128,66 +1187,6 @@ static struct qfq_aggregate *qfq_choose_next_agg(struct qfq_sched *q)
1128 return agg; 1187 return agg;
1129} 1188}
1130 1189
1131/*
1132 * Assign a reasonable start time for a new aggregate in group i.
1133 * Admissible values for \hat(F) are multiples of \sigma_i
1134 * no greater than V+\sigma_i . Larger values mean that
1135 * we had a wraparound so we consider the timestamp to be stale.
1136 *
1137 * If F is not stale and F >= V then we set S = F.
1138 * Otherwise we should assign S = V, but this may violate
1139 * the ordering in EB (see [2]). So, if we have groups in ER,
1140 * set S to the F_j of the first group j which would be blocking us.
1141 * We are guaranteed not to move S backward because
1142 * otherwise our group i would still be blocked.
1143 */
1144static void qfq_update_start(struct qfq_sched *q, struct qfq_aggregate *agg)
1145{
1146 unsigned long mask;
1147 u64 limit, roundedF;
1148 int slot_shift = agg->grp->slot_shift;
1149
1150 roundedF = qfq_round_down(agg->F, slot_shift);
1151 limit = qfq_round_down(q->V, slot_shift) + (1ULL << slot_shift);
1152
1153 if (!qfq_gt(agg->F, q->V) || qfq_gt(roundedF, limit)) {
1154 /* timestamp was stale */
1155 mask = mask_from(q->bitmaps[ER], agg->grp->index);
1156 if (mask) {
1157 struct qfq_group *next = qfq_ffs(q, mask);
1158 if (qfq_gt(roundedF, next->F)) {
1159 if (qfq_gt(limit, next->F))
1160 agg->S = next->F;
1161 else /* preserve timestamp correctness */
1162 agg->S = limit;
1163 return;
1164 }
1165 }
1166 agg->S = q->V;
1167 } else /* timestamp is not stale */
1168 agg->S = agg->F;
1169}
1170
1171/*
1172 * Update the timestamps of agg before scheduling/rescheduling it for
1173 * service. In particular, assign to agg->F its maximum possible
1174 * value, i.e., the virtual finish time with which the aggregate
1175 * should be labeled if it used all its budget once in service.
1176 */
1177static inline void
1178qfq_update_agg_ts(struct qfq_sched *q,
1179 struct qfq_aggregate *agg, enum update_reason reason)
1180{
1181 if (reason != requeue)
1182 qfq_update_start(q, agg);
1183 else /* just charge agg for the service received */
1184 agg->S = agg->F;
1185
1186 agg->F = agg->S + (u64)agg->budgetmax * agg->inv_w;
1187}
1188
1189static void qfq_schedule_agg(struct qfq_sched *, struct qfq_aggregate *);
1190
1191static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) 1190static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
1192{ 1191{
1193 struct qfq_sched *q = qdisc_priv(sch); 1192 struct qfq_sched *q = qdisc_priv(sch);
diff --git a/net/socket.c b/net/socket.c
index 45afa648364a..829b460acb87 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -104,11 +104,11 @@
104#include <linux/route.h> 104#include <linux/route.h>
105#include <linux/sockios.h> 105#include <linux/sockios.h>
106#include <linux/atalk.h> 106#include <linux/atalk.h>
107#include <net/ll_poll.h> 107#include <net/busy_poll.h>
108 108
109#ifdef CONFIG_NET_LL_RX_POLL 109#ifdef CONFIG_NET_LL_RX_POLL
110unsigned int sysctl_net_ll_read __read_mostly; 110unsigned int sysctl_net_busy_read __read_mostly;
111unsigned int sysctl_net_ll_poll __read_mostly; 111unsigned int sysctl_net_busy_poll __read_mostly;
112#endif 112#endif
113 113
114static int sock_no_open(struct inode *irrelevant, struct file *dontcare); 114static int sock_no_open(struct inode *irrelevant, struct file *dontcare);
diff --git a/net/tipc/ib_media.c b/net/tipc/ib_media.c
index ad2e1ec4117e..9934a32bfa87 100644
--- a/net/tipc/ib_media.c
+++ b/net/tipc/ib_media.c
@@ -292,13 +292,7 @@ static int ib_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size)
292 if (str_size < 60) /* 60 = 19 * strlen("xx:") + strlen("xx\0") */ 292 if (str_size < 60) /* 60 = 19 * strlen("xx:") + strlen("xx\0") */
293 return 1; 293 return 1;
294 294
295 sprintf(str_buf, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:" 295 sprintf(str_buf, "%20phC", a->value);
296 "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
297 a->value[0], a->value[1], a->value[2], a->value[3],
298 a->value[4], a->value[5], a->value[6], a->value[7],
299 a->value[8], a->value[9], a->value[10], a->value[11],
300 a->value[12], a->value[13], a->value[14], a->value[15],
301 a->value[16], a->value[17], a->value[18], a->value[19]);
302 296
303 return 0; 297 return 0;
304} 298}