aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-04 09:40:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-04 09:40:55 -0500
commitbe408cd3e1fef73e9408b196a79b9934697fe3b1 (patch)
tree8923594afd1e556360986cd2bc417f5fe0a72118
parent5e01dc7b26d9f24f39abace5da98ccbd6a5ceb52 (diff)
parentc32b7dfbb1dfb3f0a68f250deff65103c8bb704a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "I'm sending a pull request of these lingering bug fixes for networking before the normal merge window material because some of this stuff I'd like to get to -stable ASAP" 1) cxgb3 stopped working on 32-bit machines, fix from Ben Hutchings. 2) Structures passed via netlink for netfilter logging are not fully initialized. From Mathias Krause. 3) Properly unlink upper openvswitch device during notifications, from Alexei Starovoitov. 4) Fix race conditions involving access to the IP compression scratch buffer, from Michal Kubrecek. 5) We don't handle the expiration of MTU information contained in ipv6 routes sometimes, fix from Hannes Frederic Sowa. 6) With Fast Open we can miscompute the TCP SYN/ACK RTT, from Yuchung Cheng. 7) Don't take TCP RTT sample when an ACK doesn't acknowledge new data, also from Yuchung Cheng. 8) The decreased IPSEC garbage collection threshold causes problems for some people, bump it back up. From Steffen Klassert. 9) Fix skb->truesize calculated by tcp_tso_segment(), from Eric Dumazet. 10) flow_dissector doesn't validate packet lengths sufficiently, from Jason Wang * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (41 commits) net/mlx4_core: Fix call to __mlx4_unregister_mac net: sctp: do not trigger BUG_ON in sctp_cmd_delete_tcb net: flow_dissector: fail on evil iph->ihl xfrm: Fix null pointer dereference when decoding sessions can: kvaser_usb: fix usb endpoints detection can: c_can: Fix RX message handling, handle lost message before EOB doc:net: Fix typo in Documentation/networking bgmac: don't update slot on skb alloc/dma mapping error ibm emac: Fix locking for enable/disable eob irq ibm emac: Don't call napi_complete if napi_reschedule failed virtio-net: correctly handle cpu hotplug notifier during resuming bridge: pass correct vlan id to multicast code net: x25: Fix dead URLs in Kconfig netfilter: xt_NFQUEUE: fix --queue-bypass regression xen-netback: use jiffies_64 value to calculate credit timeout cxgb3: Fix length calculation in write_ofld_wr() on 32-bit architectures bnx2x: Disable VF access on PF removal bnx2x: prevent FW assert on low mem during unload tcp: gso: fix truesize tracking xfrm: Increase the garbage collector threshold ...
-rw-r--r--Documentation/networking/dccp.txt4
-rw-r--r--Documentation/networking/e100.txt2
-rw-r--r--Documentation/networking/ieee802154.txt4
-rw-r--r--Documentation/networking/l2tp.txt2
-rw-r--r--Documentation/networking/netdev-FAQ.txt24
-rw-r--r--Documentation/networking/netlink_mmap.txt6
-rw-r--r--Documentation/networking/operstates.txt4
-rw-r--r--Documentation/networking/rxrpc.txt2
-rw-r--r--Documentation/networking/stmmac.txt8
-rw-r--r--Documentation/networking/vortex.txt4
-rw-r--r--Documentation/networking/x25-iface.txt2
-rw-r--r--drivers/net/can/c_can/c_can.c6
-rw-r--r--drivers/net/can/usb/kvaser_usb.c20
-rw-r--r--drivers/net/ethernet/broadcom/bgmac.c20
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c10
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c16
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/sge.c3
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h9
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c6
-rw-r--r--drivers/net/ethernet/ibm/emac/mal.c16
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/cmd.c2
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c6
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c7
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c6
-rw-r--r--drivers/net/netconsole.c18
-rw-r--r--drivers/net/usb/ax88179_178a.c11
-rw-r--r--drivers/net/virtio_net.c13
-rw-r--r--drivers/net/wan/sbni.c89
-rw-r--r--drivers/net/xen-netback/common.h1
-rw-r--r--drivers/net/xen-netback/interface.c3
-rw-r--r--drivers/net/xen-netback/netback.c10
-rw-r--r--include/linux/netpoll.h5
-rw-r--r--include/net/ip6_fib.h1
-rw-r--r--net/bridge/br_device.c2
-rw-r--r--net/bridge/br_input.c2
-rw-r--r--net/bridge/br_multicast.c44
-rw-r--r--net/bridge/br_private.h6
-rw-r--r--net/bridge/netfilter/ebt_ulog.c9
-rw-r--r--net/core/flow_dissector.c2
-rw-r--r--net/core/netpoll.c31
-rw-r--r--net/ipv4/netfilter/arp_tables.c5
-rw-r--r--net/ipv4/netfilter/ip_tables.c5
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c7
-rw-r--r--net/ipv4/tcp_input.c34
-rw-r--r--net/ipv4/tcp_offload.c13
-rw-r--r--net/ipv4/xfrm4_policy.c8
-rw-r--r--net/ipv6/netfilter/ip6_tables.c5
-rw-r--r--net/ipv6/route.c9
-rw-r--r--net/ipv6/xfrm6_policy.c8
-rw-r--r--net/netfilter/x_tables.c7
-rw-r--r--net/netfilter/xt_NFQUEUE.c7
-rw-r--r--net/openvswitch/dp_notify.c7
-rw-r--r--net/openvswitch/vport-netdev.c16
-rw-r--r--net/openvswitch/vport-netdev.h1
-rw-r--r--net/sched/sch_fq.c1
-rw-r--r--net/sctp/ipv6.c4
-rw-r--r--net/sctp/sm_sideeffect.c1
-rw-r--r--net/x25/Kconfig4
-rw-r--r--net/xfrm/xfrm_ipcomp.c12
59 files changed, 303 insertions, 287 deletions
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt
index d718bc2ff1cf..bf5dbe3ab8c5 100644
--- a/Documentation/networking/dccp.txt
+++ b/Documentation/networking/dccp.txt
@@ -18,8 +18,8 @@ Introduction
18Datagram Congestion Control Protocol (DCCP) is an unreliable, connection 18Datagram Congestion Control Protocol (DCCP) is an unreliable, connection
19oriented protocol designed to solve issues present in UDP and TCP, particularly 19oriented protocol designed to solve issues present in UDP and TCP, particularly
20for real-time and multimedia (streaming) traffic. 20for real-time and multimedia (streaming) traffic.
21It divides into a base protocol (RFC 4340) and plugable congestion control 21It divides into a base protocol (RFC 4340) and pluggable congestion control
22modules called CCIDs. Like plugable TCP congestion control, at least one CCID 22modules called CCIDs. Like pluggable TCP congestion control, at least one CCID
23needs to be enabled in order for the protocol to function properly. In the Linux 23needs to be enabled in order for the protocol to function properly. In the Linux
24implementation, this is the TCP-like CCID2 (RFC 4341). Additional CCIDs, such as 24implementation, this is the TCP-like CCID2 (RFC 4341). Additional CCIDs, such as
25the TCP-friendly CCID3 (RFC 4342), are optional. 25the TCP-friendly CCID3 (RFC 4342), are optional.
diff --git a/Documentation/networking/e100.txt b/Documentation/networking/e100.txt
index 13a32124bca0..f862cf3aff34 100644
--- a/Documentation/networking/e100.txt
+++ b/Documentation/networking/e100.txt
@@ -103,7 +103,7 @@ Additional Configurations
103 PRO/100 Family of Adapters is e100. 103 PRO/100 Family of Adapters is e100.
104 104
105 As an example, if you install the e100 driver for two PRO/100 adapters 105 As an example, if you install the e100 driver for two PRO/100 adapters
106 (eth0 and eth1), add the following to a configuraton file in /etc/modprobe.d/ 106 (eth0 and eth1), add the following to a configuration file in /etc/modprobe.d/
107 107
108 alias eth0 e100 108 alias eth0 e100
109 alias eth1 e100 109 alias eth1 e100
diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt
index 09eb57329f11..22bbc7225f8e 100644
--- a/Documentation/networking/ieee802154.txt
+++ b/Documentation/networking/ieee802154.txt
@@ -4,7 +4,7 @@
4 4
5Introduction 5Introduction
6============ 6============
7The IEEE 802.15.4 working group focuses on standartization of bottom 7The IEEE 802.15.4 working group focuses on standardization of bottom
8two layers: Medium Access Control (MAC) and Physical (PHY). And there 8two layers: Medium Access Control (MAC) and Physical (PHY). And there
9are mainly two options available for upper layers: 9are mainly two options available for upper layers:
10 - ZigBee - proprietary protocol from ZigBee Alliance 10 - ZigBee - proprietary protocol from ZigBee Alliance
@@ -66,7 +66,7 @@ net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
66code via plain sk_buffs. On skb reception skb->cb must contain additional 66code via plain sk_buffs. On skb reception skb->cb must contain additional
67info as described in the struct ieee802154_mac_cb. During packet transmission 67info as described in the struct ieee802154_mac_cb. During packet transmission
68the skb->cb is used to provide additional data to device's header_ops->create 68the skb->cb is used to provide additional data to device's header_ops->create
69function. Be aware, that this data can be overriden later (when socket code 69function. Be aware that this data can be overridden later (when socket code
70submits skb to qdisc), so if you need something from that cb later, you should 70submits skb to qdisc), so if you need something from that cb later, you should
71store info in the skb->data on your own. 71store info in the skb->data on your own.
72 72
diff --git a/Documentation/networking/l2tp.txt b/Documentation/networking/l2tp.txt
index e63fc1f7bf87..c74434de2fa5 100644
--- a/Documentation/networking/l2tp.txt
+++ b/Documentation/networking/l2tp.txt
@@ -197,7 +197,7 @@ state information because the file format is subject to change. It is
197implemented to provide extra debug information to help diagnose 197implemented to provide extra debug information to help diagnose
198problems.) Users should use the netlink API. 198problems.) Users should use the netlink API.
199 199
200/proc/net/pppol2tp is also provided for backwards compaibility with 200/proc/net/pppol2tp is also provided for backwards compatibility with
201the original pppol2tp driver. It lists information about L2TPv2 201the original pppol2tp driver. It lists information about L2TPv2
202tunnels and sessions only. Its use is discouraged. 202tunnels and sessions only. Its use is discouraged.
203 203
diff --git a/Documentation/networking/netdev-FAQ.txt b/Documentation/networking/netdev-FAQ.txt
index d9112f01c44a..0fe1c6e0dbcd 100644
--- a/Documentation/networking/netdev-FAQ.txt
+++ b/Documentation/networking/netdev-FAQ.txt
@@ -4,23 +4,23 @@ Information you need to know about netdev
4 4
5Q: What is netdev? 5Q: What is netdev?
6 6
7A: It is a mailing list for all network related linux stuff. This includes 7A: It is a mailing list for all network-related Linux stuff. This includes
8 anything found under net/ (i.e. core code like IPv6) and drivers/net 8 anything found under net/ (i.e. core code like IPv6) and drivers/net
9 (i.e. hardware specific drivers) in the linux source tree. 9 (i.e. hardware specific drivers) in the Linux source tree.
10 10
11 Note that some subsystems (e.g. wireless drivers) which have a high volume 11 Note that some subsystems (e.g. wireless drivers) which have a high volume
12 of traffic have their own specific mailing lists. 12 of traffic have their own specific mailing lists.
13 13
14 The netdev list is managed (like many other linux mailing lists) through 14 The netdev list is managed (like many other Linux mailing lists) through
15 VGER ( http://vger.kernel.org/ ) and archives can be found below: 15 VGER ( http://vger.kernel.org/ ) and archives can be found below:
16 16
17 http://marc.info/?l=linux-netdev 17 http://marc.info/?l=linux-netdev
18 http://www.spinics.net/lists/netdev/ 18 http://www.spinics.net/lists/netdev/
19 19
20 Aside from subsystems like that mentioned above, all network related linux 20 Aside from subsystems like that mentioned above, all network-related Linux
21 development (i.e. RFC, review, comments, etc) takes place on netdev. 21 development (i.e. RFC, review, comments, etc.) takes place on netdev.
22 22
23Q: How do the changes posted to netdev make their way into linux? 23Q: How do the changes posted to netdev make their way into Linux?
24 24
25A: There are always two trees (git repositories) in play. Both are driven 25A: There are always two trees (git repositories) in play. Both are driven
26 by David Miller, the main network maintainer. There is the "net" tree, 26 by David Miller, the main network maintainer. There is the "net" tree,
@@ -35,7 +35,7 @@ A: There are always two trees (git repositories) in play. Both are driven
35Q: How often do changes from these trees make it to the mainline Linus tree? 35Q: How often do changes from these trees make it to the mainline Linus tree?
36 36
37A: To understand this, you need to know a bit of background information 37A: To understand this, you need to know a bit of background information
38 on the cadence of linux development. Each new release starts off with 38 on the cadence of Linux development. Each new release starts off with
39 a two week "merge window" where the main maintainers feed their new 39 a two week "merge window" where the main maintainers feed their new
40 stuff to Linus for merging into the mainline tree. After the two weeks, 40 stuff to Linus for merging into the mainline tree. After the two weeks,
41 the merge window is closed, and it is called/tagged "-rc1". No new 41 the merge window is closed, and it is called/tagged "-rc1". No new
@@ -46,7 +46,7 @@ A: To understand this, you need to know a bit of background information
46 things are in a state of churn), and a week after the last vX.Y-rcN 46 things are in a state of churn), and a week after the last vX.Y-rcN
47 was done, the official "vX.Y" is released. 47 was done, the official "vX.Y" is released.
48 48
49 Relating that to netdev: At the beginning of the 2 week merge window, 49 Relating that to netdev: At the beginning of the 2-week merge window,
50 the net-next tree will be closed - no new changes/features. The 50 the net-next tree will be closed - no new changes/features. The
51 accumulated new content of the past ~10 weeks will be passed onto 51 accumulated new content of the past ~10 weeks will be passed onto
52 mainline/Linus via a pull request for vX.Y -- at the same time, 52 mainline/Linus via a pull request for vX.Y -- at the same time,
@@ -59,16 +59,16 @@ A: To understand this, you need to know a bit of background information
59 IMPORTANT: Do not send new net-next content to netdev during the 59 IMPORTANT: Do not send new net-next content to netdev during the
60 period during which net-next tree is closed. 60 period during which net-next tree is closed.
61 61
62 Shortly after the two weeks have passed, (and vX.Y-rc1 is released) the 62 Shortly after the two weeks have passed (and vX.Y-rc1 is released), the
63 tree for net-next reopens to collect content for the next (vX.Y+1) release. 63 tree for net-next reopens to collect content for the next (vX.Y+1) release.
64 64
65 If you aren't subscribed to netdev and/or are simply unsure if net-next 65 If you aren't subscribed to netdev and/or are simply unsure if net-next
66 has re-opened yet, simply check the net-next git repository link above for 66 has re-opened yet, simply check the net-next git repository link above for
67 any new networking related commits. 67 any new networking-related commits.
68 68
69 The "net" tree continues to collect fixes for the vX.Y content, and 69 The "net" tree continues to collect fixes for the vX.Y content, and
70 is fed back to Linus at regular (~weekly) intervals. Meaning that the 70 is fed back to Linus at regular (~weekly) intervals. Meaning that the
71 focus for "net" is on stablilization and bugfixes. 71 focus for "net" is on stabilization and bugfixes.
72 72
73 Finally, the vX.Y gets released, and the whole cycle starts over. 73 Finally, the vX.Y gets released, and the whole cycle starts over.
74 74
@@ -217,7 +217,7 @@ A: Attention to detail. Re-read your own work as if you were the
217 to why it happens, and then if necessary, explain why the fix proposed 217 to why it happens, and then if necessary, explain why the fix proposed
218 is the best way to get things done. Don't mangle whitespace, and as 218 is the best way to get things done. Don't mangle whitespace, and as
219 is common, don't mis-indent function arguments that span multiple lines. 219 is common, don't mis-indent function arguments that span multiple lines.
220 If it is your 1st patch, mail it to yourself so you can test apply 220 If it is your first patch, mail it to yourself so you can test apply
221 it to an unpatched tree to confirm infrastructure didn't mangle it. 221 it to an unpatched tree to confirm infrastructure didn't mangle it.
222 222
223 Finally, go back and read Documentation/SubmittingPatches to be 223 Finally, go back and read Documentation/SubmittingPatches to be
diff --git a/Documentation/networking/netlink_mmap.txt b/Documentation/networking/netlink_mmap.txt
index 533378839546..b26122973525 100644
--- a/Documentation/networking/netlink_mmap.txt
+++ b/Documentation/networking/netlink_mmap.txt
@@ -45,7 +45,7 @@ processing.
45 45
46Conversion of the reception path involves calling poll() on the file 46Conversion of the reception path involves calling poll() on the file
47descriptor, once the socket is readable the frames from the ring are 47descriptor, once the socket is readable the frames from the ring are
48processsed in order until no more messages are available, as indicated by 48processed in order until no more messages are available, as indicated by
49a status word in the frame header. 49a status word in the frame header.
50 50
51On kernel side, in order to make use of memory mapped I/O on receive, the 51On kernel side, in order to make use of memory mapped I/O on receive, the
@@ -56,7 +56,7 @@ Dumps of kernel databases automatically support memory mapped I/O.
56 56
57Conversion of the transmit path involves changing message construction to 57Conversion of the transmit path involves changing message construction to
58use memory from the TX ring instead of (usually) a buffer declared on the 58use memory from the TX ring instead of (usually) a buffer declared on the
59stack and setting up the frame header approriately. Optionally poll() can 59stack and setting up the frame header appropriately. Optionally poll() can
60be used to wait for free frames in the TX ring. 60be used to wait for free frames in the TX ring.
61 61
62Structured and definitions for using memory mapped I/O are contained in 62Structured and definitions for using memory mapped I/O are contained in
@@ -231,7 +231,7 @@ Ring setup:
231 if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0) 231 if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0)
232 exit(1) 232 exit(1)
233 233
234 /* Calculate size of each invididual ring */ 234 /* Calculate size of each individual ring */
235 ring_size = req.nm_block_nr * req.nm_block_size; 235 ring_size = req.nm_block_nr * req.nm_block_size;
236 236
237 /* Map RX/TX rings. The TX ring is located after the RX ring */ 237 /* Map RX/TX rings. The TX ring is located after the RX ring */
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt
index 97694572338b..355c6d8ef8ad 100644
--- a/Documentation/networking/operstates.txt
+++ b/Documentation/networking/operstates.txt
@@ -89,8 +89,8 @@ packets. The name 'carrier' and the inversion are historical, think of
89it as lower layer. 89it as lower layer.
90 90
91Note that for certain kind of soft-devices, which are not managing any 91Note that for certain kind of soft-devices, which are not managing any
92real hardware, there is possible to set this bit from userpsace. 92real hardware, it is possible to set this bit from userspace. One
93One should use TVL IFLA_CARRIER to do so. 93should use TVL IFLA_CARRIER to do so.
94 94
95netif_carrier_ok() can be used to query that bit. 95netif_carrier_ok() can be used to query that bit.
96 96
diff --git a/Documentation/networking/rxrpc.txt b/Documentation/networking/rxrpc.txt
index 60d05eb77c64..b89bc82eed46 100644
--- a/Documentation/networking/rxrpc.txt
+++ b/Documentation/networking/rxrpc.txt
@@ -144,7 +144,7 @@ An overview of the RxRPC protocol:
144 (*) Calls use ACK packets to handle reliability. Data packets are also 144 (*) Calls use ACK packets to handle reliability. Data packets are also
145 explicitly sequenced per call. 145 explicitly sequenced per call.
146 146
147 (*) There are two types of positive acknowledgement: hard-ACKs and soft-ACKs. 147 (*) There are two types of positive acknowledgment: hard-ACKs and soft-ACKs.
148 A hard-ACK indicates to the far side that all the data received to a point 148 A hard-ACK indicates to the far side that all the data received to a point
149 has been received and processed; a soft-ACK indicates that the data has 149 has been received and processed; a soft-ACK indicates that the data has
150 been received but may yet be discarded and re-requested. The sender may 150 been received but may yet be discarded and re-requested. The sender may
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index 457b8bbafb08..cdd916da838d 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -160,7 +160,7 @@ Where:
160 o pmt: core has the embedded power module (optional). 160 o pmt: core has the embedded power module (optional).
161 o force_sf_dma_mode: force DMA to use the Store and Forward mode 161 o force_sf_dma_mode: force DMA to use the Store and Forward mode
162 instead of the Threshold. 162 instead of the Threshold.
163 o force_thresh_dma_mode: force DMA to use the Shreshold mode other than 163 o force_thresh_dma_mode: force DMA to use the Threshold mode other than
164 the Store and Forward mode. 164 the Store and Forward mode.
165 o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode. 165 o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode.
166 o fix_mac_speed: this callback is used for modifying some syscfg registers 166 o fix_mac_speed: this callback is used for modifying some syscfg registers
@@ -175,7 +175,7 @@ Where:
175 registers. 175 registers.
176 o custom_cfg/custom_data: this is a custom configuration that can be passed 176 o custom_cfg/custom_data: this is a custom configuration that can be passed
177 while initializing the resources. 177 while initializing the resources.
178 o bsp_priv: another private poiter. 178 o bsp_priv: another private pointer.
179 179
180For MDIO bus The we have: 180For MDIO bus The we have:
181 181
@@ -271,7 +271,7 @@ reset procedure etc).
271 o dwmac1000_dma.c: dma functions for the GMAC chip; 271 o dwmac1000_dma.c: dma functions for the GMAC chip;
272 o dwmac1000.h: specific header file for the GMAC; 272 o dwmac1000.h: specific header file for the GMAC;
273 o dwmac100_core: MAC 100 core and dma code; 273 o dwmac100_core: MAC 100 core and dma code;
274 o dwmac100_dma.c: dma funtions for the MAC chip; 274 o dwmac100_dma.c: dma functions for the MAC chip;
275 o dwmac1000.h: specific header file for the MAC; 275 o dwmac1000.h: specific header file for the MAC;
276 o dwmac_lib.c: generic DMA functions shared among chips; 276 o dwmac_lib.c: generic DMA functions shared among chips;
277 o enh_desc.c: functions for handling enhanced descriptors; 277 o enh_desc.c: functions for handling enhanced descriptors;
@@ -364,4 +364,4 @@ Auto-negotiated Link Parter Ability.
36410) TODO: 36410) TODO:
365 o XGMAC is not supported. 365 o XGMAC is not supported.
366 o Complete the TBI & RTBI support. 366 o Complete the TBI & RTBI support.
367 o extened VLAN support for 3.70a SYNP GMAC. 367 o extend VLAN support for 3.70a SYNP GMAC.
diff --git a/Documentation/networking/vortex.txt b/Documentation/networking/vortex.txt
index 9a8041dcbb53..97282da82b75 100644
--- a/Documentation/networking/vortex.txt
+++ b/Documentation/networking/vortex.txt
@@ -68,7 +68,7 @@ Module parameters
68 68
69There are several parameters which may be provided to the driver when 69There are several parameters which may be provided to the driver when
70its module is loaded. These are usually placed in /etc/modprobe.d/*.conf 70its module is loaded. These are usually placed in /etc/modprobe.d/*.conf
71configuretion files. Example: 71configuration files. Example:
72 72
73options 3c59x debug=3 rx_copybreak=300 73options 3c59x debug=3 rx_copybreak=300
74 74
@@ -178,7 +178,7 @@ max_interrupt_work=N
178 178
179 The driver's interrupt service routine can handle many receive and 179 The driver's interrupt service routine can handle many receive and
180 transmit packets in a single invocation. It does this in a loop. 180 transmit packets in a single invocation. It does this in a loop.
181 The value of max_interrupt_work governs how mnay times the interrupt 181 The value of max_interrupt_work governs how many times the interrupt
182 service routine will loop. The default value is 32 loops. If this 182 service routine will loop. The default value is 32 loops. If this
183 is exceeded the interrupt service routine gives up and generates a 183 is exceeded the interrupt service routine gives up and generates a
184 warning message "eth0: Too much work in interrupt". 184 warning message "eth0: Too much work in interrupt".
diff --git a/Documentation/networking/x25-iface.txt b/Documentation/networking/x25-iface.txt
index 78f662ee0622..7f213b556e85 100644
--- a/Documentation/networking/x25-iface.txt
+++ b/Documentation/networking/x25-iface.txt
@@ -105,7 +105,7 @@ reduced by the following measures or a combination thereof:
105 later. 105 later.
106 The lapb module interface was modified to support this. Its 106 The lapb module interface was modified to support this. Its
107 data_indication() method should now transparently pass the 107 data_indication() method should now transparently pass the
108 netif_rx() return value to the (lapb mopdule) caller. 108 netif_rx() return value to the (lapb module) caller.
109(2) Drivers for kernel versions 2.2.x should always check the global 109(2) Drivers for kernel versions 2.2.x should always check the global
110 variable netdev_dropping when a new frame is received. The driver 110 variable netdev_dropping when a new frame is received. The driver
111 should only call netif_rx() if netdev_dropping is zero. Otherwise 111 should only call netif_rx() if netdev_dropping is zero. Otherwise
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index a668cd491cb3..e3fc07cf2f62 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -814,9 +814,6 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
814 msg_ctrl_save = priv->read_reg(priv, 814 msg_ctrl_save = priv->read_reg(priv,
815 C_CAN_IFACE(MSGCTRL_REG, 0)); 815 C_CAN_IFACE(MSGCTRL_REG, 0));
816 816
817 if (msg_ctrl_save & IF_MCONT_EOB)
818 return num_rx_pkts;
819
820 if (msg_ctrl_save & IF_MCONT_MSGLST) { 817 if (msg_ctrl_save & IF_MCONT_MSGLST) {
821 c_can_handle_lost_msg_obj(dev, 0, msg_obj); 818 c_can_handle_lost_msg_obj(dev, 0, msg_obj);
822 num_rx_pkts++; 819 num_rx_pkts++;
@@ -824,6 +821,9 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
824 continue; 821 continue;
825 } 822 }
826 823
824 if (msg_ctrl_save & IF_MCONT_EOB)
825 return num_rx_pkts;
826
827 if (!(msg_ctrl_save & IF_MCONT_NEWDAT)) 827 if (!(msg_ctrl_save & IF_MCONT_NEWDAT))
828 continue; 828 continue;
829 829
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c
index 3b9546588240..4b2d5ed62b11 100644
--- a/drivers/net/can/usb/kvaser_usb.c
+++ b/drivers/net/can/usb/kvaser_usb.c
@@ -1544,9 +1544,9 @@ static int kvaser_usb_init_one(struct usb_interface *intf,
1544 return 0; 1544 return 0;
1545} 1545}
1546 1546
1547static void kvaser_usb_get_endpoints(const struct usb_interface *intf, 1547static int kvaser_usb_get_endpoints(const struct usb_interface *intf,
1548 struct usb_endpoint_descriptor **in, 1548 struct usb_endpoint_descriptor **in,
1549 struct usb_endpoint_descriptor **out) 1549 struct usb_endpoint_descriptor **out)
1550{ 1550{
1551 const struct usb_host_interface *iface_desc; 1551 const struct usb_host_interface *iface_desc;
1552 struct usb_endpoint_descriptor *endpoint; 1552 struct usb_endpoint_descriptor *endpoint;
@@ -1557,12 +1557,18 @@ static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
1557 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { 1557 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
1558 endpoint = &iface_desc->endpoint[i].desc; 1558 endpoint = &iface_desc->endpoint[i].desc;
1559 1559
1560 if (usb_endpoint_is_bulk_in(endpoint)) 1560 if (!*in && usb_endpoint_is_bulk_in(endpoint))
1561 *in = endpoint; 1561 *in = endpoint;
1562 1562
1563 if (usb_endpoint_is_bulk_out(endpoint)) 1563 if (!*out && usb_endpoint_is_bulk_out(endpoint))
1564 *out = endpoint; 1564 *out = endpoint;
1565
1566 /* use first bulk endpoint for in and out */
1567 if (*in && *out)
1568 return 0;
1565 } 1569 }
1570
1571 return -ENODEV;
1566} 1572}
1567 1573
1568static int kvaser_usb_probe(struct usb_interface *intf, 1574static int kvaser_usb_probe(struct usb_interface *intf,
@@ -1576,8 +1582,8 @@ static int kvaser_usb_probe(struct usb_interface *intf,
1576 if (!dev) 1582 if (!dev)
1577 return -ENOMEM; 1583 return -ENOMEM;
1578 1584
1579 kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out); 1585 err = kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
1580 if (!dev->bulk_in || !dev->bulk_out) { 1586 if (err) {
1581 dev_err(&intf->dev, "Cannot get usb endpoint(s)"); 1587 dev_err(&intf->dev, "Cannot get usb endpoint(s)");
1582 return err; 1588 return err;
1583 } 1589 }
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 249468f95365..9e8a3e024e01 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -244,25 +244,33 @@ static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac,
244 struct bgmac_slot_info *slot) 244 struct bgmac_slot_info *slot)
245{ 245{
246 struct device *dma_dev = bgmac->core->dma_dev; 246 struct device *dma_dev = bgmac->core->dma_dev;
247 struct sk_buff *skb;
248 dma_addr_t dma_addr;
247 struct bgmac_rx_header *rx; 249 struct bgmac_rx_header *rx;
248 250
249 /* Alloc skb */ 251 /* Alloc skb */
250 slot->skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE); 252 skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE);
251 if (!slot->skb) 253 if (!skb)
252 return -ENOMEM; 254 return -ENOMEM;
253 255
254 /* Poison - if everything goes fine, hardware will overwrite it */ 256 /* Poison - if everything goes fine, hardware will overwrite it */
255 rx = (struct bgmac_rx_header *)slot->skb->data; 257 rx = (struct bgmac_rx_header *)skb->data;
256 rx->len = cpu_to_le16(0xdead); 258 rx->len = cpu_to_le16(0xdead);
257 rx->flags = cpu_to_le16(0xbeef); 259 rx->flags = cpu_to_le16(0xbeef);
258 260
259 /* Map skb for the DMA */ 261 /* Map skb for the DMA */
260 slot->dma_addr = dma_map_single(dma_dev, slot->skb->data, 262 dma_addr = dma_map_single(dma_dev, skb->data,
261 BGMAC_RX_BUF_SIZE, DMA_FROM_DEVICE); 263 BGMAC_RX_BUF_SIZE, DMA_FROM_DEVICE);
262 if (dma_mapping_error(dma_dev, slot->dma_addr)) { 264 if (dma_mapping_error(dma_dev, dma_addr)) {
263 bgmac_err(bgmac, "DMA mapping error\n"); 265 bgmac_err(bgmac, "DMA mapping error\n");
266 dev_kfree_skb(skb);
264 return -ENOMEM; 267 return -ENOMEM;
265 } 268 }
269
270 /* Update the slot */
271 slot->skb = skb;
272 slot->dma_addr = dma_addr;
273
266 if (slot->dma_addr & 0xC0000000) 274 if (slot->dma_addr & 0xC0000000)
267 bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); 275 bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
268 276
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 4ab4c89c60cd..74d6486fccfd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2545,10 +2545,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
2545 } 2545 }
2546 } 2546 }
2547 2547
2548 /* Allocated memory for FW statistics */
2549 if (bnx2x_alloc_fw_stats_mem(bp))
2550 LOAD_ERROR_EXIT(bp, load_error0);
2551
2552 /* need to be done after alloc mem, since it's self adjusting to amount 2548 /* need to be done after alloc mem, since it's self adjusting to amount
2553 * of memory available for RSS queues 2549 * of memory available for RSS queues
2554 */ 2550 */
@@ -2558,6 +2554,10 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
2558 LOAD_ERROR_EXIT(bp, load_error0); 2554 LOAD_ERROR_EXIT(bp, load_error0);
2559 } 2555 }
2560 2556
2557 /* Allocated memory for FW statistics */
2558 if (bnx2x_alloc_fw_stats_mem(bp))
2559 LOAD_ERROR_EXIT(bp, load_error0);
2560
2561 /* request pf to initialize status blocks */ 2561 /* request pf to initialize status blocks */
2562 if (IS_VF(bp)) { 2562 if (IS_VF(bp)) {
2563 rc = bnx2x_vfpf_init(bp); 2563 rc = bnx2x_vfpf_init(bp);
@@ -2812,8 +2812,8 @@ load_error1:
2812 if (IS_PF(bp)) 2812 if (IS_PF(bp))
2813 bnx2x_clear_pf_load(bp); 2813 bnx2x_clear_pf_load(bp);
2814load_error0: 2814load_error0:
2815 bnx2x_free_fp_mem(bp);
2816 bnx2x_free_fw_stats_mem(bp); 2815 bnx2x_free_fw_stats_mem(bp);
2816 bnx2x_free_fp_mem(bp);
2817 bnx2x_free_mem(bp); 2817 bnx2x_free_mem(bp);
2818 2818
2819 return rc; 2819 return rc;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index bf08ad68b405..5e07efb6ec13 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2018,6 +2018,8 @@ failed:
2018 2018
2019void bnx2x_iov_remove_one(struct bnx2x *bp) 2019void bnx2x_iov_remove_one(struct bnx2x *bp)
2020{ 2020{
2021 int vf_idx;
2022
2021 /* if SRIOV is not enabled there's nothing to do */ 2023 /* if SRIOV is not enabled there's nothing to do */
2022 if (!IS_SRIOV(bp)) 2024 if (!IS_SRIOV(bp))
2023 return; 2025 return;
@@ -2026,6 +2028,18 @@ void bnx2x_iov_remove_one(struct bnx2x *bp)
2026 pci_disable_sriov(bp->pdev); 2028 pci_disable_sriov(bp->pdev);
2027 DP(BNX2X_MSG_IOV, "sriov disabled\n"); 2029 DP(BNX2X_MSG_IOV, "sriov disabled\n");
2028 2030
2031 /* disable access to all VFs */
2032 for (vf_idx = 0; vf_idx < bp->vfdb->sriov.total; vf_idx++) {
2033 bnx2x_pretend_func(bp,
2034 HW_VF_HANDLE(bp,
2035 bp->vfdb->sriov.first_vf_in_pf +
2036 vf_idx));
2037 DP(BNX2X_MSG_IOV, "disabling internal access for vf %d\n",
2038 bp->vfdb->sriov.first_vf_in_pf + vf_idx);
2039 bnx2x_vf_enable_internal(bp, 0);
2040 bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
2041 }
2042
2029 /* free vf database */ 2043 /* free vf database */
2030 __bnx2x_iov_free_vfdb(bp); 2044 __bnx2x_iov_free_vfdb(bp);
2031} 2045}
@@ -3197,7 +3211,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp)
3197 * the "acquire" messages to appear on the VF PF channel. 3211 * the "acquire" messages to appear on the VF PF channel.
3198 */ 3212 */
3199 DP(BNX2X_MSG_IOV, "about to call enable sriov\n"); 3213 DP(BNX2X_MSG_IOV, "about to call enable sriov\n");
3200 pci_disable_sriov(bp->pdev); 3214 bnx2x_disable_sriov(bp);
3201 rc = pci_enable_sriov(bp->pdev, req_vfs); 3215 rc = pci_enable_sriov(bp->pdev, req_vfs);
3202 if (rc) { 3216 if (rc) {
3203 BNX2X_ERR("pci_enable_sriov failed with %d\n", rc); 3217 BNX2X_ERR("pci_enable_sriov failed with %d\n", rc);
diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
index 9c89dc8fe105..632b318eb38a 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
@@ -1599,7 +1599,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb,
1599 flits = skb_transport_offset(skb) / 8; 1599 flits = skb_transport_offset(skb) / 8;
1600 sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; 1600 sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl;
1601 sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), 1601 sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb),
1602 skb->tail - skb->transport_header, 1602 skb_tail_pointer(skb) -
1603 skb_transport_header(skb),
1603 adap->pdev); 1604 adap->pdev);
1604 if (need_skb_unmap()) { 1605 if (need_skb_unmap()) {
1605 setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); 1606 setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits);
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index db020230bd0b..c99dac6a9ddf 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -696,6 +696,15 @@ static inline int qnq_async_evt_rcvd(struct be_adapter *adapter)
696 return adapter->flags & BE_FLAGS_QNQ_ASYNC_EVT_RCVD; 696 return adapter->flags & BE_FLAGS_QNQ_ASYNC_EVT_RCVD;
697} 697}
698 698
699static inline int fw_major_num(const char *fw_ver)
700{
701 int fw_major = 0;
702
703 sscanf(fw_ver, "%d.", &fw_major);
704
705 return fw_major;
706}
707
699extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, 708extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm,
700 u16 num_popped); 709 u16 num_popped);
701extern void be_link_status_update(struct be_adapter *adapter, u8 link_status); 710extern void be_link_status_update(struct be_adapter *adapter, u8 link_status);
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 2c38cc402119..53ed58b492c8 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3247,6 +3247,12 @@ static int be_setup(struct be_adapter *adapter)
3247 3247
3248 be_cmd_get_fw_ver(adapter, adapter->fw_ver, adapter->fw_on_flash); 3248 be_cmd_get_fw_ver(adapter, adapter->fw_ver, adapter->fw_on_flash);
3249 3249
3250 if (BE2_chip(adapter) && fw_major_num(adapter->fw_ver) < 4) {
3251 dev_err(dev, "Firmware on card is old(%s), IRQs may not work.",
3252 adapter->fw_ver);
3253 dev_err(dev, "Please upgrade firmware to version >= 4.0\n");
3254 }
3255
3250 if (adapter->vlans_added) 3256 if (adapter->vlans_added)
3251 be_vid_config(adapter); 3257 be_vid_config(adapter);
3252 3258
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index dac564c25440..e7847510eda2 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -263,7 +263,9 @@ static inline void mal_schedule_poll(struct mal_instance *mal)
263{ 263{
264 if (likely(napi_schedule_prep(&mal->napi))) { 264 if (likely(napi_schedule_prep(&mal->napi))) {
265 MAL_DBG2(mal, "schedule_poll" NL); 265 MAL_DBG2(mal, "schedule_poll" NL);
266 spin_lock(&mal->lock);
266 mal_disable_eob_irq(mal); 267 mal_disable_eob_irq(mal);
268 spin_unlock(&mal->lock);
267 __napi_schedule(&mal->napi); 269 __napi_schedule(&mal->napi);
268 } else 270 } else
269 MAL_DBG2(mal, "already in poll" NL); 271 MAL_DBG2(mal, "already in poll" NL);
@@ -442,15 +444,13 @@ static int mal_poll(struct napi_struct *napi, int budget)
442 if (unlikely(mc->ops->peek_rx(mc->dev) || 444 if (unlikely(mc->ops->peek_rx(mc->dev) ||
443 test_bit(MAL_COMMAC_RX_STOPPED, &mc->flags))) { 445 test_bit(MAL_COMMAC_RX_STOPPED, &mc->flags))) {
444 MAL_DBG2(mal, "rotting packet" NL); 446 MAL_DBG2(mal, "rotting packet" NL);
445 if (napi_reschedule(napi)) 447 if (!napi_reschedule(napi))
446 mal_disable_eob_irq(mal);
447 else
448 MAL_DBG2(mal, "already in poll list" NL);
449
450 if (budget > 0)
451 goto again;
452 else
453 goto more_work; 448 goto more_work;
449
450 spin_lock_irqsave(&mal->lock, flags);
451 mal_disable_eob_irq(mal);
452 spin_unlock_irqrestore(&mal->lock, flags);
453 goto again;
454 } 454 }
455 mc->ops->poll_tx(mc->dev); 455 mc->ops->poll_tx(mc->dev);
456 } 456 }
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index ea20182c6969..bb11624a1f39 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1691,7 +1691,7 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave
1691 vp_oper->vlan_idx = NO_INDX; 1691 vp_oper->vlan_idx = NO_INDX;
1692 } 1692 }
1693 if (NO_INDX != vp_oper->mac_idx) { 1693 if (NO_INDX != vp_oper->mac_idx) {
1694 __mlx4_unregister_mac(&priv->dev, port, vp_oper->mac_idx); 1694 __mlx4_unregister_mac(&priv->dev, port, vp_oper->state.mac);
1695 vp_oper->mac_idx = NO_INDX; 1695 vp_oper->mac_idx = NO_INDX;
1696 } 1696 }
1697 } 1697 }
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 3ca00e05f23d..ace217c447dd 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -2276,9 +2276,9 @@ int qlcnic_83xx_get_nic_info(struct qlcnic_adapter *adapter,
2276 temp = (cmd.rsp.arg[8] & 0x7FFE0000) >> 17; 2276 temp = (cmd.rsp.arg[8] & 0x7FFE0000) >> 17;
2277 npar_info->max_linkspeed_reg_offset = temp; 2277 npar_info->max_linkspeed_reg_offset = temp;
2278 } 2278 }
2279 if (npar_info->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) 2279
2280 memcpy(ahw->extra_capability, &cmd.rsp.arg[16], 2280 memcpy(ahw->extra_capability, &cmd.rsp.arg[16],
2281 sizeof(ahw->extra_capability)); 2281 sizeof(ahw->extra_capability));
2282 2282
2283out: 2283out:
2284 qlcnic_free_mbx_args(&cmd); 2284 qlcnic_free_mbx_args(&cmd);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index f8adc7b01f1f..b64e2bef9428 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -785,8 +785,6 @@ void qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *adapter)
785 785
786#define QLCNIC_ENABLE_IPV4_LRO 1 786#define QLCNIC_ENABLE_IPV4_LRO 1
787#define QLCNIC_ENABLE_IPV6_LRO 2 787#define QLCNIC_ENABLE_IPV6_LRO 2
788#define QLCNIC_NO_DEST_IPV4_CHECK (1 << 8)
789#define QLCNIC_NO_DEST_IPV6_CHECK (2 << 8)
790 788
791int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable) 789int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
792{ 790{
@@ -806,11 +804,10 @@ int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
806 804
807 word = 0; 805 word = 0;
808 if (enable) { 806 if (enable) {
809 word = QLCNIC_ENABLE_IPV4_LRO | QLCNIC_NO_DEST_IPV4_CHECK; 807 word = QLCNIC_ENABLE_IPV4_LRO;
810 if (adapter->ahw->extra_capability[0] & 808 if (adapter->ahw->extra_capability[0] &
811 QLCNIC_FW_CAP2_HW_LRO_IPV6) 809 QLCNIC_FW_CAP2_HW_LRO_IPV6)
812 word |= QLCNIC_ENABLE_IPV6_LRO | 810 word |= QLCNIC_ENABLE_IPV6_LRO;
813 QLCNIC_NO_DEST_IPV6_CHECK;
814 } 811 }
815 812
816 req.words[0] = cpu_to_le64(word); 813 req.words[0] = cpu_to_le64(word);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 9e61eb867452..d8f4897e9e82 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -1131,7 +1131,10 @@ qlcnic_initialize_nic(struct qlcnic_adapter *adapter)
1131 if (err == -EIO) 1131 if (err == -EIO)
1132 return err; 1132 return err;
1133 adapter->ahw->extra_capability[0] = temp; 1133 adapter->ahw->extra_capability[0] = temp;
1134 } else {
1135 adapter->ahw->extra_capability[0] = 0;
1134 } 1136 }
1137
1135 adapter->ahw->max_mac_filters = nic_info.max_mac_filters; 1138 adapter->ahw->max_mac_filters = nic_info.max_mac_filters;
1136 adapter->ahw->max_mtu = nic_info.max_mtu; 1139 adapter->ahw->max_mtu = nic_info.max_mtu;
1137 1140
@@ -2159,8 +2162,7 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter)
2159 else if (qlcnic_83xx_check(adapter)) 2162 else if (qlcnic_83xx_check(adapter))
2160 fw_cmd = QLCNIC_CMD_83XX_SET_DRV_VER; 2163 fw_cmd = QLCNIC_CMD_83XX_SET_DRV_VER;
2161 2164
2162 if ((ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) && 2165 if (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER)
2163 (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER))
2164 qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd); 2166 qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd);
2165} 2167}
2166 2168
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index adeee615dd19..c9a15925a1f7 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -310,6 +310,7 @@ static ssize_t store_enabled(struct netconsole_target *nt,
310 const char *buf, 310 const char *buf,
311 size_t count) 311 size_t count)
312{ 312{
313 unsigned long flags;
313 int enabled; 314 int enabled;
314 int err; 315 int err;
315 316
@@ -324,9 +325,7 @@ static ssize_t store_enabled(struct netconsole_target *nt,
324 return -EINVAL; 325 return -EINVAL;
325 } 326 }
326 327
327 mutex_lock(&nt->mutex);
328 if (enabled) { /* 1 */ 328 if (enabled) { /* 1 */
329
330 /* 329 /*
331 * Skip netpoll_parse_options() -- all the attributes are 330 * Skip netpoll_parse_options() -- all the attributes are
332 * already configured via configfs. Just print them out. 331 * already configured via configfs. Just print them out.
@@ -334,19 +333,22 @@ static ssize_t store_enabled(struct netconsole_target *nt,
334 netpoll_print_options(&nt->np); 333 netpoll_print_options(&nt->np);
335 334
336 err = netpoll_setup(&nt->np); 335 err = netpoll_setup(&nt->np);
337 if (err) { 336 if (err)
338 mutex_unlock(&nt->mutex);
339 return err; 337 return err;
340 }
341 338
342 printk(KERN_INFO "netconsole: network logging started\n"); 339 printk(KERN_INFO "netconsole: network logging started\n");
343
344 } else { /* 0 */ 340 } else { /* 0 */
341 /* We need to disable the netconsole before cleaning it up
342 * otherwise we might end up in write_msg() with
343 * nt->np.dev == NULL and nt->enabled == 1
344 */
345 spin_lock_irqsave(&target_list_lock, flags);
346 nt->enabled = 0;
347 spin_unlock_irqrestore(&target_list_lock, flags);
345 netpoll_cleanup(&nt->np); 348 netpoll_cleanup(&nt->np);
346 } 349 }
347 350
348 nt->enabled = enabled; 351 nt->enabled = enabled;
349 mutex_unlock(&nt->mutex);
350 352
351 return strnlen(buf, count); 353 return strnlen(buf, count);
352} 354}
@@ -563,8 +565,10 @@ static ssize_t netconsole_target_attr_store(struct config_item *item,
563 struct netconsole_target_attr *na = 565 struct netconsole_target_attr *na =
564 container_of(attr, struct netconsole_target_attr, attr); 566 container_of(attr, struct netconsole_target_attr, attr);
565 567
568 mutex_lock(&nt->mutex);
566 if (na->store) 569 if (na->store)
567 ret = na->store(nt, buf, count); 570 ret = na->store(nt, buf, count);
571 mutex_unlock(&nt->mutex);
568 572
569 return ret; 573 return ret;
570} 574}
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 846cc19c04f2..8e8d0fcd4979 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -78,7 +78,6 @@
78#define AX_MEDIUM_STATUS_MODE 0x22 78#define AX_MEDIUM_STATUS_MODE 0x22
79 #define AX_MEDIUM_GIGAMODE 0x01 79 #define AX_MEDIUM_GIGAMODE 0x01
80 #define AX_MEDIUM_FULL_DUPLEX 0x02 80 #define AX_MEDIUM_FULL_DUPLEX 0x02
81 #define AX_MEDIUM_ALWAYS_ONE 0x04
82 #define AX_MEDIUM_EN_125MHZ 0x08 81 #define AX_MEDIUM_EN_125MHZ 0x08
83 #define AX_MEDIUM_RXFLOW_CTRLEN 0x10 82 #define AX_MEDIUM_RXFLOW_CTRLEN 0x10
84 #define AX_MEDIUM_TXFLOW_CTRLEN 0x20 83 #define AX_MEDIUM_TXFLOW_CTRLEN 0x20
@@ -1065,8 +1064,8 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)
1065 1064
1066 /* Configure default medium type => giga */ 1065 /* Configure default medium type => giga */
1067 *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | 1066 *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN |
1068 AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_ALWAYS_ONE | 1067 AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_FULL_DUPLEX |
1069 AX_MEDIUM_FULL_DUPLEX | AX_MEDIUM_GIGAMODE; 1068 AX_MEDIUM_GIGAMODE;
1070 ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE, 1069 ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
1071 2, 2, tmp16); 1070 2, 2, tmp16);
1072 1071
@@ -1225,7 +1224,7 @@ static int ax88179_link_reset(struct usbnet *dev)
1225 } 1224 }
1226 1225
1227 mode = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | 1226 mode = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN |
1228 AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_ALWAYS_ONE; 1227 AX_MEDIUM_RXFLOW_CTRLEN;
1229 1228
1230 ax88179_read_cmd(dev, AX_ACCESS_MAC, PHYSICAL_LINK_STATUS, 1229 ax88179_read_cmd(dev, AX_ACCESS_MAC, PHYSICAL_LINK_STATUS,
1231 1, 1, &link_sts); 1230 1, 1, &link_sts);
@@ -1339,8 +1338,8 @@ static int ax88179_reset(struct usbnet *dev)
1339 1338
1340 /* Configure default medium type => giga */ 1339 /* Configure default medium type => giga */
1341 *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | 1340 *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN |
1342 AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_ALWAYS_ONE | 1341 AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_FULL_DUPLEX |
1343 AX_MEDIUM_FULL_DUPLEX | AX_MEDIUM_GIGAMODE; 1342 AX_MEDIUM_GIGAMODE;
1344 ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE, 1343 ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE,
1345 2, 2, tmp16); 1344 2, 2, tmp16);
1346 1345
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9fbdfcd1e1a0..bbc9cb84ec1f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1118,11 +1118,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1118{ 1118{
1119 struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); 1119 struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
1120 1120
1121 mutex_lock(&vi->config_lock);
1122
1123 if (!vi->config_enable)
1124 goto done;
1125
1126 switch(action & ~CPU_TASKS_FROZEN) { 1121 switch(action & ~CPU_TASKS_FROZEN) {
1127 case CPU_ONLINE: 1122 case CPU_ONLINE:
1128 case CPU_DOWN_FAILED: 1123 case CPU_DOWN_FAILED:
@@ -1136,8 +1131,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb,
1136 break; 1131 break;
1137 } 1132 }
1138 1133
1139done:
1140 mutex_unlock(&vi->config_lock);
1141 return NOTIFY_OK; 1134 return NOTIFY_OK;
1142} 1135}
1143 1136
@@ -1699,6 +1692,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
1699 struct virtnet_info *vi = vdev->priv; 1692 struct virtnet_info *vi = vdev->priv;
1700 int i; 1693 int i;
1701 1694
1695 unregister_hotcpu_notifier(&vi->nb);
1696
1702 /* Prevent config work handler from accessing the device */ 1697 /* Prevent config work handler from accessing the device */
1703 mutex_lock(&vi->config_lock); 1698 mutex_lock(&vi->config_lock);
1704 vi->config_enable = false; 1699 vi->config_enable = false;
@@ -1747,6 +1742,10 @@ static int virtnet_restore(struct virtio_device *vdev)
1747 virtnet_set_queues(vi, vi->curr_queue_pairs); 1742 virtnet_set_queues(vi, vi->curr_queue_pairs);
1748 rtnl_unlock(); 1743 rtnl_unlock();
1749 1744
1745 err = register_hotcpu_notifier(&vi->nb);
1746 if (err)
1747 return err;
1748
1750 return 0; 1749 return 0;
1751} 1750}
1752#endif 1751#endif
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 5bbcb5e3ee0c..388ddf60a66d 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -148,10 +148,6 @@ static int enslave( struct net_device *, struct net_device * );
148static int emancipate( struct net_device * ); 148static int emancipate( struct net_device * );
149#endif 149#endif
150 150
151#ifdef __i386__
152#define ASM_CRC 1
153#endif
154
155static const char version[] = 151static const char version[] =
156 "Granch SBNI12 driver ver 5.0.1 Jun 22 2001 Denis I.Timofeev.\n"; 152 "Granch SBNI12 driver ver 5.0.1 Jun 22 2001 Denis I.Timofeev.\n";
157 153
@@ -1551,88 +1547,6 @@ __setup( "sbni=", sbni_setup );
1551 1547
1552/* -------------------------------------------------------------------------- */ 1548/* -------------------------------------------------------------------------- */
1553 1549
1554#ifdef ASM_CRC
1555
1556static u32
1557calc_crc32( u32 crc, u8 *p, u32 len )
1558{
1559 register u32 _crc;
1560 _crc = crc;
1561
1562 __asm__ __volatile__ (
1563 "xorl %%ebx, %%ebx\n"
1564 "movl %2, %%esi\n"
1565 "movl %3, %%ecx\n"
1566 "movl $crc32tab, %%edi\n"
1567 "shrl $2, %%ecx\n"
1568 "jz 1f\n"
1569
1570 ".align 4\n"
1571 "0:\n"
1572 "movb %%al, %%bl\n"
1573 "movl (%%esi), %%edx\n"
1574 "shrl $8, %%eax\n"
1575 "xorb %%dl, %%bl\n"
1576 "shrl $8, %%edx\n"
1577 "xorl (%%edi,%%ebx,4), %%eax\n"
1578
1579 "movb %%al, %%bl\n"
1580 "shrl $8, %%eax\n"
1581 "xorb %%dl, %%bl\n"
1582 "shrl $8, %%edx\n"
1583 "xorl (%%edi,%%ebx,4), %%eax\n"
1584
1585 "movb %%al, %%bl\n"
1586 "shrl $8, %%eax\n"
1587 "xorb %%dl, %%bl\n"
1588 "movb %%dh, %%dl\n"
1589 "xorl (%%edi,%%ebx,4), %%eax\n"
1590
1591 "movb %%al, %%bl\n"
1592 "shrl $8, %%eax\n"
1593 "xorb %%dl, %%bl\n"
1594 "addl $4, %%esi\n"
1595 "xorl (%%edi,%%ebx,4), %%eax\n"
1596
1597 "decl %%ecx\n"
1598 "jnz 0b\n"
1599
1600 "1:\n"
1601 "movl %3, %%ecx\n"
1602 "andl $3, %%ecx\n"
1603 "jz 2f\n"
1604
1605 "movb %%al, %%bl\n"
1606 "shrl $8, %%eax\n"
1607 "xorb (%%esi), %%bl\n"
1608 "xorl (%%edi,%%ebx,4), %%eax\n"
1609
1610 "decl %%ecx\n"
1611 "jz 2f\n"
1612
1613 "movb %%al, %%bl\n"
1614 "shrl $8, %%eax\n"
1615 "xorb 1(%%esi), %%bl\n"
1616 "xorl (%%edi,%%ebx,4), %%eax\n"
1617
1618 "decl %%ecx\n"
1619 "jz 2f\n"
1620
1621 "movb %%al, %%bl\n"
1622 "shrl $8, %%eax\n"
1623 "xorb 2(%%esi), %%bl\n"
1624 "xorl (%%edi,%%ebx,4), %%eax\n"
1625 "2:\n"
1626 : "=a" (_crc)
1627 : "0" (_crc), "g" (p), "g" (len)
1628 : "bx", "cx", "dx", "si", "di"
1629 );
1630
1631 return _crc;
1632}
1633
1634#else /* ASM_CRC */
1635
1636static u32 1550static u32
1637calc_crc32( u32 crc, u8 *p, u32 len ) 1551calc_crc32( u32 crc, u8 *p, u32 len )
1638{ 1552{
@@ -1642,9 +1556,6 @@ calc_crc32( u32 crc, u8 *p, u32 len )
1642 return crc; 1556 return crc;
1643} 1557}
1644 1558
1645#endif /* ASM_CRC */
1646
1647
1648static u32 crc32tab[] __attribute__ ((aligned(8))) = { 1559static u32 crc32tab[] __attribute__ ((aligned(8))) = {
1649 0xD202EF8D, 0xA505DF1B, 0x3C0C8EA1, 0x4B0BBE37, 1560 0xD202EF8D, 0xA505DF1B, 0x3C0C8EA1, 0x4B0BBE37,
1650 0xD56F2B94, 0xA2681B02, 0x3B614AB8, 0x4C667A2E, 1561 0xD56F2B94, 0xA2681B02, 0x3B614AB8, 0x4C667A2E,
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 5715318d6bab..400fea1de080 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -163,6 +163,7 @@ struct xenvif {
163 unsigned long credit_usec; 163 unsigned long credit_usec;
164 unsigned long remaining_credit; 164 unsigned long remaining_credit;
165 struct timer_list credit_timeout; 165 struct timer_list credit_timeout;
166 u64 credit_window_start;
166 167
167 /* Statistics */ 168 /* Statistics */
168 unsigned long rx_gso_checksum_fixup; 169 unsigned long rx_gso_checksum_fixup;
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 01bb854c7f62..459935a6bfae 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -312,8 +312,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
312 vif->credit_bytes = vif->remaining_credit = ~0UL; 312 vif->credit_bytes = vif->remaining_credit = ~0UL;
313 vif->credit_usec = 0UL; 313 vif->credit_usec = 0UL;
314 init_timer(&vif->credit_timeout); 314 init_timer(&vif->credit_timeout);
315 /* Initialize 'expires' now: it's used to track the credit window. */ 315 vif->credit_window_start = get_jiffies_64();
316 vif->credit_timeout.expires = jiffies;
317 316
318 dev->netdev_ops = &xenvif_netdev_ops; 317 dev->netdev_ops = &xenvif_netdev_ops;
319 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; 318 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index f3e591c611de..900da4b243ad 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1185,9 +1185,8 @@ out:
1185 1185
1186static bool tx_credit_exceeded(struct xenvif *vif, unsigned size) 1186static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
1187{ 1187{
1188 unsigned long now = jiffies; 1188 u64 now = get_jiffies_64();
1189 unsigned long next_credit = 1189 u64 next_credit = vif->credit_window_start +
1190 vif->credit_timeout.expires +
1191 msecs_to_jiffies(vif->credit_usec / 1000); 1190 msecs_to_jiffies(vif->credit_usec / 1000);
1192 1191
1193 /* Timer could already be pending in rare cases. */ 1192 /* Timer could already be pending in rare cases. */
@@ -1195,8 +1194,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
1195 return true; 1194 return true;
1196 1195
1197 /* Passed the point where we can replenish credit? */ 1196 /* Passed the point where we can replenish credit? */
1198 if (time_after_eq(now, next_credit)) { 1197 if (time_after_eq64(now, next_credit)) {
1199 vif->credit_timeout.expires = now; 1198 vif->credit_window_start = now;
1200 tx_add_credit(vif); 1199 tx_add_credit(vif);
1201 } 1200 }
1202 1201
@@ -1208,6 +1207,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
1208 tx_credit_callback; 1207 tx_credit_callback;
1209 mod_timer(&vif->credit_timeout, 1208 mod_timer(&vif->credit_timeout,
1210 next_credit); 1209 next_credit);
1210 vif->credit_window_start = next_credit;
1211 1211
1212 return true; 1212 return true;
1213 } 1213 }
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index f3c7c24bec1c..fbfdb9d8d3a7 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -24,7 +24,8 @@ struct netpoll {
24 struct net_device *dev; 24 struct net_device *dev;
25 char dev_name[IFNAMSIZ]; 25 char dev_name[IFNAMSIZ];
26 const char *name; 26 const char *name;
27 void (*rx_hook)(struct netpoll *, int, char *, int); 27 void (*rx_skb_hook)(struct netpoll *np, int source, struct sk_buff *skb,
28 int offset, int len);
28 29
29 union inet_addr local_ip, remote_ip; 30 union inet_addr local_ip, remote_ip;
30 bool ipv6; 31 bool ipv6;
@@ -41,7 +42,7 @@ struct netpoll_info {
41 unsigned long rx_flags; 42 unsigned long rx_flags;
42 spinlock_t rx_lock; 43 spinlock_t rx_lock;
43 struct semaphore dev_lock; 44 struct semaphore dev_lock;
44 struct list_head rx_np; /* netpolls that registered an rx_hook */ 45 struct list_head rx_np; /* netpolls that registered an rx_skb_hook */
45 46
46 struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */ 47 struct sk_buff_head neigh_tx; /* list of neigh requests to reply to */
47 struct sk_buff_head txq; 48 struct sk_buff_head txq;
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 48ec25a7fcb6..5e661a979694 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -165,6 +165,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
165static inline void rt6_clean_expires(struct rt6_info *rt) 165static inline void rt6_clean_expires(struct rt6_info *rt)
166{ 166{
167 rt->rt6i_flags &= ~RTF_EXPIRES; 167 rt->rt6i_flags &= ~RTF_EXPIRES;
168 rt->dst.expires = 0;
168} 169}
169 170
170static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) 171static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index ca04163635da..e6b7fecb3af1 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -64,7 +64,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
64 br_flood_deliver(br, skb, false); 64 br_flood_deliver(br, skb, false);
65 goto out; 65 goto out;
66 } 66 }
67 if (br_multicast_rcv(br, NULL, skb)) { 67 if (br_multicast_rcv(br, NULL, skb, vid)) {
68 kfree_skb(skb); 68 kfree_skb(skb);
69 goto out; 69 goto out;
70 } 70 }
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index a2fd37ec35f7..7e73c32e205d 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -80,7 +80,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
80 br_fdb_update(br, p, eth_hdr(skb)->h_source, vid); 80 br_fdb_update(br, p, eth_hdr(skb)->h_source, vid);
81 81
82 if (!is_broadcast_ether_addr(dest) && is_multicast_ether_addr(dest) && 82 if (!is_broadcast_ether_addr(dest) && is_multicast_ether_addr(dest) &&
83 br_multicast_rcv(br, p, skb)) 83 br_multicast_rcv(br, p, skb, vid))
84 goto drop; 84 goto drop;
85 85
86 if (p->state == BR_STATE_LEARNING) 86 if (p->state == BR_STATE_LEARNING)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 8b0b610ca2c9..686284ff3d6a 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -947,7 +947,8 @@ void br_multicast_disable_port(struct net_bridge_port *port)
947 947
948static int br_ip4_multicast_igmp3_report(struct net_bridge *br, 948static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
949 struct net_bridge_port *port, 949 struct net_bridge_port *port,
950 struct sk_buff *skb) 950 struct sk_buff *skb,
951 u16 vid)
951{ 952{
952 struct igmpv3_report *ih; 953 struct igmpv3_report *ih;
953 struct igmpv3_grec *grec; 954 struct igmpv3_grec *grec;
@@ -957,12 +958,10 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
957 int type; 958 int type;
958 int err = 0; 959 int err = 0;
959 __be32 group; 960 __be32 group;
960 u16 vid = 0;
961 961
962 if (!pskb_may_pull(skb, sizeof(*ih))) 962 if (!pskb_may_pull(skb, sizeof(*ih)))
963 return -EINVAL; 963 return -EINVAL;
964 964
965 br_vlan_get_tag(skb, &vid);
966 ih = igmpv3_report_hdr(skb); 965 ih = igmpv3_report_hdr(skb);
967 num = ntohs(ih->ngrec); 966 num = ntohs(ih->ngrec);
968 len = sizeof(*ih); 967 len = sizeof(*ih);
@@ -1005,7 +1004,8 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
1005#if IS_ENABLED(CONFIG_IPV6) 1004#if IS_ENABLED(CONFIG_IPV6)
1006static int br_ip6_multicast_mld2_report(struct net_bridge *br, 1005static int br_ip6_multicast_mld2_report(struct net_bridge *br,
1007 struct net_bridge_port *port, 1006 struct net_bridge_port *port,
1008 struct sk_buff *skb) 1007 struct sk_buff *skb,
1008 u16 vid)
1009{ 1009{
1010 struct icmp6hdr *icmp6h; 1010 struct icmp6hdr *icmp6h;
1011 struct mld2_grec *grec; 1011 struct mld2_grec *grec;
@@ -1013,12 +1013,10 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
1013 int len; 1013 int len;
1014 int num; 1014 int num;
1015 int err = 0; 1015 int err = 0;
1016 u16 vid = 0;
1017 1016
1018 if (!pskb_may_pull(skb, sizeof(*icmp6h))) 1017 if (!pskb_may_pull(skb, sizeof(*icmp6h)))
1019 return -EINVAL; 1018 return -EINVAL;
1020 1019
1021 br_vlan_get_tag(skb, &vid);
1022 icmp6h = icmp6_hdr(skb); 1020 icmp6h = icmp6_hdr(skb);
1023 num = ntohs(icmp6h->icmp6_dataun.un_data16[1]); 1021 num = ntohs(icmp6h->icmp6_dataun.un_data16[1]);
1024 len = sizeof(*icmp6h); 1022 len = sizeof(*icmp6h);
@@ -1141,7 +1139,8 @@ static void br_multicast_query_received(struct net_bridge *br,
1141 1139
1142static int br_ip4_multicast_query(struct net_bridge *br, 1140static int br_ip4_multicast_query(struct net_bridge *br,
1143 struct net_bridge_port *port, 1141 struct net_bridge_port *port,
1144 struct sk_buff *skb) 1142 struct sk_buff *skb,
1143 u16 vid)
1145{ 1144{
1146 const struct iphdr *iph = ip_hdr(skb); 1145 const struct iphdr *iph = ip_hdr(skb);
1147 struct igmphdr *ih = igmp_hdr(skb); 1146 struct igmphdr *ih = igmp_hdr(skb);
@@ -1153,7 +1152,6 @@ static int br_ip4_multicast_query(struct net_bridge *br,
1153 unsigned long now = jiffies; 1152 unsigned long now = jiffies;
1154 __be32 group; 1153 __be32 group;
1155 int err = 0; 1154 int err = 0;
1156 u16 vid = 0;
1157 1155
1158 spin_lock(&br->multicast_lock); 1156 spin_lock(&br->multicast_lock);
1159 if (!netif_running(br->dev) || 1157 if (!netif_running(br->dev) ||
@@ -1189,7 +1187,6 @@ static int br_ip4_multicast_query(struct net_bridge *br,
1189 if (!group) 1187 if (!group)
1190 goto out; 1188 goto out;
1191 1189
1192 br_vlan_get_tag(skb, &vid);
1193 mp = br_mdb_ip4_get(mlock_dereference(br->mdb, br), group, vid); 1190 mp = br_mdb_ip4_get(mlock_dereference(br->mdb, br), group, vid);
1194 if (!mp) 1191 if (!mp)
1195 goto out; 1192 goto out;
@@ -1219,7 +1216,8 @@ out:
1219#if IS_ENABLED(CONFIG_IPV6) 1216#if IS_ENABLED(CONFIG_IPV6)
1220static int br_ip6_multicast_query(struct net_bridge *br, 1217static int br_ip6_multicast_query(struct net_bridge *br,
1221 struct net_bridge_port *port, 1218 struct net_bridge_port *port,
1222 struct sk_buff *skb) 1219 struct sk_buff *skb,
1220 u16 vid)
1223{ 1221{
1224 const struct ipv6hdr *ip6h = ipv6_hdr(skb); 1222 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
1225 struct mld_msg *mld; 1223 struct mld_msg *mld;
@@ -1231,7 +1229,6 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1231 unsigned long now = jiffies; 1229 unsigned long now = jiffies;
1232 const struct in6_addr *group = NULL; 1230 const struct in6_addr *group = NULL;
1233 int err = 0; 1231 int err = 0;
1234 u16 vid = 0;
1235 1232
1236 spin_lock(&br->multicast_lock); 1233 spin_lock(&br->multicast_lock);
1237 if (!netif_running(br->dev) || 1234 if (!netif_running(br->dev) ||
@@ -1265,7 +1262,6 @@ static int br_ip6_multicast_query(struct net_bridge *br,
1265 if (!group) 1262 if (!group)
1266 goto out; 1263 goto out;
1267 1264
1268 br_vlan_get_tag(skb, &vid);
1269 mp = br_mdb_ip6_get(mlock_dereference(br->mdb, br), group, vid); 1265 mp = br_mdb_ip6_get(mlock_dereference(br->mdb, br), group, vid);
1270 if (!mp) 1266 if (!mp)
1271 goto out; 1267 goto out;
@@ -1439,7 +1435,8 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br,
1439 1435
1440static int br_multicast_ipv4_rcv(struct net_bridge *br, 1436static int br_multicast_ipv4_rcv(struct net_bridge *br,
1441 struct net_bridge_port *port, 1437 struct net_bridge_port *port,
1442 struct sk_buff *skb) 1438 struct sk_buff *skb,
1439 u16 vid)
1443{ 1440{
1444 struct sk_buff *skb2 = skb; 1441 struct sk_buff *skb2 = skb;
1445 const struct iphdr *iph; 1442 const struct iphdr *iph;
@@ -1447,7 +1444,6 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1447 unsigned int len; 1444 unsigned int len;
1448 unsigned int offset; 1445 unsigned int offset;
1449 int err; 1446 int err;
1450 u16 vid = 0;
1451 1447
1452 /* We treat OOM as packet loss for now. */ 1448 /* We treat OOM as packet loss for now. */
1453 if (!pskb_may_pull(skb, sizeof(*iph))) 1449 if (!pskb_may_pull(skb, sizeof(*iph)))
@@ -1508,7 +1504,6 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1508 1504
1509 err = 0; 1505 err = 0;
1510 1506
1511 br_vlan_get_tag(skb2, &vid);
1512 BR_INPUT_SKB_CB(skb)->igmp = 1; 1507 BR_INPUT_SKB_CB(skb)->igmp = 1;
1513 ih = igmp_hdr(skb2); 1508 ih = igmp_hdr(skb2);
1514 1509
@@ -1519,10 +1514,10 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
1519 err = br_ip4_multicast_add_group(br, port, ih->group, vid); 1514 err = br_ip4_multicast_add_group(br, port, ih->group, vid);
1520 break; 1515 break;
1521 case IGMPV3_HOST_MEMBERSHIP_REPORT: 1516 case IGMPV3_HOST_MEMBERSHIP_REPORT:
1522 err = br_ip4_multicast_igmp3_report(br, port, skb2); 1517 err = br_ip4_multicast_igmp3_report(br, port, skb2, vid);
1523 break; 1518 break;
1524 case IGMP_HOST_MEMBERSHIP_QUERY: 1519 case IGMP_HOST_MEMBERSHIP_QUERY:
1525 err = br_ip4_multicast_query(br, port, skb2); 1520 err = br_ip4_multicast_query(br, port, skb2, vid);
1526 break; 1521 break;
1527 case IGMP_HOST_LEAVE_MESSAGE: 1522 case IGMP_HOST_LEAVE_MESSAGE:
1528 br_ip4_multicast_leave_group(br, port, ih->group, vid); 1523 br_ip4_multicast_leave_group(br, port, ih->group, vid);
@@ -1540,7 +1535,8 @@ err_out:
1540#if IS_ENABLED(CONFIG_IPV6) 1535#if IS_ENABLED(CONFIG_IPV6)
1541static int br_multicast_ipv6_rcv(struct net_bridge *br, 1536static int br_multicast_ipv6_rcv(struct net_bridge *br,
1542 struct net_bridge_port *port, 1537 struct net_bridge_port *port,
1543 struct sk_buff *skb) 1538 struct sk_buff *skb,
1539 u16 vid)
1544{ 1540{
1545 struct sk_buff *skb2; 1541 struct sk_buff *skb2;
1546 const struct ipv6hdr *ip6h; 1542 const struct ipv6hdr *ip6h;
@@ -1550,7 +1546,6 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
1550 unsigned int len; 1546 unsigned int len;
1551 int offset; 1547 int offset;
1552 int err; 1548 int err;
1553 u16 vid = 0;
1554 1549
1555 if (!pskb_may_pull(skb, sizeof(*ip6h))) 1550 if (!pskb_may_pull(skb, sizeof(*ip6h)))
1556 return -EINVAL; 1551 return -EINVAL;
@@ -1640,7 +1635,6 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
1640 1635
1641 err = 0; 1636 err = 0;
1642 1637
1643 br_vlan_get_tag(skb, &vid);
1644 BR_INPUT_SKB_CB(skb)->igmp = 1; 1638 BR_INPUT_SKB_CB(skb)->igmp = 1;
1645 1639
1646 switch (icmp6_type) { 1640 switch (icmp6_type) {
@@ -1657,10 +1651,10 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
1657 break; 1651 break;
1658 } 1652 }
1659 case ICMPV6_MLD2_REPORT: 1653 case ICMPV6_MLD2_REPORT:
1660 err = br_ip6_multicast_mld2_report(br, port, skb2); 1654 err = br_ip6_multicast_mld2_report(br, port, skb2, vid);
1661 break; 1655 break;
1662 case ICMPV6_MGM_QUERY: 1656 case ICMPV6_MGM_QUERY:
1663 err = br_ip6_multicast_query(br, port, skb2); 1657 err = br_ip6_multicast_query(br, port, skb2, vid);
1664 break; 1658 break;
1665 case ICMPV6_MGM_REDUCTION: 1659 case ICMPV6_MGM_REDUCTION:
1666 { 1660 {
@@ -1681,7 +1675,7 @@ out:
1681#endif 1675#endif
1682 1676
1683int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port, 1677int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port,
1684 struct sk_buff *skb) 1678 struct sk_buff *skb, u16 vid)
1685{ 1679{
1686 BR_INPUT_SKB_CB(skb)->igmp = 0; 1680 BR_INPUT_SKB_CB(skb)->igmp = 0;
1687 BR_INPUT_SKB_CB(skb)->mrouters_only = 0; 1681 BR_INPUT_SKB_CB(skb)->mrouters_only = 0;
@@ -1691,10 +1685,10 @@ int br_multicast_rcv(struct net_bridge *br, struct net_bridge_port *port,
1691 1685
1692 switch (skb->protocol) { 1686 switch (skb->protocol) {
1693 case htons(ETH_P_IP): 1687 case htons(ETH_P_IP):
1694 return br_multicast_ipv4_rcv(br, port, skb); 1688 return br_multicast_ipv4_rcv(br, port, skb, vid);
1695#if IS_ENABLED(CONFIG_IPV6) 1689#if IS_ENABLED(CONFIG_IPV6)
1696 case htons(ETH_P_IPV6): 1690 case htons(ETH_P_IPV6):
1697 return br_multicast_ipv6_rcv(br, port, skb); 1691 return br_multicast_ipv6_rcv(br, port, skb, vid);
1698#endif 1692#endif
1699 } 1693 }
1700 1694
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index e14c33b42f75..2e8244efb262 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -451,7 +451,8 @@ extern int br_ioctl_deviceless_stub(struct net *net, unsigned int cmd, void __us
451extern unsigned int br_mdb_rehash_seq; 451extern unsigned int br_mdb_rehash_seq;
452extern int br_multicast_rcv(struct net_bridge *br, 452extern int br_multicast_rcv(struct net_bridge *br,
453 struct net_bridge_port *port, 453 struct net_bridge_port *port,
454 struct sk_buff *skb); 454 struct sk_buff *skb,
455 u16 vid);
455extern struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, 456extern struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br,
456 struct sk_buff *skb, u16 vid); 457 struct sk_buff *skb, u16 vid);
457extern void br_multicast_add_port(struct net_bridge_port *port); 458extern void br_multicast_add_port(struct net_bridge_port *port);
@@ -522,7 +523,8 @@ static inline bool br_multicast_querier_exists(struct net_bridge *br,
522#else 523#else
523static inline int br_multicast_rcv(struct net_bridge *br, 524static inline int br_multicast_rcv(struct net_bridge *br,
524 struct net_bridge_port *port, 525 struct net_bridge_port *port,
525 struct sk_buff *skb) 526 struct sk_buff *skb,
527 u16 vid)
526{ 528{
527 return 0; 529 return 0;
528} 530}
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 518093802d1d..7c470c371e14 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -181,6 +181,7 @@ static void ebt_ulog_packet(struct net *net, unsigned int hooknr,
181 ub->qlen++; 181 ub->qlen++;
182 182
183 pm = nlmsg_data(nlh); 183 pm = nlmsg_data(nlh);
184 memset(pm, 0, sizeof(*pm));
184 185
185 /* Fill in the ulog data */ 186 /* Fill in the ulog data */
186 pm->version = EBT_ULOG_VERSION; 187 pm->version = EBT_ULOG_VERSION;
@@ -193,8 +194,6 @@ static void ebt_ulog_packet(struct net *net, unsigned int hooknr,
193 pm->hook = hooknr; 194 pm->hook = hooknr;
194 if (uloginfo->prefix != NULL) 195 if (uloginfo->prefix != NULL)
195 strcpy(pm->prefix, uloginfo->prefix); 196 strcpy(pm->prefix, uloginfo->prefix);
196 else
197 *(pm->prefix) = '\0';
198 197
199 if (in) { 198 if (in) {
200 strcpy(pm->physindev, in->name); 199 strcpy(pm->physindev, in->name);
@@ -204,16 +203,14 @@ static void ebt_ulog_packet(struct net *net, unsigned int hooknr,
204 strcpy(pm->indev, br_port_get_rcu(in)->br->dev->name); 203 strcpy(pm->indev, br_port_get_rcu(in)->br->dev->name);
205 else 204 else
206 strcpy(pm->indev, in->name); 205 strcpy(pm->indev, in->name);
207 } else 206 }
208 pm->indev[0] = pm->physindev[0] = '\0';
209 207
210 if (out) { 208 if (out) {
211 /* If out exists, then out is a bridge port */ 209 /* If out exists, then out is a bridge port */
212 strcpy(pm->physoutdev, out->name); 210 strcpy(pm->physoutdev, out->name);
213 /* rcu_read_lock()ed by nf_hook_slow */ 211 /* rcu_read_lock()ed by nf_hook_slow */
214 strcpy(pm->outdev, br_port_get_rcu(out)->br->dev->name); 212 strcpy(pm->outdev, br_port_get_rcu(out)->br->dev->name);
215 } else 213 }
216 pm->outdev[0] = pm->physoutdev[0] = '\0';
217 214
218 if (skb_copy_bits(skb, -ETH_HLEN, pm->data, copy_len) < 0) 215 if (skb_copy_bits(skb, -ETH_HLEN, pm->data, copy_len) < 0)
219 BUG(); 216 BUG();
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 8d7d0dd72db2..143b6fdb9647 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -40,7 +40,7 @@ again:
40 struct iphdr _iph; 40 struct iphdr _iph;
41ip: 41ip:
42 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph); 42 iph = skb_header_pointer(skb, nhoff, sizeof(_iph), &_iph);
43 if (!iph) 43 if (!iph || iph->ihl < 5)
44 return false; 44 return false;
45 45
46 if (ip_is_fragment(iph)) 46 if (ip_is_fragment(iph))
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index fc75c9e461b8..8f971990677c 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -636,8 +636,9 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfo
636 636
637 netpoll_send_skb(np, send_skb); 637 netpoll_send_skb(np, send_skb);
638 638
639 /* If there are several rx_hooks for the same address, 639 /* If there are several rx_skb_hooks for the same
640 we're fine by sending a single reply */ 640 * address we're fine by sending a single reply
641 */
641 break; 642 break;
642 } 643 }
643 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 644 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
@@ -719,8 +720,9 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfo
719 720
720 netpoll_send_skb(np, send_skb); 721 netpoll_send_skb(np, send_skb);
721 722
722 /* If there are several rx_hooks for the same address, 723 /* If there are several rx_skb_hooks for the same
723 we're fine by sending a single reply */ 724 * address, we're fine by sending a single reply
725 */
724 break; 726 break;
725 } 727 }
726 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 728 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
@@ -756,11 +758,12 @@ static bool pkt_is_ns(struct sk_buff *skb)
756 758
757int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo) 759int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo)
758{ 760{
759 int proto, len, ulen; 761 int proto, len, ulen, data_len;
760 int hits = 0; 762 int hits = 0, offset;
761 const struct iphdr *iph; 763 const struct iphdr *iph;
762 struct udphdr *uh; 764 struct udphdr *uh;
763 struct netpoll *np, *tmp; 765 struct netpoll *np, *tmp;
766 uint16_t source;
764 767
765 if (list_empty(&npinfo->rx_np)) 768 if (list_empty(&npinfo->rx_np))
766 goto out; 769 goto out;
@@ -820,7 +823,10 @@ int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo)
820 823
821 len -= iph->ihl*4; 824 len -= iph->ihl*4;
822 uh = (struct udphdr *)(((char *)iph) + iph->ihl*4); 825 uh = (struct udphdr *)(((char *)iph) + iph->ihl*4);
826 offset = (unsigned char *)(uh + 1) - skb->data;
823 ulen = ntohs(uh->len); 827 ulen = ntohs(uh->len);
828 data_len = skb->len - offset;
829 source = ntohs(uh->source);
824 830
825 if (ulen != len) 831 if (ulen != len)
826 goto out; 832 goto out;
@@ -834,9 +840,7 @@ int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo)
834 if (np->local_port && np->local_port != ntohs(uh->dest)) 840 if (np->local_port && np->local_port != ntohs(uh->dest))
835 continue; 841 continue;
836 842
837 np->rx_hook(np, ntohs(uh->source), 843 np->rx_skb_hook(np, source, skb, offset, data_len);
838 (char *)(uh+1),
839 ulen - sizeof(struct udphdr));
840 hits++; 844 hits++;
841 } 845 }
842 } else { 846 } else {
@@ -859,7 +863,10 @@ int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo)
859 if (!pskb_may_pull(skb, sizeof(struct udphdr))) 863 if (!pskb_may_pull(skb, sizeof(struct udphdr)))
860 goto out; 864 goto out;
861 uh = udp_hdr(skb); 865 uh = udp_hdr(skb);
866 offset = (unsigned char *)(uh + 1) - skb->data;
862 ulen = ntohs(uh->len); 867 ulen = ntohs(uh->len);
868 data_len = skb->len - offset;
869 source = ntohs(uh->source);
863 if (ulen != skb->len) 870 if (ulen != skb->len)
864 goto out; 871 goto out;
865 if (udp6_csum_init(skb, uh, IPPROTO_UDP)) 872 if (udp6_csum_init(skb, uh, IPPROTO_UDP))
@@ -872,9 +879,7 @@ int __netpoll_rx(struct sk_buff *skb, struct netpoll_info *npinfo)
872 if (np->local_port && np->local_port != ntohs(uh->dest)) 879 if (np->local_port && np->local_port != ntohs(uh->dest))
873 continue; 880 continue;
874 881
875 np->rx_hook(np, ntohs(uh->source), 882 np->rx_skb_hook(np, source, skb, offset, data_len);
876 (char *)(uh+1),
877 ulen - sizeof(struct udphdr));
878 hits++; 883 hits++;
879 } 884 }
880#endif 885#endif
@@ -1062,7 +1067,7 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev, gfp_t gfp)
1062 1067
1063 npinfo->netpoll = np; 1068 npinfo->netpoll = np;
1064 1069
1065 if (np->rx_hook) { 1070 if (np->rx_skb_hook) {
1066 spin_lock_irqsave(&npinfo->rx_lock, flags); 1071 spin_lock_irqsave(&npinfo->rx_lock, flags);
1067 npinfo->rx_flags |= NETPOLL_RX_ENABLED; 1072 npinfo->rx_flags |= NETPOLL_RX_ENABLED;
1068 list_add_tail(&np->rx, &npinfo->rx_np); 1073 list_add_tail(&np->rx, &npinfo->rx_np);
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 85a4f21aac1a..59da7cde0724 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -271,6 +271,11 @@ unsigned int arpt_do_table(struct sk_buff *skb,
271 local_bh_disable(); 271 local_bh_disable();
272 addend = xt_write_recseq_begin(); 272 addend = xt_write_recseq_begin();
273 private = table->private; 273 private = table->private;
274 /*
275 * Ensure we load private-> members after we've fetched the base
276 * pointer.
277 */
278 smp_read_barrier_depends();
274 table_base = private->entries[smp_processor_id()]; 279 table_base = private->entries[smp_processor_id()];
275 280
276 e = get_entry(table_base, private->hook_entry[hook]); 281 e = get_entry(table_base, private->hook_entry[hook]);
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index d23118d95ff9..718dfbd30cbe 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -327,6 +327,11 @@ ipt_do_table(struct sk_buff *skb,
327 addend = xt_write_recseq_begin(); 327 addend = xt_write_recseq_begin();
328 private = table->private; 328 private = table->private;
329 cpu = smp_processor_id(); 329 cpu = smp_processor_id();
330 /*
331 * Ensure we load private-> members after we've fetched the base
332 * pointer.
333 */
334 smp_read_barrier_depends();
330 table_base = private->entries[cpu]; 335 table_base = private->entries[cpu];
331 jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; 336 jumpstack = (struct ipt_entry **)private->jumpstack[cpu];
332 stackptr = per_cpu_ptr(private->stackptr, cpu); 337 stackptr = per_cpu_ptr(private->stackptr, cpu);
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index cbc22158af49..9cb993cd224b 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -220,6 +220,7 @@ static void ipt_ulog_packet(struct net *net,
220 ub->qlen++; 220 ub->qlen++;
221 221
222 pm = nlmsg_data(nlh); 222 pm = nlmsg_data(nlh);
223 memset(pm, 0, sizeof(*pm));
223 224
224 /* We might not have a timestamp, get one */ 225 /* We might not have a timestamp, get one */
225 if (skb->tstamp.tv64 == 0) 226 if (skb->tstamp.tv64 == 0)
@@ -238,8 +239,6 @@ static void ipt_ulog_packet(struct net *net,
238 } 239 }
239 else if (loginfo->prefix[0] != '\0') 240 else if (loginfo->prefix[0] != '\0')
240 strncpy(pm->prefix, loginfo->prefix, sizeof(pm->prefix)); 241 strncpy(pm->prefix, loginfo->prefix, sizeof(pm->prefix));
241 else
242 *(pm->prefix) = '\0';
243 242
244 if (in && in->hard_header_len > 0 && 243 if (in && in->hard_header_len > 0 &&
245 skb->mac_header != skb->network_header && 244 skb->mac_header != skb->network_header &&
@@ -251,13 +250,9 @@ static void ipt_ulog_packet(struct net *net,
251 250
252 if (in) 251 if (in)
253 strncpy(pm->indev_name, in->name, sizeof(pm->indev_name)); 252 strncpy(pm->indev_name, in->name, sizeof(pm->indev_name));
254 else
255 pm->indev_name[0] = '\0';
256 253
257 if (out) 254 if (out)
258 strncpy(pm->outdev_name, out->name, sizeof(pm->outdev_name)); 255 strncpy(pm->outdev_name, out->name, sizeof(pm->outdev_name));
259 else
260 pm->outdev_name[0] = '\0';
261 256
262 /* copy_len <= skb->len, so can't fail. */ 257 /* copy_len <= skb->len, so can't fail. */
263 if (skb_copy_bits(skb, 0, pm->payload, copy_len) < 0) 258 if (skb_copy_bits(skb, 0, pm->payload, copy_len) < 0)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a16b01b537ba..068c8fb0d158 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2856,7 +2856,8 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
2856 * left edge of the send window. 2856 * left edge of the send window.
2857 * See draft-ietf-tcplw-high-performance-00, section 3.3. 2857 * See draft-ietf-tcplw-high-performance-00, section 3.3.
2858 */ 2858 */
2859 if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr) 2859 if (seq_rtt < 0 && tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
2860 flag & FLAG_ACKED)
2860 seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr; 2861 seq_rtt = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
2861 2862
2862 if (seq_rtt < 0) 2863 if (seq_rtt < 0)
@@ -2871,14 +2872,19 @@ static inline bool tcp_ack_update_rtt(struct sock *sk, const int flag,
2871} 2872}
2872 2873
2873/* Compute time elapsed between (last) SYNACK and the ACK completing 3WHS. */ 2874/* Compute time elapsed between (last) SYNACK and the ACK completing 3WHS. */
2874static void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req) 2875static void tcp_synack_rtt_meas(struct sock *sk, const u32 synack_stamp)
2875{ 2876{
2876 struct tcp_sock *tp = tcp_sk(sk); 2877 struct tcp_sock *tp = tcp_sk(sk);
2877 s32 seq_rtt = -1; 2878 s32 seq_rtt = -1;
2878 2879
2879 if (tp->lsndtime && !tp->total_retrans) 2880 if (synack_stamp && !tp->total_retrans)
2880 seq_rtt = tcp_time_stamp - tp->lsndtime; 2881 seq_rtt = tcp_time_stamp - synack_stamp;
2881 tcp_ack_update_rtt(sk, FLAG_SYN_ACKED, seq_rtt, -1); 2882
2883 /* If the ACK acks both the SYNACK and the (Fast Open'd) data packets
2884 * sent in SYN_RECV, SYNACK RTT is the smooth RTT computed in tcp_ack()
2885 */
2886 if (!tp->srtt)
2887 tcp_ack_update_rtt(sk, FLAG_SYN_ACKED, seq_rtt, -1);
2882} 2888}
2883 2889
2884static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) 2890static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
@@ -2981,6 +2987,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
2981 s32 seq_rtt = -1; 2987 s32 seq_rtt = -1;
2982 s32 ca_seq_rtt = -1; 2988 s32 ca_seq_rtt = -1;
2983 ktime_t last_ackt = net_invalid_timestamp(); 2989 ktime_t last_ackt = net_invalid_timestamp();
2990 bool rtt_update;
2984 2991
2985 while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) { 2992 while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) {
2986 struct tcp_skb_cb *scb = TCP_SKB_CB(skb); 2993 struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
@@ -3057,14 +3064,13 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
3057 if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) 3064 if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
3058 flag |= FLAG_SACK_RENEGING; 3065 flag |= FLAG_SACK_RENEGING;
3059 3066
3060 if (tcp_ack_update_rtt(sk, flag, seq_rtt, sack_rtt) || 3067 rtt_update = tcp_ack_update_rtt(sk, flag, seq_rtt, sack_rtt);
3061 (flag & FLAG_ACKED))
3062 tcp_rearm_rto(sk);
3063 3068
3064 if (flag & FLAG_ACKED) { 3069 if (flag & FLAG_ACKED) {
3065 const struct tcp_congestion_ops *ca_ops 3070 const struct tcp_congestion_ops *ca_ops
3066 = inet_csk(sk)->icsk_ca_ops; 3071 = inet_csk(sk)->icsk_ca_ops;
3067 3072
3073 tcp_rearm_rto(sk);
3068 if (unlikely(icsk->icsk_mtup.probe_size && 3074 if (unlikely(icsk->icsk_mtup.probe_size &&
3069 !after(tp->mtu_probe.probe_seq_end, tp->snd_una))) { 3075 !after(tp->mtu_probe.probe_seq_end, tp->snd_una))) {
3070 tcp_mtup_probe_success(sk); 3076 tcp_mtup_probe_success(sk);
@@ -3103,6 +3109,13 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
3103 3109
3104 ca_ops->pkts_acked(sk, pkts_acked, rtt_us); 3110 ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
3105 } 3111 }
3112 } else if (skb && rtt_update && sack_rtt >= 0 &&
3113 sack_rtt > (s32)(now - TCP_SKB_CB(skb)->when)) {
3114 /* Do not re-arm RTO if the sack RTT is measured from data sent
3115 * after when the head was last (re)transmitted. Otherwise the
3116 * timeout may continue to extend in loss recovery.
3117 */
3118 tcp_rearm_rto(sk);
3106 } 3119 }
3107 3120
3108#if FASTRETRANS_DEBUG > 0 3121#if FASTRETRANS_DEBUG > 0
@@ -5587,6 +5600,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
5587 struct request_sock *req; 5600 struct request_sock *req;
5588 int queued = 0; 5601 int queued = 0;
5589 bool acceptable; 5602 bool acceptable;
5603 u32 synack_stamp;
5590 5604
5591 tp->rx_opt.saw_tstamp = 0; 5605 tp->rx_opt.saw_tstamp = 0;
5592 5606
@@ -5669,9 +5683,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
5669 * so release it. 5683 * so release it.
5670 */ 5684 */
5671 if (req) { 5685 if (req) {
5686 synack_stamp = tcp_rsk(req)->snt_synack;
5672 tp->total_retrans = req->num_retrans; 5687 tp->total_retrans = req->num_retrans;
5673 reqsk_fastopen_remove(sk, req, false); 5688 reqsk_fastopen_remove(sk, req, false);
5674 } else { 5689 } else {
5690 synack_stamp = tp->lsndtime;
5675 /* Make sure socket is routed, for correct metrics. */ 5691 /* Make sure socket is routed, for correct metrics. */
5676 icsk->icsk_af_ops->rebuild_header(sk); 5692 icsk->icsk_af_ops->rebuild_header(sk);
5677 tcp_init_congestion_control(sk); 5693 tcp_init_congestion_control(sk);
@@ -5694,7 +5710,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
5694 tp->snd_una = TCP_SKB_CB(skb)->ack_seq; 5710 tp->snd_una = TCP_SKB_CB(skb)->ack_seq;
5695 tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale; 5711 tp->snd_wnd = ntohs(th->window) << tp->rx_opt.snd_wscale;
5696 tcp_init_wl(tp, TCP_SKB_CB(skb)->seq); 5712 tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
5697 tcp_synack_rtt_meas(sk, req); 5713 tcp_synack_rtt_meas(sk, synack_stamp);
5698 5714
5699 if (tp->rx_opt.tstamp_ok) 5715 if (tp->rx_opt.tstamp_ok)
5700 tp->advmss -= TCPOLEN_TSTAMP_ALIGNED; 5716 tp->advmss -= TCPOLEN_TSTAMP_ALIGNED;
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
index 3a7525e6c086..533c58a5cfb7 100644
--- a/net/ipv4/tcp_offload.c
+++ b/net/ipv4/tcp_offload.c
@@ -18,6 +18,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
18 netdev_features_t features) 18 netdev_features_t features)
19{ 19{
20 struct sk_buff *segs = ERR_PTR(-EINVAL); 20 struct sk_buff *segs = ERR_PTR(-EINVAL);
21 unsigned int sum_truesize = 0;
21 struct tcphdr *th; 22 struct tcphdr *th;
22 unsigned int thlen; 23 unsigned int thlen;
23 unsigned int seq; 24 unsigned int seq;
@@ -102,13 +103,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
102 if (copy_destructor) { 103 if (copy_destructor) {
103 skb->destructor = gso_skb->destructor; 104 skb->destructor = gso_skb->destructor;
104 skb->sk = gso_skb->sk; 105 skb->sk = gso_skb->sk;
105 /* {tcp|sock}_wfree() use exact truesize accounting : 106 sum_truesize += skb->truesize;
106 * sum(skb->truesize) MUST be exactly be gso_skb->truesize
107 * So we account mss bytes of 'true size' for each segment.
108 * The last segment will contain the remaining.
109 */
110 skb->truesize = mss;
111 gso_skb->truesize -= mss;
112 } 107 }
113 skb = skb->next; 108 skb = skb->next;
114 th = tcp_hdr(skb); 109 th = tcp_hdr(skb);
@@ -125,7 +120,9 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
125 if (copy_destructor) { 120 if (copy_destructor) {
126 swap(gso_skb->sk, skb->sk); 121 swap(gso_skb->sk, skb->sk);
127 swap(gso_skb->destructor, skb->destructor); 122 swap(gso_skb->destructor, skb->destructor);
128 swap(gso_skb->truesize, skb->truesize); 123 sum_truesize += skb->truesize;
124 atomic_add(sum_truesize - gso_skb->truesize,
125 &skb->sk->sk_wmem_alloc);
129 } 126 }
130 127
131 delta = htonl(oldlen + (skb_tail_pointer(skb) - 128 delta = htonl(oldlen + (skb_tail_pointer(skb) -
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index ccde54248c8c..e1a63930a967 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -104,10 +104,14 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
104 const struct iphdr *iph = ip_hdr(skb); 104 const struct iphdr *iph = ip_hdr(skb);
105 u8 *xprth = skb_network_header(skb) + iph->ihl * 4; 105 u8 *xprth = skb_network_header(skb) + iph->ihl * 4;
106 struct flowi4 *fl4 = &fl->u.ip4; 106 struct flowi4 *fl4 = &fl->u.ip4;
107 int oif = 0;
108
109 if (skb_dst(skb))
110 oif = skb_dst(skb)->dev->ifindex;
107 111
108 memset(fl4, 0, sizeof(struct flowi4)); 112 memset(fl4, 0, sizeof(struct flowi4));
109 fl4->flowi4_mark = skb->mark; 113 fl4->flowi4_mark = skb->mark;
110 fl4->flowi4_oif = skb_dst(skb)->dev->ifindex; 114 fl4->flowi4_oif = reverse ? skb->skb_iif : oif;
111 115
112 if (!ip_is_fragment(iph)) { 116 if (!ip_is_fragment(iph)) {
113 switch (iph->protocol) { 117 switch (iph->protocol) {
@@ -236,7 +240,7 @@ static struct dst_ops xfrm4_dst_ops = {
236 .destroy = xfrm4_dst_destroy, 240 .destroy = xfrm4_dst_destroy,
237 .ifdown = xfrm4_dst_ifdown, 241 .ifdown = xfrm4_dst_ifdown,
238 .local_out = __ip_local_out, 242 .local_out = __ip_local_out,
239 .gc_thresh = 1024, 243 .gc_thresh = 32768,
240}; 244};
241 245
242static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { 246static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 44400c216dc6..710238f58aa9 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -349,6 +349,11 @@ ip6t_do_table(struct sk_buff *skb,
349 local_bh_disable(); 349 local_bh_disable();
350 addend = xt_write_recseq_begin(); 350 addend = xt_write_recseq_begin();
351 private = table->private; 351 private = table->private;
352 /*
353 * Ensure we load private-> members after we've fetched the base
354 * pointer.
355 */
356 smp_read_barrier_depends();
352 cpu = smp_processor_id(); 357 cpu = smp_processor_id();
353 table_base = private->entries[cpu]; 358 table_base = private->entries[cpu];
354 jumpstack = (struct ip6t_entry **)private->jumpstack[cpu]; 359 jumpstack = (struct ip6t_entry **)private->jumpstack[cpu];
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f54e3a101098..04e17b3309fb 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1087,10 +1087,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
1087 if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev))) 1087 if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev)))
1088 return NULL; 1088 return NULL;
1089 1089
1090 if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) 1090 if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
1091 return dst; 1091 return NULL;
1092 1092
1093 return NULL; 1093 if (rt6_check_expired(rt))
1094 return NULL;
1095
1096 return dst;
1094} 1097}
1095 1098
1096static struct dst_entry *ip6_negative_advice(struct dst_entry *dst) 1099static struct dst_entry *ip6_negative_advice(struct dst_entry *dst)
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 08ed2772b7aa..5f8e128c512d 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -135,10 +135,14 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
135 struct ipv6_opt_hdr *exthdr; 135 struct ipv6_opt_hdr *exthdr;
136 const unsigned char *nh = skb_network_header(skb); 136 const unsigned char *nh = skb_network_header(skb);
137 u8 nexthdr = nh[IP6CB(skb)->nhoff]; 137 u8 nexthdr = nh[IP6CB(skb)->nhoff];
138 int oif = 0;
139
140 if (skb_dst(skb))
141 oif = skb_dst(skb)->dev->ifindex;
138 142
139 memset(fl6, 0, sizeof(struct flowi6)); 143 memset(fl6, 0, sizeof(struct flowi6));
140 fl6->flowi6_mark = skb->mark; 144 fl6->flowi6_mark = skb->mark;
141 fl6->flowi6_oif = skb_dst(skb)->dev->ifindex; 145 fl6->flowi6_oif = reverse ? skb->skb_iif : oif;
142 146
143 fl6->daddr = reverse ? hdr->saddr : hdr->daddr; 147 fl6->daddr = reverse ? hdr->saddr : hdr->daddr;
144 fl6->saddr = reverse ? hdr->daddr : hdr->saddr; 148 fl6->saddr = reverse ? hdr->daddr : hdr->saddr;
@@ -285,7 +289,7 @@ static struct dst_ops xfrm6_dst_ops = {
285 .destroy = xfrm6_dst_destroy, 289 .destroy = xfrm6_dst_destroy,
286 .ifdown = xfrm6_dst_ifdown, 290 .ifdown = xfrm6_dst_ifdown,
287 .local_out = __ip6_local_out, 291 .local_out = __ip6_local_out,
288 .gc_thresh = 1024, 292 .gc_thresh = 32768,
289}; 293};
290 294
291static struct xfrm_policy_afinfo xfrm6_policy_afinfo = { 295static struct xfrm_policy_afinfo xfrm6_policy_afinfo = {
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 8b03028cca69..227aa11e8409 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -845,8 +845,13 @@ xt_replace_table(struct xt_table *table,
845 return NULL; 845 return NULL;
846 } 846 }
847 847
848 table->private = newinfo;
849 newinfo->initial_entries = private->initial_entries; 848 newinfo->initial_entries = private->initial_entries;
849 /*
850 * Ensure contents of newinfo are visible before assigning to
851 * private.
852 */
853 smp_wmb();
854 table->private = newinfo;
850 855
851 /* 856 /*
852 * Even though table entries have now been swapped, other CPU's 857 * Even though table entries have now been swapped, other CPU's
diff --git a/net/netfilter/xt_NFQUEUE.c b/net/netfilter/xt_NFQUEUE.c
index 1e2fae32f81b..ed00fef58996 100644
--- a/net/netfilter/xt_NFQUEUE.c
+++ b/net/netfilter/xt_NFQUEUE.c
@@ -147,6 +147,7 @@ nfqueue_tg_v3(struct sk_buff *skb, const struct xt_action_param *par)
147{ 147{
148 const struct xt_NFQ_info_v3 *info = par->targinfo; 148 const struct xt_NFQ_info_v3 *info = par->targinfo;
149 u32 queue = info->queuenum; 149 u32 queue = info->queuenum;
150 int ret;
150 151
151 if (info->queues_total > 1) { 152 if (info->queues_total > 1) {
152 if (info->flags & NFQ_FLAG_CPU_FANOUT) { 153 if (info->flags & NFQ_FLAG_CPU_FANOUT) {
@@ -157,7 +158,11 @@ nfqueue_tg_v3(struct sk_buff *skb, const struct xt_action_param *par)
157 queue = nfqueue_hash(skb, par); 158 queue = nfqueue_hash(skb, par);
158 } 159 }
159 160
160 return NF_QUEUE_NR(queue); 161 ret = NF_QUEUE_NR(queue);
162 if (info->flags & NFQ_FLAG_BYPASS)
163 ret |= NF_VERDICT_FLAG_QUEUE_BYPASS;
164
165 return ret;
161} 166}
162 167
163static struct xt_target nfqueue_tg_reg[] __read_mostly = { 168static struct xt_target nfqueue_tg_reg[] __read_mostly = {
diff --git a/net/openvswitch/dp_notify.c b/net/openvswitch/dp_notify.c
index c3235675f359..5c2dab276109 100644
--- a/net/openvswitch/dp_notify.c
+++ b/net/openvswitch/dp_notify.c
@@ -65,8 +65,7 @@ void ovs_dp_notify_wq(struct work_struct *work)
65 continue; 65 continue;
66 66
67 netdev_vport = netdev_vport_priv(vport); 67 netdev_vport = netdev_vport_priv(vport);
68 if (netdev_vport->dev->reg_state == NETREG_UNREGISTERED || 68 if (!(netdev_vport->dev->priv_flags & IFF_OVS_DATAPATH))
69 netdev_vport->dev->reg_state == NETREG_UNREGISTERING)
70 dp_detach_port_notify(vport); 69 dp_detach_port_notify(vport);
71 } 70 }
72 } 71 }
@@ -88,6 +87,10 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
88 return NOTIFY_DONE; 87 return NOTIFY_DONE;
89 88
90 if (event == NETDEV_UNREGISTER) { 89 if (event == NETDEV_UNREGISTER) {
90 /* upper_dev_unlink and decrement promisc immediately */
91 ovs_netdev_detach_dev(vport);
92
93 /* schedule vport destroy, dev_put and genl notification */
91 ovs_net = net_generic(dev_net(dev), ovs_net_id); 94 ovs_net = net_generic(dev_net(dev), ovs_net_id);
92 queue_work(system_wq, &ovs_net->dp_notify_work); 95 queue_work(system_wq, &ovs_net->dp_notify_work);
93 } 96 }
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 09d93c13cfd6..d21f77d875ba 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -150,15 +150,25 @@ static void free_port_rcu(struct rcu_head *rcu)
150 ovs_vport_free(vport_from_priv(netdev_vport)); 150 ovs_vport_free(vport_from_priv(netdev_vport));
151} 151}
152 152
153static void netdev_destroy(struct vport *vport) 153void ovs_netdev_detach_dev(struct vport *vport)
154{ 154{
155 struct netdev_vport *netdev_vport = netdev_vport_priv(vport); 155 struct netdev_vport *netdev_vport = netdev_vport_priv(vport);
156 156
157 rtnl_lock(); 157 ASSERT_RTNL();
158 netdev_vport->dev->priv_flags &= ~IFF_OVS_DATAPATH; 158 netdev_vport->dev->priv_flags &= ~IFF_OVS_DATAPATH;
159 netdev_rx_handler_unregister(netdev_vport->dev); 159 netdev_rx_handler_unregister(netdev_vport->dev);
160 netdev_upper_dev_unlink(netdev_vport->dev, get_dpdev(vport->dp)); 160 netdev_upper_dev_unlink(netdev_vport->dev,
161 netdev_master_upper_dev_get(netdev_vport->dev));
161 dev_set_promiscuity(netdev_vport->dev, -1); 162 dev_set_promiscuity(netdev_vport->dev, -1);
163}
164
165static void netdev_destroy(struct vport *vport)
166{
167 struct netdev_vport *netdev_vport = netdev_vport_priv(vport);
168
169 rtnl_lock();
170 if (netdev_vport->dev->priv_flags & IFF_OVS_DATAPATH)
171 ovs_netdev_detach_dev(vport);
162 rtnl_unlock(); 172 rtnl_unlock();
163 173
164 call_rcu(&netdev_vport->rcu, free_port_rcu); 174 call_rcu(&netdev_vport->rcu, free_port_rcu);
diff --git a/net/openvswitch/vport-netdev.h b/net/openvswitch/vport-netdev.h
index dd298b5c5cdb..8df01c1127e5 100644
--- a/net/openvswitch/vport-netdev.h
+++ b/net/openvswitch/vport-netdev.h
@@ -39,5 +39,6 @@ netdev_vport_priv(const struct vport *vport)
39} 39}
40 40
41const char *ovs_netdev_get_name(const struct vport *); 41const char *ovs_netdev_get_name(const struct vport *);
42void ovs_netdev_detach_dev(struct vport *);
42 43
43#endif /* vport_netdev.h */ 44#endif /* vport_netdev.h */
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index a9dfdda9ed1d..fdc041c57853 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -255,6 +255,7 @@ static struct fq_flow *fq_classify(struct sk_buff *skb, struct fq_sched_data *q)
255 f->socket_hash != sk->sk_hash)) { 255 f->socket_hash != sk->sk_hash)) {
256 f->credit = q->initial_quantum; 256 f->credit = q->initial_quantum;
257 f->socket_hash = sk->sk_hash; 257 f->socket_hash = sk->sk_hash;
258 f->time_next_packet = 0ULL;
258 } 259 }
259 return f; 260 return f;
260 } 261 }
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index e7b2d4fe2b6a..96a55910262c 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -279,7 +279,9 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
279 sctp_v6_to_addr(&dst_saddr, &fl6->saddr, htons(bp->port)); 279 sctp_v6_to_addr(&dst_saddr, &fl6->saddr, htons(bp->port));
280 rcu_read_lock(); 280 rcu_read_lock();
281 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 281 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
282 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) 282 if (!laddr->valid || laddr->state == SCTP_ADDR_DEL ||
283 (laddr->state != SCTP_ADDR_SRC &&
284 !asoc->src_out_of_asoc_ok))
283 continue; 285 continue;
284 286
285 /* Do not compare against v4 addrs */ 287 /* Do not compare against v4 addrs */
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 666c66842799..1a6eef39ab2f 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -860,7 +860,6 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
860 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK)) 860 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
861 return; 861 return;
862 862
863 BUG_ON(asoc->peer.primary_path == NULL);
864 sctp_unhash_established(asoc); 863 sctp_unhash_established(asoc);
865 sctp_association_free(asoc); 864 sctp_association_free(asoc);
866} 865}
diff --git a/net/x25/Kconfig b/net/x25/Kconfig
index c959312c45e3..e2fa133f9fba 100644
--- a/net/x25/Kconfig
+++ b/net/x25/Kconfig
@@ -16,8 +16,8 @@ config X25
16 if you want that) and the lower level data link layer protocol LAPB 16 if you want that) and the lower level data link layer protocol LAPB
17 (say Y to "LAPB Data Link Driver" below if you want that). 17 (say Y to "LAPB Data Link Driver" below if you want that).
18 18
19 You can read more about X.25 at <http://www.sangoma.com/x25.htm> and 19 You can read more about X.25 at <http://www.sangoma.com/tutorials/x25/> and
20 <http://www.cisco.com/univercd/cc/td/doc/product/software/ios11/cbook/cx25.htm>. 20 <http://docwiki.cisco.com/wiki/X.25>.
21 Information about X.25 for Linux is contained in the files 21 Information about X.25 for Linux is contained in the files
22 <file:Documentation/networking/x25.txt> and 22 <file:Documentation/networking/x25.txt> and
23 <file:Documentation/networking/x25-iface.txt>. 23 <file:Documentation/networking/x25-iface.txt>.
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index 2906d520eea7..3be02b680268 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -141,14 +141,14 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
141 const int plen = skb->len; 141 const int plen = skb->len;
142 int dlen = IPCOMP_SCRATCH_SIZE; 142 int dlen = IPCOMP_SCRATCH_SIZE;
143 u8 *start = skb->data; 143 u8 *start = skb->data;
144 const int cpu = get_cpu(); 144 struct crypto_comp *tfm;
145 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu); 145 u8 *scratch;
146 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
147 int err; 146 int err;
148 147
149 local_bh_disable(); 148 local_bh_disable();
149 scratch = *this_cpu_ptr(ipcomp_scratches);
150 tfm = *this_cpu_ptr(ipcd->tfms);
150 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); 151 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
151 local_bh_enable();
152 if (err) 152 if (err)
153 goto out; 153 goto out;
154 154
@@ -158,13 +158,13 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
158 } 158 }
159 159
160 memcpy(start + sizeof(struct ip_comp_hdr), scratch, dlen); 160 memcpy(start + sizeof(struct ip_comp_hdr), scratch, dlen);
161 put_cpu(); 161 local_bh_enable();
162 162
163 pskb_trim(skb, dlen + sizeof(struct ip_comp_hdr)); 163 pskb_trim(skb, dlen + sizeof(struct ip_comp_hdr));
164 return 0; 164 return 0;
165 165
166out: 166out:
167 put_cpu(); 167 local_bh_enable();
168 return err; 168 return err;
169} 169}
170 170