aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-25 14:17:34 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-25 14:17:34 -0500
commit4ba9920e5e9c0e16b5ed24292d45322907bb9035 (patch)
tree7d023baea59ed0886ded1f0b6d1c6385690b88f7 /include
parent82c477669a4665eb4e52030792051e0559ee2a36 (diff)
parent8b662fe70c68282f78482dc272df0c4f355e49f5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: 1) BPF debugger and asm tool by Daniel Borkmann. 2) Speed up create/bind in AF_PACKET, also from Daniel Borkmann. 3) Correct reciprocal_divide and update users, from Hannes Frederic Sowa and Daniel Borkmann. 4) Currently we only have a "set" operation for the hw timestamp socket ioctl, add a "get" operation to match. From Ben Hutchings. 5) Add better trace events for debugging driver datapath problems, also from Ben Hutchings. 6) Implement auto corking in TCP, from Eric Dumazet. Basically, if we have a small send and a previous packet is already in the qdisc or device queue, defer until TX completion or we get more data. 7) Allow userspace to manage ipv6 temporary addresses, from Jiri Pirko. 8) Add a qdisc bypass option for AF_PACKET sockets, from Daniel Borkmann. 9) Share IP header compression code between Bluetooth and IEEE802154 layers, from Jukka Rissanen. 10) Fix ipv6 router reachability probing, from Jiri Benc. 11) Allow packets to be captured on macvtap devices, from Vlad Yasevich. 12) Support tunneling in GRO layer, from Jerry Chu. 13) Allow bonding to be configured fully using netlink, from Scott Feldman. 14) Allow AF_PACKET users to obtain the VLAN TPID, just like they can already get the TCI. From Atzm Watanabe. 15) New "Heavy Hitter" qdisc, from Terry Lam. 16) Significantly improve the IPSEC support in pktgen, from Fan Du. 17) Allow ipv4 tunnels to cache routes, just like sockets. From Tom Herbert. 18) Add Proportional Integral Enhanced packet scheduler, from Vijay Subramanian. 19) Allow openvswitch to mmap'd netlink, from Thomas Graf. 20) Key TCP metrics blobs also by source address, not just destination address. From Christoph Paasch. 21) Support 10G in generic phylib. From Andy Fleming. 22) Try to short-circuit GRO flow compares using device provided RX hash, if provided. From Tom Herbert. The wireless and netfilter folks have been busy little bees too. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2064 commits) net/cxgb4: Fix referencing freed adapter ipv6: reallocate addrconf router for ipv6 address when lo device up fib_frontend: fix possible NULL pointer dereference rtnetlink: remove IFLA_BOND_SLAVE definition rtnetlink: remove check for fill_slave_info in rtnl_have_link_slave_info qlcnic: update version to 5.3.55 qlcnic: Enhance logic to calculate msix vectors. qlcnic: Refactor interrupt coalescing code for all adapters. qlcnic: Update poll controller code path qlcnic: Interrupt code cleanup qlcnic: Enhance Tx timeout debugging. qlcnic: Use bool for rx_mac_learn. bonding: fix u64 division rtnetlink: add missing IFLA_BOND_AD_INFO_UNSPEC sfc: Use the correct maximum TX DMA ring size for SFC9100 Add Shradha Shah as the sfc driver maintainer. net/vxlan: Share RX skb de-marking and checksum checks with ovs tulip: cleanup by using ARRAY_SIZE() ip_tunnel: clear IPCB in ip_tunnel_xmit() in case dst_link_failure() is called net/cxgb4: Don't retrieve stats during recovery ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/hash.h9
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/bcma/bcma.h9
-rw-r--r--include/linux/cgroup_subsys.h4
-rw-r--r--include/linux/etherdevice.h118
-rw-r--r--include/linux/filter.h5
-rw-r--r--include/linux/flex_array.h3
-rw-r--r--include/linux/hash.h36
-rw-r--r--include/linux/ieee80211.h10
-rw-r--r--include/linux/if_macvlan.h37
-rw-r--r--include/linux/if_tunnel.h9
-rw-r--r--include/linux/if_vlan.h38
-rw-r--r--include/linux/inet_lro.h23
-rw-r--r--include/linux/inetdevice.h14
-rw-r--r--include/linux/ipv6.h8
-rw-r--r--include/linux/kernel.h19
-rw-r--r--include/linux/mdio.h3
-rw-r--r--include/linux/mlx4/cmd.h1
-rw-r--r--include/linux/mlx4/cq.h5
-rw-r--r--include/linux/mlx4/device.h39
-rw-r--r--include/linux/mlx4/qp.h6
-rw-r--r--include/linux/mmc/sdio_ids.h9
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h156
-rw-r--r--include/linux/netfilter/ipset/ip_set.h1
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/of_mdio.h10
-rw-r--r--include/linux/phy.h116
-rw-r--r--include/linux/platform_data/eth-netx.h6
-rw-r--r--include/linux/platform_data/pn544.h3
-rw-r--r--include/linux/printk.h7
-rw-r--r--include/linux/random.h18
-rw-r--r--include/linux/reciprocal_div.h39
-rw-r--r--include/linux/sctp.h7
-rw-r--r--include/linux/sh_eth.h1
-rw-r--r--include/linux/skbuff.h229
-rw-r--r--include/linux/slab_def.h4
-rw-r--r--include/linux/socket.h16
-rw-r--r--include/linux/stmmac.h26
-rw-r--r--include/linux/tcp.h5
-rw-r--r--include/net/Space.h31
-rw-r--r--include/net/act_api.h63
-rw-r--r--include/net/addrconf.h16
-rw-r--r--include/net/arp.h1
-rw-r--r--include/net/bluetooth/bluetooth.h3
-rw-r--r--include/net/bluetooth/hci.h10
-rw-r--r--include/net/bluetooth/hci_core.h7
-rw-r--r--include/net/bluetooth/l2cap.h46
-rw-r--r--include/net/cfg80211.h323
-rw-r--r--include/net/cipso_ipv4.h5
-rw-r--r--include/net/cls_cgroup.h40
-rw-r--r--include/net/codel.h4
-rw-r--r--include/net/dcbevent.h3
-rw-r--r--include/net/dcbnl.h3
-rw-r--r--include/net/dn_dev.h2
-rw-r--r--include/net/dst.h5
-rw-r--r--include/net/flow.h3
-rw-r--r--include/net/genetlink.h4
-rw-r--r--include/net/gre.h3
-rw-r--r--include/net/if_inet6.h2
-rw-r--r--include/net/inet_timewait_sock.h6
-rw-r--r--include/net/inetpeer.h1
-rw-r--r--include/net/ip.h42
-rw-r--r--include/net/ip6_fib.h2
-rw-r--r--include/net/ip6_route.h34
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h10
-rw-r--r--include/net/ipv6.h26
-rw-r--r--include/net/irda/discovery.h4
-rw-r--r--include/net/irda/ircomm_core.h4
-rw-r--r--include/net/irda/ircomm_event.h4
-rw-r--r--include/net/irda/ircomm_lmp.h4
-rw-r--r--include/net/irda/ircomm_param.h4
-rw-r--r--include/net/irda/ircomm_ttp.h4
-rw-r--r--include/net/irda/ircomm_tty.h4
-rw-r--r--include/net/irda/ircomm_tty_attach.h4
-rw-r--r--include/net/irda/irda_device.h4
-rw-r--r--include/net/irda/irlap_event.h4
-rw-r--r--include/net/irda/irlap_frame.h4
-rw-r--r--include/net/irda/parameters.h4
-rw-r--r--include/net/irda/qos.h4
-rw-r--r--include/net/llc.h1
-rw-r--r--include/net/mac80211.h138
-rw-r--r--include/net/mip6.h3
-rw-r--r--include/net/neighbour.h83
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h2
-rw-r--r--include/net/netfilter/ipv4/nf_reject.h128
-rw-r--r--include/net/netfilter/ipv6/nf_reject.h171
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h1
-rw-r--r--include/net/netfilter/nf_queue.h62
-rw-r--r--include/net/netfilter/nf_tables.h47
-rw-r--r--include/net/netfilter/nf_tables_ipv4.h5
-rw-r--r--include/net/netfilter/nf_tables_ipv6.h3
-rw-r--r--include/net/netlabel.h3
-rw-r--r--include/net/netns/conntrack.h33
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/netns/ipv6.h2
-rw-r--r--include/net/netns/nftables.h1
-rw-r--r--include/net/netns/xfrm.h6
-rw-r--r--include/net/netprio_cgroup.h18
-rw-r--r--include/net/nfc/digital.h10
-rw-r--r--include/net/nfc/hci.h4
-rw-r--r--include/net/nfc/llc.h4
-rw-r--r--include/net/nfc/nci.h3
-rw-r--r--include/net/nfc/nci_core.h5
-rw-r--r--include/net/nfc/nfc.h4
-rw-r--r--include/net/ping.h16
-rw-r--r--include/net/pkt_cls.h67
-rw-r--r--include/net/pkt_sched.h1
-rw-r--r--include/net/protocol.h10
-rw-r--r--include/net/red.h5
-rw-r--r--include/net/regulatory.h84
-rw-r--r--include/net/route.h27
-rw-r--r--include/net/rtnetlink.h17
-rw-r--r--include/net/sch_generic.h4
-rw-r--r--include/net/sctp/auth.h5
-rw-r--r--include/net/sctp/checksum.h5
-rw-r--r--include/net/sctp/command.h5
-rw-r--r--include/net/sctp/constants.h5
-rw-r--r--include/net/sctp/sctp.h32
-rw-r--r--include/net/sctp/sm.h5
-rw-r--r--include/net/sctp/structs.h65
-rw-r--r--include/net/sctp/tsnmap.h5
-rw-r--r--include/net/sctp/ulpevent.h5
-rw-r--r--include/net/sctp/ulpqueue.h5
-rw-r--r--include/net/sock.h26
-rw-r--r--include/net/tc_act/tc_skbedit.h3
-rw-r--r--include/net/tcp.h11
-rw-r--r--include/net/transp_v6.h9
-rw-r--r--include/net/vxlan.h1
-rw-r--r--include/net/xfrm.h16
-rw-r--r--include/trace/events/net.h158
-rw-r--r--include/uapi/asm-generic/socket.h2
-rw-r--r--include/uapi/linux/if_addr.h6
-rw-r--r--include/uapi/linux/if_arp.h1
-rw-r--r--include/uapi/linux/if_link.h48
-rw-r--r--include/uapi/linux/if_packet.h29
-rw-r--r--include/uapi/linux/in6.h6
-rw-r--r--include/uapi/linux/net_tstamp.h16
-rw-r--r--include/uapi/linux/netconf.h1
-rw-r--r--include/uapi/linux/netfilter.h1
-rw-r--r--include/uapi/linux/netfilter/Kbuild3
-rw-r--r--include/uapi/linux/netfilter/nf_nat.h12
-rw-r--r--include/uapi/linux/netfilter/nf_tables.h30
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h5
-rw-r--r--include/uapi/linux/netfilter/xt_cgroup.h11
-rw-r--r--include/uapi/linux/netfilter/xt_ipcomp.h16
-rw-r--r--include/uapi/linux/netfilter/xt_l2tp.h27
-rw-r--r--include/uapi/linux/netfilter/xt_osf.h3
-rw-r--r--include/uapi/linux/nl80211.h129
-rw-r--r--include/uapi/linux/openvswitch.h14
-rw-r--r--include/uapi/linux/pci_regs.h5
-rw-r--r--include/uapi/linux/pkt_sched.h53
-rw-r--r--include/uapi/linux/sctp.h5
-rw-r--r--include/uapi/linux/snmp.h1
-rw-r--r--include/uapi/linux/sockios.h3
-rw-r--r--include/uapi/linux/tc_act/tc_ipt.h1
-rw-r--r--include/uapi/linux/tcp_metrics.h2
158 files changed, 2714 insertions, 852 deletions
diff --git a/include/asm-generic/hash.h b/include/asm-generic/hash.h
new file mode 100644
index 000000000000..b6312843dbd9
--- /dev/null
+++ b/include/asm-generic/hash.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_GENERIC_HASH_H
2#define __ASM_GENERIC_HASH_H
3
4struct fast_hash_ops;
5static inline void setup_arch_fast_hash(struct fast_hash_ops *ops)
6{
7}
8
9#endif /* __ASM_GENERIC_HASH_H */
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index fcdd81bd5314..8598f8eacb20 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -32,6 +32,8 @@ struct ath9k_platform_data {
32 u32 gpio_val; 32 u32 gpio_val;
33 33
34 bool is_clk_25mhz; 34 bool is_clk_25mhz;
35 bool tx_gain_buffalo;
36
35 int (*get_mac_revision)(void); 37 int (*get_mac_revision)(void);
36 int (*external_reset)(void); 38 int (*external_reset)(void);
37}; 39};
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 4d043c30216f..0b3bb16c705a 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -418,7 +418,14 @@ static inline void bcma_maskset16(struct bcma_device *cc,
418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); 418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
419} 419}
420 420
421extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid); 421extern struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
422 u8 unit);
423static inline struct bcma_device *bcma_find_core(struct bcma_bus *bus,
424 u16 coreid)
425{
426 return bcma_find_core_unit(bus, coreid, 0);
427}
428
422extern bool bcma_core_is_enabled(struct bcma_device *core); 429extern bool bcma_core_is_enabled(struct bcma_device *core);
423extern void bcma_core_disable(struct bcma_device *core, u32 flags); 430extern void bcma_core_disable(struct bcma_device *core, u32 flags);
424extern int bcma_core_enable(struct bcma_device *core, u32 flags); 431extern int bcma_core_enable(struct bcma_device *core, u32 flags);
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index b613ffd402d1..7b99d717411d 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -31,7 +31,7 @@ SUBSYS(devices)
31SUBSYS(freezer) 31SUBSYS(freezer)
32#endif 32#endif
33 33
34#if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) 34#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_CLASSID)
35SUBSYS(net_cls) 35SUBSYS(net_cls)
36#endif 36#endif
37 37
@@ -43,7 +43,7 @@ SUBSYS(blkio)
43SUBSYS(perf) 43SUBSYS(perf)
44#endif 44#endif
45 45
46#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) 46#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_PRIO)
47SUBSYS(net_prio) 47SUBSYS(net_prio)
48#endif 48#endif
49 49
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index fc4a9aa7dd82..9c5529dc6d07 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -26,6 +26,7 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/random.h> 27#include <linux/random.h>
28#include <asm/unaligned.h> 28#include <asm/unaligned.h>
29#include <asm/bitsperlong.h>
29 30
30#ifdef __KERNEL__ 31#ifdef __KERNEL__
31__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); 32__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
@@ -60,6 +61,8 @@ static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
60 * 61 *
61 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per 62 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
62 * IEEE 802.1Q 8.6.3 Frame filtering. 63 * IEEE 802.1Q 8.6.3 Frame filtering.
64 *
65 * Please note: addr must be aligned to u16.
63 */ 66 */
64static inline bool is_link_local_ether_addr(const u8 *addr) 67static inline bool is_link_local_ether_addr(const u8 *addr)
65{ 68{
@@ -67,7 +70,12 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
67 static const __be16 *b = (const __be16 *)eth_reserved_addr_base; 70 static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
68 static const __be16 m = cpu_to_be16(0xfff0); 71 static const __be16 m = cpu_to_be16(0xfff0);
69 72
73#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
74 return (((*(const u32 *)addr) ^ (*(const u32 *)b)) |
75 ((a[2] ^ b[2]) & m)) == 0;
76#else
70 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; 77 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
78#endif
71} 79}
72 80
73/** 81/**
@@ -75,10 +83,18 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
75 * @addr: Pointer to a six-byte array containing the Ethernet address 83 * @addr: Pointer to a six-byte array containing the Ethernet address
76 * 84 *
77 * Return true if the address is all zeroes. 85 * Return true if the address is all zeroes.
86 *
87 * Please note: addr must be aligned to u16.
78 */ 88 */
79static inline bool is_zero_ether_addr(const u8 *addr) 89static inline bool is_zero_ether_addr(const u8 *addr)
80{ 90{
81 return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); 91#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
92 return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0;
93#else
94 return (*(const u16 *)(addr + 0) |
95 *(const u16 *)(addr + 2) |
96 *(const u16 *)(addr + 4)) == 0;
97#endif
82} 98}
83 99
84/** 100/**
@@ -109,10 +125,14 @@ static inline bool is_local_ether_addr(const u8 *addr)
109 * @addr: Pointer to a six-byte array containing the Ethernet address 125 * @addr: Pointer to a six-byte array containing the Ethernet address
110 * 126 *
111 * Return true if the address is the broadcast address. 127 * Return true if the address is the broadcast address.
128 *
129 * Please note: addr must be aligned to u16.
112 */ 130 */
113static inline bool is_broadcast_ether_addr(const u8 *addr) 131static inline bool is_broadcast_ether_addr(const u8 *addr)
114{ 132{
115 return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; 133 return (*(const u16 *)(addr + 0) &
134 *(const u16 *)(addr + 2) &
135 *(const u16 *)(addr + 4)) == 0xffff;
116} 136}
117 137
118/** 138/**
@@ -134,6 +154,8 @@ static inline bool is_unicast_ether_addr(const u8 *addr)
134 * a multicast address, and is not FF:FF:FF:FF:FF:FF. 154 * a multicast address, and is not FF:FF:FF:FF:FF:FF.
135 * 155 *
136 * Return true if the address is valid. 156 * Return true if the address is valid.
157 *
158 * Please note: addr must be aligned to u16.
137 */ 159 */
138static inline bool is_valid_ether_addr(const u8 *addr) 160static inline bool is_valid_ether_addr(const u8 *addr)
139{ 161{
@@ -196,6 +218,28 @@ static inline void eth_hw_addr_random(struct net_device *dev)
196} 218}
197 219
198/** 220/**
221 * ether_addr_copy - Copy an Ethernet address
222 * @dst: Pointer to a six-byte array Ethernet address destination
223 * @src: Pointer to a six-byte array Ethernet address source
224 *
225 * Please note: dst & src must both be aligned to u16.
226 */
227static inline void ether_addr_copy(u8 *dst, const u8 *src)
228{
229#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
230 *(u32 *)dst = *(const u32 *)src;
231 *(u16 *)(dst + 4) = *(const u16 *)(src + 4);
232#else
233 u16 *a = (u16 *)dst;
234 const u16 *b = (const u16 *)src;
235
236 a[0] = b[0];
237 a[1] = b[1];
238 a[2] = b[2];
239#endif
240}
241
242/**
199 * eth_hw_addr_inherit - Copy dev_addr from another net_device 243 * eth_hw_addr_inherit - Copy dev_addr from another net_device
200 * @dst: pointer to net_device to copy dev_addr to 244 * @dst: pointer to net_device to copy dev_addr to
201 * @src: pointer to net_device to copy dev_addr from 245 * @src: pointer to net_device to copy dev_addr from
@@ -207,24 +251,7 @@ static inline void eth_hw_addr_inherit(struct net_device *dst,
207 struct net_device *src) 251 struct net_device *src)
208{ 252{
209 dst->addr_assign_type = src->addr_assign_type; 253 dst->addr_assign_type = src->addr_assign_type;
210 memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN); 254 ether_addr_copy(dst->dev_addr, src->dev_addr);
211}
212
213/**
214 * compare_ether_addr - Compare two Ethernet addresses
215 * @addr1: Pointer to a six-byte array containing the Ethernet address
216 * @addr2: Pointer other six-byte array containing the Ethernet address
217 *
218 * Compare two Ethernet addresses, returns 0 if equal, non-zero otherwise.
219 * Unlike memcmp(), it doesn't return a value suitable for sorting.
220 */
221static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
222{
223 const u16 *a = (const u16 *) addr1;
224 const u16 *b = (const u16 *) addr2;
225
226 BUILD_BUG_ON(ETH_ALEN != 6);
227 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
228} 255}
229 256
230/** 257/**
@@ -233,18 +260,21 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
233 * @addr2: Pointer other six-byte array containing the Ethernet address 260 * @addr2: Pointer other six-byte array containing the Ethernet address
234 * 261 *
235 * Compare two Ethernet addresses, returns true if equal 262 * Compare two Ethernet addresses, returns true if equal
263 *
264 * Please note: addr1 & addr2 must both be aligned to u16.
236 */ 265 */
237static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) 266static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
238{ 267{
239 return !compare_ether_addr(addr1, addr2); 268#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
240} 269 u32 fold = ((*(const u32 *)addr1) ^ (*(const u32 *)addr2)) |
270 ((*(const u16 *)(addr1 + 4)) ^ (*(const u16 *)(addr2 + 4)));
241 271
242static inline unsigned long zap_last_2bytes(unsigned long value) 272 return fold == 0;
243{
244#ifdef __BIG_ENDIAN
245 return value >> 16;
246#else 273#else
247 return value << 16; 274 const u16 *a = (const u16 *)addr1;
275 const u16 *b = (const u16 *)addr2;
276
277 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0;
248#endif 278#endif
249} 279}
250 280
@@ -265,22 +295,38 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
265static inline bool ether_addr_equal_64bits(const u8 addr1[6+2], 295static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
266 const u8 addr2[6+2]) 296 const u8 addr2[6+2])
267{ 297{
268#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 298#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
269 unsigned long fold = ((*(unsigned long *)addr1) ^ 299 u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2);
270 (*(unsigned long *)addr2));
271
272 if (sizeof(fold) == 8)
273 return zap_last_2bytes(fold) == 0;
274 300
275 fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^ 301#ifdef __BIG_ENDIAN
276 (*(unsigned long *)(addr2 + 4))); 302 return (fold >> 16) == 0;
277 return fold == 0; 303#else
304 return (fold << 16) == 0;
305#endif
278#else 306#else
279 return ether_addr_equal(addr1, addr2); 307 return ether_addr_equal(addr1, addr2);
280#endif 308#endif
281} 309}
282 310
283/** 311/**
312 * ether_addr_equal_unaligned - Compare two not u16 aligned Ethernet addresses
313 * @addr1: Pointer to a six-byte array containing the Ethernet address
314 * @addr2: Pointer other six-byte array containing the Ethernet address
315 *
316 * Compare two Ethernet addresses, returns true if equal
317 *
318 * Please note: Use only when any Ethernet address may not be u16 aligned.
319 */
320static inline bool ether_addr_equal_unaligned(const u8 *addr1, const u8 *addr2)
321{
322#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
323 return ether_addr_equal(addr1, addr2);
324#else
325 return memcmp(addr1, addr2, ETH_ALEN) == 0;
326#endif
327}
328
329/**
284 * is_etherdev_addr - Tell if given Ethernet address belongs to the device. 330 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
285 * @dev: Pointer to a device structure 331 * @dev: Pointer to a device structure
286 * @addr: Pointer to a six-byte array containing the Ethernet address 332 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/filter.h b/include/linux/filter.h
index ff4e40cd45b1..e568c8ef896b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -83,6 +83,11 @@ static inline void bpf_jit_free(struct sk_filter *fp)
83#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) 83#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns)
84#endif 84#endif
85 85
86static inline int bpf_tell_extensions(void)
87{
88 return SKF_AD_MAX;
89}
90
86enum { 91enum {
87 BPF_S_RET_K = 1, 92 BPF_S_RET_K = 1,
88 BPF_S_RET_A, 93 BPF_S_RET_A,
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
index 6843cf193a44..b6efb0c64408 100644
--- a/include/linux/flex_array.h
+++ b/include/linux/flex_array.h
@@ -2,6 +2,7 @@
2#define _FLEX_ARRAY_H 2#define _FLEX_ARRAY_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/reciprocal_div.h>
5#include <asm/page.h> 6#include <asm/page.h>
6 7
7#define FLEX_ARRAY_PART_SIZE PAGE_SIZE 8#define FLEX_ARRAY_PART_SIZE PAGE_SIZE
@@ -22,7 +23,7 @@ struct flex_array {
22 int element_size; 23 int element_size;
23 int total_nr_elements; 24 int total_nr_elements;
24 int elems_per_part; 25 int elems_per_part;
25 u32 reciprocal_elems; 26 struct reciprocal_value reciprocal_elems;
26 struct flex_array_part *parts[]; 27 struct flex_array_part *parts[];
27 }; 28 };
28 /* 29 /*
diff --git a/include/linux/hash.h b/include/linux/hash.h
index f09a0ae4d858..bd1754c7ecef 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/hash.h>
18#include <linux/compiler.h> 19#include <linux/compiler.h>
19 20
20/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 21/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
@@ -78,4 +79,39 @@ static inline u32 hash32_ptr(const void *ptr)
78#endif 79#endif
79 return (u32)val; 80 return (u32)val;
80} 81}
82
83struct fast_hash_ops {
84 u32 (*hash)(const void *data, u32 len, u32 seed);
85 u32 (*hash2)(const u32 *data, u32 len, u32 seed);
86};
87
88/**
89 * arch_fast_hash - Caclulates a hash over a given buffer that can have
90 * arbitrary size. This function will eventually use an
91 * architecture-optimized hashing implementation if
92 * available, and trades off distribution for speed.
93 *
94 * @data: buffer to hash
95 * @len: length of buffer in bytes
96 * @seed: start seed
97 *
98 * Returns 32bit hash.
99 */
100extern u32 arch_fast_hash(const void *data, u32 len, u32 seed);
101
102/**
103 * arch_fast_hash2 - Caclulates a hash over a given buffer that has a
104 * size that is of a multiple of 32bit words. This
105 * function will eventually use an architecture-
106 * optimized hashing implementation if available,
107 * and trades off distribution for speed.
108 *
109 * @data: buffer to hash (must be 32bit padded)
110 * @len: number of 32bit words
111 * @seed: start seed
112 *
113 * Returns 32bit hash.
114 */
115extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed);
116
81#endif /* _LINUX_HASH_H */ 117#endif /* _LINUX_HASH_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8c3b26a21574..e526a8cecb70 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1411,8 +1411,12 @@ struct ieee80211_vht_operation {
1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700
1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MAX 0x0000e000 1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13
1415#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00070000 1415#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK \
1416 (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT)
1417#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16
1418#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \
1419 (7 << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT)
1416#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1420#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1417#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1421#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1418#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1422#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
@@ -1853,6 +1857,7 @@ enum ieee80211_key_len {
1853 WLAN_KEY_LEN_CCMP = 16, 1857 WLAN_KEY_LEN_CCMP = 16,
1854 WLAN_KEY_LEN_TKIP = 32, 1858 WLAN_KEY_LEN_TKIP = 32,
1855 WLAN_KEY_LEN_AES_CMAC = 16, 1859 WLAN_KEY_LEN_AES_CMAC = 16,
1860 WLAN_KEY_LEN_SMS4 = 32,
1856}; 1861};
1857 1862
1858#define IEEE80211_WEP_IV_LEN 4 1863#define IEEE80211_WEP_IV_LEN 4
@@ -1898,6 +1903,7 @@ enum ieee80211_tdls_actioncode {
1898#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) 1903#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1899 1904
1900#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) 1905#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
1906#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(7)
1901 1907
1902/* TDLS specific payload type in the LLC/SNAP header */ 1908/* TDLS specific payload type in the LLC/SNAP header */
1903#define WLAN_TDLS_SNAP_RFTYPE 0x2 1909#define WLAN_TDLS_SNAP_RFTYPE 0x2
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 84ba5ac39e03..7c8b20b120ea 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -2,6 +2,7 @@
2#define _LINUX_IF_MACVLAN_H 2#define _LINUX_IF_MACVLAN_H
3 3
4#include <linux/if_link.h> 4#include <linux/if_link.h>
5#include <linux/if_vlan.h>
5#include <linux/list.h> 6#include <linux/list.h>
6#include <linux/netdevice.h> 7#include <linux/netdevice.h>
7#include <linux/netlink.h> 8#include <linux/netlink.h>
@@ -24,28 +25,6 @@ static inline struct socket *macvtap_get_socket(struct file *f)
24struct macvlan_port; 25struct macvlan_port;
25struct macvtap_queue; 26struct macvtap_queue;
26 27
27/**
28 * struct macvlan_pcpu_stats - MACVLAN percpu stats
29 * @rx_packets: number of received packets
30 * @rx_bytes: number of received bytes
31 * @rx_multicast: number of received multicast packets
32 * @tx_packets: number of transmitted packets
33 * @tx_bytes: number of transmitted bytes
34 * @syncp: synchronization point for 64bit counters
35 * @rx_errors: number of rx errors
36 * @tx_dropped: number of tx dropped packets
37 */
38struct macvlan_pcpu_stats {
39 u64 rx_packets;
40 u64 rx_bytes;
41 u64 rx_multicast;
42 u64 tx_packets;
43 u64 tx_bytes;
44 struct u64_stats_sync syncp;
45 u32 rx_errors;
46 u32 tx_dropped;
47};
48
49/* 28/*
50 * Maximum times a macvtap device can be opened. This can be used to 29 * Maximum times a macvtap device can be opened. This can be used to
51 * configure the number of receive queue, e.g. for multiqueue virtio. 30 * configure the number of receive queue, e.g. for multiqueue virtio.
@@ -62,15 +41,13 @@ struct macvlan_dev {
62 struct macvlan_port *port; 41 struct macvlan_port *port;
63 struct net_device *lowerdev; 42 struct net_device *lowerdev;
64 void *fwd_priv; 43 void *fwd_priv;
65 struct macvlan_pcpu_stats __percpu *pcpu_stats; 44 struct vlan_pcpu_stats __percpu *pcpu_stats;
66 45
67 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); 46 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ);
68 47
69 netdev_features_t set_features; 48 netdev_features_t set_features;
70 enum macvlan_mode mode; 49 enum macvlan_mode mode;
71 u16 flags; 50 u16 flags;
72 int (*receive)(struct sk_buff *skb);
73 int (*forward)(struct net_device *dev, struct sk_buff *skb);
74 /* This array tracks active taps. */ 51 /* This array tracks active taps. */
75 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; 52 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES];
76 /* This list tracks all taps (both enabled and disabled) */ 53 /* This list tracks all taps (both enabled and disabled) */
@@ -86,7 +63,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
86 bool multicast) 63 bool multicast)
87{ 64{
88 if (likely(success)) { 65 if (likely(success)) {
89 struct macvlan_pcpu_stats *pcpu_stats; 66 struct vlan_pcpu_stats *pcpu_stats;
90 67
91 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); 68 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
92 u64_stats_update_begin(&pcpu_stats->syncp); 69 u64_stats_update_begin(&pcpu_stats->syncp);
@@ -103,10 +80,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
103extern void macvlan_common_setup(struct net_device *dev); 80extern void macvlan_common_setup(struct net_device *dev);
104 81
105extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, 82extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
106 struct nlattr *tb[], struct nlattr *data[], 83 struct nlattr *tb[], struct nlattr *data[]);
107 int (*receive)(struct sk_buff *skb),
108 int (*forward)(struct net_device *dev,
109 struct sk_buff *skb));
110 84
111extern void macvlan_count_rx(const struct macvlan_dev *vlan, 85extern void macvlan_count_rx(const struct macvlan_dev *vlan,
112 unsigned int len, bool success, 86 unsigned int len, bool success,
@@ -116,9 +90,6 @@ extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
116 90
117extern int macvlan_link_register(struct rtnl_link_ops *ops); 91extern int macvlan_link_register(struct rtnl_link_ops *ops);
118 92
119extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
120 struct net_device *dev);
121
122#if IS_ENABLED(CONFIG_MACVLAN) 93#if IS_ENABLED(CONFIG_MACVLAN)
123static inline struct net_device * 94static inline struct net_device *
124macvlan_dev_real_dev(const struct net_device *dev) 95macvlan_dev_real_dev(const struct net_device *dev)
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index f4e56ecd0b1a..712710bc0580 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -13,13 +13,4 @@
13#define for_each_ip_tunnel_rcu(pos, start) \ 13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) 14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15 15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
24
25#endif /* _IF_TUNNEL_H_ */ 16#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index f252deb99454..bbedfb56bd66 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -82,25 +82,6 @@ static inline int is_vlan_dev(struct net_device *dev)
82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) 83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK)
84 84
85#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
86
87extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
88 __be16 vlan_proto, u16 vlan_id);
89extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
90extern u16 vlan_dev_vlan_id(const struct net_device *dev);
91
92/**
93 * struct vlan_priority_tci_mapping - vlan egress priority mappings
94 * @priority: skb priority
95 * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
96 * @next: pointer to next struct
97 */
98struct vlan_priority_tci_mapping {
99 u32 priority;
100 u16 vlan_qos;
101 struct vlan_priority_tci_mapping *next;
102};
103
104/** 85/**
105 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats 86 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats
106 * @rx_packets: number of received packets 87 * @rx_packets: number of received packets
@@ -123,6 +104,25 @@ struct vlan_pcpu_stats {
123 u32 tx_dropped; 104 u32 tx_dropped;
124}; 105};
125 106
107#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
108
109extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
110 __be16 vlan_proto, u16 vlan_id);
111extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
112extern u16 vlan_dev_vlan_id(const struct net_device *dev);
113
114/**
115 * struct vlan_priority_tci_mapping - vlan egress priority mappings
116 * @priority: skb priority
117 * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
118 * @next: pointer to next struct
119 */
120struct vlan_priority_tci_mapping {
121 u32 priority;
122 u16 vlan_qos;
123 struct vlan_priority_tci_mapping *next;
124};
125
126struct proc_dir_entry; 126struct proc_dir_entry;
127struct netpoll; 127struct netpoll;
128 128
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index 2cf55afbcd4e..9a715cfa1fe3 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -133,33 +133,10 @@ struct net_lro_mgr {
133void lro_receive_skb(struct net_lro_mgr *lro_mgr, 133void lro_receive_skb(struct net_lro_mgr *lro_mgr,
134 struct sk_buff *skb, 134 struct sk_buff *skb,
135 void *priv); 135 void *priv);
136
137/*
138 * Processes a fragment list
139 *
140 * This functions aggregate fragments and generate SKBs do pass
141 * the packets to the stack.
142 *
143 * @lro_mgr: LRO manager to use
144 * @frags: Fragment to be processed. Must contain entire header in first
145 * element.
146 * @len: Length of received data
147 * @true_size: Actual size of memory the fragment is consuming
148 * @priv: Private data that may be used by driver functions
149 * (for example get_tcp_ip_hdr)
150 */
151
152void lro_receive_frags(struct net_lro_mgr *lro_mgr,
153 struct skb_frag_struct *frags,
154 int len, int true_size, void *priv, __wsum sum);
155
156/* 136/*
157 * Forward all aggregated SKBs held by lro_mgr to network stack 137 * Forward all aggregated SKBs held by lro_mgr to network stack
158 */ 138 */
159 139
160void lro_flush_all(struct net_lro_mgr *lro_mgr); 140void lro_flush_all(struct net_lro_mgr *lro_mgr);
161 141
162void lro_flush_pkt(struct net_lro_mgr *lro_mgr,
163 struct iphdr *iph, struct tcphdr *tcph);
164
165#endif 142#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 0d678aefe69d..0068708161ff 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -136,8 +136,8 @@ struct in_ifaddr {
136 __be32 ifa_mask; 136 __be32 ifa_mask;
137 __be32 ifa_broadcast; 137 __be32 ifa_broadcast;
138 unsigned char ifa_scope; 138 unsigned char ifa_scope;
139 unsigned char ifa_flags;
140 unsigned char ifa_prefixlen; 139 unsigned char ifa_prefixlen;
140 __u32 ifa_flags;
141 char ifa_label[IFNAMSIZ]; 141 char ifa_label[IFNAMSIZ];
142 142
143 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ 143 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
@@ -164,11 +164,10 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
164void devinet_init(void); 164void devinet_init(void);
165struct in_device *inetdev_by_index(struct net *, int); 165struct in_device *inetdev_by_index(struct net *, int);
166__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); 166__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
167__be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, 167__be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst,
168 int scope); 168 __be32 local, int scope);
169struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, 169struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
170 __be32 mask); 170 __be32 mask);
171
172static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) 171static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
173{ 172{
174 return !((addr^ifa->ifa_address)&ifa->ifa_mask); 173 return !((addr^ifa->ifa_address)&ifa->ifa_mask);
@@ -220,6 +219,13 @@ static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
220 return rtnl_dereference(dev->ip_ptr); 219 return rtnl_dereference(dev->ip_ptr);
221} 220}
222 221
222static inline struct neigh_parms *__in_dev_arp_parms_get_rcu(const struct net_device *dev)
223{
224 struct in_device *in_dev = __in_dev_get_rcu(dev);
225
226 return in_dev ? in_dev->arp_parms : NULL;
227}
228
223void in_dev_finish_destroy(struct in_device *idev); 229void in_dev_finish_destroy(struct in_device *idev);
224 230
225static inline void in_dev_put(struct in_device *idev) 231static inline void in_dev_put(struct in_device *idev)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c56c350324e4..2faef339d8f2 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -191,7 +191,8 @@ struct ipv6_pinfo {
191 /* sockopt flags */ 191 /* sockopt flags */
192 __u16 recverr:1, 192 __u16 recverr:1,
193 sndflow:1, 193 sndflow:1,
194 pmtudisc:2, 194 repflow:1,
195 pmtudisc:3,
195 ipv6only:1, 196 ipv6only:1,
196 srcprefs:3, /* 001: prefer temporary address 197 srcprefs:3, /* 001: prefer temporary address
197 * 010: prefer public address 198 * 010: prefer public address
@@ -200,7 +201,7 @@ struct ipv6_pinfo {
200 dontfrag:1; 201 dontfrag:1;
201 __u8 min_hopcount; 202 __u8 min_hopcount;
202 __u8 tclass; 203 __u8 tclass;
203 __u8 rcv_tclass; 204 __be32 rcv_flowinfo;
204 205
205 __u32 dst_cookie; 206 __u32 dst_cookie;
206 __u32 rx_dst_cookie; 207 __u32 rx_dst_cookie;
@@ -283,6 +284,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
283 284
284#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 285#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
285#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 286#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
287#define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \
288 inet6_sk(sk)->rxopt.bits.rxinfo)
286 289
287static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) 290static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk)
288{ 291{
@@ -299,6 +302,7 @@ static inline int inet_v6_ipv6only(const struct sock *sk)
299#else 302#else
300#define __ipv6_only_sock(sk) 0 303#define __ipv6_only_sock(sk) 0
301#define ipv6_only_sock(sk) 0 304#define ipv6_only_sock(sk) 0
305#define ipv6_sk_rxinfo(sk) 0
302 306
303static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 307static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
304{ 308{
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f74bb581ab64..196d1ea86df0 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -206,6 +206,25 @@ extern int _cond_resched(void);
206 (__x < 0) ? -__x : __x; \ 206 (__x < 0) ? -__x : __x; \
207 }) 207 })
208 208
209/**
210 * reciprocal_scale - "scale" a value into range [0, ep_ro)
211 * @val: value
212 * @ep_ro: right open interval endpoint
213 *
214 * Perform a "reciprocal multiplication" in order to "scale" a value into
215 * range [0, ep_ro), where the upper interval endpoint is right-open.
216 * This is useful, e.g. for accessing a index of an array containing
217 * ep_ro elements, for example. Think of it as sort of modulus, only that
218 * the result isn't that of modulo. ;) Note that if initial input is a
219 * small value, then result will return 0.
220 *
221 * Return: a result based on val in interval [0, ep_ro).
222 */
223static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
224{
225 return (u32)(((u64) val * ep_ro) >> 32);
226}
227
209#if defined(CONFIG_MMU) && \ 228#if defined(CONFIG_MMU) && \
210 (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) 229 (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP))
211void might_fault(void); 230void might_fault(void);
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 3d15c838116c..b42963bc81dd 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -70,9 +70,6 @@ extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
70extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, 70extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
71 struct ethtool_cmd *ecmd, 71 struct ethtool_cmd *ecmd,
72 u32 npage_adv, u32 npage_lpa); 72 u32 npage_adv, u32 npage_lpa);
73extern void
74mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
75 const struct ethtool_pauseparam *ecmd);
76 73
77/** 74/**
78 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET 75 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index ff36620f88a7..79a347238168 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -181,6 +181,7 @@ enum {
181 MLX4_SET_PORT_GID_TABLE = 0x5, 181 MLX4_SET_PORT_GID_TABLE = 0x5,
182 MLX4_SET_PORT_PRIO2TC = 0x8, 182 MLX4_SET_PORT_PRIO2TC = 0x8,
183 MLX4_SET_PORT_SCHEDULER = 0x9, 183 MLX4_SET_PORT_SCHEDULER = 0x9,
184 MLX4_SET_PORT_VXLAN = 0xB
184}; 185};
185 186
186enum { 187enum {
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h
index e1862997f933..e7ecc12a1163 100644
--- a/include/linux/mlx4/cq.h
+++ b/include/linux/mlx4/cq.h
@@ -87,7 +87,12 @@ struct mlx4_ts_cqe {
87} __packed; 87} __packed;
88 88
89enum { 89enum {
90 MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31,
90 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, 91 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29,
92 MLX4_CQE_L2_TUNNEL = 1 << 27,
93 MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26,
94 MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25,
95
91 MLX4_CQE_QPN_MASK = 0xffffff, 96 MLX4_CQE_QPN_MASK = 0xffffff,
92 MLX4_CQE_VID_MASK = 0xfff, 97 MLX4_CQE_VID_MASK = 0xfff,
93}; 98};
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index ac5cb1d92487..5edd2c68274d 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -119,6 +119,11 @@ static inline const char *mlx4_steering_mode_str(int steering_mode)
119} 119}
120 120
121enum { 121enum {
122 MLX4_TUNNEL_OFFLOAD_MODE_NONE,
123 MLX4_TUNNEL_OFFLOAD_MODE_VXLAN
124};
125
126enum {
122 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 127 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
123 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 128 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
124 MLX4_DEV_CAP_FLAG_UD = 1LL << 2, 129 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
@@ -161,7 +166,8 @@ enum {
161 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, 166 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6,
162 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, 167 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7,
163 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8, 168 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8,
164 MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9 169 MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9,
170 MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10,
165}; 171};
166 172
167enum { 173enum {
@@ -455,6 +461,8 @@ struct mlx4_caps {
455 u32 userspace_caps; /* userspace must be aware of these */ 461 u32 userspace_caps; /* userspace must be aware of these */
456 u32 function_caps; /* VFs must be aware of these */ 462 u32 function_caps; /* VFs must be aware of these */
457 u16 hca_core_clock; 463 u16 hca_core_clock;
464 u64 phys_port_id[MLX4_MAX_PORTS + 1];
465 int tunnel_offload_mode;
458}; 466};
459 467
460struct mlx4_buf_list { 468struct mlx4_buf_list {
@@ -909,6 +917,7 @@ enum mlx4_net_trans_rule_id {
909 MLX4_NET_TRANS_RULE_ID_IPV4, 917 MLX4_NET_TRANS_RULE_ID_IPV4,
910 MLX4_NET_TRANS_RULE_ID_TCP, 918 MLX4_NET_TRANS_RULE_ID_TCP,
911 MLX4_NET_TRANS_RULE_ID_UDP, 919 MLX4_NET_TRANS_RULE_ID_UDP,
920 MLX4_NET_TRANS_RULE_ID_VXLAN,
912 MLX4_NET_TRANS_RULE_NUM, /* should be last */ 921 MLX4_NET_TRANS_RULE_NUM, /* should be last */
913}; 922};
914 923
@@ -966,6 +975,12 @@ struct mlx4_spec_ib {
966 u8 dst_gid_msk[16]; 975 u8 dst_gid_msk[16];
967}; 976};
968 977
978struct mlx4_spec_vxlan {
979 __be32 vni;
980 __be32 vni_mask;
981
982};
983
969struct mlx4_spec_list { 984struct mlx4_spec_list {
970 struct list_head list; 985 struct list_head list;
971 enum mlx4_net_trans_rule_id id; 986 enum mlx4_net_trans_rule_id id;
@@ -974,6 +989,7 @@ struct mlx4_spec_list {
974 struct mlx4_spec_ib ib; 989 struct mlx4_spec_ib ib;
975 struct mlx4_spec_ipv4 ipv4; 990 struct mlx4_spec_ipv4 ipv4;
976 struct mlx4_spec_tcp_udp tcp_udp; 991 struct mlx4_spec_tcp_udp tcp_udp;
992 struct mlx4_spec_vxlan vxlan;
977 }; 993 };
978}; 994};
979 995
@@ -1060,6 +1076,15 @@ struct mlx4_net_trans_rule_hw_ipv4 {
1060 __be32 src_ip_msk; 1076 __be32 src_ip_msk;
1061} __packed; 1077} __packed;
1062 1078
1079struct mlx4_net_trans_rule_hw_vxlan {
1080 u8 size;
1081 u8 rsvd;
1082 __be16 id;
1083 __be32 rsvd1;
1084 __be32 vni;
1085 __be32 vni_mask;
1086} __packed;
1087
1063struct _rule_hw { 1088struct _rule_hw {
1064 union { 1089 union {
1065 struct { 1090 struct {
@@ -1071,9 +1096,19 @@ struct _rule_hw {
1071 struct mlx4_net_trans_rule_hw_ib ib; 1096 struct mlx4_net_trans_rule_hw_ib ib;
1072 struct mlx4_net_trans_rule_hw_ipv4 ipv4; 1097 struct mlx4_net_trans_rule_hw_ipv4 ipv4;
1073 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; 1098 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp;
1099 struct mlx4_net_trans_rule_hw_vxlan vxlan;
1074 }; 1100 };
1075}; 1101};
1076 1102
1103enum {
1104 VXLAN_STEER_BY_OUTER_MAC = 1 << 0,
1105 VXLAN_STEER_BY_OUTER_VLAN = 1 << 1,
1106 VXLAN_STEER_BY_VSID_VNI = 1 << 2,
1107 VXLAN_STEER_BY_INNER_MAC = 1 << 3,
1108 VXLAN_STEER_BY_INNER_VLAN = 1 << 4,
1109};
1110
1111
1077int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, 1112int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
1078 enum mlx4_net_trans_promisc_mode mode); 1113 enum mlx4_net_trans_promisc_mode mode);
1079int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, 1114int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
@@ -1096,6 +1131,7 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
1096int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); 1131int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc);
1097int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, 1132int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
1098 u8 *pg, u16 *ratelimit); 1133 u8 *pg, u16 *ratelimit);
1134int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering);
1099int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx); 1135int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx);
1100int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 1136int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
1101int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 1137int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
@@ -1115,6 +1151,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
1115 int *vector); 1151 int *vector);
1116void mlx4_release_eq(struct mlx4_dev *dev, int vec); 1152void mlx4_release_eq(struct mlx4_dev *dev, int vec);
1117 1153
1154int mlx4_get_phys_port_id(struct mlx4_dev *dev);
1118int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 1155int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
1119int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); 1156int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
1120 1157
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 6d351473c292..59f8ba84568b 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -109,6 +109,10 @@ enum {
109 MLX4_RSS_TCP_IPV4 = 1 << 4, 109 MLX4_RSS_TCP_IPV4 = 1 << 4,
110 MLX4_RSS_IPV4 = 1 << 5, 110 MLX4_RSS_IPV4 = 1 << 5,
111 111
112 MLX4_RSS_BY_OUTER_HEADERS = 0 << 6,
113 MLX4_RSS_BY_INNER_HEADERS = 2 << 6,
114 MLX4_RSS_BY_INNER_HEADERS_IPONLY = 3 << 6,
115
112 /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */ 116 /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */
113 MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24, 117 MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24,
114 /* offset of being RSS indirection QP within mlx4_qp_context.flags */ 118 /* offset of being RSS indirection QP within mlx4_qp_context.flags */
@@ -252,6 +256,8 @@ enum { /* param3 */
252 256
253enum { 257enum {
254 MLX4_WQE_CTRL_NEC = 1 << 29, 258 MLX4_WQE_CTRL_NEC = 1 << 29,
259 MLX4_WQE_CTRL_IIP = 1 << 28,
260 MLX4_WQE_CTRL_ILP = 1 << 27,
255 MLX4_WQE_CTRL_FENCE = 1 << 6, 261 MLX4_WQE_CTRL_FENCE = 1 << 6,
256 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, 262 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
257 MLX4_WQE_CTRL_SOLICITED = 1 << 1, 263 MLX4_WQE_CTRL_SOLICITED = 1 << 1,
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 9f03feedc8e7..d8836623f36a 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -23,6 +23,15 @@
23/* 23/*
24 * Vendors and devices. Sort key: vendor first, device next. 24 * Vendors and devices. Sort key: vendor first, device next.
25 */ 25 */
26#define SDIO_VENDOR_ID_BROADCOM 0x02d0
27#define SDIO_DEVICE_ID_BROADCOM_43143 43143
28#define SDIO_DEVICE_ID_BROADCOM_43241 0x4324
29#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
30#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330
31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334
32#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335
33#define SDIO_DEVICE_ID_BROADCOM_43362 43362
34
26#define SDIO_VENDOR_ID_INTEL 0x0089 35#define SDIO_VENDOR_ID_INTEL 0x0089
27#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 36#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
28#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 37#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403
diff --git a/include/linux/net.h b/include/linux/net.h
index 69be3e6079c8..94734a6259a4 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -245,9 +245,6 @@ do { \
245#define net_dbg_ratelimited(fmt, ...) \ 245#define net_dbg_ratelimited(fmt, ...) \
246 net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) 246 net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
247 247
248#define net_random() prandom_u32()
249#define net_srandom(seed) prandom_seed((__force u32)(seed))
250
251bool __net_get_random_once(void *buf, int nbytes, bool *done, 248bool __net_get_random_once(void *buf, int nbytes, bool *done,
252 struct static_key *done_key); 249 struct static_key *done_key);
253 250
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ce2a1f5f9a1e..440a02ee6f92 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -668,15 +668,28 @@ extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, 668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
669 u16 filter_id); 669 u16 filter_id);
670#endif 670#endif
671#endif /* CONFIG_RPS */
671 672
672/* This structure contains an instance of an RX queue. */ 673/* This structure contains an instance of an RX queue. */
673struct netdev_rx_queue { 674struct netdev_rx_queue {
675#ifdef CONFIG_RPS
674 struct rps_map __rcu *rps_map; 676 struct rps_map __rcu *rps_map;
675 struct rps_dev_flow_table __rcu *rps_flow_table; 677 struct rps_dev_flow_table __rcu *rps_flow_table;
678#endif
676 struct kobject kobj; 679 struct kobject kobj;
677 struct net_device *dev; 680 struct net_device *dev;
678} ____cacheline_aligned_in_smp; 681} ____cacheline_aligned_in_smp;
679#endif /* CONFIG_RPS */ 682
683/*
684 * RX queue sysfs structures and functions.
685 */
686struct rx_queue_attribute {
687 struct attribute attr;
688 ssize_t (*show)(struct netdev_rx_queue *queue,
689 struct rx_queue_attribute *attr, char *buf);
690 ssize_t (*store)(struct netdev_rx_queue *queue,
691 struct rx_queue_attribute *attr, const char *buf, size_t len);
692};
680 693
681#ifdef CONFIG_XPS 694#ifdef CONFIG_XPS
682/* 695/*
@@ -1285,6 +1298,9 @@ struct net_device {
1285#if IS_ENABLED(CONFIG_NET_DSA) 1298#if IS_ENABLED(CONFIG_NET_DSA)
1286 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ 1299 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */
1287#endif 1300#endif
1301#if IS_ENABLED(CONFIG_TIPC)
1302 struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */
1303#endif
1288 void *atalk_ptr; /* AppleTalk link */ 1304 void *atalk_ptr; /* AppleTalk link */
1289 struct in_device __rcu *ip_ptr; /* IPv4 specific data */ 1305 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
1290 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ 1306 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */
@@ -1310,7 +1326,7 @@ struct net_device {
1310 unicast) */ 1326 unicast) */
1311 1327
1312 1328
1313#ifdef CONFIG_RPS 1329#ifdef CONFIG_SYSFS
1314 struct netdev_rx_queue *_rx; 1330 struct netdev_rx_queue *_rx;
1315 1331
1316 /* Number of RX queues allocated at register_netdev() time */ 1332 /* Number of RX queues allocated at register_netdev() time */
@@ -1408,7 +1424,7 @@ struct net_device {
1408 union { 1424 union {
1409 void *ml_priv; 1425 void *ml_priv;
1410 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1426 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1411 struct pcpu_tstats __percpu *tstats; /* tunnel stats */ 1427 struct pcpu_sw_netstats __percpu *tstats;
1412 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1428 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1413 struct pcpu_vstats __percpu *vstats; /* veth stats */ 1429 struct pcpu_vstats __percpu *vstats; /* veth stats */
1414 }; 1430 };
@@ -1421,6 +1437,8 @@ struct net_device {
1421 struct device dev; 1437 struct device dev;
1422 /* space for optional device, statistics, and wireless sysfs groups */ 1438 /* space for optional device, statistics, and wireless sysfs groups */
1423 const struct attribute_group *sysfs_groups[4]; 1439 const struct attribute_group *sysfs_groups[4];
1440 /* space for optional per-rx queue attributes */
1441 const struct attribute_group *sysfs_rx_queue_group;
1424 1442
1425 /* rtnetlink link ops */ 1443 /* rtnetlink link ops */
1426 const struct rtnl_link_ops *rtnl_link_ops; 1444 const struct rtnl_link_ops *rtnl_link_ops;
@@ -1443,7 +1461,7 @@ struct net_device {
1443 /* max exchange id for FCoE LRO by ddp */ 1461 /* max exchange id for FCoE LRO by ddp */
1444 unsigned int fcoe_ddp_xid; 1462 unsigned int fcoe_ddp_xid;
1445#endif 1463#endif
1446#if IS_ENABLED(CONFIG_NETPRIO_CGROUP) 1464#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
1447 struct netprio_map __rcu *priomap; 1465 struct netprio_map __rcu *priomap;
1448#endif 1466#endif
1449 /* phy device may attach itself for hardware timestamping */ 1467 /* phy device may attach itself for hardware timestamping */
@@ -1632,7 +1650,10 @@ struct napi_gro_cb {
1632 int data_offset; 1650 int data_offset;
1633 1651
1634 /* This is non-zero if the packet cannot be merged with the new skb. */ 1652 /* This is non-zero if the packet cannot be merged with the new skb. */
1635 int flush; 1653 u16 flush;
1654
1655 /* Save the IP ID here and check when we get to the transport layer */
1656 u16 flush_id;
1636 1657
1637 /* Number of segments aggregated. */ 1658 /* Number of segments aggregated. */
1638 u16 count; 1659 u16 count;
@@ -1649,7 +1670,13 @@ struct napi_gro_cb {
1649 unsigned long age; 1670 unsigned long age;
1650 1671
1651 /* Used in ipv6_gro_receive() */ 1672 /* Used in ipv6_gro_receive() */
1652 int proto; 1673 u16 proto;
1674
1675 /* Used in udp_gro_receive */
1676 u16 udp_mark;
1677
1678 /* used to support CHECKSUM_COMPLETE for tunneling protocols */
1679 __wsum csum;
1653 1680
1654 /* used in skb_gro_receive() slow path */ 1681 /* used in skb_gro_receive() slow path */
1655 struct sk_buff *last; 1682 struct sk_buff *last;
@@ -1676,7 +1703,7 @@ struct offload_callbacks {
1676 int (*gso_send_check)(struct sk_buff *skb); 1703 int (*gso_send_check)(struct sk_buff *skb);
1677 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1704 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1678 struct sk_buff *skb); 1705 struct sk_buff *skb);
1679 int (*gro_complete)(struct sk_buff *skb); 1706 int (*gro_complete)(struct sk_buff *skb, int nhoff);
1680}; 1707};
1681 1708
1682struct packet_offload { 1709struct packet_offload {
@@ -1685,6 +1712,20 @@ struct packet_offload {
1685 struct list_head list; 1712 struct list_head list;
1686}; 1713};
1687 1714
1715struct udp_offload {
1716 __be16 port;
1717 struct offload_callbacks callbacks;
1718};
1719
1720/* often modified stats are per cpu, other are shared (netdev->stats) */
1721struct pcpu_sw_netstats {
1722 u64 rx_packets;
1723 u64 rx_bytes;
1724 u64 tx_packets;
1725 u64 tx_bytes;
1726 struct u64_stats_sync syncp;
1727};
1728
1688#include <linux/notifier.h> 1729#include <linux/notifier.h>
1689 1730
1690/* netdevice notifier chain. Please remember to update the rtnetlink 1731/* netdevice notifier chain. Please remember to update the rtnetlink
@@ -1700,7 +1741,7 @@ struct packet_offload {
1700#define NETDEV_CHANGE 0x0004 /* Notify device state change */ 1741#define NETDEV_CHANGE 0x0004 /* Notify device state change */
1701#define NETDEV_REGISTER 0x0005 1742#define NETDEV_REGISTER 0x0005
1702#define NETDEV_UNREGISTER 0x0006 1743#define NETDEV_UNREGISTER 0x0006
1703#define NETDEV_CHANGEMTU 0x0007 1744#define NETDEV_CHANGEMTU 0x0007 /* notify after mtu change happened */
1704#define NETDEV_CHANGEADDR 0x0008 1745#define NETDEV_CHANGEADDR 0x0008
1705#define NETDEV_GOING_DOWN 0x0009 1746#define NETDEV_GOING_DOWN 0x0009
1706#define NETDEV_CHANGENAME 0x000A 1747#define NETDEV_CHANGENAME 0x000A
@@ -1716,6 +1757,7 @@ struct packet_offload {
1716#define NETDEV_JOIN 0x0014 1757#define NETDEV_JOIN 0x0014
1717#define NETDEV_CHANGEUPPER 0x0015 1758#define NETDEV_CHANGEUPPER 0x0015
1718#define NETDEV_RESEND_IGMP 0x0016 1759#define NETDEV_RESEND_IGMP 0x0016
1760#define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */
1719 1761
1720int register_netdevice_notifier(struct notifier_block *nb); 1762int register_netdevice_notifier(struct notifier_block *nb);
1721int unregister_netdevice_notifier(struct notifier_block *nb); 1763int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -1741,8 +1783,6 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
1741 return info->dev; 1783 return info->dev;
1742} 1784}
1743 1785
1744int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1745 struct netdev_notifier_info *info);
1746int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1786int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1747 1787
1748 1788
@@ -1809,7 +1849,6 @@ void dev_remove_pack(struct packet_type *pt);
1809void __dev_remove_pack(struct packet_type *pt); 1849void __dev_remove_pack(struct packet_type *pt);
1810void dev_add_offload(struct packet_offload *po); 1850void dev_add_offload(struct packet_offload *po);
1811void dev_remove_offload(struct packet_offload *po); 1851void dev_remove_offload(struct packet_offload *po);
1812void __dev_remove_offload(struct packet_offload *po);
1813 1852
1814struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1853struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1815 unsigned short mask); 1854 unsigned short mask);
@@ -1895,6 +1934,14 @@ static inline void *skb_gro_network_header(struct sk_buff *skb)
1895 skb_network_offset(skb); 1934 skb_network_offset(skb);
1896} 1935}
1897 1936
1937static inline void skb_gro_postpull_rcsum(struct sk_buff *skb,
1938 const void *start, unsigned int len)
1939{
1940 if (skb->ip_summed == CHECKSUM_COMPLETE)
1941 NAPI_GRO_CB(skb)->csum = csum_sub(NAPI_GRO_CB(skb)->csum,
1942 csum_partial(start, len, 0));
1943}
1944
1898static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 1945static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
1899 unsigned short type, 1946 unsigned short type,
1900 const void *daddr, const void *saddr, 1947 const void *daddr, const void *saddr,
@@ -2351,7 +2398,7 @@ static inline bool netif_is_multiqueue(const struct net_device *dev)
2351 2398
2352int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq); 2399int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
2353 2400
2354#ifdef CONFIG_RPS 2401#ifdef CONFIG_SYSFS
2355int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); 2402int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
2356#else 2403#else
2357static inline int netif_set_real_num_rx_queues(struct net_device *dev, 2404static inline int netif_set_real_num_rx_queues(struct net_device *dev,
@@ -2370,7 +2417,7 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2370 from_dev->real_num_tx_queues); 2417 from_dev->real_num_tx_queues);
2371 if (err) 2418 if (err)
2372 return err; 2419 return err;
2373#ifdef CONFIG_RPS 2420#ifdef CONFIG_SYSFS
2374 return netif_set_real_num_rx_queues(to_dev, 2421 return netif_set_real_num_rx_queues(to_dev,
2375 from_dev->real_num_rx_queues); 2422 from_dev->real_num_rx_queues);
2376#else 2423#else
@@ -2378,20 +2425,67 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2378#endif 2425#endif
2379} 2426}
2380 2427
2428#ifdef CONFIG_SYSFS
2429static inline unsigned int get_netdev_rx_queue_index(
2430 struct netdev_rx_queue *queue)
2431{
2432 struct net_device *dev = queue->dev;
2433 int index = queue - dev->_rx;
2434
2435 BUG_ON(index >= dev->num_rx_queues);
2436 return index;
2437}
2438#endif
2439
2381#define DEFAULT_MAX_NUM_RSS_QUEUES (8) 2440#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2382int netif_get_num_default_rss_queues(void); 2441int netif_get_num_default_rss_queues(void);
2383 2442
2384/* Use this variant when it is known for sure that it 2443enum skb_free_reason {
2385 * is executing from hardware interrupt context or with hardware interrupts 2444 SKB_REASON_CONSUMED,
2386 * disabled. 2445 SKB_REASON_DROPPED,
2387 */ 2446};
2388void dev_kfree_skb_irq(struct sk_buff *skb);
2389 2447
2390/* Use this variant in places where it could be invoked 2448void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason);
2391 * from either hardware interrupt or other context, with hardware interrupts 2449void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason);
2392 * either disabled or enabled. 2450
2451/*
2452 * It is not allowed to call kfree_skb() or consume_skb() from hardware
2453 * interrupt context or with hardware interrupts being disabled.
2454 * (in_irq() || irqs_disabled())
2455 *
2456 * We provide four helpers that can be used in following contexts :
2457 *
2458 * dev_kfree_skb_irq(skb) when caller drops a packet from irq context,
2459 * replacing kfree_skb(skb)
2460 *
2461 * dev_consume_skb_irq(skb) when caller consumes a packet from irq context.
2462 * Typically used in place of consume_skb(skb) in TX completion path
2463 *
2464 * dev_kfree_skb_any(skb) when caller doesn't know its current irq context,
2465 * replacing kfree_skb(skb)
2466 *
2467 * dev_consume_skb_any(skb) when caller doesn't know its current irq context,
2468 * and consumed a packet. Used in place of consume_skb(skb)
2393 */ 2469 */
2394void dev_kfree_skb_any(struct sk_buff *skb); 2470static inline void dev_kfree_skb_irq(struct sk_buff *skb)
2471{
2472 __dev_kfree_skb_irq(skb, SKB_REASON_DROPPED);
2473}
2474
2475static inline void dev_consume_skb_irq(struct sk_buff *skb)
2476{
2477 __dev_kfree_skb_irq(skb, SKB_REASON_CONSUMED);
2478}
2479
2480static inline void dev_kfree_skb_any(struct sk_buff *skb)
2481{
2482 __dev_kfree_skb_any(skb, SKB_REASON_DROPPED);
2483}
2484
2485static inline void dev_consume_skb_any(struct sk_buff *skb)
2486{
2487 __dev_kfree_skb_any(skb, SKB_REASON_CONSUMED);
2488}
2395 2489
2396int netif_rx(struct sk_buff *skb); 2490int netif_rx(struct sk_buff *skb);
2397int netif_rx_ni(struct sk_buff *skb); 2491int netif_rx_ni(struct sk_buff *skb);
@@ -2400,6 +2494,8 @@ gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
2400void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2494void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2401struct sk_buff *napi_get_frags(struct napi_struct *napi); 2495struct sk_buff *napi_get_frags(struct napi_struct *napi);
2402gro_result_t napi_gro_frags(struct napi_struct *napi); 2496gro_result_t napi_gro_frags(struct napi_struct *napi);
2497struct packet_offload *gro_find_receive_by_type(__be16 type);
2498struct packet_offload *gro_find_complete_by_type(__be16 type);
2403 2499
2404static inline void napi_free_frags(struct napi_struct *napi) 2500static inline void napi_free_frags(struct napi_struct *napi)
2405{ 2501{
@@ -2785,17 +2881,10 @@ int register_netdev(struct net_device *dev);
2785void unregister_netdev(struct net_device *dev); 2881void unregister_netdev(struct net_device *dev);
2786 2882
2787/* General hardware address lists handling functions */ 2883/* General hardware address lists handling functions */
2788int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2789 struct netdev_hw_addr_list *from_list,
2790 int addr_len, unsigned char addr_type);
2791void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2792 struct netdev_hw_addr_list *from_list,
2793 int addr_len, unsigned char addr_type);
2794int __hw_addr_sync(struct netdev_hw_addr_list *to_list, 2884int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
2795 struct netdev_hw_addr_list *from_list, int addr_len); 2885 struct netdev_hw_addr_list *from_list, int addr_len);
2796void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, 2886void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
2797 struct netdev_hw_addr_list *from_list, int addr_len); 2887 struct netdev_hw_addr_list *from_list, int addr_len);
2798void __hw_addr_flush(struct netdev_hw_addr_list *list);
2799void __hw_addr_init(struct netdev_hw_addr_list *list); 2888void __hw_addr_init(struct netdev_hw_addr_list *list);
2800 2889
2801/* Functions used for device addresses handling */ 2890/* Functions used for device addresses handling */
@@ -2803,10 +2892,6 @@ int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2803 unsigned char addr_type); 2892 unsigned char addr_type);
2804int dev_addr_del(struct net_device *dev, const unsigned char *addr, 2893int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2805 unsigned char addr_type); 2894 unsigned char addr_type);
2806int dev_addr_add_multiple(struct net_device *to_dev,
2807 struct net_device *from_dev, unsigned char addr_type);
2808int dev_addr_del_multiple(struct net_device *to_dev,
2809 struct net_device *from_dev, unsigned char addr_type);
2810void dev_addr_flush(struct net_device *dev); 2895void dev_addr_flush(struct net_device *dev);
2811int dev_addr_init(struct net_device *dev); 2896int dev_addr_init(struct net_device *dev);
2812 2897
@@ -2853,7 +2938,6 @@ extern int weight_p;
2853extern int bpf_jit_enable; 2938extern int bpf_jit_enable;
2854 2939
2855bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); 2940bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
2856bool netdev_has_any_upper_dev(struct net_device *dev);
2857struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, 2941struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
2858 struct list_head **iter); 2942 struct list_head **iter);
2859 2943
@@ -2882,6 +2966,7 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2882 priv = netdev_lower_get_next_private_rcu(dev, &(iter))) 2966 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
2883 2967
2884void *netdev_adjacent_get_private(struct list_head *adj_list); 2968void *netdev_adjacent_get_private(struct list_head *adj_list);
2969void *netdev_lower_get_first_private_rcu(struct net_device *dev);
2885struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2970struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2886struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2971struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2887int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); 2972int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
@@ -2892,8 +2977,7 @@ int netdev_master_upper_dev_link_private(struct net_device *dev,
2892 void *private); 2977 void *private);
2893void netdev_upper_dev_unlink(struct net_device *dev, 2978void netdev_upper_dev_unlink(struct net_device *dev,
2894 struct net_device *upper_dev); 2979 struct net_device *upper_dev);
2895void *netdev_lower_dev_get_private_rcu(struct net_device *dev, 2980void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
2896 struct net_device *lower_dev);
2897void *netdev_lower_dev_get_private(struct net_device *dev, 2981void *netdev_lower_dev_get_private(struct net_device *dev,
2898 struct net_device *lower_dev); 2982 struct net_device *lower_dev);
2899int skb_checksum_help(struct sk_buff *skb); 2983int skb_checksum_help(struct sk_buff *skb);
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index c7174b816674..0c7d01eae56c 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -331,7 +331,6 @@ extern ip_set_id_t ip_set_get_byname(struct net *net,
331 const char *name, struct ip_set **set); 331 const char *name, struct ip_set **set);
332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); 332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index);
333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index); 333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index);
334extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name);
335extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); 334extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index);
336extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); 335extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index);
337 336
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 7a6c396a263b..aad8eeaf416d 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -62,7 +62,6 @@ extern void netlink_kernel_release(struct sock *sk);
62extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 62extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
63extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 63extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
64extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); 64extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
65extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
66extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 65extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
67extern int netlink_has_listeners(struct sock *sk, unsigned int group); 66extern int netlink_has_listeners(struct sock *sk, unsigned int group);
68extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size, 67extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
@@ -168,7 +167,6 @@ struct netlink_tap {
168}; 167};
169 168
170extern int netlink_add_tap(struct netlink_tap *nt); 169extern int netlink_add_tap(struct netlink_tap *nt);
171extern int __netlink_remove_tap(struct netlink_tap *nt);
172extern int netlink_remove_tap(struct netlink_tap *nt); 170extern int netlink_remove_tap(struct netlink_tap *nt);
173 171
174#endif /* __LINUX_NETLINK_H */ 172#endif /* __LINUX_NETLINK_H */
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 8163107b94b4..6fe8464ed767 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -19,6 +19,9 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
19 struct device_node *phy_np, 19 struct device_node *phy_np,
20 void (*hndlr)(struct net_device *), 20 void (*hndlr)(struct net_device *),
21 u32 flags, phy_interface_t iface); 21 u32 flags, phy_interface_t iface);
22struct phy_device *of_phy_attach(struct net_device *dev,
23 struct device_node *phy_np, u32 flags,
24 phy_interface_t iface);
22extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 25extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
23 void (*hndlr)(struct net_device *), 26 void (*hndlr)(struct net_device *),
24 phy_interface_t iface); 27 phy_interface_t iface);
@@ -44,6 +47,13 @@ static inline struct phy_device *of_phy_connect(struct net_device *dev,
44 return NULL; 47 return NULL;
45} 48}
46 49
50static inline struct phy_device *of_phy_attach(struct net_device *dev,
51 struct device_node *phy_np,
52 u32 flags, phy_interface_t iface)
53{
54 return NULL;
55}
56
47static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 57static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
48 void (*hndlr)(struct net_device *), 58 void (*hndlr)(struct net_device *),
49 phy_interface_t iface) 59 phy_interface_t iface)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 48a4dc3cb8cf..565188ca328f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * include/linux/phy.h
3 *
4 * Framework and drivers for configuring and reading different PHYs 2 * Framework and drivers for configuring and reading different PHYs
5 * Based on code in sungem_phy.c and gianfar_phy.c 3 * Based on code in sungem_phy.c and gianfar_phy.c
6 * 4 *
@@ -27,18 +25,27 @@
27 25
28#include <linux/atomic.h> 26#include <linux/atomic.h>
29 27
30#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 28#define PHY_DEFAULT_FEATURES (SUPPORTED_Autoneg | \
31 SUPPORTED_10baseT_Full | \
32 SUPPORTED_100baseT_Half | \
33 SUPPORTED_100baseT_Full | \
34 SUPPORTED_Autoneg | \
35 SUPPORTED_TP | \ 29 SUPPORTED_TP | \
36 SUPPORTED_MII) 30 SUPPORTED_MII)
37 31
38#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ 32#define PHY_10BT_FEATURES (SUPPORTED_10baseT_Half | \
39 SUPPORTED_1000baseT_Half | \ 33 SUPPORTED_10baseT_Full)
34
35#define PHY_100BT_FEATURES (SUPPORTED_100baseT_Half | \
36 SUPPORTED_100baseT_Full)
37
38#define PHY_1000BT_FEATURES (SUPPORTED_1000baseT_Half | \
40 SUPPORTED_1000baseT_Full) 39 SUPPORTED_1000baseT_Full)
41 40
41#define PHY_BASIC_FEATURES (PHY_10BT_FEATURES | \
42 PHY_100BT_FEATURES | \
43 PHY_DEFAULT_FEATURES)
44
45#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
46 PHY_1000BT_FEATURES)
47
48
42/* 49/*
43 * Set phydev->irq to PHY_POLL if interrupts are not supported, 50 * Set phydev->irq to PHY_POLL if interrupts are not supported,
44 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if 51 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
@@ -66,6 +73,7 @@ typedef enum {
66 PHY_INTERFACE_MODE_RGMII_TXID, 73 PHY_INTERFACE_MODE_RGMII_TXID,
67 PHY_INTERFACE_MODE_RTBI, 74 PHY_INTERFACE_MODE_RTBI,
68 PHY_INTERFACE_MODE_SMII, 75 PHY_INTERFACE_MODE_SMII,
76 PHY_INTERFACE_MODE_XGMII,
69} phy_interface_t; 77} phy_interface_t;
70 78
71 79
@@ -231,7 +239,7 @@ int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
231 * - phy_stop moves to HALTED 239 * - phy_stop moves to HALTED
232 */ 240 */
233enum phy_state { 241enum phy_state {
234 PHY_DOWN=0, 242 PHY_DOWN = 0,
235 PHY_STARTING, 243 PHY_STARTING,
236 PHY_READY, 244 PHY_READY,
237 PHY_PENDING, 245 PHY_PENDING,
@@ -275,11 +283,9 @@ struct phy_c45_device_ids {
275 * attached_dev: The attached enet driver's device instance ptr 283 * attached_dev: The attached enet driver's device instance ptr
276 * adjust_link: Callback for the enet controller to respond to 284 * adjust_link: Callback for the enet controller to respond to
277 * changes in the link state. 285 * changes in the link state.
278 * adjust_state: Callback for the enet driver to respond to
279 * changes in the state machine.
280 * 286 *
281 * speed, duplex, pause, supported, advertising, and 287 * speed, duplex, pause, supported, advertising, lp_advertising,
282 * autoneg are used like in mii_if_info 288 * and autoneg are used like in mii_if_info
283 * 289 *
284 * interrupts currently only supports enabled or disabled, 290 * interrupts currently only supports enabled or disabled,
285 * but could be changed in the future to support enabling 291 * but could be changed in the future to support enabling
@@ -331,6 +337,7 @@ struct phy_device {
331 /* See mii.h for more info */ 337 /* See mii.h for more info */
332 u32 supported; 338 u32 supported;
333 u32 advertising; 339 u32 advertising;
340 u32 lp_advertising;
334 341
335 int autoneg; 342 int autoneg;
336 343
@@ -356,8 +363,6 @@ struct phy_device {
356 struct net_device *attached_dev; 363 struct net_device *attached_dev;
357 364
358 void (*adjust_link)(struct net_device *dev); 365 void (*adjust_link)(struct net_device *dev);
359
360 void (*adjust_state)(struct net_device *dev);
361}; 366};
362#define to_phy_device(d) container_of(d, struct phy_device, dev) 367#define to_phy_device(d) container_of(d, struct phy_device, dev)
363 368
@@ -484,6 +489,24 @@ struct phy_fixup {
484}; 489};
485 490
486/** 491/**
492 * phy_read_mmd - Convenience function for reading a register
493 * from an MMD on a given PHY.
494 * @phydev: The phy_device struct
495 * @devad: The MMD to read from
496 * @regnum: The register on the MMD to read
497 *
498 * Same rules as for phy_read();
499 */
500static inline int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum)
501{
502 if (!phydev->is_c45)
503 return -EOPNOTSUPP;
504
505 return mdiobus_read(phydev->bus, phydev->addr,
506 MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff));
507}
508
509/**
487 * phy_read - Convenience function for reading a given PHY register 510 * phy_read - Convenience function for reading a given PHY register
488 * @phydev: the phy_device struct 511 * @phydev: the phy_device struct
489 * @regnum: register number to read 512 * @regnum: register number to read
@@ -533,20 +556,46 @@ static inline bool phy_is_internal(struct phy_device *phydev)
533 return phydev->is_internal; 556 return phydev->is_internal;
534} 557}
535 558
559/**
560 * phy_write_mmd - Convenience function for writing a register
561 * on an MMD on a given PHY.
562 * @phydev: The phy_device struct
563 * @devad: The MMD to read from
564 * @regnum: The register on the MMD to read
565 * @val: value to write to @regnum
566 *
567 * Same rules as for phy_write();
568 */
569static inline int phy_write_mmd(struct phy_device *phydev, int devad,
570 u32 regnum, u16 val)
571{
572 if (!phydev->is_c45)
573 return -EOPNOTSUPP;
574
575 regnum = MII_ADDR_C45 | ((devad & 0x1f) << 16) | (regnum & 0xffff);
576
577 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
578}
579
536struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, 580struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
537 bool is_c45, struct phy_c45_device_ids *c45_ids); 581 bool is_c45,
582 struct phy_c45_device_ids *c45_ids);
538struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); 583struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
539int phy_device_register(struct phy_device *phy); 584int phy_device_register(struct phy_device *phy);
540int phy_init_hw(struct phy_device *phydev); 585int phy_init_hw(struct phy_device *phydev);
541struct phy_device * phy_attach(struct net_device *dev, 586int phy_suspend(struct phy_device *phydev);
542 const char *bus_id, phy_interface_t interface); 587int phy_resume(struct phy_device *phydev);
588struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
589 phy_interface_t interface);
543struct phy_device *phy_find_first(struct mii_bus *bus); 590struct phy_device *phy_find_first(struct mii_bus *bus);
591int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
592 u32 flags, phy_interface_t interface);
544int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, 593int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
545 void (*handler)(struct net_device *), 594 void (*handler)(struct net_device *),
546 phy_interface_t interface); 595 phy_interface_t interface);
547struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, 596struct phy_device *phy_connect(struct net_device *dev, const char *bus_id,
548 void (*handler)(struct net_device *), 597 void (*handler)(struct net_device *),
549 phy_interface_t interface); 598 phy_interface_t interface);
550void phy_disconnect(struct phy_device *phydev); 599void phy_disconnect(struct phy_device *phydev);
551void phy_detach(struct phy_device *phydev); 600void phy_detach(struct phy_device *phydev);
552void phy_start(struct phy_device *phydev); 601void phy_start(struct phy_device *phydev);
@@ -555,7 +604,8 @@ int phy_start_aneg(struct phy_device *phydev);
555 604
556int phy_stop_interrupts(struct phy_device *phydev); 605int phy_stop_interrupts(struct phy_device *phydev);
557 606
558static inline int phy_read_status(struct phy_device *phydev) { 607static inline int phy_read_status(struct phy_device *phydev)
608{
559 return phydev->drv->read_status(phydev); 609 return phydev->drv->read_status(phydev);
560} 610}
561 611
@@ -573,31 +623,29 @@ int phy_drivers_register(struct phy_driver *new_driver, int n);
573void phy_state_machine(struct work_struct *work); 623void phy_state_machine(struct work_struct *work);
574void phy_change(struct work_struct *work); 624void phy_change(struct work_struct *work);
575void phy_mac_interrupt(struct phy_device *phydev, int new_link); 625void phy_mac_interrupt(struct phy_device *phydev, int new_link);
576void phy_start_machine(struct phy_device *phydev, 626void phy_start_machine(struct phy_device *phydev);
577 void (*handler)(struct net_device *));
578void phy_stop_machine(struct phy_device *phydev); 627void phy_stop_machine(struct phy_device *phydev);
579int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 628int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
580int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); 629int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
581int phy_mii_ioctl(struct phy_device *phydev, 630int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
582 struct ifreq *ifr, int cmd);
583int phy_start_interrupts(struct phy_device *phydev); 631int phy_start_interrupts(struct phy_device *phydev);
584void phy_print_status(struct phy_device *phydev); 632void phy_print_status(struct phy_device *phydev);
585void phy_device_free(struct phy_device *phydev); 633void phy_device_free(struct phy_device *phydev);
586 634
587int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, 635int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
588 int (*run)(struct phy_device *)); 636 int (*run)(struct phy_device *));
589int phy_register_fixup_for_id(const char *bus_id, 637int phy_register_fixup_for_id(const char *bus_id,
590 int (*run)(struct phy_device *)); 638 int (*run)(struct phy_device *));
591int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, 639int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
592 int (*run)(struct phy_device *)); 640 int (*run)(struct phy_device *));
593int phy_scan_fixups(struct phy_device *phydev);
594 641
595int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); 642int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
596int phy_get_eee_err(struct phy_device *phydev); 643int phy_get_eee_err(struct phy_device *phydev);
597int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); 644int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
598int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); 645int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
599int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); 646int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
600void phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); 647void phy_ethtool_get_wol(struct phy_device *phydev,
648 struct ethtool_wolinfo *wol);
601 649
602int __init mdio_bus_init(void); 650int __init mdio_bus_init(void);
603void mdio_bus_exit(void); 651void mdio_bus_exit(void);
diff --git a/include/linux/platform_data/eth-netx.h b/include/linux/platform_data/eth-netx.h
index 88af1ac28ead..a395159725d5 100644
--- a/include/linux/platform_data/eth-netx.h
+++ b/include/linux/platform_data/eth-netx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-netx/include/mach/eth.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix 2 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -17,8 +15,8 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 16 */
19 17
20#ifndef ASMARM_ARCH_ETH_H 18#ifndef __ETH_NETX_H
21#define ASMARM_ARCH_ETH_H 19#define __ETH_NETX_H
22 20
23struct netxeth_platform_data { 21struct netxeth_platform_data {
24 unsigned int xcno; /* number of xmac/xpec engine this eth uses */ 22 unsigned int xcno; /* number of xmac/xpec engine this eth uses */
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h
index 713bfd703342..5ce1ab983f44 100644
--- a/include/linux/platform_data/pn544.h
+++ b/include/linux/platform_data/pn544.h
@@ -16,8 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 20 */
22 21
23#ifndef _PN544_H_ 22#ifndef _PN544_H_
diff --git a/include/linux/printk.h b/include/linux/printk.h
index cc6f74d65167..fa47e2708c01 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -89,6 +89,13 @@ struct va_format {
89#define HW_ERR "[Hardware Error]: " 89#define HW_ERR "[Hardware Error]: "
90 90
91/* 91/*
92 * DEPRECATED
93 * Add this to a message whenever you want to warn user space about the use
94 * of a deprecated aspect of an API so they can stop using it
95 */
96#define DEPRECATED "[Deprecated]: "
97
98/*
92 * Dummy printk for disabled debugging statements to use whilst maintaining 99 * Dummy printk for disabled debugging statements to use whilst maintaining
93 * gcc's format and side-effect checking. 100 * gcc's format and side-effect checking.
94 */ 101 */
diff --git a/include/linux/random.h b/include/linux/random.h
index 4002b3df4c85..1cfce0e24dbd 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -8,7 +8,6 @@
8 8
9#include <uapi/linux/random.h> 9#include <uapi/linux/random.h>
10 10
11
12extern void add_device_randomness(const void *, unsigned int); 11extern void add_device_randomness(const void *, unsigned int);
13extern void add_input_randomness(unsigned int type, unsigned int code, 12extern void add_input_randomness(unsigned int type, unsigned int code,
14 unsigned int value); 13 unsigned int value);
@@ -38,6 +37,23 @@ struct rnd_state {
38u32 prandom_u32_state(struct rnd_state *state); 37u32 prandom_u32_state(struct rnd_state *state);
39void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); 38void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes);
40 39
40/**
41 * prandom_u32_max - returns a pseudo-random number in interval [0, ep_ro)
42 * @ep_ro: right open interval endpoint
43 *
44 * Returns a pseudo-random number that is in interval [0, ep_ro). Note
45 * that the result depends on PRNG being well distributed in [0, ~0U]
46 * u32 space. Here we use maximally equidistributed combined Tausworthe
47 * generator, that is, prandom_u32(). This is useful when requesting a
48 * random index of an array containing ep_ro elements, for example.
49 *
50 * Returns: pseudo-random number in interval [0, ep_ro)
51 */
52static inline u32 prandom_u32_max(u32 ep_ro)
53{
54 return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
55}
56
41/* 57/*
42 * Handle minimum values for seeds 58 * Handle minimum values for seeds
43 */ 59 */
diff --git a/include/linux/reciprocal_div.h b/include/linux/reciprocal_div.h
index f9c90b33285b..8c5a3fb6c6c5 100644
--- a/include/linux/reciprocal_div.h
+++ b/include/linux/reciprocal_div.h
@@ -4,29 +4,32 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* 6/*
7 * This file describes reciprocical division. 7 * This algorithm is based on the paper "Division by Invariant
8 * Integers Using Multiplication" by Torbjörn Granlund and Peter
9 * L. Montgomery.
8 * 10 *
9 * This optimizes the (A/B) problem, when A and B are two u32 11 * The assembler implementation from Agner Fog, which this code is
10 * and B is a known value (but not known at compile time) 12 * based on, can be found here:
13 * http://www.agner.org/optimize/asmlib.zip
11 * 14 *
12 * The math principle used is : 15 * This optimization for A/B is helpful if the divisor B is mostly
13 * Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B) 16 * runtime invariant. The reciprocal of B is calculated in the
14 * Then A / B = (u32)(((u64)(A) * (R)) >> 32) 17 * slow-path with reciprocal_value(). The fast-path can then just use
15 * 18 * a much faster multiplication operation with a variable dividend A
16 * This replaces a divide by a multiply (and a shift), and 19 * to calculate the division A/B.
17 * is generally less expensive in CPU cycles.
18 */ 20 */
19 21
20/* 22struct reciprocal_value {
21 * Computes the reciprocal value (R) for the value B of the divisor. 23 u32 m;
22 * Should not be called before each reciprocal_divide(), 24 u8 sh1, sh2;
23 * or else the performance is slower than a normal divide. 25};
24 */
25extern u32 reciprocal_value(u32 B);
26 26
27struct reciprocal_value reciprocal_value(u32 d);
27 28
28static inline u32 reciprocal_divide(u32 A, u32 R) 29static inline u32 reciprocal_divide(u32 a, struct reciprocal_value R)
29{ 30{
30 return (u32)(((u64)A * R) >> 32); 31 u32 t = (u32)(((u64)a * R.m) >> 32);
32 return (t + ((a - t) >> R.sh1)) >> R.sh2;
31} 33}
32#endif 34
35#endif /* _LINUX_RECIPROCAL_DIV_H */
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 3bfe8d6ee248..a9414fd49dc6 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -23,13 +23,12 @@
23 * See the GNU General Public License for more details. 23 * See the GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with GNU CC; see the file COPYING. If not, write to 26 * along with GNU CC; see the file COPYING. If not, see
27 * the Free Software Foundation, 59 Temple Place - Suite 330, 27 * <http://www.gnu.org/licenses/>.
28 * Boston, MA 02111-1307, USA.
29 * 28 *
30 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
31 * email address(es): 30 * email address(es):
32 * lksctp developers <lksctp-developerst@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
33 * 32 *
34 * Or submit a bug report through the following website: 33 * Or submit a bug report through the following website:
35 * http://www.sf.net/projects/lksctp 34 * http://www.sf.net/projects/lksctp
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index 90b5e30c2f22..8c9131db2b25 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
8 8
9struct sh_eth_plat_data { 9struct sh_eth_plat_data {
10 int phy; 10 int phy;
11 int phy_irq;
11 int edmac_endian; 12 int edmac_endian;
12 phy_interface_t phy_interface; 13 phy_interface_t phy_interface;
13 void (*set_mdio_gate)(void *addr); 14 void (*set_mdio_gate)(void *addr);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6f69b3f914fb..1f689e62e4cb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -34,11 +34,82 @@
34#include <linux/netdev_features.h> 34#include <linux/netdev_features.h>
35#include <net/flow_keys.h> 35#include <net/flow_keys.h>
36 36
37/* A. Checksumming of received packets by device.
38 *
39 * CHECKSUM_NONE:
40 *
41 * Device failed to checksum this packet e.g. due to lack of capabilities.
42 * The packet contains full (though not verified) checksum in packet but
43 * not in skb->csum. Thus, skb->csum is undefined in this case.
44 *
45 * CHECKSUM_UNNECESSARY:
46 *
47 * The hardware you're dealing with doesn't calculate the full checksum
48 * (as in CHECKSUM_COMPLETE), but it does parse headers and verify checksums
49 * for specific protocols e.g. TCP/UDP/SCTP, then, for such packets it will
50 * set CHECKSUM_UNNECESSARY if their checksums are okay. skb->csum is still
51 * undefined in this case though. It is a bad option, but, unfortunately,
52 * nowadays most vendors do this. Apparently with the secret goal to sell
53 * you new devices, when you will add new protocol to your host, f.e. IPv6 8)
54 *
55 * CHECKSUM_COMPLETE:
56 *
57 * This is the most generic way. The device supplied checksum of the _whole_
58 * packet as seen by netif_rx() and fills out in skb->csum. Meaning, the
59 * hardware doesn't need to parse L3/L4 headers to implement this.
60 *
61 * Note: Even if device supports only some protocols, but is able to produce
62 * skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY.
63 *
64 * CHECKSUM_PARTIAL:
65 *
66 * This is identical to the case for output below. This may occur on a packet
67 * received directly from another Linux OS, e.g., a virtualized Linux kernel
68 * on the same host. The packet can be treated in the same way as
69 * CHECKSUM_UNNECESSARY, except that on output (i.e., forwarding) the
70 * checksum must be filled in by the OS or the hardware.
71 *
72 * B. Checksumming on output.
73 *
74 * CHECKSUM_NONE:
75 *
76 * The skb was already checksummed by the protocol, or a checksum is not
77 * required.
78 *
79 * CHECKSUM_PARTIAL:
80 *
81 * The device is required to checksum the packet as seen by hard_start_xmit()
82 * from skb->csum_start up to the end, and to record/write the checksum at
83 * offset skb->csum_start + skb->csum_offset.
84 *
85 * The device must show its capabilities in dev->features, set up at device
86 * setup time, e.g. netdev_features.h:
87 *
88 * NETIF_F_HW_CSUM - It's a clever device, it's able to checksum everything.
89 * NETIF_F_IP_CSUM - Device is dumb, it's able to checksum only TCP/UDP over
90 * IPv4. Sigh. Vendors like this way for an unknown reason.
91 * Though, see comment above about CHECKSUM_UNNECESSARY. 8)
92 * NETIF_F_IPV6_CSUM - About as dumb as the last one but does IPv6 instead.
93 * NETIF_F_... - Well, you get the picture.
94 *
95 * CHECKSUM_UNNECESSARY:
96 *
97 * Normally, the device will do per protocol specific checksumming. Protocol
98 * implementations that do not want the NIC to perform the checksum
99 * calculation should use this flag in their outgoing skbs.
100 *
101 * NETIF_F_FCOE_CRC - This indicates that the device can do FCoE FC CRC
102 * offload. Correspondingly, the FCoE protocol driver
103 * stack should use CHECKSUM_UNNECESSARY.
104 *
105 * Any questions? No questions, good. --ANK
106 */
107
37/* Don't change this without changing skb_csum_unnecessary! */ 108/* Don't change this without changing skb_csum_unnecessary! */
38#define CHECKSUM_NONE 0 109#define CHECKSUM_NONE 0
39#define CHECKSUM_UNNECESSARY 1 110#define CHECKSUM_UNNECESSARY 1
40#define CHECKSUM_COMPLETE 2 111#define CHECKSUM_COMPLETE 2
41#define CHECKSUM_PARTIAL 3 112#define CHECKSUM_PARTIAL 3
42 113
43#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ 114#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \
44 ~(SMP_CACHE_BYTES - 1)) 115 ~(SMP_CACHE_BYTES - 1))
@@ -54,58 +125,6 @@
54 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ 125 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \
55 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 126 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
56 127
57/* A. Checksumming of received packets by device.
58 *
59 * NONE: device failed to checksum this packet.
60 * skb->csum is undefined.
61 *
62 * UNNECESSARY: device parsed packet and wouldbe verified checksum.
63 * skb->csum is undefined.
64 * It is bad option, but, unfortunately, many of vendors do this.
65 * Apparently with secret goal to sell you new device, when you
66 * will add new protocol to your host. F.e. IPv6. 8)
67 *
68 * COMPLETE: the most generic way. Device supplied checksum of _all_
69 * the packet as seen by netif_rx in skb->csum.
70 * NOTE: Even if device supports only some protocols, but
71 * is able to produce some skb->csum, it MUST use COMPLETE,
72 * not UNNECESSARY.
73 *
74 * PARTIAL: identical to the case for output below. This may occur
75 * on a packet received directly from another Linux OS, e.g.,
76 * a virtualised Linux kernel on the same host. The packet can
77 * be treated in the same way as UNNECESSARY except that on
78 * output (i.e., forwarding) the checksum must be filled in
79 * by the OS or the hardware.
80 *
81 * B. Checksumming on output.
82 *
83 * NONE: skb is checksummed by protocol or csum is not required.
84 *
85 * PARTIAL: device is required to csum packet as seen by hard_start_xmit
86 * from skb->csum_start to the end and to record the checksum
87 * at skb->csum_start + skb->csum_offset.
88 *
89 * Device must show its capabilities in dev->features, set
90 * at device setup time.
91 * NETIF_F_HW_CSUM - it is clever device, it is able to checksum
92 * everything.
93 * NETIF_F_IP_CSUM - device is dumb. It is able to csum only
94 * TCP/UDP over IPv4. Sigh. Vendors like this
95 * way by an unknown reason. Though, see comment above
96 * about CHECKSUM_UNNECESSARY. 8)
97 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
98 *
99 * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
100 * that do not want net to perform the checksum calculation should use
101 * this flag in their outgoing skbs.
102 * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
103 * offload. Correspondingly, the FCoE protocol driver
104 * stack should use CHECKSUM_UNNECESSARY.
105 *
106 * Any questions? No questions, good. --ANK
107 */
108
109struct net_device; 128struct net_device;
110struct scatterlist; 129struct scatterlist;
111struct pipe_inode_info; 130struct pipe_inode_info;
@@ -703,15 +722,78 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
703 unsigned int to, struct ts_config *config, 722 unsigned int to, struct ts_config *config,
704 struct ts_state *state); 723 struct ts_state *state);
705 724
706void __skb_get_rxhash(struct sk_buff *skb); 725/*
707static inline __u32 skb_get_rxhash(struct sk_buff *skb) 726 * Packet hash types specify the type of hash in skb_set_hash.
727 *
728 * Hash types refer to the protocol layer addresses which are used to
729 * construct a packet's hash. The hashes are used to differentiate or identify
730 * flows of the protocol layer for the hash type. Hash types are either
731 * layer-2 (L2), layer-3 (L3), or layer-4 (L4).
732 *
733 * Properties of hashes:
734 *
735 * 1) Two packets in different flows have different hash values
736 * 2) Two packets in the same flow should have the same hash value
737 *
738 * A hash at a higher layer is considered to be more specific. A driver should
739 * set the most specific hash possible.
740 *
741 * A driver cannot indicate a more specific hash than the layer at which a hash
742 * was computed. For instance an L3 hash cannot be set as an L4 hash.
743 *
744 * A driver may indicate a hash level which is less specific than the
745 * actual layer the hash was computed on. For instance, a hash computed
746 * at L4 may be considered an L3 hash. This should only be done if the
747 * driver can't unambiguously determine that the HW computed the hash at
748 * the higher layer. Note that the "should" in the second property above
749 * permits this.
750 */
751enum pkt_hash_types {
752 PKT_HASH_TYPE_NONE, /* Undefined type */
753 PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */
754 PKT_HASH_TYPE_L3, /* Input: src_IP, dst_IP */
755 PKT_HASH_TYPE_L4, /* Input: src_IP, dst_IP, src_port, dst_port */
756};
757
758static inline void
759skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
760{
761 skb->l4_rxhash = (type == PKT_HASH_TYPE_L4);
762 skb->rxhash = hash;
763}
764
765void __skb_get_hash(struct sk_buff *skb);
766static inline __u32 skb_get_hash(struct sk_buff *skb)
708{ 767{
709 if (!skb->l4_rxhash) 768 if (!skb->l4_rxhash)
710 __skb_get_rxhash(skb); 769 __skb_get_hash(skb);
711 770
712 return skb->rxhash; 771 return skb->rxhash;
713} 772}
714 773
774static inline __u32 skb_get_hash_raw(const struct sk_buff *skb)
775{
776 return skb->rxhash;
777}
778
779static inline void skb_clear_hash(struct sk_buff *skb)
780{
781 skb->rxhash = 0;
782 skb->l4_rxhash = 0;
783}
784
785static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
786{
787 if (!skb->l4_rxhash)
788 skb_clear_hash(skb);
789}
790
791static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
792{
793 to->rxhash = from->rxhash;
794 to->l4_rxhash = from->l4_rxhash;
795};
796
715#ifdef NET_SKBUFF_DATA_USES_OFFSET 797#ifdef NET_SKBUFF_DATA_USES_OFFSET
716static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 798static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
717{ 799{
@@ -750,7 +832,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
750 */ 832 */
751static inline int skb_queue_empty(const struct sk_buff_head *list) 833static inline int skb_queue_empty(const struct sk_buff_head *list)
752{ 834{
753 return list->next == (struct sk_buff *)list; 835 return list->next == (const struct sk_buff *) list;
754} 836}
755 837
756/** 838/**
@@ -763,7 +845,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
763static inline bool skb_queue_is_last(const struct sk_buff_head *list, 845static inline bool skb_queue_is_last(const struct sk_buff_head *list,
764 const struct sk_buff *skb) 846 const struct sk_buff *skb)
765{ 847{
766 return skb->next == (struct sk_buff *)list; 848 return skb->next == (const struct sk_buff *) list;
767} 849}
768 850
769/** 851/**
@@ -776,7 +858,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
776static inline bool skb_queue_is_first(const struct sk_buff_head *list, 858static inline bool skb_queue_is_first(const struct sk_buff_head *list,
777 const struct sk_buff *skb) 859 const struct sk_buff *skb)
778{ 860{
779 return skb->prev == (struct sk_buff *)list; 861 return skb->prev == (const struct sk_buff *) list;
780} 862}
781 863
782/** 864/**
@@ -2368,6 +2450,9 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
2368 struct pipe_inode_info *pipe, unsigned int len, 2450 struct pipe_inode_info *pipe, unsigned int len,
2369 unsigned int flags); 2451 unsigned int flags);
2370void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); 2452void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
2453unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
2454void skb_zerocopy(struct sk_buff *to, const struct sk_buff *from,
2455 int len, int hlen);
2371void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); 2456void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len);
2372int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); 2457int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
2373void skb_scrub_packet(struct sk_buff *skb, bool xnet); 2458void skb_scrub_packet(struct sk_buff *skb, bool xnet);
@@ -2397,6 +2482,24 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
2397 return buffer; 2482 return buffer;
2398} 2483}
2399 2484
2485/**
2486 * skb_needs_linearize - check if we need to linearize a given skb
2487 * depending on the given device features.
2488 * @skb: socket buffer to check
2489 * @features: net device features
2490 *
2491 * Returns true if either:
2492 * 1. skb has frag_list and the device doesn't support FRAGLIST, or
2493 * 2. skb is fragmented and the device does not support SG.
2494 */
2495static inline bool skb_needs_linearize(struct sk_buff *skb,
2496 netdev_features_t features)
2497{
2498 return skb_is_nonlinear(skb) &&
2499 ((skb_has_frag_list(skb) && !(features & NETIF_F_FRAGLIST)) ||
2500 (skb_shinfo(skb)->nr_frags && !(features & NETIF_F_SG)));
2501}
2502
2400static inline void skb_copy_from_linear_data(const struct sk_buff *skb, 2503static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
2401 void *to, 2504 void *to,
2402 const unsigned int len) 2505 const unsigned int len)
@@ -2795,6 +2898,8 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb)
2795 2898
2796bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2899bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2797 2900
2901int skb_checksum_setup(struct sk_buff *skb, bool recalculate);
2902
2798u32 __skb_get_poff(const struct sk_buff *skb); 2903u32 __skb_get_poff(const struct sk_buff *skb);
2799 2904
2800/** 2905/**
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 40fc39d22d53..8235dfbb3b05 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_SLAB_DEF_H 1#ifndef _LINUX_SLAB_DEF_H
2#define _LINUX_SLAB_DEF_H 2#define _LINUX_SLAB_DEF_H
3 3
4#include <linux/reciprocal_div.h>
5
4/* 6/*
5 * Definitions unique to the original Linux SLAB allocator. 7 * Definitions unique to the original Linux SLAB allocator.
6 */ 8 */
@@ -12,7 +14,7 @@ struct kmem_cache {
12 unsigned int shared; 14 unsigned int shared;
13 15
14 unsigned int size; 16 unsigned int size;
15 u32 reciprocal_buffer_size; 17 struct reciprocal_value reciprocal_buffer_size;
16/* 2) touched by every alloc & free from the backend */ 18/* 2) touched by every alloc & free from the backend */
17 19
18 unsigned int flags; /* constant flags */ 20 unsigned int flags; /* constant flags */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 445ef7519dc2..8e98297f1388 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -45,13 +45,13 @@ struct linger {
45 */ 45 */
46 46
47struct msghdr { 47struct msghdr {
48 void * msg_name; /* Socket name */ 48 void *msg_name; /* ptr to socket address structure */
49 int msg_namelen; /* Length of name */ 49 int msg_namelen; /* size of socket address structure */
50 struct iovec * msg_iov; /* Data blocks */ 50 struct iovec *msg_iov; /* scatter/gather array */
51 __kernel_size_t msg_iovlen; /* Number of blocks */ 51 __kernel_size_t msg_iovlen; /* # elements in msg_iov */
52 void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */ 52 void *msg_control; /* ancillary data */
53 __kernel_size_t msg_controllen; /* Length of cmsg list */ 53 __kernel_size_t msg_controllen; /* ancillary data buffer length */
54 unsigned int msg_flags; 54 unsigned int msg_flags; /* flags on received message */
55}; 55};
56 56
57/* For recvmmsg/sendmmsg */ 57/* For recvmmsg/sendmmsg */
@@ -305,8 +305,6 @@ struct ucred {
305/* IPX options */ 305/* IPX options */
306#define IPX_TYPE 1 306#define IPX_TYPE 1
307 307
308extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
309
310extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, 308extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
311 int offset, int len); 309 int offset, int len);
312extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 310extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index bb5deb0feb6b..6f27d4f957bd 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -110,12 +110,34 @@ struct plat_stmmacenet_data {
110 int force_sf_dma_mode; 110 int force_sf_dma_mode;
111 int force_thresh_dma_mode; 111 int force_thresh_dma_mode;
112 int riwt_off; 112 int riwt_off;
113 int max_speed;
114 int maxmtu;
113 void (*fix_mac_speed)(void *priv, unsigned int speed); 115 void (*fix_mac_speed)(void *priv, unsigned int speed);
114 void (*bus_setup)(void __iomem *ioaddr); 116 void (*bus_setup)(void __iomem *ioaddr);
115 int (*init)(struct platform_device *pdev); 117 void *(*setup)(struct platform_device *pdev);
116 void (*exit)(struct platform_device *pdev); 118 void (*free)(struct platform_device *pdev, void *priv);
119 int (*init)(struct platform_device *pdev, void *priv);
120 void (*exit)(struct platform_device *pdev, void *priv);
117 void *custom_cfg; 121 void *custom_cfg;
118 void *custom_data; 122 void *custom_data;
119 void *bsp_priv; 123 void *bsp_priv;
120}; 124};
125
126/* of_data for SoC glue layer device tree bindings */
127
128struct stmmac_of_data {
129 int has_gmac;
130 int enh_desc;
131 int tx_coe;
132 int rx_coe;
133 int bugged_jumbo;
134 int pmt;
135 int riwt_off;
136 void (*fix_mac_speed)(void *priv, unsigned int speed);
137 void (*bus_setup)(void __iomem *ioaddr);
138 void *(*setup)(struct platform_device *pdev);
139 void (*free)(struct platform_device *pdev, void *priv);
140 int (*init)(struct platform_device *pdev, void *priv);
141 void (*exit)(struct platform_device *pdev, void *priv);
142};
121#endif 143#endif
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index d68633452d9b..4ad0706d40eb 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -248,7 +248,10 @@ struct tcp_sock {
248 struct sk_buff* lost_skb_hint; 248 struct sk_buff* lost_skb_hint;
249 struct sk_buff *retransmit_skb_hint; 249 struct sk_buff *retransmit_skb_hint;
250 250
251 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 251 /* OOO segments go in this list. Note that socket lock must be held,
252 * as we do not use sk_buff_head lock.
253 */
254 struct sk_buff_head out_of_order_queue;
252 255
253 /* SACKs data, these 2 need to be together (see tcp_options_write) */ 256 /* SACKs data, these 2 need to be together (see tcp_options_write) */
254 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 257 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
diff --git a/include/net/Space.h b/include/net/Space.h
new file mode 100644
index 000000000000..8a32771e4215
--- /dev/null
+++ b/include/net/Space.h
@@ -0,0 +1,31 @@
1/* A unified ethernet device probe. This is the easiest way to have every
2 * ethernet adaptor have the name "eth[0123...]".
3 */
4
5struct net_device *hp100_probe(int unit);
6struct net_device *ultra_probe(int unit);
7struct net_device *wd_probe(int unit);
8struct net_device *ne_probe(int unit);
9struct net_device *fmv18x_probe(int unit);
10struct net_device *i82596_probe(int unit);
11struct net_device *ni65_probe(int unit);
12struct net_device *sonic_probe(int unit);
13struct net_device *smc_init(int unit);
14struct net_device *atarilance_probe(int unit);
15struct net_device *sun3lance_probe(int unit);
16struct net_device *sun3_82586_probe(int unit);
17struct net_device *apne_probe(int unit);
18struct net_device *cs89x0_probe(int unit);
19struct net_device *mvme147lance_probe(int unit);
20struct net_device *tc515_probe(int unit);
21struct net_device *lance_probe(int unit);
22struct net_device *mac8390_probe(int unit);
23struct net_device *mac89x0_probe(int unit);
24struct net_device *cops_probe(int unit);
25struct net_device *ltpc_probe(void);
26
27/* Fibre Channel adapters */
28int iph5526_probe(struct net_device *dev);
29
30/* SBNI adapters */
31int sbni_probe(int unit);
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 9e90fdff470d..788d8378e587 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -9,7 +9,7 @@
9#include <net/pkt_sched.h> 9#include <net/pkt_sched.h>
10 10
11struct tcf_common { 11struct tcf_common {
12 struct tcf_common *tcfc_next; 12 struct hlist_node tcfc_head;
13 u32 tcfc_index; 13 u32 tcfc_index;
14 int tcfc_refcnt; 14 int tcfc_refcnt;
15 int tcfc_bindcnt; 15 int tcfc_bindcnt;
@@ -22,7 +22,7 @@ struct tcf_common {
22 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
23 struct rcu_head tcfc_rcu; 23 struct rcu_head tcfc_rcu;
24}; 24};
25#define tcf_next common.tcfc_next 25#define tcf_head common.tcfc_head
26#define tcf_index common.tcfc_index 26#define tcf_index common.tcfc_index
27#define tcf_refcnt common.tcfc_refcnt 27#define tcf_refcnt common.tcfc_refcnt
28#define tcf_bindcnt common.tcfc_bindcnt 28#define tcf_bindcnt common.tcfc_bindcnt
@@ -36,9 +36,10 @@ struct tcf_common {
36#define tcf_rcu common.tcfc_rcu 36#define tcf_rcu common.tcfc_rcu
37 37
38struct tcf_hashinfo { 38struct tcf_hashinfo {
39 struct tcf_common **htab; 39 struct hlist_head *htab;
40 unsigned int hmask; 40 unsigned int hmask;
41 rwlock_t *lock; 41 spinlock_t lock;
42 u32 index;
42}; 43};
43 44
44static inline unsigned int tcf_hash(u32 index, unsigned int hmask) 45static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
@@ -46,33 +47,47 @@ static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
46 return index & hmask; 47 return index & hmask;
47} 48}
48 49
50static inline int tcf_hashinfo_init(struct tcf_hashinfo *hf, unsigned int mask)
51{
52 int i;
53
54 spin_lock_init(&hf->lock);
55 hf->index = 0;
56 hf->hmask = mask;
57 hf->htab = kzalloc((mask + 1) * sizeof(struct hlist_head),
58 GFP_KERNEL);
59 if (!hf->htab)
60 return -ENOMEM;
61 for (i = 0; i < mask + 1; i++)
62 INIT_HLIST_HEAD(&hf->htab[i]);
63 return 0;
64}
65
66static inline void tcf_hashinfo_destroy(struct tcf_hashinfo *hf)
67{
68 kfree(hf->htab);
69}
70
49#ifdef CONFIG_NET_CLS_ACT 71#ifdef CONFIG_NET_CLS_ACT
50 72
51#define ACT_P_CREATED 1 73#define ACT_P_CREATED 1
52#define ACT_P_DELETED 1 74#define ACT_P_DELETED 1
53 75
54struct tcf_act_hdr {
55 struct tcf_common common;
56};
57
58struct tc_action { 76struct tc_action {
59 void *priv; 77 void *priv;
60 const struct tc_action_ops *ops; 78 const struct tc_action_ops *ops;
61 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 79 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
62 __u32 order; 80 __u32 order;
63 struct tc_action *next; 81 struct list_head list;
64}; 82};
65 83
66#define TCA_CAP_NONE 0
67struct tc_action_ops { 84struct tc_action_ops {
68 struct tc_action_ops *next; 85 struct list_head head;
69 struct tcf_hashinfo *hinfo; 86 struct tcf_hashinfo *hinfo;
70 char kind[IFNAMSIZ]; 87 char kind[IFNAMSIZ];
71 __u32 type; /* TBD to match kind */ 88 __u32 type; /* TBD to match kind */
72 __u32 capab; /* capabilities includes 4 bit version */
73 struct module *owner; 89 struct module *owner;
74 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *); 90 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
75 int (*get_stats)(struct sk_buff *, struct tc_action *);
76 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 91 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
77 int (*cleanup)(struct tc_action *, int bind); 92 int (*cleanup)(struct tc_action *, int bind);
78 int (*lookup)(struct tc_action *, u32); 93 int (*lookup)(struct tc_action *, u32);
@@ -82,34 +97,30 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 97 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 98};
84 99
85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo); 100int tcf_hash_search(struct tc_action *a, u32 index);
86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 101void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87int tcf_hash_release(struct tcf_common *p, int bind, 102int tcf_hash_release(struct tcf_common *p, int bind,
88 struct tcf_hashinfo *hinfo); 103 struct tcf_hashinfo *hinfo);
89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 104u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo);
90 int type, struct tc_action *a);
91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92int tcf_hash_search(struct tc_action *a, u32 index);
93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 105struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94 int bind, struct tcf_hashinfo *hinfo); 106 int bind);
95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 107struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96 struct tc_action *a, int size, 108 struct tc_action *a, int size,
97 int bind, u32 *idx_gen, 109 int bind);
98 struct tcf_hashinfo *hinfo);
99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo); 110void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100 111
101int tcf_register_action(struct tc_action_ops *a); 112int tcf_register_action(struct tc_action_ops *a);
102int tcf_unregister_action(struct tc_action_ops *a); 113int tcf_unregister_action(struct tc_action_ops *a);
103void tcf_action_destroy(struct tc_action *a, int bind); 114void tcf_action_destroy(struct list_head *actions, int bind);
104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, 115int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
105 struct tcf_result *res); 116 struct tcf_result *res);
106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 117int tcf_action_init(struct net *net, struct nlattr *nla,
107 struct nlattr *est, char *n, int ovr, 118 struct nlattr *est, char *n, int ovr,
108 int bind); 119 int bind, struct list_head *);
109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 120struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
110 struct nlattr *est, char *n, int ovr, 121 struct nlattr *est, char *n, int ovr,
111 int bind); 122 int bind);
112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 123int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int);
113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 124int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 125int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
115int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int); 126int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 86505bfa5d2c..50e39a8822b4 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -81,9 +81,9 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
81 const struct in6_addr *daddr, unsigned int srcprefs, 81 const struct in6_addr *daddr, unsigned int srcprefs,
82 struct in6_addr *saddr); 82 struct in6_addr *saddr);
83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, 83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
84 unsigned char banned_flags); 84 u32 banned_flags);
85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, 85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
86 unsigned char banned_flags); 86 u32 banned_flags);
87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2); 87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); 88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); 89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
@@ -205,8 +205,9 @@ void ipv6_sock_ac_close(struct sock *sk);
205int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 205int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
206int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 206int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
207bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 207bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
208 const struct in6_addr *addr); 208 const struct in6_addr *addr);
209 209bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
210 const struct in6_addr *addr);
210 211
211/* Device notifier */ 212/* Device notifier */
212int register_inet6addr_notifier(struct notifier_block *nb); 213int register_inet6addr_notifier(struct notifier_block *nb);
@@ -248,6 +249,13 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
248 return idev; 249 return idev;
249} 250}
250 251
252static inline struct neigh_parms *__in6_dev_nd_parms_get_rcu(const struct net_device *dev)
253{
254 struct inet6_dev *idev = __in6_dev_get(dev);
255
256 return idev ? idev->nd_parms : NULL;
257}
258
251void in6_dev_finish_destroy(struct inet6_dev *idev); 259void in6_dev_finish_destroy(struct inet6_dev *idev);
252 260
253static inline void in6_dev_put(struct inet6_dev *idev) 261static inline void in6_dev_put(struct inet6_dev *idev)
diff --git a/include/net/arp.h b/include/net/arp.h
index 7509d9da4e36..73c49864076b 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -62,6 +62,5 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip);
66 65
67#endif /* _ARP_H */ 66#endif /* _ARP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 2a628b28249f..f4f9ee466791 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -115,6 +115,9 @@ struct bt_voice {
115#define BT_VOICE_TRANSPARENT 0x0003 115#define BT_VOICE_TRANSPARENT 0x0003
116#define BT_VOICE_CVSD_16BIT 0x0060 116#define BT_VOICE_CVSD_16BIT 0x0060
117 117
118#define BT_SNDMTU 12
119#define BT_RCVMTU 13
120
118__printf(1, 2) 121__printf(1, 2)
119int bt_info(const char *fmt, ...); 122int bt_info(const char *fmt, ...);
120__printf(1, 2) 123__printf(1, 2)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 1784c48699f0..66c1cd87bfe7 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -83,7 +83,8 @@
83enum { 83enum {
84 HCI_QUIRK_RESET_ON_CLOSE, 84 HCI_QUIRK_RESET_ON_CLOSE,
85 HCI_QUIRK_RAW_DEVICE, 85 HCI_QUIRK_RAW_DEVICE,
86 HCI_QUIRK_FIXUP_BUFFER_SIZE 86 HCI_QUIRK_FIXUP_BUFFER_SIZE,
87 HCI_QUIRK_BROKEN_STORED_LINK_KEY,
87}; 88};
88 89
89/* HCI device flags */ 90/* HCI device flags */
@@ -131,6 +132,7 @@ enum {
131 HCI_PERIODIC_INQ, 132 HCI_PERIODIC_INQ,
132 HCI_FAST_CONNECTABLE, 133 HCI_FAST_CONNECTABLE,
133 HCI_BREDR_ENABLED, 134 HCI_BREDR_ENABLED,
135 HCI_6LOWPAN_ENABLED,
134}; 136};
135 137
136/* A mask for the flags that are supposed to remain when a reset happens 138/* A mask for the flags that are supposed to remain when a reset happens
@@ -275,6 +277,12 @@ enum {
275#define LMP_EXTFEATURES 0x80 277#define LMP_EXTFEATURES 0x80
276 278
277/* Extended LMP features */ 279/* Extended LMP features */
280#define LMP_CSB_MASTER 0x01
281#define LMP_CSB_SLAVE 0x02
282#define LMP_SYNC_TRAIN 0x04
283#define LMP_SYNC_SCAN 0x08
284
285/* Host features */
278#define LMP_HOST_SSP 0x01 286#define LMP_HOST_SSP 0x01
279#define LMP_HOST_LE 0x02 287#define LMP_HOST_LE 0x02
280#define LMP_HOST_LE_BREDR 0x04 288#define LMP_HOST_LE_BREDR 0x04
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f8555ad7b104..f2f0cf5865c4 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -448,6 +448,7 @@ enum {
448 HCI_CONN_SSP_ENABLED, 448 HCI_CONN_SSP_ENABLED,
449 HCI_CONN_POWER_SAVE, 449 HCI_CONN_POWER_SAVE,
450 HCI_CONN_REMOTE_OOB, 450 HCI_CONN_REMOTE_OOB,
451 HCI_CONN_6LOWPAN,
451}; 452};
452 453
453static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 454static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
@@ -798,6 +799,12 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
798#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT) 799#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT)
799 800
800/* ----- Extended LMP capabilities ----- */ 801/* ----- Extended LMP capabilities ----- */
802#define lmp_csb_master_capable(dev) ((dev)->features[2][0] & LMP_CSB_MASTER)
803#define lmp_csb_slave_capable(dev) ((dev)->features[2][0] & LMP_CSB_SLAVE)
804#define lmp_sync_train_capable(dev) ((dev)->features[2][0] & LMP_SYNC_TRAIN)
805#define lmp_sync_scan_capable(dev) ((dev)->features[2][0] & LMP_SYNC_SCAN)
806
807/* ----- Host capabilities ----- */
801#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 808#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
802#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) 809#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE))
803#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) 810#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR))
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index c853b16de4ef..dbc4a89984ca 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -112,6 +112,9 @@ struct l2cap_conninfo {
112#define L2CAP_MOVE_CHAN_CFM_RSP 0x11 112#define L2CAP_MOVE_CHAN_CFM_RSP 0x11
113#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12 113#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
114#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13 114#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
115#define L2CAP_LE_CONN_REQ 0x14
116#define L2CAP_LE_CONN_RSP 0x15
117#define L2CAP_LE_CREDITS 0x16
115 118
116/* L2CAP extended feature mask */ 119/* L2CAP extended feature mask */
117#define L2CAP_FEAT_FLOWCTL 0x00000001 120#define L2CAP_FEAT_FLOWCTL 0x00000001
@@ -133,6 +136,7 @@ struct l2cap_conninfo {
133#define L2CAP_FC_L2CAP 0x02 136#define L2CAP_FC_L2CAP 0x02
134#define L2CAP_FC_CONNLESS 0x04 137#define L2CAP_FC_CONNLESS 0x04
135#define L2CAP_FC_A2MP 0x08 138#define L2CAP_FC_A2MP 0x08
139#define L2CAP_FC_6LOWPAN 0x3e /* reserved and temporary value */
136 140
137/* L2CAP Control Field bit masks */ 141/* L2CAP Control Field bit masks */
138#define L2CAP_CTRL_SAR 0xC000 142#define L2CAP_CTRL_SAR 0xC000
@@ -249,6 +253,7 @@ struct l2cap_conn_rsp {
249#define L2CAP_CID_SMP 0x0006 253#define L2CAP_CID_SMP 0x0006
250#define L2CAP_CID_DYN_START 0x0040 254#define L2CAP_CID_DYN_START 0x0040
251#define L2CAP_CID_DYN_END 0xffff 255#define L2CAP_CID_DYN_END 0xffff
256#define L2CAP_CID_LE_DYN_END 0x007f
252 257
253/* connect/create channel results */ 258/* connect/create channel results */
254#define L2CAP_CR_SUCCESS 0x0000 259#define L2CAP_CR_SUCCESS 0x0000
@@ -257,6 +262,10 @@ struct l2cap_conn_rsp {
257#define L2CAP_CR_SEC_BLOCK 0x0003 262#define L2CAP_CR_SEC_BLOCK 0x0003
258#define L2CAP_CR_NO_MEM 0x0004 263#define L2CAP_CR_NO_MEM 0x0004
259#define L2CAP_CR_BAD_AMP 0x0005 264#define L2CAP_CR_BAD_AMP 0x0005
265#define L2CAP_CR_AUTHENTICATION 0x0005
266#define L2CAP_CR_AUTHORIZATION 0x0006
267#define L2CAP_CR_BAD_KEY_SIZE 0x0007
268#define L2CAP_CR_ENCRYPTION 0x0008
260 269
261/* connect/create channel status */ 270/* connect/create channel status */
262#define L2CAP_CS_NO_INFO 0x0000 271#define L2CAP_CS_NO_INFO 0x0000
@@ -321,6 +330,12 @@ struct l2cap_conf_rfc {
321#define L2CAP_MODE_ERTM 0x03 330#define L2CAP_MODE_ERTM 0x03
322#define L2CAP_MODE_STREAMING 0x04 331#define L2CAP_MODE_STREAMING 0x04
323 332
333/* Unlike the above this one doesn't actually map to anything that would
334 * ever be sent over the air. Therefore, use a value that's unlikely to
335 * ever be used in the BR/EDR configuration phase.
336 */
337#define L2CAP_MODE_LE_FLOWCTL 0x80
338
324struct l2cap_conf_efs { 339struct l2cap_conf_efs {
325 __u8 id; 340 __u8 id;
326 __u8 stype; 341 __u8 stype;
@@ -423,6 +438,30 @@ struct l2cap_conn_param_update_rsp {
423#define L2CAP_CONN_PARAM_ACCEPTED 0x0000 438#define L2CAP_CONN_PARAM_ACCEPTED 0x0000
424#define L2CAP_CONN_PARAM_REJECTED 0x0001 439#define L2CAP_CONN_PARAM_REJECTED 0x0001
425 440
441#define L2CAP_LE_MAX_CREDITS 10
442#define L2CAP_LE_DEFAULT_MPS 230
443
444struct l2cap_le_conn_req {
445 __le16 psm;
446 __le16 scid;
447 __le16 mtu;
448 __le16 mps;
449 __le16 credits;
450} __packed;
451
452struct l2cap_le_conn_rsp {
453 __le16 dcid;
454 __le16 mtu;
455 __le16 mps;
456 __le16 credits;
457 __le16 result;
458} __packed;
459
460struct l2cap_le_credits {
461 __le16 cid;
462 __le16 credits;
463} __packed;
464
426/* ----- L2CAP channels and connections ----- */ 465/* ----- L2CAP channels and connections ----- */
427struct l2cap_seq_list { 466struct l2cap_seq_list {
428 __u16 head; 467 __u16 head;
@@ -477,6 +516,9 @@ struct l2cap_chan {
477 __u16 monitor_timeout; 516 __u16 monitor_timeout;
478 __u16 mps; 517 __u16 mps;
479 518
519 __u16 tx_credits;
520 __u16 rx_credits;
521
480 __u8 tx_state; 522 __u8 tx_state;
481 __u8 rx_state; 523 __u8 rx_state;
482 524
@@ -553,6 +595,7 @@ struct l2cap_ops {
553 void (*ready) (struct l2cap_chan *chan); 595 void (*ready) (struct l2cap_chan *chan);
554 void (*defer) (struct l2cap_chan *chan); 596 void (*defer) (struct l2cap_chan *chan);
555 void (*resume) (struct l2cap_chan *chan); 597 void (*resume) (struct l2cap_chan *chan);
598 void (*suspend) (struct l2cap_chan *chan);
556 void (*set_shutdown) (struct l2cap_chan *chan); 599 void (*set_shutdown) (struct l2cap_chan *chan);
557 long (*get_sndtimeo) (struct l2cap_chan *chan); 600 long (*get_sndtimeo) (struct l2cap_chan *chan);
558 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 601 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
@@ -654,6 +697,7 @@ enum {
654 FLAG_EXT_CTRL, 697 FLAG_EXT_CTRL,
655 FLAG_EFS_ENABLE, 698 FLAG_EFS_ENABLE,
656 FLAG_DEFER_SETUP, 699 FLAG_DEFER_SETUP,
700 FLAG_LE_CONN_REQ_SENT,
657}; 701};
658 702
659enum { 703enum {
@@ -809,11 +853,13 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan)
809} 853}
810 854
811extern bool disable_ertm; 855extern bool disable_ertm;
856extern bool enable_lecoc;
812 857
813int l2cap_init_sockets(void); 858int l2cap_init_sockets(void);
814void l2cap_cleanup_sockets(void); 859void l2cap_cleanup_sockets(void);
815bool l2cap_is_socket(struct socket *sock); 860bool l2cap_is_socket(struct socket *sock);
816 861
862void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan);
817void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); 863void __l2cap_connect_rsp_defer(struct l2cap_chan *chan);
818 864
819int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); 865int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3eae46cb1acf..b1f84b05c67e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -91,9 +91,8 @@ enum ieee80211_band {
91 * Channel flags set by the regulatory control code. 91 * Channel flags set by the regulatory control code.
92 * 92 *
93 * @IEEE80211_CHAN_DISABLED: This channel is disabled. 93 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
94 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted 94 * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
95 * on this channel. 95 * sending probe requests or beaconing.
96 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
97 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. 96 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
98 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel 97 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
99 * is not permitted. 98 * is not permitted.
@@ -113,8 +112,8 @@ enum ieee80211_band {
113 */ 112 */
114enum ieee80211_channel_flags { 113enum ieee80211_channel_flags {
115 IEEE80211_CHAN_DISABLED = 1<<0, 114 IEEE80211_CHAN_DISABLED = 1<<0,
116 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 115 IEEE80211_CHAN_NO_IR = 1<<1,
117 IEEE80211_CHAN_NO_IBSS = 1<<2, 116 /* hole at 1<<2 */
118 IEEE80211_CHAN_RADAR = 1<<3, 117 IEEE80211_CHAN_RADAR = 1<<3,
119 IEEE80211_CHAN_NO_HT40PLUS = 1<<4, 118 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
120 IEEE80211_CHAN_NO_HT40MINUS = 1<<5, 119 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
@@ -748,6 +747,8 @@ enum station_parameters_apply_mask {
748 * @supported_channels_len: number of supported channels 747 * @supported_channels_len: number of supported channels
749 * @supported_oper_classes: supported oper classes in IEEE 802.11 format 748 * @supported_oper_classes: supported oper classes in IEEE 802.11 format
750 * @supported_oper_classes_len: number of supported operating classes 749 * @supported_oper_classes_len: number of supported operating classes
750 * @opmode_notif: operating mode field from Operating Mode Notification
751 * @opmode_notif_used: information if operating mode field is used
751 */ 752 */
752struct station_parameters { 753struct station_parameters {
753 const u8 *supported_rates; 754 const u8 *supported_rates;
@@ -771,6 +772,8 @@ struct station_parameters {
771 u8 supported_channels_len; 772 u8 supported_channels_len;
772 const u8 *supported_oper_classes; 773 const u8 *supported_oper_classes;
773 u8 supported_oper_classes_len; 774 u8 supported_oper_classes_len;
775 u8 opmode_notif;
776 bool opmode_notif_used;
774}; 777};
775 778
776/** 779/**
@@ -1763,7 +1766,8 @@ enum wiphy_params_flags {
1763struct cfg80211_bitrate_mask { 1766struct cfg80211_bitrate_mask {
1764 struct { 1767 struct {
1765 u32 legacy; 1768 u32 legacy;
1766 u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; 1769 u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
1770 u16 vht_mcs[NL80211_VHT_NSS_MAX];
1767 } control[IEEE80211_NUM_BANDS]; 1771 } control[IEEE80211_NUM_BANDS];
1768}; 1772};
1769/** 1773/**
@@ -1945,6 +1949,73 @@ struct cfg80211_update_ft_ies_params {
1945}; 1949};
1946 1950
1947/** 1951/**
1952 * struct cfg80211_mgmt_tx_params - mgmt tx parameters
1953 *
1954 * This structure provides information needed to transmit a mgmt frame
1955 *
1956 * @chan: channel to use
1957 * @offchan: indicates wether off channel operation is required
1958 * @wait: duration for ROC
1959 * @buf: buffer to transmit
1960 * @len: buffer length
1961 * @no_cck: don't use cck rates for this frame
1962 * @dont_wait_for_ack: tells the low level not to wait for an ack
1963 */
1964struct cfg80211_mgmt_tx_params {
1965 struct ieee80211_channel *chan;
1966 bool offchan;
1967 unsigned int wait;
1968 const u8 *buf;
1969 size_t len;
1970 bool no_cck;
1971 bool dont_wait_for_ack;
1972};
1973
1974/**
1975 * struct cfg80211_dscp_exception - DSCP exception
1976 *
1977 * @dscp: DSCP value that does not adhere to the user priority range definition
1978 * @up: user priority value to which the corresponding DSCP value belongs
1979 */
1980struct cfg80211_dscp_exception {
1981 u8 dscp;
1982 u8 up;
1983};
1984
1985/**
1986 * struct cfg80211_dscp_range - DSCP range definition for user priority
1987 *
1988 * @low: lowest DSCP value of this user priority range, inclusive
1989 * @high: highest DSCP value of this user priority range, inclusive
1990 */
1991struct cfg80211_dscp_range {
1992 u8 low;
1993 u8 high;
1994};
1995
1996/* QoS Map Set element length defined in IEEE Std 802.11-2012, 8.4.2.97 */
1997#define IEEE80211_QOS_MAP_MAX_EX 21
1998#define IEEE80211_QOS_MAP_LEN_MIN 16
1999#define IEEE80211_QOS_MAP_LEN_MAX \
2000 (IEEE80211_QOS_MAP_LEN_MIN + 2 * IEEE80211_QOS_MAP_MAX_EX)
2001
2002/**
2003 * struct cfg80211_qos_map - QoS Map Information
2004 *
2005 * This struct defines the Interworking QoS map setting for DSCP values
2006 *
2007 * @num_des: number of DSCP exceptions (0..21)
2008 * @dscp_exception: optionally up to maximum of 21 DSCP exceptions from
2009 * the user priority DSCP range definition
2010 * @up: DSCP range definition for a particular user priority
2011 */
2012struct cfg80211_qos_map {
2013 u8 num_des;
2014 struct cfg80211_dscp_exception dscp_exception[IEEE80211_QOS_MAP_MAX_EX];
2015 struct cfg80211_dscp_range up[8];
2016};
2017
2018/**
1948 * struct cfg80211_ops - backend description for wireless configuration 2019 * struct cfg80211_ops - backend description for wireless configuration
1949 * 2020 *
1950 * This struct is registered by fullmac card drivers and/or wireless stacks 2021 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2186,6 +2257,8 @@ struct cfg80211_update_ft_ies_params {
2186 * @set_coalesce: Set coalesce parameters. 2257 * @set_coalesce: Set coalesce parameters.
2187 * 2258 *
2188 * @channel_switch: initiate channel-switch procedure (with CSA) 2259 * @channel_switch: initiate channel-switch procedure (with CSA)
2260 *
2261 * @set_qos_map: Set QoS mapping information to the driver
2189 */ 2262 */
2190struct cfg80211_ops { 2263struct cfg80211_ops {
2191 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2264 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2342,9 +2415,8 @@ struct cfg80211_ops {
2342 u64 cookie); 2415 u64 cookie);
2343 2416
2344 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, 2417 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
2345 struct ieee80211_channel *chan, bool offchan, 2418 struct cfg80211_mgmt_tx_params *params,
2346 unsigned int wait, const u8 *buf, size_t len, 2419 u64 *cookie);
2347 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
2348 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 2420 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
2349 struct wireless_dev *wdev, 2421 struct wireless_dev *wdev,
2350 u64 cookie); 2422 u64 cookie);
@@ -2428,6 +2500,9 @@ struct cfg80211_ops {
2428 int (*channel_switch)(struct wiphy *wiphy, 2500 int (*channel_switch)(struct wiphy *wiphy,
2429 struct net_device *dev, 2501 struct net_device *dev,
2430 struct cfg80211_csa_settings *params); 2502 struct cfg80211_csa_settings *params);
2503 int (*set_qos_map)(struct wiphy *wiphy,
2504 struct net_device *dev,
2505 struct cfg80211_qos_map *qos_map);
2431}; 2506};
2432 2507
2433/* 2508/*
@@ -2438,27 +2513,6 @@ struct cfg80211_ops {
2438/** 2513/**
2439 * enum wiphy_flags - wiphy capability flags 2514 * enum wiphy_flags - wiphy capability flags
2440 * 2515 *
2441 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
2442 * has its own custom regulatory domain and cannot identify the
2443 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
2444 * we will disregard the first regulatory hint (when the
2445 * initiator is %REGDOM_SET_BY_CORE).
2446 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
2447 * ignore regulatory domain settings until it gets its own regulatory
2448 * domain via its regulatory_hint() unless the regulatory hint is
2449 * from a country IE. After its gets its own regulatory domain it will
2450 * only allow further regulatory domain settings to further enhance
2451 * compliance. For example if channel 13 and 14 are disabled by this
2452 * regulatory domain no user regulatory domain can enable these channels
2453 * at a later time. This can be used for devices which do not have
2454 * calibration information guaranteed for frequencies or settings
2455 * outside of its regulatory domain. If used in combination with
2456 * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
2457 * will be followed.
2458 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
2459 * that passive scan flags and beaconing flags may not be lifted by
2460 * cfg80211 due to regulatory beacon hints. For more information on beacon
2461 * hints read the documenation for regulatory_hint_found_beacon()
2462 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 2516 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
2463 * wiphy at all 2517 * wiphy at all
2464 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 2518 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
@@ -2497,9 +2551,9 @@ struct cfg80211_ops {
2497 * beaconing mode (AP, IBSS, Mesh, ...). 2551 * beaconing mode (AP, IBSS, Mesh, ...).
2498 */ 2552 */
2499enum wiphy_flags { 2553enum wiphy_flags {
2500 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2554 /* use hole at 0 */
2501 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 2555 /* use hole at 1 */
2502 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 2556 /* use hole at 2 */
2503 WIPHY_FLAG_NETNS_OK = BIT(3), 2557 WIPHY_FLAG_NETNS_OK = BIT(3),
2504 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 2558 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
2505 WIPHY_FLAG_4ADDR_AP = BIT(5), 2559 WIPHY_FLAG_4ADDR_AP = BIT(5),
@@ -2676,6 +2730,34 @@ struct wiphy_coalesce_support {
2676}; 2730};
2677 2731
2678/** 2732/**
2733 * enum wiphy_vendor_command_flags - validation flags for vendor commands
2734 * @WIPHY_VENDOR_CMD_NEED_WDEV: vendor command requires wdev
2735 * @WIPHY_VENDOR_CMD_NEED_NETDEV: vendor command requires netdev
2736 * @WIPHY_VENDOR_CMD_NEED_RUNNING: interface/wdev must be up & running
2737 * (must be combined with %_WDEV or %_NETDEV)
2738 */
2739enum wiphy_vendor_command_flags {
2740 WIPHY_VENDOR_CMD_NEED_WDEV = BIT(0),
2741 WIPHY_VENDOR_CMD_NEED_NETDEV = BIT(1),
2742 WIPHY_VENDOR_CMD_NEED_RUNNING = BIT(2),
2743};
2744
2745/**
2746 * struct wiphy_vendor_command - vendor command definition
2747 * @info: vendor command identifying information, as used in nl80211
2748 * @flags: flags, see &enum wiphy_vendor_command_flags
2749 * @doit: callback for the operation, note that wdev is %NULL if the
2750 * flags didn't ask for a wdev and non-%NULL otherwise; the data
2751 * pointer may be %NULL if userspace provided no data at all
2752 */
2753struct wiphy_vendor_command {
2754 struct nl80211_vendor_cmd_info info;
2755 u32 flags;
2756 int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev,
2757 const void *data, int data_len);
2758};
2759
2760/**
2679 * struct wiphy - wireless hardware description 2761 * struct wiphy - wireless hardware description
2680 * @reg_notifier: the driver's regulatory notification callback, 2762 * @reg_notifier: the driver's regulatory notification callback,
2681 * note that if your driver uses wiphy_apply_custom_regulatory() 2763 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2721,6 +2803,8 @@ struct wiphy_coalesce_support {
2721 * @software_iftypes: bitmask of software interface types, these are not 2803 * @software_iftypes: bitmask of software interface types, these are not
2722 * subject to any restrictions since they are purely managed in SW. 2804 * subject to any restrictions since they are purely managed in SW.
2723 * @flags: wiphy flags, see &enum wiphy_flags 2805 * @flags: wiphy flags, see &enum wiphy_flags
2806 * @regulatory_flags: wiphy regulatory flags, see
2807 * &enum ieee80211_regulatory_flags
2724 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 2808 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
2725 * @bss_priv_size: each BSS struct has private data allocated with it, 2809 * @bss_priv_size: each BSS struct has private data allocated with it,
2726 * this variable determines its size 2810 * this variable determines its size
@@ -2786,6 +2870,11 @@ struct wiphy_coalesce_support {
2786 * @extended_capabilities_mask: mask of the valid values 2870 * @extended_capabilities_mask: mask of the valid values
2787 * @extended_capabilities_len: length of the extended capabilities 2871 * @extended_capabilities_len: length of the extended capabilities
2788 * @coalesce: packet coalescing support information 2872 * @coalesce: packet coalescing support information
2873 *
2874 * @vendor_commands: array of vendor commands supported by the hardware
2875 * @n_vendor_commands: number of vendor commands
2876 * @vendor_events: array of vendor events supported by the hardware
2877 * @n_vendor_events: number of vendor events
2789 */ 2878 */
2790struct wiphy { 2879struct wiphy {
2791 /* assign these fields before you register the wiphy */ 2880 /* assign these fields before you register the wiphy */
@@ -2809,7 +2898,7 @@ struct wiphy {
2809 2898
2810 u16 max_acl_mac_addrs; 2899 u16 max_acl_mac_addrs;
2811 2900
2812 u32 flags, features; 2901 u32 flags, regulatory_flags, features;
2813 2902
2814 u32 ap_sme_capa; 2903 u32 ap_sme_capa;
2815 2904
@@ -2897,6 +2986,10 @@ struct wiphy {
2897 2986
2898 const struct wiphy_coalesce_support *coalesce; 2987 const struct wiphy_coalesce_support *coalesce;
2899 2988
2989 const struct wiphy_vendor_command *vendor_commands;
2990 const struct nl80211_vendor_cmd_info *vendor_events;
2991 int n_vendor_commands, n_vendor_events;
2992
2900 char priv[0] __aligned(NETDEV_ALIGN); 2993 char priv[0] __aligned(NETDEV_ALIGN);
2901}; 2994};
2902 2995
@@ -3388,9 +3481,11 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
3388/** 3481/**
3389 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 3482 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
3390 * @skb: the data frame 3483 * @skb: the data frame
3484 * @qos_map: Interworking QoS mapping or %NULL if not in use
3391 * Return: The 802.1p/1d tag. 3485 * Return: The 802.1p/1d tag.
3392 */ 3486 */
3393unsigned int cfg80211_classify8021d(struct sk_buff *skb); 3487unsigned int cfg80211_classify8021d(struct sk_buff *skb,
3488 struct cfg80211_qos_map *qos_map);
3394 3489
3395/** 3490/**
3396 * cfg80211_find_ie - find information element in data 3491 * cfg80211_find_ie - find information element in data
@@ -3472,6 +3567,9 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3472 * custom regulatory domain will be trusted completely and as such previous 3567 * custom regulatory domain will be trusted completely and as such previous
3473 * default channel settings will be disregarded. If no rule is found for a 3568 * default channel settings will be disregarded. If no rule is found for a
3474 * channel on the regulatory domain the channel will be disabled. 3569 * channel on the regulatory domain the channel will be disabled.
3570 * Drivers using this for a wiphy should also set the wiphy flag
3571 * WIPHY_FLAG_CUSTOM_REGULATORY or cfg80211 will set it for the wiphy
3572 * that called this helper.
3475 */ 3573 */
3476void wiphy_apply_custom_regulatory(struct wiphy *wiphy, 3574void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3477 const struct ieee80211_regdomain *regd); 3575 const struct ieee80211_regdomain *regd);
@@ -3838,6 +3936,121 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy);
3838 */ 3936 */
3839void wiphy_rfkill_stop_polling(struct wiphy *wiphy); 3937void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3840 3938
3939/**
3940 * DOC: Vendor commands
3941 *
3942 * Occasionally, there are special protocol or firmware features that
3943 * can't be implemented very openly. For this and similar cases, the
3944 * vendor command functionality allows implementing the features with
3945 * (typically closed-source) userspace and firmware, using nl80211 as
3946 * the configuration mechanism.
3947 *
3948 * A driver supporting vendor commands must register them as an array
3949 * in struct wiphy, with handlers for each one, each command has an
3950 * OUI and sub command ID to identify it.
3951 *
3952 * Note that this feature should not be (ab)used to implement protocol
3953 * features that could openly be shared across drivers. In particular,
3954 * it must never be required to use vendor commands to implement any
3955 * "normal" functionality that higher-level userspace like connection
3956 * managers etc. need.
3957 */
3958
3959struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
3960 enum nl80211_commands cmd,
3961 enum nl80211_attrs attr,
3962 int approxlen);
3963
3964struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
3965 enum nl80211_commands cmd,
3966 enum nl80211_attrs attr,
3967 int vendor_event_idx,
3968 int approxlen, gfp_t gfp);
3969
3970void __cfg80211_send_event_skb(struct sk_buff *skb, gfp_t gfp);
3971
3972/**
3973 * cfg80211_vendor_cmd_alloc_reply_skb - allocate vendor command reply
3974 * @wiphy: the wiphy
3975 * @approxlen: an upper bound of the length of the data that will
3976 * be put into the skb
3977 *
3978 * This function allocates and pre-fills an skb for a reply to
3979 * a vendor command. Since it is intended for a reply, calling
3980 * it outside of a vendor command's doit() operation is invalid.
3981 *
3982 * The returned skb is pre-filled with some identifying data in
3983 * a way that any data that is put into the skb (with skb_put(),
3984 * nla_put() or similar) will end up being within the
3985 * %NL80211_ATTR_VENDOR_DATA attribute, so all that needs to be done
3986 * with the skb is adding data for the corresponding userspace tool
3987 * which can then read that data out of the vendor data attribute.
3988 * You must not modify the skb in any other way.
3989 *
3990 * When done, call cfg80211_vendor_cmd_reply() with the skb and return
3991 * its error code as the result of the doit() operation.
3992 *
3993 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3994 */
3995static inline struct sk_buff *
3996cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
3997{
3998 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_VENDOR,
3999 NL80211_ATTR_VENDOR_DATA, approxlen);
4000}
4001
4002/**
4003 * cfg80211_vendor_cmd_reply - send the reply skb
4004 * @skb: The skb, must have been allocated with
4005 * cfg80211_vendor_cmd_alloc_reply_skb()
4006 *
4007 * Since calling this function will usually be the last thing
4008 * before returning from the vendor command doit() you should
4009 * return the error code. Note that this function consumes the
4010 * skb regardless of the return value.
4011 *
4012 * Return: An error code or 0 on success.
4013 */
4014int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
4015
4016/**
4017 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
4018 * @wiphy: the wiphy
4019 * @event_idx: index of the vendor event in the wiphy's vendor_events
4020 * @approxlen: an upper bound of the length of the data that will
4021 * be put into the skb
4022 * @gfp: allocation flags
4023 *
4024 * This function allocates and pre-fills an skb for an event on the
4025 * vendor-specific multicast group.
4026 *
4027 * When done filling the skb, call cfg80211_vendor_event() with the
4028 * skb to send the event.
4029 *
4030 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
4031 */
4032static inline struct sk_buff *
4033cfg80211_vendor_event_alloc(struct wiphy *wiphy, int approxlen,
4034 int event_idx, gfp_t gfp)
4035{
4036 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_VENDOR,
4037 NL80211_ATTR_VENDOR_DATA,
4038 event_idx, approxlen, gfp);
4039}
4040
4041/**
4042 * cfg80211_vendor_event - send the event
4043 * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc()
4044 * @gfp: allocation flags
4045 *
4046 * This function sends the given @skb, which must have been allocated
4047 * by cfg80211_vendor_event_alloc(), as an event. It always consumes it.
4048 */
4049static inline void cfg80211_vendor_event(struct sk_buff *skb, gfp_t gfp)
4050{
4051 __cfg80211_send_event_skb(skb, gfp);
4052}
4053
3841#ifdef CONFIG_NL80211_TESTMODE 4054#ifdef CONFIG_NL80211_TESTMODE
3842/** 4055/**
3843 * DOC: Test mode 4056 * DOC: Test mode
@@ -3873,8 +4086,12 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3873 * 4086 *
3874 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4087 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3875 */ 4088 */
3876struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, 4089static inline struct sk_buff *
3877 int approxlen); 4090cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
4091{
4092 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_TESTMODE,
4093 NL80211_ATTR_TESTDATA, approxlen);
4094}
3878 4095
3879/** 4096/**
3880 * cfg80211_testmode_reply - send the reply skb 4097 * cfg80211_testmode_reply - send the reply skb
@@ -3888,7 +4105,10 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
3888 * 4105 *
3889 * Return: An error code or 0 on success. 4106 * Return: An error code or 0 on success.
3890 */ 4107 */
3891int cfg80211_testmode_reply(struct sk_buff *skb); 4108static inline int cfg80211_testmode_reply(struct sk_buff *skb)
4109{
4110 return cfg80211_vendor_cmd_reply(skb);
4111}
3892 4112
3893/** 4113/**
3894 * cfg80211_testmode_alloc_event_skb - allocate testmode event 4114 * cfg80211_testmode_alloc_event_skb - allocate testmode event
@@ -3911,8 +4131,13 @@ int cfg80211_testmode_reply(struct sk_buff *skb);
3911 * 4131 *
3912 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4132 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3913 */ 4133 */
3914struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, 4134static inline struct sk_buff *
3915 int approxlen, gfp_t gfp); 4135cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
4136{
4137 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_TESTMODE,
4138 NL80211_ATTR_TESTDATA, -1,
4139 approxlen, gfp);
4140}
3916 4141
3917/** 4142/**
3918 * cfg80211_testmode_event - send the event 4143 * cfg80211_testmode_event - send the event
@@ -3924,7 +4149,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
3924 * by cfg80211_testmode_alloc_event_skb(), as an event. It always 4149 * by cfg80211_testmode_alloc_event_skb(), as an event. It always
3925 * consumes it. 4150 * consumes it.
3926 */ 4151 */
3927void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); 4152static inline void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
4153{
4154 __cfg80211_send_event_skb(skb, gfp);
4155}
3928 4156
3929#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), 4157#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
3930#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd), 4158#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
@@ -4146,6 +4374,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4146/** 4374/**
4147 * cfg80211_cac_event - Channel availability check (CAC) event 4375 * cfg80211_cac_event - Channel availability check (CAC) event
4148 * @netdev: network device 4376 * @netdev: network device
4377 * @chandef: chandef for the current channel
4149 * @event: type of event 4378 * @event: type of event
4150 * @gfp: context flags 4379 * @gfp: context flags
4151 * 4380 *
@@ -4154,6 +4383,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4154 * also by full-MAC drivers. 4383 * also by full-MAC drivers.
4155 */ 4384 */
4156void cfg80211_cac_event(struct net_device *netdev, 4385void cfg80211_cac_event(struct net_device *netdev,
4386 const struct cfg80211_chan_def *chandef,
4157 enum nl80211_radar_event event, gfp_t gfp); 4387 enum nl80211_radar_event event, gfp_t gfp);
4158 4388
4159 4389
@@ -4279,7 +4509,8 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
4279 * @dev: the device which switched channels 4509 * @dev: the device which switched channels
4280 * @chandef: the new channel definition 4510 * @chandef: the new channel definition
4281 * 4511 *
4282 * Acquires wdev_lock, so must only be called from sleepable driver context! 4512 * Caller must acquire wdev_lock, therefore must only be called from sleepable
4513 * driver context!
4283 */ 4514 */
4284void cfg80211_ch_switch_notify(struct net_device *dev, 4515void cfg80211_ch_switch_notify(struct net_device *dev,
4285 struct cfg80211_chan_def *chandef); 4516 struct cfg80211_chan_def *chandef);
@@ -4409,6 +4640,14 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
4409 */ 4640 */
4410void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); 4641void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
4411 4642
4643/**
4644 * ieee80211_get_num_supported_channels - get number of channels device has
4645 * @wiphy: the wiphy
4646 *
4647 * Return: the number of channels supported by the device.
4648 */
4649unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy);
4650
4412/* Logging, debugging and troubleshooting/diagnostic helpers. */ 4651/* Logging, debugging and troubleshooting/diagnostic helpers. */
4413 4652
4414/* wiphy_printk helpers, similar to dev_printk */ 4653/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index a8c2ef6d3b93..a6fd939f202d 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -26,8 +26,7 @@
26 * the GNU General Public License for more details. 26 * the GNU General Public License for more details.
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, see <http://www.gnu.org/licenses/>.
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * 30 *
32 */ 31 */
33 32
@@ -304,7 +303,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,
304 303
305 for (opt_iter = 6; opt_iter < opt_len;) { 304 for (opt_iter = 6; opt_iter < opt_len;) {
306 tag_len = opt[opt_iter + 1]; 305 tag_len = opt[opt_iter + 1];
307 if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { 306 if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) {
308 err_offset = opt_iter + 1; 307 err_offset = opt_iter + 1;
309 goto out; 308 goto out;
310 } 309 }
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 33d03b648646..9cf2d5ef38d9 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -16,17 +16,16 @@
16#include <linux/cgroup.h> 16#include <linux/cgroup.h>
17#include <linux/hardirq.h> 17#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19#include <net/sock.h>
19 20
20#if IS_ENABLED(CONFIG_NET_CLS_CGROUP) 21#ifdef CONFIG_CGROUP_NET_CLASSID
21struct cgroup_cls_state 22struct cgroup_cls_state {
22{
23 struct cgroup_subsys_state css; 23 struct cgroup_subsys_state css;
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27void sock_update_classid(struct sock *sk); 27struct cgroup_cls_state *task_cls_state(struct task_struct *p);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 29static inline u32 task_cls_classid(struct task_struct *p)
31{ 30{
32 u32 classid; 31 u32 classid;
@@ -41,33 +40,18 @@ static inline u32 task_cls_classid(struct task_struct *p)
41 40
42 return classid; 41 return classid;
43} 42}
44#elif IS_MODULE(CONFIG_NET_CLS_CGROUP)
45static inline u32 task_cls_classid(struct task_struct *p)
46{
47 struct cgroup_subsys_state *css;
48 u32 classid = 0;
49
50 if (in_interrupt())
51 return 0;
52
53 rcu_read_lock();
54 css = task_css(p, net_cls_subsys_id);
55 if (css)
56 classid = container_of(css,
57 struct cgroup_cls_state, css)->classid;
58 rcu_read_unlock();
59 43
60 return classid;
61}
62#endif
63#else /* !CGROUP_NET_CLS_CGROUP */
64static inline void sock_update_classid(struct sock *sk) 44static inline void sock_update_classid(struct sock *sk)
65{ 45{
66} 46 u32 classid;
67 47
68static inline u32 task_cls_classid(struct task_struct *p) 48 classid = task_cls_classid(current);
49 if (classid != sk->sk_classid)
50 sk->sk_classid = classid;
51}
52#else /* !CONFIG_CGROUP_NET_CLASSID */
53static inline void sock_update_classid(struct sock *sk)
69{ 54{
70 return 0;
71} 55}
72#endif /* CGROUP_NET_CLS_CGROUP */ 56#endif /* CONFIG_CGROUP_NET_CLASSID */
73#endif /* _NET_CLS_CGROUP_H */ 57#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/codel.h b/include/net/codel.h
index 3b04ff5f6f8d..fe0eab32ce76 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -46,7 +46,6 @@
46#include <linux/skbuff.h> 46#include <linux/skbuff.h>
47#include <net/pkt_sched.h> 47#include <net/pkt_sched.h>
48#include <net/inet_ecn.h> 48#include <net/inet_ecn.h>
49#include <linux/reciprocal_div.h>
50 49
51/* Controlling Queue Delay (CoDel) algorithm 50/* Controlling Queue Delay (CoDel) algorithm
52 * ========================================= 51 * =========================================
@@ -211,10 +210,9 @@ static codel_time_t codel_control_law(codel_time_t t,
211 codel_time_t interval, 210 codel_time_t interval,
212 u32 rec_inv_sqrt) 211 u32 rec_inv_sqrt)
213{ 212{
214 return t + reciprocal_divide(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT); 213 return t + reciprocal_scale(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT);
215} 214}
216 215
217
218static bool codel_should_drop(const struct sk_buff *skb, 216static bool codel_should_drop(const struct sk_buff *skb,
219 struct Qdisc *sch, 217 struct Qdisc *sch,
220 struct codel_vars *vars, 218 struct codel_vars *vars,
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
index d2f3041c0dfa..aec07c8a660a 100644
--- a/include/net/dcbevent.h
+++ b/include/net/dcbevent.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: John Fastabend <john.r.fastabend@intel.com> 16 * Author: John Fastabend <john.r.fastabend@intel.com>
18 */ 17 */
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index fc5d5dcebb00..a975edf21b22 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: Lucy Liu <lucy.liu@intel.com> 16 * Author: Lucy Liu <lucy.liu@intel.com>
18 */ 17 */
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index 20b5ab06032d..197886cd7bdd 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -9,7 +9,7 @@ struct dn_ifaddr {
9 struct dn_dev *ifa_dev; 9 struct dn_dev *ifa_dev;
10 __le16 ifa_local; 10 __le16 ifa_local;
11 __le16 ifa_address; 11 __le16 ifa_address;
12 __u8 ifa_flags; 12 __u32 ifa_flags;
13 __u8 ifa_scope; 13 __u8 ifa_scope;
14 char ifa_label[IFNAMSIZ]; 14 char ifa_label[IFNAMSIZ];
15 struct rcu_head rcu; 15 struct rcu_head rcu;
diff --git a/include/net/dst.h b/include/net/dst.h
index 44995c13e941..77eb53fabfb0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -322,12 +322,11 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
322 skb->dev = dev; 322 skb->dev = dev;
323 323
324 /* 324 /*
325 * Clear rxhash so that we can recalulate the hash for the 325 * Clear hash so that we can recalulate the hash for the
326 * encapsulated packet, unless we have already determine the hash 326 * encapsulated packet, unless we have already determine the hash
327 * over the L4 4-tuple. 327 * over the L4 4-tuple.
328 */ 328 */
329 if (!skb->l4_rxhash) 329 skb_clear_hash_if_not_l4(skb);
330 skb->rxhash = 0;
331 skb_set_queue_mapping(skb, 0); 330 skb_set_queue_mapping(skb, 0);
332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev))); 331 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
333} 332}
diff --git a/include/net/flow.h b/include/net/flow.h
index 65ce471d2ab5..d23e7fa2042e 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -20,8 +20,7 @@ struct flowi_common {
20 __u8 flowic_proto; 20 __u8 flowic_proto;
21 __u8 flowic_flags; 21 __u8 flowic_flags;
22#define FLOWI_FLAG_ANYSRC 0x01 22#define FLOWI_FLAG_ANYSRC 0x01
23#define FLOWI_FLAG_CAN_SLEEP 0x02 23#define FLOWI_FLAG_KNOWN_NH 0x02
24#define FLOWI_FLAG_KNOWN_NH 0x04
25 __u32 flowic_secid; 24 __u32 flowic_secid;
26}; 25};
27 26
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 1b177ed803b7..93695f0e22a5 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -73,6 +73,7 @@ struct genl_family {
73 * @attrs: netlink attributes 73 * @attrs: netlink attributes
74 * @_net: network namespace 74 * @_net: network namespace
75 * @user_ptr: user pointers 75 * @user_ptr: user pointers
76 * @dst_sk: destination socket
76 */ 77 */
77struct genl_info { 78struct genl_info {
78 u32 snd_seq; 79 u32 snd_seq;
@@ -85,6 +86,7 @@ struct genl_info {
85 struct net * _net; 86 struct net * _net;
86#endif 87#endif
87 void * user_ptr[2]; 88 void * user_ptr[2];
89 struct sock * dst_sk;
88}; 90};
89 91
90static inline struct net *genl_info_net(struct genl_info *info) 92static inline struct net *genl_info_net(struct genl_info *info)
@@ -177,6 +179,8 @@ void genl_notify(struct genl_family *family,
177 struct sk_buff *skb, struct net *net, u32 portid, 179 struct sk_buff *skb, struct net *net, u32 portid,
178 u32 group, struct nlmsghdr *nlh, gfp_t flags); 180 u32 group, struct nlmsghdr *nlh, gfp_t flags);
179 181
182struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
183 gfp_t flags);
180void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, 184void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
181 struct genl_family *family, int flags, u8 cmd); 185 struct genl_family *family, int flags, u8 cmd);
182 186
diff --git a/include/net/gre.h b/include/net/gre.h
index dcd9ae3270d3..70046a0b0b89 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -33,9 +33,6 @@ struct gre_cisco_protocol {
33int gre_cisco_register(struct gre_cisco_protocol *proto); 33int gre_cisco_register(struct gre_cisco_protocol *proto);
34int gre_cisco_unregister(struct gre_cisco_protocol *proto); 34int gre_cisco_unregister(struct gre_cisco_protocol *proto);
35 35
36int gre_offload_init(void);
37void gre_offload_exit(void);
38
39void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, 36void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
40 int hdr_len); 37 int hdr_len);
41 38
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 65bb13035598..9650a3ffd2d2 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -50,8 +50,8 @@ struct inet6_ifaddr {
50 50
51 int state; 51 int state;
52 52
53 __u32 flags;
53 __u8 dad_probes; 54 __u8 dad_probes;
54 __u8 flags;
55 55
56 __u16 scope; 56 __u16 scope;
57 57
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 71c6e264e5b5..61474ea02152 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -133,9 +133,9 @@ struct inet_timewait_sock {
133 /* And these are ours. */ 133 /* And these are ours. */
134 unsigned int tw_ipv6only : 1, 134 unsigned int tw_ipv6only : 1,
135 tw_transparent : 1, 135 tw_transparent : 1,
136 tw_pad : 6, /* 6 bits hole */ 136 tw_flowlabel : 20,
137 tw_tos : 8, 137 tw_pad : 2, /* 2 bits hole */
138 tw_pad2 : 16; /* 16 bits hole */ 138 tw_tos : 8;
139 kmemcheck_bitfield_end(flags); 139 kmemcheck_bitfield_end(flags);
140 u32 tw_ttd; 140 u32 tw_ttd;
141 struct inet_bind_bucket *tw_tb; 141 struct inet_bind_bucket *tw_tb;
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index f4e127af4e17..6efe73c79c52 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -163,7 +163,6 @@ void inet_putpeer(struct inet_peer *p);
163bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); 163bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout);
164 164
165void inetpeer_invalidate_tree(struct inet_peer_base *); 165void inetpeer_invalidate_tree(struct inet_peer_base *);
166void inetpeer_invalidate_family(int family);
167 166
168/* 167/*
169 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, 168 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts,
diff --git a/include/net/ip.h b/include/net/ip.h
index 5a25f36fe3a7..23be0fd37937 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -63,6 +63,7 @@ struct ipcm_cookie {
63}; 63};
64 64
65#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 65#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
66#define PKTINFO_SKB_CB(skb) ((struct in_pktinfo *)((skb)->cb))
66 67
67struct ip_ra_chain { 68struct ip_ra_chain {
68 struct ip_ra_chain __rcu *next; 69 struct ip_ra_chain __rcu *next;
@@ -90,7 +91,7 @@ struct packet_type;
90struct rtable; 91struct rtable;
91struct sockaddr; 92struct sockaddr;
92 93
93int igmp_mc_proc_init(void); 94int igmp_mc_init(void);
94 95
95/* 96/*
96 * Functions provided by ip.c 97 * Functions provided by ip.c
@@ -177,12 +178,6 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
177 __be32 saddr, const struct ip_reply_arg *arg, 178 __be32 saddr, const struct ip_reply_arg *arg,
178 unsigned int len); 179 unsigned int len);
179 180
180struct ipv4_config {
181 int log_martians;
182 int no_pmtu_disc;
183};
184
185extern struct ipv4_config ipv4_config;
186#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) 181#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field)
187#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) 182#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field)
188#define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) 183#define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val)
@@ -269,6 +264,39 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
269 !(dst_metric_locked(dst, RTAX_MTU))); 264 !(dst_metric_locked(dst, RTAX_MTU)));
270} 265}
271 266
267static inline bool ip_sk_accept_pmtu(const struct sock *sk)
268{
269 return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE;
270}
271
272static inline bool ip_sk_use_pmtu(const struct sock *sk)
273{
274 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
275}
276
277static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
278 bool forwarding)
279{
280 struct net *net = dev_net(dst->dev);
281
282 if (net->ipv4.sysctl_ip_fwd_use_pmtu ||
283 dst_metric_locked(dst, RTAX_MTU) ||
284 !forwarding)
285 return dst_mtu(dst);
286
287 return min(dst->dev->mtu, IP_MAX_MTU);
288}
289
290static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
291{
292 if (!skb->sk || ip_sk_use_pmtu(skb->sk)) {
293 bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED;
294 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
295 } else {
296 return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
297 }
298}
299
272void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 300void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
273 301
274static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) 302static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk)
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 2182525e4d74..aca0c2709fd6 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -282,7 +282,7 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
282 const struct in6_addr *saddr, int src_len); 282 const struct in6_addr *saddr, int src_len);
283 283
284void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), 284void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
285 int prune, void *arg); 285 void *arg);
286 286
287int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info); 287int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info);
288 288
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 733747ce163c..017badb1aec7 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -51,26 +51,6 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
51 return (flags >> 3) & 7; 51 return (flags >> 3) & 7;
52} 52}
53 53
54void rt6_bind_peer(struct rt6_info *rt, int create);
55
56static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create)
57{
58 if (rt6_has_peer(rt))
59 return rt6_peer_ptr(rt);
60
61 rt6_bind_peer(rt, create);
62 return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL);
63}
64
65static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
66{
67 return __rt6_get_peer(rt, 0);
68}
69
70static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt)
71{
72 return __rt6_get_peer(rt, 1);
73}
74 54
75void ip6_route_input(struct sk_buff *skb); 55void ip6_route_input(struct sk_buff *skb);
76 56
@@ -172,16 +152,28 @@ static inline bool ipv6_unicast_destination(const struct sk_buff *skb)
172 return rt->rt6i_flags & RTF_LOCAL; 152 return rt->rt6i_flags & RTF_LOCAL;
173} 153}
174 154
155static inline bool ipv6_anycast_destination(const struct sk_buff *skb)
156{
157 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb);
158
159 return rt->rt6i_flags & RTF_ANYCAST;
160}
161
175int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); 162int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
176 163
177static inline int ip6_skb_dst_mtu(struct sk_buff *skb) 164static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
178{ 165{
179 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; 166 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
180 167
181 return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? 168 return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ?
182 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); 169 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
183} 170}
184 171
172static inline bool ip6_sk_accept_pmtu(const struct sock *sk)
173{
174 return inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_INTERFACE;
175}
176
185static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) 177static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt)
186{ 178{
187 return &rt->rt6i_gateway; 179 return &rt->rt6i_gateway;
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 6d1549c4893c..a5593dab6af7 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -79,7 +79,7 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
81 if (net_xmit_eval(err) == 0) { 81 if (net_xmit_eval(err) == 0) {
82 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); 82 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
83 u64_stats_update_begin(&tstats->syncp); 83 u64_stats_update_begin(&tstats->syncp);
84 tstats->tx_bytes += pkt_len; 84 tstats->tx_bytes += pkt_len;
85 tstats->tx_packets++; 85 tstats->tx_packets++;
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 732f8c6ae975..48ed75c21260 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -38,6 +38,10 @@ struct ip_tunnel_prl_entry {
38 struct rcu_head rcu_head; 38 struct rcu_head rcu_head;
39}; 39};
40 40
41struct ip_tunnel_dst {
42 struct dst_entry __rcu *dst;
43};
44
41struct ip_tunnel { 45struct ip_tunnel {
42 struct ip_tunnel __rcu *next; 46 struct ip_tunnel __rcu *next;
43 struct hlist_node hash_node; 47 struct hlist_node hash_node;
@@ -54,6 +58,8 @@ struct ip_tunnel {
54 int hlen; /* Precalculated header length */ 58 int hlen; /* Precalculated header length */
55 int mlink; 59 int mlink;
56 60
61 struct ip_tunnel_dst __percpu *dst_cache;
62
57 struct ip_tunnel_parm parms; 63 struct ip_tunnel_parm parms;
58 64
59 /* for SIT */ 65 /* for SIT */
@@ -155,10 +161,10 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
155 161
156static inline void iptunnel_xmit_stats(int err, 162static inline void iptunnel_xmit_stats(int err,
157 struct net_device_stats *err_stats, 163 struct net_device_stats *err_stats,
158 struct pcpu_tstats __percpu *stats) 164 struct pcpu_sw_netstats __percpu *stats)
159{ 165{
160 if (err > 0) { 166 if (err > 0) {
161 struct pcpu_tstats *tstats = this_cpu_ptr(stats); 167 struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats);
162 168
163 u64_stats_update_begin(&tstats->syncp); 169 u64_stats_update_begin(&tstats->syncp);
164 tstats->tx_bytes += err; 170 tstats->tx_bytes += err;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 488316e339a1..4f541f11ce63 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -238,6 +238,8 @@ struct ip6_flowlabel {
238 238
239#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) 239#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
240#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) 240#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
241#define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK)
242#define IPV6_TCLASS_SHIFT 20
241 243
242struct ipv6_fl_socklist { 244struct ipv6_fl_socklist {
243 struct ipv6_fl_socklist __rcu *next; 245 struct ipv6_fl_socklist __rcu *next;
@@ -251,7 +253,8 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
251 struct ipv6_txoptions *fopt); 253 struct ipv6_txoptions *fopt);
252void fl6_free_socklist(struct sock *sk); 254void fl6_free_socklist(struct sock *sk);
253int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); 255int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen);
254int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq); 256int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
257 int flags);
255int ip6_flowlabel_init(void); 258int ip6_flowlabel_init(void);
256void ip6_flowlabel_cleanup(void); 259void ip6_flowlabel_cleanup(void);
257 260
@@ -266,9 +269,6 @@ void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
266int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, 269int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
267 struct icmp6hdr *thdr, int len); 270 struct icmp6hdr *thdr, int len);
268 271
269struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb,
270 struct sock *sk, struct flowi6 *fl6);
271
272int ip6_ra_control(struct sock *sk, int sel); 272int ip6_ra_control(struct sock *sk, int sel);
273 273
274int ipv6_parse_hopopts(struct sk_buff *skb); 274int ipv6_parse_hopopts(struct sk_buff *skb);
@@ -678,6 +678,15 @@ static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
678 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; 678 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
679} 679}
680 680
681static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
682{
683 return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
684}
685
686static inline u8 ip6_tclass(__be32 flowinfo)
687{
688 return ntohl(flowinfo & IPV6_TCLASS_MASK) >> IPV6_TCLASS_SHIFT;
689}
681/* 690/*
682 * Prototypes exported by ipv6 691 * Prototypes exported by ipv6
683 */ 692 */
@@ -712,11 +721,9 @@ void ip6_flush_pending_frames(struct sock *sk);
712 721
713int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); 722int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6);
714struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 723struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
715 const struct in6_addr *final_dst, 724 const struct in6_addr *final_dst);
716 bool can_sleep);
717struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 725struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
718 const struct in6_addr *final_dst, 726 const struct in6_addr *final_dst);
719 bool can_sleep);
720struct dst_entry *ip6_blackhole_route(struct net *net, 727struct dst_entry *ip6_blackhole_route(struct net *net,
721 struct dst_entry *orig_dst); 728 struct dst_entry *orig_dst);
722 729
@@ -776,6 +783,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
776 char __user *optval, int __user *optlen); 783 char __user *optval, int __user *optlen);
777 784
778int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); 785int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
786int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
787 int addr_len);
779 788
780int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, 789int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
781 int *addr_len); 790 int *addr_len);
@@ -835,7 +844,6 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
835 844
836#ifdef CONFIG_SYSCTL 845#ifdef CONFIG_SYSCTL
837extern struct ctl_table ipv6_route_table_template[]; 846extern struct ctl_table ipv6_route_table_template[];
838extern struct ctl_table ipv6_icmp_table_template[];
839 847
840struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); 848struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
841struct ctl_table *ipv6_route_sysctl_init(struct net *net); 849struct ctl_table *ipv6_route_sysctl_init(struct net *net);
diff --git a/include/net/irda/discovery.h b/include/net/irda/discovery.h
index 0ce93398720d..63ae32530567 100644
--- a/include/net/irda/discovery.h
+++ b/include/net/irda/discovery.h
@@ -23,9 +23,7 @@
23 * GNU General Public License for more details. 23 * GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software 26 * along with this program; if not, see <http://www.gnu.org/licenses/>.
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
29 * 27 *
30 ********************************************************************/ 28 ********************************************************************/
31 29
diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h
index 69b610acd2df..2a580ce9edad 100644
--- a/include/net/irda/ircomm_core.h
+++ b/include/net/irda/ircomm_core.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index bc0c6f31f1c6..5bbc32998d57 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_lmp.h b/include/net/irda/ircomm_lmp.h
index ae02106be590..5042a5021a04 100644
--- a/include/net/irda/ircomm_lmp.h
+++ b/include/net/irda/ircomm_lmp.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_param.h b/include/net/irda/ircomm_param.h
index e6678800c41f..1f67432321c4 100644
--- a/include/net/irda/ircomm_param.h
+++ b/include/net/irda/ircomm_param.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_ttp.h b/include/net/irda/ircomm_ttp.h
index 403081ed725c..c5627288bca3 100644
--- a/include/net/irda/ircomm_ttp.h
+++ b/include/net/irda/ircomm_ttp.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 0224402260a7..8d4f588974bc 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index 0a63bbb972d7..20dcbdf258cf 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 11417475a6c3..664bf8178412 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -24,9 +24,7 @@
24 * GNU General Public License for more details. 24 * GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, see <http://www.gnu.org/licenses/>.
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 * 28 *
31 ********************************************************************/ 29 ********************************************************************/
32 30
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index f9d88da97af2..e4325fee1267 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -25,9 +25,7 @@
25 * GNU General Public License for more details. 25 * GNU General Public License for more details.
26 * 26 *
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software 28 * along with this program; if not, see <http://www.gnu.org/licenses/>.
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 * 29 *
32 ********************************************************************/ 30 ********************************************************************/
33 31
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h
index 57173ae398ae..cbc12a926e5f 100644
--- a/include/net/irda/irlap_frame.h
+++ b/include/net/irda/irlap_frame.h
@@ -24,9 +24,7 @@
24 * GNU General Public License for more details. 24 * GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, see <http://www.gnu.org/licenses/>.
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 * 28 *
31 ********************************************************************/ 29 ********************************************************************/
32 30
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h
index c0d938847bd3..42713c931d1f 100644
--- a/include/net/irda/parameters.h
+++ b/include/net/irda/parameters.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 * Michel Dänzer <daenzer@debian.org>, 10/2001 27 * Michel Dänzer <daenzer@debian.org>, 10/2001
30 * - simplify irda_pv_t to avoid endianness issues 28 * - simplify irda_pv_t to avoid endianness issues
diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h
index cc577dc0a0ef..05a5a249956f 100644
--- a/include/net/irda/qos.h
+++ b/include/net/irda/qos.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/llc.h b/include/net/llc.h
index 68490cbc8a65..e8e61d4fb458 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -93,7 +93,6 @@ struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap,
93#define LLC_DEST_CONN 2 /* Type 2 goes here */ 93#define LLC_DEST_CONN 2 /* Type 2 goes here */
94 94
95extern struct list_head llc_sap_list; 95extern struct list_head llc_sap_list;
96extern spinlock_t llc_sap_list_lock;
97 96
98int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, 97int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
99 struct net_device *orig_dev); 98 struct net_device *orig_dev);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7ceed99a05bc..f4ab2fb4d50c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -154,12 +154,14 @@ struct ieee80211_low_level_stats {
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel, 155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA 156 * this is used only with channel switching with CSA
157 * @IEEE80211_CHANCTX_CHANGE_MIN_WIDTH: The min required channel width changed
157 */ 158 */
158enum ieee80211_chanctx_change { 159enum ieee80211_chanctx_change {
159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 160 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 161 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 162 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), 163 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
164 IEEE80211_CHANCTX_CHANGE_MIN_WIDTH = BIT(4),
163}; 165};
164 166
165/** 167/**
@@ -169,6 +171,7 @@ enum ieee80211_chanctx_change {
169 * that contains it is visible in mac80211 only. 171 * that contains it is visible in mac80211 only.
170 * 172 *
171 * @def: the channel definition 173 * @def: the channel definition
174 * @min_def: the minimum channel definition currently required.
172 * @rx_chains_static: The number of RX chains that must always be 175 * @rx_chains_static: The number of RX chains that must always be
173 * active on the channel to receive MIMO transmissions 176 * active on the channel to receive MIMO transmissions
174 * @rx_chains_dynamic: The number of RX chains that must be enabled 177 * @rx_chains_dynamic: The number of RX chains that must be enabled
@@ -180,6 +183,7 @@ enum ieee80211_chanctx_change {
180 */ 183 */
181struct ieee80211_chanctx_conf { 184struct ieee80211_chanctx_conf {
182 struct cfg80211_chan_def def; 185 struct cfg80211_chan_def def;
186 struct cfg80211_chan_def min_def;
183 187
184 u8 rx_chains_static, rx_chains_dynamic; 188 u8 rx_chains_static, rx_chains_dynamic;
185 189
@@ -1159,6 +1163,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1159} 1163}
1160 1164
1161/** 1165/**
1166 * wdev_to_ieee80211_vif - return a vif struct from a wdev
1167 * @wdev: the wdev to get the vif for
1168 *
1169 * This can be used by mac80211 drivers with direct cfg80211 APIs
1170 * (like the vendor commands) that get a wdev.
1171 *
1172 * Note that this function may return %NULL if the given wdev isn't
1173 * associated with a vif that the driver knows about (e.g. monitor
1174 * or AP_VLAN interfaces.)
1175 */
1176struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1177
1178/**
1162 * enum ieee80211_key_flags - key flags 1179 * enum ieee80211_key_flags - key flags
1163 * 1180 *
1164 * These flags are used for communication about keys between the driver 1181 * These flags are used for communication about keys between the driver
@@ -1229,6 +1246,36 @@ struct ieee80211_key_conf {
1229}; 1246};
1230 1247
1231/** 1248/**
1249 * struct ieee80211_cipher_scheme - cipher scheme
1250 *
1251 * This structure contains a cipher scheme information defining
1252 * the secure packet crypto handling.
1253 *
1254 * @cipher: a cipher suite selector
1255 * @iftype: a cipher iftype bit mask indicating an allowed cipher usage
1256 * @hdr_len: a length of a security header used the cipher
1257 * @pn_len: a length of a packet number in the security header
1258 * @pn_off: an offset of pn from the beginning of the security header
1259 * @key_idx_off: an offset of key index byte in the security header
1260 * @key_idx_mask: a bit mask of key_idx bits
1261 * @key_idx_shift: a bit shift needed to get key_idx
1262 * key_idx value calculation:
1263 * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift
1264 * @mic_len: a mic length in bytes
1265 */
1266struct ieee80211_cipher_scheme {
1267 u32 cipher;
1268 u16 iftype;
1269 u8 hdr_len;
1270 u8 pn_len;
1271 u8 pn_off;
1272 u8 key_idx_off;
1273 u8 key_idx_mask;
1274 u8 key_idx_shift;
1275 u8 mic_len;
1276};
1277
1278/**
1232 * enum set_key_cmd - key command 1279 * enum set_key_cmd - key command
1233 * 1280 *
1234 * Used with the set_key() callback in &struct ieee80211_ops, this 1281 * Used with the set_key() callback in &struct ieee80211_ops, this
@@ -1566,7 +1613,8 @@ enum ieee80211_hw_flags {
1566 * @extra_tx_headroom: headroom to reserve in each transmit skb 1613 * @extra_tx_headroom: headroom to reserve in each transmit skb
1567 * for use by the driver (e.g. for transmit headers.) 1614 * for use by the driver (e.g. for transmit headers.)
1568 * 1615 *
1569 * @channel_change_time: time (in microseconds) it takes to change channels. 1616 * @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb.
1617 * Can be used by drivers to add extra IEs.
1570 * 1618 *
1571 * @max_signal: Maximum value for signal (rssi) in RX information, used 1619 * @max_signal: Maximum value for signal (rssi) in RX information, used
1572 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 1620 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
@@ -1636,6 +1684,10 @@ enum ieee80211_hw_flags {
1636 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may 1684 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may
1637 * deliver to a WMM STA during any Service Period triggered by the WMM STA. 1685 * deliver to a WMM STA during any Service Period triggered by the WMM STA.
1638 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. 1686 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values.
1687 *
1688 * @n_cipher_schemes: a size of an array of cipher schemes definitions.
1689 * @cipher_schemes: a pointer to an array of cipher scheme definitions
1690 * supported by HW.
1639 */ 1691 */
1640struct ieee80211_hw { 1692struct ieee80211_hw {
1641 struct ieee80211_conf conf; 1693 struct ieee80211_conf conf;
@@ -1644,7 +1696,7 @@ struct ieee80211_hw {
1644 void *priv; 1696 void *priv;
1645 u32 flags; 1697 u32 flags;
1646 unsigned int extra_tx_headroom; 1698 unsigned int extra_tx_headroom;
1647 int channel_change_time; 1699 unsigned int extra_beacon_tailroom;
1648 int vif_data_size; 1700 int vif_data_size;
1649 int sta_data_size; 1701 int sta_data_size;
1650 int chanctx_data_size; 1702 int chanctx_data_size;
@@ -1663,6 +1715,8 @@ struct ieee80211_hw {
1663 netdev_features_t netdev_features; 1715 netdev_features_t netdev_features;
1664 u8 uapsd_queues; 1716 u8 uapsd_queues;
1665 u8 uapsd_max_sp_len; 1717 u8 uapsd_max_sp_len;
1718 u8 n_cipher_schemes;
1719 const struct ieee80211_cipher_scheme *cipher_schemes;
1666}; 1720};
1667 1721
1668/** 1722/**
@@ -2065,6 +2119,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
2065 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) 2119 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP)
2066 * and also take care of the EOSP and MORE_DATA bits in the frame. 2120 * and also take care of the EOSP and MORE_DATA bits in the frame.
2067 * The driver may also use ieee80211_sta_eosp() in this case. 2121 * The driver may also use ieee80211_sta_eosp() in this case.
2122 *
2123 * Note that if the driver ever buffers frames other than QoS-data
2124 * frames, it must take care to never send a non-QoS-data frame as
2125 * the last frame in a service period, adding a QoS-nulldata frame
2126 * after a non-QoS-data frame if needed.
2068 */ 2127 */
2069 2128
2070/** 2129/**
@@ -2358,9 +2417,6 @@ enum ieee80211_roc_type {
2358 * See the section "Frame filtering" for more information. 2417 * See the section "Frame filtering" for more information.
2359 * This callback must be implemented and can sleep. 2418 * This callback must be implemented and can sleep.
2360 * 2419 *
2361 * @set_multicast_list: Configure the device's interface specific RX multicast
2362 * filter. This callback is optional. This callback must be atomic.
2363 *
2364 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 2420 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
2365 * must be set or cleared for a given STA. Must be atomic. 2421 * must be set or cleared for a given STA. Must be atomic.
2366 * 2422 *
@@ -2445,7 +2501,11 @@ enum ieee80211_roc_type {
2445 * AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2501 * AP, IBSS/WDS/mesh peer etc. This callback can sleep.
2446 * 2502 *
2447 * @sta_remove: Notifies low level driver about removal of an associated 2503 * @sta_remove: Notifies low level driver about removal of an associated
2448 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2504 * station, AP, IBSS/WDS/mesh peer etc. Note that after the callback
2505 * returns it isn't safe to use the pointer, not even RCU protected;
2506 * no RCU grace period is guaranteed between returning here and freeing
2507 * the station. See @sta_pre_rcu_remove if needed.
2508 * This callback can sleep.
2449 * 2509 *
2450 * @sta_add_debugfs: Drivers can use this callback to add debugfs files 2510 * @sta_add_debugfs: Drivers can use this callback to add debugfs files
2451 * when a station is added to mac80211's station list. This callback 2511 * when a station is added to mac80211's station list. This callback
@@ -2464,7 +2524,17 @@ enum ieee80211_roc_type {
2464 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) 2524 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
2465 * This callback is mutually exclusive with @sta_add/@sta_remove. 2525 * This callback is mutually exclusive with @sta_add/@sta_remove.
2466 * It must not fail for down transitions but may fail for transitions 2526 * It must not fail for down transitions but may fail for transitions
2467 * up the list of states. 2527 * up the list of states. Also note that after the callback returns it
2528 * isn't safe to use the pointer, not even RCU protected - no RCU grace
2529 * period is guaranteed between returning here and freeing the station.
2530 * See @sta_pre_rcu_remove if needed.
2531 * The callback can sleep.
2532 *
2533 * @sta_pre_rcu_remove: Notify driver about station removal before RCU
2534 * synchronisation. This is useful if a driver needs to have station
2535 * pointers protected using RCU, it can then use this call to clear
2536 * the pointers instead of waiting for an RCU grace period to elapse
2537 * in @sta_state.
2468 * The callback can sleep. 2538 * The callback can sleep.
2469 * 2539 *
2470 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be 2540 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
@@ -2724,10 +2794,6 @@ struct ieee80211_ops {
2724 unsigned int changed_flags, 2794 unsigned int changed_flags,
2725 unsigned int *total_flags, 2795 unsigned int *total_flags,
2726 u64 multicast); 2796 u64 multicast);
2727 void (*set_multicast_list)(struct ieee80211_hw *hw,
2728 struct ieee80211_vif *vif, bool allmulti,
2729 struct netdev_hw_addr_list *mc_list);
2730
2731 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2797 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
2732 bool set); 2798 bool set);
2733 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2799 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -2781,6 +2847,9 @@ struct ieee80211_ops {
2781 struct ieee80211_sta *sta, 2847 struct ieee80211_sta *sta,
2782 enum ieee80211_sta_state old_state, 2848 enum ieee80211_sta_state old_state,
2783 enum ieee80211_sta_state new_state); 2849 enum ieee80211_sta_state new_state);
2850 void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
2851 struct ieee80211_vif *vif,
2852 struct ieee80211_sta *sta);
2784 void (*sta_rc_update)(struct ieee80211_hw *hw, 2853 void (*sta_rc_update)(struct ieee80211_hw *hw,
2785 struct ieee80211_vif *vif, 2854 struct ieee80211_vif *vif,
2786 struct ieee80211_sta *sta, 2855 struct ieee80211_sta *sta,
@@ -4585,4 +4654,51 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
4585 struct ieee80211_vif *vif, struct sk_buff *skb, 4654 struct ieee80211_vif *vif, struct sk_buff *skb,
4586 int band, struct ieee80211_sta **sta); 4655 int band, struct ieee80211_sta **sta);
4587 4656
4657/**
4658 * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state
4659 *
4660 * @next_tsf: TSF timestamp of the next absent state change
4661 * @has_next_tsf: next absent state change event pending
4662 *
4663 * @absent: descriptor bitmask, set if GO is currently absent
4664 *
4665 * private:
4666 *
4667 * @count: count fields from the NoA descriptors
4668 * @desc: adjusted data from the NoA
4669 */
4670struct ieee80211_noa_data {
4671 u32 next_tsf;
4672 bool has_next_tsf;
4673
4674 u8 absent;
4675
4676 u8 count[IEEE80211_P2P_NOA_DESC_MAX];
4677 struct {
4678 u32 start;
4679 u32 duration;
4680 u32 interval;
4681 } desc[IEEE80211_P2P_NOA_DESC_MAX];
4682};
4683
4684/**
4685 * ieee80211_parse_p2p_noa - initialize NoA tracking data from P2P IE
4686 *
4687 * @attr: P2P NoA IE
4688 * @data: NoA tracking data
4689 * @tsf: current TSF timestamp
4690 *
4691 * Return: number of successfully parsed descriptors
4692 */
4693int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr,
4694 struct ieee80211_noa_data *data, u32 tsf);
4695
4696/**
4697 * ieee80211_update_p2p_noa - get next pending P2P GO absent state change
4698 *
4699 * @data: NoA tracking data
4700 * @tsf: current TSF timestamp
4701 */
4702void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
4703
4588#endif /* MAC80211_H */ 4704#endif /* MAC80211_H */
diff --git a/include/net/mip6.h b/include/net/mip6.h
index 26ba99b5a4b1..0386b618908c 100644
--- a/include/net/mip6.h
+++ b/include/net/mip6.h
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19/* 18/*
20 * Authors: 19 * Authors:
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 536501a3e58d..7277caf3743d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -21,6 +21,7 @@
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <linux/rcupdate.h> 22#include <linux/rcupdate.h>
23#include <linux/seq_file.h> 23#include <linux/seq_file.h>
24#include <linux/bitmap.h>
24 25
25#include <linux/err.h> 26#include <linux/err.h>
26#include <linux/sysctl.h> 27#include <linux/sysctl.h>
@@ -37,6 +38,32 @@
37 38
38struct neighbour; 39struct neighbour;
39 40
41enum {
42 NEIGH_VAR_MCAST_PROBES,
43 NEIGH_VAR_UCAST_PROBES,
44 NEIGH_VAR_APP_PROBES,
45 NEIGH_VAR_RETRANS_TIME,
46 NEIGH_VAR_BASE_REACHABLE_TIME,
47 NEIGH_VAR_DELAY_PROBE_TIME,
48 NEIGH_VAR_GC_STALETIME,
49 NEIGH_VAR_QUEUE_LEN_BYTES,
50 NEIGH_VAR_PROXY_QLEN,
51 NEIGH_VAR_ANYCAST_DELAY,
52 NEIGH_VAR_PROXY_DELAY,
53 NEIGH_VAR_LOCKTIME,
54#define NEIGH_VAR_DATA_MAX (NEIGH_VAR_LOCKTIME + 1)
55 /* Following are used as a second way to access one of the above */
56 NEIGH_VAR_QUEUE_LEN, /* same data as NEIGH_VAR_QUEUE_LEN_BYTES */
57 NEIGH_VAR_RETRANS_TIME_MS, /* same data as NEIGH_VAR_RETRANS_TIME */
58 NEIGH_VAR_BASE_REACHABLE_TIME_MS, /* same data as NEIGH_VAR_BASE_REACHABLE_TIME */
59 /* Following are used by "default" only */
60 NEIGH_VAR_GC_INTERVAL,
61 NEIGH_VAR_GC_THRESH1,
62 NEIGH_VAR_GC_THRESH2,
63 NEIGH_VAR_GC_THRESH3,
64 NEIGH_VAR_MAX
65};
66
40struct neigh_parms { 67struct neigh_parms {
41#ifdef CONFIG_NET_NS 68#ifdef CONFIG_NET_NS
42 struct net *net; 69 struct net *net;
@@ -53,22 +80,35 @@ struct neigh_parms {
53 atomic_t refcnt; 80 atomic_t refcnt;
54 struct rcu_head rcu_head; 81 struct rcu_head rcu_head;
55 82
56 int base_reachable_time;
57 int retrans_time;
58 int gc_staletime;
59 int reachable_time; 83 int reachable_time;
60 int delay_probe_time; 84 int data[NEIGH_VAR_DATA_MAX];
61 85 DECLARE_BITMAP(data_state, NEIGH_VAR_DATA_MAX);
62 int queue_len_bytes;
63 int ucast_probes;
64 int app_probes;
65 int mcast_probes;
66 int anycast_delay;
67 int proxy_delay;
68 int proxy_qlen;
69 int locktime;
70}; 86};
71 87
88static inline void neigh_var_set(struct neigh_parms *p, int index, int val)
89{
90 set_bit(index, p->data_state);
91 p->data[index] = val;
92}
93
94#define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr])
95
96/* In ndo_neigh_setup, NEIGH_VAR_INIT should be used.
97 * In other cases, NEIGH_VAR_SET should be used.
98 */
99#define NEIGH_VAR_INIT(p, attr, val) (NEIGH_VAR(p, attr) = val)
100#define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val)
101
102static inline void neigh_parms_data_state_setall(struct neigh_parms *p)
103{
104 bitmap_fill(p->data_state, NEIGH_VAR_DATA_MAX);
105}
106
107static inline void neigh_parms_data_state_cleanall(struct neigh_parms *p)
108{
109 bitmap_zero(p->data_state, NEIGH_VAR_DATA_MAX);
110}
111
72struct neigh_statistics { 112struct neigh_statistics {
73 unsigned long allocs; /* number of allocated neighs */ 113 unsigned long allocs; /* number of allocated neighs */
74 unsigned long destroys; /* number of destroyed neighs */ 114 unsigned long destroys; /* number of destroyed neighs */
@@ -180,6 +220,11 @@ struct neigh_table {
180 struct pneigh_entry **phash_buckets; 220 struct pneigh_entry **phash_buckets;
181}; 221};
182 222
223static inline int neigh_parms_family(struct neigh_parms *p)
224{
225 return p->tbl->family;
226}
227
183#define NEIGH_PRIV_ALIGN sizeof(long long) 228#define NEIGH_PRIV_ALIGN sizeof(long long)
184#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) 229#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN)
185 230
@@ -212,6 +257,7 @@ static inline struct neighbour *neigh_create(struct neigh_table *tbl,
212void neigh_destroy(struct neighbour *neigh); 257void neigh_destroy(struct neighbour *neigh);
213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 258int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags); 259int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
260void __neigh_set_probe_once(struct neighbour *neigh);
215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 261void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 262int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 263int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
@@ -274,8 +320,17 @@ void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274void *neigh_seq_next(struct seq_file *, void *, loff_t *); 320void *neigh_seq_next(struct seq_file *, void *, loff_t *);
275void neigh_seq_stop(struct seq_file *, void *); 321void neigh_seq_stop(struct seq_file *, void *);
276 322
323int neigh_proc_dointvec(struct ctl_table *ctl, int write,
324 void __user *buffer, size_t *lenp, loff_t *ppos);
325int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write,
326 void __user *buffer,
327 size_t *lenp, loff_t *ppos);
328int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,
329 void __user *buffer,
330 size_t *lenp, loff_t *ppos);
331
277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, 332int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
278 char *p_name, proc_handler *proc_handler); 333 proc_handler *proc_handler);
279void neigh_sysctl_unregister(struct neigh_parms *p); 334void neigh_sysctl_unregister(struct neigh_parms *p);
280 335
281static inline void __neigh_parms_put(struct neigh_parms *parms) 336static inline void __neigh_parms_put(struct neigh_parms *parms)
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 6c3d12e2949f..981c327374da 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -19,6 +19,4 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
19int nf_conntrack_ipv4_compat_init(void); 19int nf_conntrack_ipv4_compat_init(void);
20void nf_conntrack_ipv4_compat_fini(void); 20void nf_conntrack_ipv4_compat_fini(void);
21 21
22void need_ipv4_conntrack(void);
23
24#endif /*_NF_CONNTRACK_IPV4_H*/ 22#endif /*_NF_CONNTRACK_IPV4_H*/
diff --git a/include/net/netfilter/ipv4/nf_reject.h b/include/net/netfilter/ipv4/nf_reject.h
new file mode 100644
index 000000000000..931fbf812171
--- /dev/null
+++ b/include/net/netfilter/ipv4/nf_reject.h
@@ -0,0 +1,128 @@
1#ifndef _IPV4_NF_REJECT_H
2#define _IPV4_NF_REJECT_H
3
4#include <net/ip.h>
5#include <net/tcp.h>
6#include <net/route.h>
7#include <net/dst.h>
8
9static inline void nf_send_unreach(struct sk_buff *skb_in, int code)
10{
11 icmp_send(skb_in, ICMP_DEST_UNREACH, code, 0);
12}
13
14/* Send RST reply */
15static void nf_send_reset(struct sk_buff *oldskb, int hook)
16{
17 struct sk_buff *nskb;
18 const struct iphdr *oiph;
19 struct iphdr *niph;
20 const struct tcphdr *oth;
21 struct tcphdr _otcph, *tcph;
22
23 /* IP header checks: fragment. */
24 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET))
25 return;
26
27 oth = skb_header_pointer(oldskb, ip_hdrlen(oldskb),
28 sizeof(_otcph), &_otcph);
29 if (oth == NULL)
30 return;
31
32 /* No RST for RST. */
33 if (oth->rst)
34 return;
35
36 if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
37 return;
38
39 /* Check checksum */
40 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP))
41 return;
42 oiph = ip_hdr(oldskb);
43
44 nskb = alloc_skb(sizeof(struct iphdr) + sizeof(struct tcphdr) +
45 LL_MAX_HEADER, GFP_ATOMIC);
46 if (!nskb)
47 return;
48
49 skb_reserve(nskb, LL_MAX_HEADER);
50
51 skb_reset_network_header(nskb);
52 niph = (struct iphdr *)skb_put(nskb, sizeof(struct iphdr));
53 niph->version = 4;
54 niph->ihl = sizeof(struct iphdr) / 4;
55 niph->tos = 0;
56 niph->id = 0;
57 niph->frag_off = htons(IP_DF);
58 niph->protocol = IPPROTO_TCP;
59 niph->check = 0;
60 niph->saddr = oiph->daddr;
61 niph->daddr = oiph->saddr;
62
63 skb_reset_transport_header(nskb);
64 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
65 memset(tcph, 0, sizeof(*tcph));
66 tcph->source = oth->dest;
67 tcph->dest = oth->source;
68 tcph->doff = sizeof(struct tcphdr) / 4;
69
70 if (oth->ack)
71 tcph->seq = oth->ack_seq;
72 else {
73 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin +
74 oldskb->len - ip_hdrlen(oldskb) -
75 (oth->doff << 2));
76 tcph->ack = 1;
77 }
78
79 tcph->rst = 1;
80 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr,
81 niph->daddr, 0);
82 nskb->ip_summed = CHECKSUM_PARTIAL;
83 nskb->csum_start = (unsigned char *)tcph - nskb->head;
84 nskb->csum_offset = offsetof(struct tcphdr, check);
85
86 /* ip_route_me_harder expects skb->dst to be set */
87 skb_dst_set_noref(nskb, skb_dst(oldskb));
88
89 nskb->protocol = htons(ETH_P_IP);
90 if (ip_route_me_harder(nskb, RTN_UNSPEC))
91 goto free_nskb;
92
93 niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
94
95 /* "Never happens" */
96 if (nskb->len > dst_mtu(skb_dst(nskb)))
97 goto free_nskb;
98
99 nf_ct_attach(nskb, oldskb);
100
101#ifdef CONFIG_BRIDGE_NETFILTER
102 /* If we use ip_local_out for bridged traffic, the MAC source on
103 * the RST will be ours, instead of the destination's. This confuses
104 * some routers/firewalls, and they drop the packet. So we need to
105 * build the eth header using the original destination's MAC as the
106 * source, and send the RST packet directly.
107 */
108 if (oldskb->nf_bridge) {
109 struct ethhdr *oeth = eth_hdr(oldskb);
110 nskb->dev = oldskb->nf_bridge->physindev;
111 niph->tot_len = htons(nskb->len);
112 ip_send_check(niph);
113 if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol),
114 oeth->h_source, oeth->h_dest, nskb->len) < 0)
115 goto free_nskb;
116 dev_queue_xmit(nskb);
117 } else
118#endif
119 ip_local_out(nskb);
120
121 return;
122
123 free_nskb:
124 kfree_skb(nskb);
125}
126
127
128#endif /* _IPV4_NF_REJECT_H */
diff --git a/include/net/netfilter/ipv6/nf_reject.h b/include/net/netfilter/ipv6/nf_reject.h
new file mode 100644
index 000000000000..710d17ed70b4
--- /dev/null
+++ b/include/net/netfilter/ipv6/nf_reject.h
@@ -0,0 +1,171 @@
1#ifndef _IPV6_NF_REJECT_H
2#define _IPV6_NF_REJECT_H
3
4#include <net/ipv6.h>
5#include <net/ip6_route.h>
6#include <net/ip6_fib.h>
7#include <net/ip6_checksum.h>
8#include <linux/netfilter_ipv6.h>
9
10static inline void
11nf_send_unreach6(struct net *net, struct sk_buff *skb_in, unsigned char code,
12 unsigned int hooknum)
13{
14 if (hooknum == NF_INET_LOCAL_OUT && skb_in->dev == NULL)
15 skb_in->dev = net->loopback_dev;
16
17 icmpv6_send(skb_in, ICMPV6_DEST_UNREACH, code, 0);
18}
19
20/* Send RST reply */
21static void nf_send_reset6(struct net *net, struct sk_buff *oldskb, int hook)
22{
23 struct sk_buff *nskb;
24 struct tcphdr otcph, *tcph;
25 unsigned int otcplen, hh_len;
26 int tcphoff, needs_ack;
27 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
28 struct ipv6hdr *ip6h;
29#define DEFAULT_TOS_VALUE 0x0U
30 const __u8 tclass = DEFAULT_TOS_VALUE;
31 struct dst_entry *dst = NULL;
32 u8 proto;
33 __be16 frag_off;
34 struct flowi6 fl6;
35
36 if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) ||
37 (!(ipv6_addr_type(&oip6h->daddr) & IPV6_ADDR_UNICAST))) {
38 pr_debug("addr is not unicast.\n");
39 return;
40 }
41
42 proto = oip6h->nexthdr;
43 tcphoff = ipv6_skip_exthdr(oldskb, ((u8*)(oip6h+1) - oldskb->data), &proto, &frag_off);
44
45 if ((tcphoff < 0) || (tcphoff > oldskb->len)) {
46 pr_debug("Cannot get TCP header.\n");
47 return;
48 }
49
50 otcplen = oldskb->len - tcphoff;
51
52 /* IP header checks: fragment, too short. */
53 if (proto != IPPROTO_TCP || otcplen < sizeof(struct tcphdr)) {
54 pr_debug("proto(%d) != IPPROTO_TCP, "
55 "or too short. otcplen = %d\n",
56 proto, otcplen);
57 return;
58 }
59
60 if (skb_copy_bits(oldskb, tcphoff, &otcph, sizeof(struct tcphdr)))
61 BUG();
62
63 /* No RST for RST. */
64 if (otcph.rst) {
65 pr_debug("RST is set\n");
66 return;
67 }
68
69 /* Check checksum. */
70 if (nf_ip6_checksum(oldskb, hook, tcphoff, IPPROTO_TCP)) {
71 pr_debug("TCP checksum is invalid\n");
72 return;
73 }
74
75 memset(&fl6, 0, sizeof(fl6));
76 fl6.flowi6_proto = IPPROTO_TCP;
77 fl6.saddr = oip6h->daddr;
78 fl6.daddr = oip6h->saddr;
79 fl6.fl6_sport = otcph.dest;
80 fl6.fl6_dport = otcph.source;
81 security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
82 dst = ip6_route_output(net, NULL, &fl6);
83 if (dst == NULL || dst->error) {
84 dst_release(dst);
85 return;
86 }
87 dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
88 if (IS_ERR(dst))
89 return;
90
91 hh_len = (dst->dev->hard_header_len + 15)&~15;
92 nskb = alloc_skb(hh_len + 15 + dst->header_len + sizeof(struct ipv6hdr)
93 + sizeof(struct tcphdr) + dst->trailer_len,
94 GFP_ATOMIC);
95
96 if (!nskb) {
97 net_dbg_ratelimited("cannot alloc skb\n");
98 dst_release(dst);
99 return;
100 }
101
102 skb_dst_set(nskb, dst);
103
104 skb_reserve(nskb, hh_len + dst->header_len);
105
106 skb_put(nskb, sizeof(struct ipv6hdr));
107 skb_reset_network_header(nskb);
108 ip6h = ipv6_hdr(nskb);
109 ip6_flow_hdr(ip6h, tclass, 0);
110 ip6h->hop_limit = ip6_dst_hoplimit(dst);
111 ip6h->nexthdr = IPPROTO_TCP;
112 ip6h->saddr = oip6h->daddr;
113 ip6h->daddr = oip6h->saddr;
114
115 skb_reset_transport_header(nskb);
116 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
117 /* Truncate to length (no data) */
118 tcph->doff = sizeof(struct tcphdr)/4;
119 tcph->source = otcph.dest;
120 tcph->dest = otcph.source;
121
122 if (otcph.ack) {
123 needs_ack = 0;
124 tcph->seq = otcph.ack_seq;
125 tcph->ack_seq = 0;
126 } else {
127 needs_ack = 1;
128 tcph->ack_seq = htonl(ntohl(otcph.seq) + otcph.syn + otcph.fin
129 + otcplen - (otcph.doff<<2));
130 tcph->seq = 0;
131 }
132
133 /* Reset flags */
134 ((u_int8_t *)tcph)[13] = 0;
135 tcph->rst = 1;
136 tcph->ack = needs_ack;
137 tcph->window = 0;
138 tcph->urg_ptr = 0;
139 tcph->check = 0;
140
141 /* Adjust TCP checksum */
142 tcph->check = csum_ipv6_magic(&ipv6_hdr(nskb)->saddr,
143 &ipv6_hdr(nskb)->daddr,
144 sizeof(struct tcphdr), IPPROTO_TCP,
145 csum_partial(tcph,
146 sizeof(struct tcphdr), 0));
147
148 nf_ct_attach(nskb, oldskb);
149
150#ifdef CONFIG_BRIDGE_NETFILTER
151 /* If we use ip6_local_out for bridged traffic, the MAC source on
152 * the RST will be ours, instead of the destination's. This confuses
153 * some routers/firewalls, and they drop the packet. So we need to
154 * build the eth header using the original destination's MAC as the
155 * source, and send the RST packet directly.
156 */
157 if (oldskb->nf_bridge) {
158 struct ethhdr *oeth = eth_hdr(oldskb);
159 nskb->dev = oldskb->nf_bridge->physindev;
160 nskb->protocol = htons(ETH_P_IPV6);
161 ip6h->payload_len = htons(sizeof(struct tcphdr));
162 if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol),
163 oeth->h_source, oeth->h_dest, nskb->len) < 0)
164 return;
165 dev_queue_xmit(nskb);
166 } else
167#endif
168 ip6_local_out(nskb);
169}
170
171#endif /* _IPV6_NF_REJECT_H */
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 3efab704b7eb..adc1fa3dd7ab 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -87,7 +87,6 @@ int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto);
87void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); 87void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto);
88 88
89struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); 89struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
90void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
91 90
92/* Existing built-in protocols */ 91/* Existing built-in protocols */
93extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; 92extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index c1d5b3e34a21..84a53d780306 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -1,6 +1,10 @@
1#ifndef _NF_QUEUE_H 1#ifndef _NF_QUEUE_H
2#define _NF_QUEUE_H 2#define _NF_QUEUE_H
3 3
4#include <linux/ip.h>
5#include <linux/ipv6.h>
6#include <linux/jhash.h>
7
4/* Each queued (to userspace) skbuff has one of these. */ 8/* Each queued (to userspace) skbuff has one of these. */
5struct nf_queue_entry { 9struct nf_queue_entry {
6 struct list_head list; 10 struct list_head list;
@@ -33,4 +37,62 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
33bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); 37bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
34void nf_queue_entry_release_refs(struct nf_queue_entry *entry); 38void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
35 39
40static inline void init_hashrandom(u32 *jhash_initval)
41{
42 while (*jhash_initval == 0)
43 *jhash_initval = prandom_u32();
44}
45
46static inline u32 hash_v4(const struct sk_buff *skb, u32 jhash_initval)
47{
48 const struct iphdr *iph = ip_hdr(skb);
49
50 /* packets in either direction go into same queue */
51 if ((__force u32)iph->saddr < (__force u32)iph->daddr)
52 return jhash_3words((__force u32)iph->saddr,
53 (__force u32)iph->daddr, iph->protocol, jhash_initval);
54
55 return jhash_3words((__force u32)iph->daddr,
56 (__force u32)iph->saddr, iph->protocol, jhash_initval);
57}
58
59#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
60static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
61{
62 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
63 u32 a, b, c;
64
65 if ((__force u32)ip6h->saddr.s6_addr32[3] <
66 (__force u32)ip6h->daddr.s6_addr32[3]) {
67 a = (__force u32) ip6h->saddr.s6_addr32[3];
68 b = (__force u32) ip6h->daddr.s6_addr32[3];
69 } else {
70 b = (__force u32) ip6h->saddr.s6_addr32[3];
71 a = (__force u32) ip6h->daddr.s6_addr32[3];
72 }
73
74 if ((__force u32)ip6h->saddr.s6_addr32[1] <
75 (__force u32)ip6h->daddr.s6_addr32[1])
76 c = (__force u32) ip6h->saddr.s6_addr32[1];
77 else
78 c = (__force u32) ip6h->daddr.s6_addr32[1];
79
80 return jhash_3words(a, b, c, jhash_initval);
81}
82#endif
83
84static inline u32
85nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family,
86 u32 jhash_initval)
87{
88 if (family == NFPROTO_IPV4)
89 queue += ((u64) hash_v4(skb, jhash_initval) * queues_total) >> 32;
90#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
91 else if (family == NFPROTO_IPV6)
92 queue += ((u64) hash_v6(skb, jhash_initval) * queues_total) >> 32;
93#endif
94
95 return queue;
96}
97
36#endif /* _NF_QUEUE_H */ 98#endif /* _NF_QUEUE_H */
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 5a91abfc0c30..57c8ff7955df 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -13,9 +13,10 @@ struct nft_pktinfo {
13 struct sk_buff *skb; 13 struct sk_buff *skb;
14 const struct net_device *in; 14 const struct net_device *in;
15 const struct net_device *out; 15 const struct net_device *out;
16 u8 hooknum; 16 const struct nf_hook_ops *ops;
17 u8 nhoff; 17 u8 nhoff;
18 u8 thoff; 18 u8 thoff;
19 u8 tprot;
19 /* for x_tables compatibility */ 20 /* for x_tables compatibility */
20 struct xt_action_param xt; 21 struct xt_action_param xt;
21}; 22};
@@ -29,7 +30,8 @@ static inline void nft_set_pktinfo(struct nft_pktinfo *pkt,
29 pkt->skb = skb; 30 pkt->skb = skb;
30 pkt->in = pkt->xt.in = in; 31 pkt->in = pkt->xt.in = in;
31 pkt->out = pkt->xt.out = out; 32 pkt->out = pkt->xt.out = out;
32 pkt->hooknum = pkt->xt.hooknum = ops->hooknum; 33 pkt->ops = ops;
34 pkt->xt.hooknum = ops->hooknum;
33 pkt->xt.family = ops->pf; 35 pkt->xt.family = ops->pf;
34} 36}
35 37
@@ -421,6 +423,8 @@ struct nft_stats {
421 u64 pkts; 423 u64 pkts;
422}; 424};
423 425
426#define NFT_HOOK_OPS_MAX 2
427
424/** 428/**
425 * struct nft_base_chain - nf_tables base chain 429 * struct nft_base_chain - nf_tables base chain
426 * 430 *
@@ -431,8 +435,8 @@ struct nft_stats {
431 * @chain: the chain 435 * @chain: the chain
432 */ 436 */
433struct nft_base_chain { 437struct nft_base_chain {
434 struct nf_hook_ops ops; 438 struct nf_hook_ops ops[NFT_HOOK_OPS_MAX];
435 enum nft_chain_type type; 439 const struct nf_chain_type *type;
436 u8 policy; 440 u8 policy;
437 struct nft_stats __percpu *stats; 441 struct nft_stats __percpu *stats;
438 struct nft_chain chain; 442 struct nft_chain chain;
@@ -443,8 +447,8 @@ static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chai
443 return container_of(chain, struct nft_base_chain, chain); 447 return container_of(chain, struct nft_base_chain, chain);
444} 448}
445 449
446unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt, 450unsigned int nft_do_chain(struct nft_pktinfo *pkt,
447 const struct nf_hook_ops *ops); 451 const struct nf_hook_ops *ops);
448 452
449/** 453/**
450 * struct nft_table - nf_tables table 454 * struct nft_table - nf_tables table
@@ -475,6 +479,8 @@ struct nft_table {
475 * @nhooks: number of hooks in this family 479 * @nhooks: number of hooks in this family
476 * @owner: module owner 480 * @owner: module owner
477 * @tables: used internally 481 * @tables: used internally
482 * @nops: number of hook ops in this family
483 * @hook_ops_init: initialization function for chain hook ops
478 * @hooks: hookfn overrides for packet validation 484 * @hooks: hookfn overrides for packet validation
479 */ 485 */
480struct nft_af_info { 486struct nft_af_info {
@@ -483,23 +489,36 @@ struct nft_af_info {
483 unsigned int nhooks; 489 unsigned int nhooks;
484 struct module *owner; 490 struct module *owner;
485 struct list_head tables; 491 struct list_head tables;
492 unsigned int nops;
493 void (*hook_ops_init)(struct nf_hook_ops *,
494 unsigned int);
486 nf_hookfn *hooks[NF_MAX_HOOKS]; 495 nf_hookfn *hooks[NF_MAX_HOOKS];
487}; 496};
488 497
489int nft_register_afinfo(struct net *, struct nft_af_info *); 498int nft_register_afinfo(struct net *, struct nft_af_info *);
490void nft_unregister_afinfo(struct nft_af_info *); 499void nft_unregister_afinfo(struct nft_af_info *);
491 500
501/**
502 * struct nf_chain_type - nf_tables chain type info
503 *
504 * @name: name of the type
505 * @type: numeric identifier
506 * @family: address family
507 * @owner: module owner
508 * @hook_mask: mask of valid hooks
509 * @hooks: hookfn overrides
510 */
492struct nf_chain_type { 511struct nf_chain_type {
493 unsigned int hook_mask; 512 const char *name;
494 const char *name; 513 enum nft_chain_type type;
495 enum nft_chain_type type; 514 int family;
496 nf_hookfn *fn[NF_MAX_HOOKS]; 515 struct module *owner;
497 struct module *me; 516 unsigned int hook_mask;
498 int family; 517 nf_hookfn *hooks[NF_MAX_HOOKS];
499}; 518};
500 519
501int nft_register_chain_type(struct nf_chain_type *); 520int nft_register_chain_type(const struct nf_chain_type *);
502void nft_unregister_chain_type(struct nf_chain_type *); 521void nft_unregister_chain_type(const struct nf_chain_type *);
503 522
504int nft_register_expr(struct nft_expr_type *); 523int nft_register_expr(struct nft_expr_type *);
505void nft_unregister_expr(struct nft_expr_type *); 524void nft_unregister_expr(struct nft_expr_type *);
diff --git a/include/net/netfilter/nf_tables_ipv4.h b/include/net/netfilter/nf_tables_ipv4.h
index 1be1c2c197ee..cba143fbd2e4 100644
--- a/include/net/netfilter/nf_tables_ipv4.h
+++ b/include/net/netfilter/nf_tables_ipv4.h
@@ -15,9 +15,12 @@ nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt,
15 15
16 nft_set_pktinfo(pkt, ops, skb, in, out); 16 nft_set_pktinfo(pkt, ops, skb, in, out);
17 17
18 pkt->xt.thoff = ip_hdrlen(pkt->skb);
19 ip = ip_hdr(pkt->skb); 18 ip = ip_hdr(pkt->skb);
19 pkt->tprot = ip->protocol;
20 pkt->xt.thoff = ip_hdrlen(pkt->skb);
20 pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET; 21 pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
21} 22}
22 23
24extern struct nft_af_info nft_af_ipv4;
25
23#endif 26#endif
diff --git a/include/net/netfilter/nf_tables_ipv6.h b/include/net/netfilter/nf_tables_ipv6.h
index 4a9b88a65963..74d976137658 100644
--- a/include/net/netfilter/nf_tables_ipv6.h
+++ b/include/net/netfilter/nf_tables_ipv6.h
@@ -21,10 +21,13 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt,
21 if (protohdr < 0) 21 if (protohdr < 0)
22 return -1; 22 return -1;
23 23
24 pkt->tprot = protohdr;
24 pkt->xt.thoff = thoff; 25 pkt->xt.thoff = thoff;
25 pkt->xt.fragoff = frag_off; 26 pkt->xt.fragoff = frag_off;
26 27
27 return 0; 28 return 0;
28} 29}
29 30
31extern struct nft_af_info nft_af_ipv6;
32
30#endif 33#endif
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 97e6dcaf12bb..4fe018c48ed9 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -22,8 +22,7 @@
22 * the GNU General Public License for more details. 22 * the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * 26 *
28 */ 27 */
29 28
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index c9c0c538b68b..fbcc7fa536dc 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -65,6 +65,23 @@ struct nf_ip_net {
65struct netns_ct { 65struct netns_ct {
66 atomic_t count; 66 atomic_t count;
67 unsigned int expect_count; 67 unsigned int expect_count;
68#ifdef CONFIG_SYSCTL
69 struct ctl_table_header *sysctl_header;
70 struct ctl_table_header *acct_sysctl_header;
71 struct ctl_table_header *tstamp_sysctl_header;
72 struct ctl_table_header *event_sysctl_header;
73 struct ctl_table_header *helper_sysctl_header;
74#endif
75 char *slabname;
76 unsigned int sysctl_log_invalid; /* Log invalid packets */
77 unsigned int sysctl_events_retry_timeout;
78 int sysctl_events;
79 int sysctl_acct;
80 int sysctl_auto_assign_helper;
81 bool auto_assign_helper_warned;
82 int sysctl_tstamp;
83 int sysctl_checksum;
84
68 unsigned int htable_size; 85 unsigned int htable_size;
69 struct kmem_cache *nf_conntrack_cachep; 86 struct kmem_cache *nf_conntrack_cachep;
70 struct hlist_nulls_head *hash; 87 struct hlist_nulls_head *hash;
@@ -75,14 +92,6 @@ struct netns_ct {
75 struct ip_conntrack_stat __percpu *stat; 92 struct ip_conntrack_stat __percpu *stat;
76 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 93 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
77 struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 94 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
78 int sysctl_events;
79 unsigned int sysctl_events_retry_timeout;
80 int sysctl_acct;
81 int sysctl_tstamp;
82 int sysctl_checksum;
83 unsigned int sysctl_log_invalid; /* Log invalid packets */
84 int sysctl_auto_assign_helper;
85 bool auto_assign_helper_warned;
86 struct nf_ip_net nf_ct_proto; 95 struct nf_ip_net nf_ct_proto;
87#if defined(CONFIG_NF_CONNTRACK_LABELS) 96#if defined(CONFIG_NF_CONNTRACK_LABELS)
88 unsigned int labels_used; 97 unsigned int labels_used;
@@ -92,13 +101,5 @@ struct netns_ct {
92 struct hlist_head *nat_bysource; 101 struct hlist_head *nat_bysource;
93 unsigned int nat_htable_size; 102 unsigned int nat_htable_size;
94#endif 103#endif
95#ifdef CONFIG_SYSCTL
96 struct ctl_table_header *sysctl_header;
97 struct ctl_table_header *acct_sysctl_header;
98 struct ctl_table_header *tstamp_sysctl_header;
99 struct ctl_table_header *event_sysctl_header;
100 struct ctl_table_header *helper_sysctl_header;
101#endif
102 char *slabname;
103}; 104};
104#endif 105#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index ee520cba2ec2..80f500a29498 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -69,6 +69,8 @@ struct netns_ipv4 {
69 struct local_ports sysctl_local_ports; 69 struct local_ports sysctl_local_ports;
70 70
71 int sysctl_tcp_ecn; 71 int sysctl_tcp_ecn;
72 int sysctl_ip_no_pmtu_disc;
73 int sysctl_ip_fwd_use_pmtu;
72 74
73 kgid_t sysctl_ping_group_range[2]; 75 kgid_t sysctl_ping_group_range[2];
74 76
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 0fb2401197c5..21edaf1f7916 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -27,7 +27,9 @@ struct netns_sysctl_ipv6 {
27 int ip6_rt_gc_elasticity; 27 int ip6_rt_gc_elasticity;
28 int ip6_rt_mtu_expires; 28 int ip6_rt_mtu_expires;
29 int ip6_rt_min_advmss; 29 int ip6_rt_min_advmss;
30 int flowlabel_consistency;
30 int icmpv6_time; 31 int icmpv6_time;
32 int anycast_src_echo_reply;
31}; 33};
32 34
33struct netns_ipv6 { 35struct netns_ipv6 {
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h
index 15d056d534e3..26a394cb91a8 100644
--- a/include/net/netns/nftables.h
+++ b/include/net/netns/nftables.h
@@ -10,6 +10,7 @@ struct netns_nftables {
10 struct list_head commit_list; 10 struct list_head commit_list;
11 struct nft_af_info *ipv4; 11 struct nft_af_info *ipv4;
12 struct nft_af_info *ipv6; 12 struct nft_af_info *ipv6;
13 struct nft_af_info *inet;
13 struct nft_af_info *arp; 14 struct nft_af_info *arp;
14 struct nft_af_info *bridge; 15 struct nft_af_info *bridge;
15 u8 gencursor; 16 u8 gencursor;
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 5299e69a32af..1006a265beb3 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -33,8 +33,6 @@ struct netns_xfrm {
33 struct hlist_head state_gc_list; 33 struct hlist_head state_gc_list;
34 struct work_struct state_gc_work; 34 struct work_struct state_gc_work;
35 35
36 wait_queue_head_t km_waitq;
37
38 struct list_head policy_all; 36 struct list_head policy_all;
39 struct hlist_head *policy_byidx; 37 struct hlist_head *policy_byidx;
40 unsigned int policy_idx_hmask; 38 unsigned int policy_idx_hmask;
@@ -59,6 +57,10 @@ struct netns_xfrm {
59#if IS_ENABLED(CONFIG_IPV6) 57#if IS_ENABLED(CONFIG_IPV6)
60 struct dst_ops xfrm6_dst_ops; 58 struct dst_ops xfrm6_dst_ops;
61#endif 59#endif
60 spinlock_t xfrm_state_lock;
61 spinlock_t xfrm_policy_sk_bundle_lock;
62 rwlock_t xfrm_policy_lock;
63 struct mutex xfrm_cfg_mutex;
62}; 64};
63 65
64#endif 66#endif
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 099d02782e22..dafc09f0fdbc 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -13,12 +13,12 @@
13 13
14#ifndef _NETPRIO_CGROUP_H 14#ifndef _NETPRIO_CGROUP_H
15#define _NETPRIO_CGROUP_H 15#define _NETPRIO_CGROUP_H
16
16#include <linux/cgroup.h> 17#include <linux/cgroup.h>
17#include <linux/hardirq.h> 18#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 19#include <linux/rcupdate.h>
19 20
20 21#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
21#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
22struct netprio_map { 22struct netprio_map {
23 struct rcu_head rcu; 23 struct rcu_head rcu;
24 u32 priomap_len; 24 u32 priomap_len;
@@ -27,8 +27,7 @@ struct netprio_map {
27 27
28void sock_update_netprioidx(struct sock *sk); 28void sock_update_netprioidx(struct sock *sk);
29 29
30#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 30#if IS_BUILTIN(CONFIG_CGROUP_NET_PRIO)
31
32static inline u32 task_netprioidx(struct task_struct *p) 31static inline u32 task_netprioidx(struct task_struct *p)
33{ 32{
34 struct cgroup_subsys_state *css; 33 struct cgroup_subsys_state *css;
@@ -40,9 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
40 rcu_read_unlock(); 39 rcu_read_unlock();
41 return idx; 40 return idx;
42} 41}
43 42#elif IS_MODULE(CONFIG_CGROUP_NET_PRIO)
44#elif IS_MODULE(CONFIG_NETPRIO_CGROUP)
45
46static inline u32 task_netprioidx(struct task_struct *p) 43static inline u32 task_netprioidx(struct task_struct *p)
47{ 44{
48 struct cgroup_subsys_state *css; 45 struct cgroup_subsys_state *css;
@@ -56,9 +53,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
56 return idx; 53 return idx;
57} 54}
58#endif 55#endif
59 56#else /* !CONFIG_CGROUP_NET_PRIO */
60#else /* !CONFIG_NETPRIO_CGROUP */
61
62static inline u32 task_netprioidx(struct task_struct *p) 57static inline u32 task_netprioidx(struct task_struct *p)
63{ 58{
64 return 0; 59 return 0;
@@ -66,6 +61,5 @@ static inline u32 task_netprioidx(struct task_struct *p)
66 61
67#define sock_update_netprioidx(sk) 62#define sock_update_netprioidx(sk)
68 63
69#endif /* CONFIG_NETPRIO_CGROUP */ 64#endif /* CONFIG_CGROUP_NET_PRIO */
70
71#endif /* _NET_CLS_CGROUP_H */ 65#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h
index 36acecd5f06c..81af21e9bcd4 100644
--- a/include/net/nfc/digital.h
+++ b/include/net/nfc/digital.h
@@ -122,6 +122,16 @@ typedef void (*nfc_digital_cmd_complete_t)(struct nfc_digital_dev *ddev,
122 * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn 122 * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn
123 * the device radio on. 123 * the device radio on.
124 * @abort_cmd: Discard the last sent command. 124 * @abort_cmd: Discard the last sent command.
125 *
126 * Notes: Asynchronous functions have a timeout parameter. It is the driver
127 * responsibility to call the digital stack back through the
128 * nfc_digital_cmd_complete_t callback when no RF respsonse has been
129 * received within the specified time (in milliseconds). In that case the
130 * driver must set the resp sk_buff to ERR_PTR(-ETIMEDOUT).
131 * Since the digital stack serializes commands to be sent, it's mandatory
132 * for the driver to handle the timeout correctly. Otherwise the stack
133 * would not be able to send new commands, waiting for the reply of the
134 * current one.
125 */ 135 */
126struct nfc_digital_ops { 136struct nfc_digital_ops {
127 int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type, 137 int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type,
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 2eca2960ca9c..03c4650b548c 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -12,9 +12,7 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */ 16 */
19 17
20#ifndef __NET_HCI_H 18#ifndef __NET_HCI_H
diff --git a/include/net/nfc/llc.h b/include/net/nfc/llc.h
index 400ab7ae749d..c25fbdee0d61 100644
--- a/include/net/nfc/llc.h
+++ b/include/net/nfc/llc.h
@@ -13,9 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */ 17 */
20 18
21#ifndef __NFC_LLC_H_ 19#ifndef __NFC_LLC_H_
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index e5aa5acafea0..fbfa4e471abb 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -20,8 +20,7 @@
20 * GNU General Public License for more details. 20 * GNU General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU General Public License 22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software 23 * along with this program; if not, see <http://www.gnu.org/licenses/>.
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 24 *
26 */ 25 */
27 26
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 6126f1f992b4..1f9a0f5272fe 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -21,8 +21,7 @@
21 * GNU General Public License for more details. 21 * GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software 24 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 25 *
27 */ 26 */
28 27
@@ -68,6 +67,7 @@ struct nci_ops {
68 int (*open)(struct nci_dev *ndev); 67 int (*open)(struct nci_dev *ndev);
69 int (*close)(struct nci_dev *ndev); 68 int (*close)(struct nci_dev *ndev);
70 int (*send)(struct nci_dev *ndev, struct sk_buff *skb); 69 int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
70 int (*setup)(struct nci_dev *ndev);
71}; 71};
72 72
73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
@@ -154,6 +154,7 @@ void nci_free_device(struct nci_dev *ndev);
154int nci_register_device(struct nci_dev *ndev); 154int nci_register_device(struct nci_dev *ndev);
155void nci_unregister_device(struct nci_dev *ndev); 155void nci_unregister_device(struct nci_dev *ndev);
156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); 156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
157int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val);
157 158
158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 159static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
159 unsigned int len, 160 unsigned int len,
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 82fc4e43fc6e..e80894bca1d0 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -16,9 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */ 20 */
23 21
24#ifndef __NET_NFC_H 22#ifndef __NET_NFC_H
diff --git a/include/net/ping.h b/include/net/ping.h
index 90f48417b03d..026479b61a2d 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -33,8 +33,12 @@
33struct pingv6_ops { 33struct pingv6_ops {
34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, 34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
35 int *addr_len); 35 int *addr_len);
36 int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, 36 void (*ip6_datagram_recv_common_ctl)(struct sock *sk,
37 struct sk_buff *skb); 37 struct msghdr *msg,
38 struct sk_buff *skb);
39 void (*ip6_datagram_recv_specific_ctl)(struct sock *sk,
40 struct msghdr *msg,
41 struct sk_buff *skb);
38 int (*icmpv6_err_convert)(u8 type, u8 code, int *err); 42 int (*icmpv6_err_convert)(u8 type, u8 code, int *err);
39 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err, 43 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
40 __be16 port, u32 info, u8 *payload); 44 __be16 port, u32 info, u8 *payload);
@@ -42,11 +46,6 @@ struct pingv6_ops {
42 const struct net_device *dev, int strict); 46 const struct net_device *dev, int strict);
43}; 47};
44 48
45struct ping_table {
46 struct hlist_nulls_head hash[PING_HTABLE_SIZE];
47 rwlock_t lock;
48};
49
50struct ping_iter_state { 49struct ping_iter_state {
51 struct seq_net_private p; 50 struct seq_net_private p;
52 int bucket; 51 int bucket;
@@ -54,7 +53,6 @@ struct ping_iter_state {
54}; 53};
55 54
56extern struct proto ping_prot; 55extern struct proto ping_prot;
57extern struct ping_table ping_table;
58#if IS_ENABLED(CONFIG_IPV6) 56#if IS_ENABLED(CONFIG_IPV6)
59extern struct pingv6_ops pingv6_ops; 57extern struct pingv6_ops pingv6_ops;
60#endif 58#endif
@@ -81,8 +79,6 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
81 size_t len, int noblock, int flags, int *addr_len); 79 size_t len, int noblock, int flags, int *addr_len);
82int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, 80int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
83 void *user_icmph, size_t icmph_len); 81 void *user_icmph, size_t icmph_len);
84int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
85 size_t len);
86int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 82int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
87 size_t len); 83 size_t len);
88int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); 84int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2ebef77a2f9a..a2441fb1428f 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -62,18 +62,26 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
62 62
63struct tcf_exts { 63struct tcf_exts {
64#ifdef CONFIG_NET_CLS_ACT 64#ifdef CONFIG_NET_CLS_ACT
65 struct tc_action *action; 65 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
66 struct list_head actions;
66#endif 67#endif
67}; 68 /* Map to export classifier specific extension TLV types to the
68 69 * generic extensions API. Unsupported extensions must be set to 0.
69/* Map to export classifier specific extension TLV types to the 70 */
70 * generic extensions API. Unsupported extensions must be set to 0.
71 */
72struct tcf_ext_map {
73 int action; 71 int action;
74 int police; 72 int police;
75}; 73};
76 74
75static inline void tcf_exts_init(struct tcf_exts *exts, int action, int police)
76{
77#ifdef CONFIG_NET_CLS_ACT
78 exts->type = 0;
79 INIT_LIST_HEAD(&exts->actions);
80#endif
81 exts->action = action;
82 exts->police = police;
83}
84
77/** 85/**
78 * tcf_exts_is_predicative - check if a predicative extension is present 86 * tcf_exts_is_predicative - check if a predicative extension is present
79 * @exts: tc filter extensions handle 87 * @exts: tc filter extensions handle
@@ -85,7 +93,7 @@ static inline int
85tcf_exts_is_predicative(struct tcf_exts *exts) 93tcf_exts_is_predicative(struct tcf_exts *exts)
86{ 94{
87#ifdef CONFIG_NET_CLS_ACT 95#ifdef CONFIG_NET_CLS_ACT
88 return !!exts->action; 96 return !list_empty(&exts->actions);
89#else 97#else
90 return 0; 98 return 0;
91#endif 99#endif
@@ -120,23 +128,20 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
120 struct tcf_result *res) 128 struct tcf_result *res)
121{ 129{
122#ifdef CONFIG_NET_CLS_ACT 130#ifdef CONFIG_NET_CLS_ACT
123 if (exts->action) 131 if (!list_empty(&exts->actions))
124 return tcf_action_exec(skb, exts->action, res); 132 return tcf_action_exec(skb, &exts->actions, res);
125#endif 133#endif
126 return 0; 134 return 0;
127} 135}
128 136
129int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 137int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 138 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 139 struct tcf_exts *exts);
132 const struct tcf_ext_map *map);
133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 140void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 141void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 142 struct tcf_exts *src);
136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 143int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts);
137 const struct tcf_ext_map *map); 144int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts);
138int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
139 const struct tcf_ext_map *map);
140 145
141/** 146/**
142 * struct tcf_pkt_info - packet information 147 * struct tcf_pkt_info - packet information
@@ -333,27 +338,27 @@ static inline int tcf_valid_offset(const struct sk_buff *skb,
333#include <net/net_namespace.h> 338#include <net/net_namespace.h>
334 339
335static inline int 340static inline int
336tcf_change_indev(struct tcf_proto *tp, char *indev, struct nlattr *indev_tlv) 341tcf_change_indev(struct net *net, struct nlattr *indev_tlv)
337{ 342{
343 char indev[IFNAMSIZ];
344 struct net_device *dev;
345
338 if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) 346 if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ)
339 return -EINVAL; 347 return -EINVAL;
340 return 0; 348 dev = __dev_get_by_name(net, indev);
349 if (!dev)
350 return -ENODEV;
351 return dev->ifindex;
341} 352}
342 353
343static inline int 354static inline bool
344tcf_match_indev(struct sk_buff *skb, char *indev) 355tcf_match_indev(struct sk_buff *skb, int ifindex)
345{ 356{
346 struct net_device *dev; 357 if (!ifindex)
347 358 return true;
348 if (indev[0]) { 359 if (!skb->skb_iif)
349 if (!skb->skb_iif) 360 return false;
350 return 0; 361 return ifindex == skb->skb_iif;
351 dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif);
352 if (!dev || strcmp(indev, dev->name))
353 return 0;
354 }
355
356 return 1;
357} 362}
358#endif /* CONFIG_NET_CLS_IND */ 363#endif /* CONFIG_NET_CLS_IND */
359 364
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 59ec3cd15d68..891d80d2c4d2 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -88,6 +88,7 @@ int unregister_qdisc(struct Qdisc_ops *qops);
88void qdisc_get_default(char *id, size_t len); 88void qdisc_get_default(char *id, size_t len);
89int qdisc_set_default(const char *id); 89int qdisc_set_default(const char *id);
90 90
91void qdisc_list_add(struct Qdisc *q);
91void qdisc_list_del(struct Qdisc *q); 92void qdisc_list_del(struct Qdisc *q);
92struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 93struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
93struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 94struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
diff --git a/include/net/protocol.h b/include/net/protocol.h
index fbf7676c9a02..a7e986b08147 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -43,7 +43,12 @@ struct net_protocol {
43 int (*handler)(struct sk_buff *skb); 43 int (*handler)(struct sk_buff *skb);
44 void (*err_handler)(struct sk_buff *skb, u32 info); 44 void (*err_handler)(struct sk_buff *skb, u32 info);
45 unsigned int no_policy:1, 45 unsigned int no_policy:1,
46 netns_ok:1; 46 netns_ok:1,
47 /* does the protocol do more stringent
48 * icmp tag validation than simple
49 * socket lookup?
50 */
51 icmp_strict_tag_validation:1;
47}; 52};
48 53
49#if IS_ENABLED(CONFIG_IPV6) 54#if IS_ENABLED(CONFIG_IPV6)
@@ -103,6 +108,9 @@ int inet_del_offload(const struct net_offload *prot, unsigned char num);
103void inet_register_protosw(struct inet_protosw *p); 108void inet_register_protosw(struct inet_protosw *p);
104void inet_unregister_protosw(struct inet_protosw *p); 109void inet_unregister_protosw(struct inet_protosw *p);
105 110
111int udp_add_offload(struct udp_offload *prot);
112void udp_del_offload(struct udp_offload *prot);
113
106#if IS_ENABLED(CONFIG_IPV6) 114#if IS_ENABLED(CONFIG_IPV6)
107int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); 115int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
108int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); 116int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
diff --git a/include/net/red.h b/include/net/red.h
index ef46058d35bf..76e0b5f922c6 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -130,7 +130,8 @@ struct red_parms {
130 u32 qth_max; /* Max avg length threshold: Wlog scaled */ 130 u32 qth_max; /* Max avg length threshold: Wlog scaled */
131 u32 Scell_max; 131 u32 Scell_max;
132 u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ 132 u32 max_P; /* probability, [0 .. 1.0] 32 scaled */
133 u32 max_P_reciprocal; /* reciprocal_value(max_P / qth_delta) */ 133 /* reciprocal_value(max_P / qth_delta) */
134 struct reciprocal_value max_P_reciprocal;
134 u32 qth_delta; /* max_th - min_th */ 135 u32 qth_delta; /* max_th - min_th */
135 u32 target_min; /* min_th + 0.4*(max_th - min_th) */ 136 u32 target_min; /* min_th + 0.4*(max_th - min_th) */
136 u32 target_max; /* min_th + 0.6*(max_th - min_th) */ 137 u32 target_max; /* min_th + 0.6*(max_th - min_th) */
@@ -303,7 +304,7 @@ static inline unsigned long red_calc_qavg(const struct red_parms *p,
303 304
304static inline u32 red_random(const struct red_parms *p) 305static inline u32 red_random(const struct red_parms *p)
305{ 306{
306 return reciprocal_divide(net_random(), p->max_P_reciprocal); 307 return reciprocal_divide(prandom_u32(), p->max_P_reciprocal);
307} 308}
308 309
309static inline int red_mark_probability(const struct red_parms *p, 310static inline int red_mark_probability(const struct red_parms *p,
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f17ed590d64a..b07cdc9fa454 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -38,17 +38,17 @@ enum environment_cap {
38 * 38 *
39 * @rcu_head: RCU head struct used to free the request 39 * @rcu_head: RCU head struct used to free the request
40 * @wiphy_idx: this is set if this request's initiator is 40 * @wiphy_idx: this is set if this request's initiator is
41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This 41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
42 * can be used by the wireless core to deal with conflicts 42 * can be used by the wireless core to deal with conflicts
43 * and potentially inform users of which devices specifically 43 * and potentially inform users of which devices specifically
44 * cased the conflicts. 44 * cased the conflicts.
45 * @initiator: indicates who sent this request, could be any of 45 * @initiator: indicates who sent this request, could be any of
46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) 46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested 47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
48 * regulatory domain. We have a few special codes: 48 * regulatory domain. We have a few special codes:
49 * 00 - World regulatory domain 49 * 00 - World regulatory domain
50 * 99 - built by driver but a specific alpha2 cannot be determined 50 * 99 - built by driver but a specific alpha2 cannot be determined
51 * 98 - result of an intersection between two regulatory domains 51 * 98 - result of an intersection between two regulatory domains
52 * 97 - regulatory domain has not yet been configured 52 * 97 - regulatory domain has not yet been configured
53 * @dfs_region: If CRDA responded with a regulatory domain that requires 53 * @dfs_region: If CRDA responded with a regulatory domain that requires
54 * DFS master operation on a known DFS region (NL80211_DFS_*), 54 * DFS master operation on a known DFS region (NL80211_DFS_*),
@@ -59,8 +59,8 @@ enum environment_cap {
59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* 59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_*
60 * types. 60 * types.
61 * @intersect: indicates whether the wireless core should intersect 61 * @intersect: indicates whether the wireless core should intersect
62 * the requested regulatory domain with the presently set regulatory 62 * the requested regulatory domain with the presently set regulatory
63 * domain. 63 * domain.
64 * @processed: indicates whether or not this requests has already been 64 * @processed: indicates whether or not this requests has already been
65 * processed. When the last request is processed it means that the 65 * processed. When the last request is processed it means that the
66 * currently regulatory domain set on cfg80211 is updated from 66 * currently regulatory domain set on cfg80211 is updated from
@@ -68,9 +68,9 @@ enum environment_cap {
68 * the last request is not yet processed we must yield until it 68 * the last request is not yet processed we must yield until it
69 * is processed before processing any new requests. 69 * is processed before processing any new requests.
70 * @country_ie_checksum: checksum of the last processed and accepted 70 * @country_ie_checksum: checksum of the last processed and accepted
71 * country IE 71 * country IE
72 * @country_ie_env: lets us know if the AP is telling us we are outdoor, 72 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
73 * indoor, or if it doesn't matter 73 * indoor, or if it doesn't matter
74 * @list: used to insert into the reg_requests_list linked list 74 * @list: used to insert into the reg_requests_list linked list
75 */ 75 */
76struct regulatory_request { 76struct regulatory_request {
@@ -79,13 +79,67 @@ struct regulatory_request {
79 enum nl80211_reg_initiator initiator; 79 enum nl80211_reg_initiator initiator;
80 enum nl80211_user_reg_hint_type user_reg_hint_type; 80 enum nl80211_user_reg_hint_type user_reg_hint_type;
81 char alpha2[2]; 81 char alpha2[2];
82 u8 dfs_region; 82 enum nl80211_dfs_regions dfs_region;
83 bool intersect; 83 bool intersect;
84 bool processed; 84 bool processed;
85 enum environment_cap country_ie_env; 85 enum environment_cap country_ie_env;
86 struct list_head list; 86 struct list_head list;
87}; 87};
88 88
89/**
90 * enum ieee80211_regulatory_flags - device regulatory flags
91 *
92 * @REGULATORY_CUSTOM_REG: tells us the driver for this device
93 * has its own custom regulatory domain and cannot identify the
94 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
95 * we will disregard the first regulatory hint (when the
96 * initiator is %REGDOM_SET_BY_CORE). Drivers that use
97 * wiphy_apply_custom_regulatory() should have this flag set
98 * or the regulatory core will set it for the wiphy.
99 * If you use regulatory_hint() *after* using
100 * wiphy_apply_custom_regulatory() the wireless core will
101 * clear the REGULATORY_CUSTOM_REG for your wiphy as it would be
102 * implied that the device somehow gained knowledge of its region.
103 * @REGULATORY_STRICT_REG: tells us that the wiphy for this device
104 * has regulatory domain that it wishes to be considered as the
105 * superset for regulatory rules. After this device gets its regulatory
106 * domain programmed further regulatory hints shall only be considered
107 * for this device to enhance regulatory compliance, forcing the
108 * device to only possibly use subsets of the original regulatory
109 * rules. For example if channel 13 and 14 are disabled by this
110 * device's regulatory domain no user specified regulatory hint which
111 * has these channels enabled would enable them for this wiphy,
112 * the device's original regulatory domain will be trusted as the
113 * base. You can program the superset of regulatory rules for this
114 * wiphy with regulatory_hint() for cards programmed with an
115 * ISO3166-alpha2 country code. wiphys that use regulatory_hint()
116 * will have their wiphy->regd programmed once the regulatory
117 * domain is set, and all other regulatory hints will be ignored
118 * until their own regulatory domain gets programmed.
119 * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to
120 * ensure that passive scan flags and beaconing flags may not be lifted by
121 * cfg80211 due to regulatory beacon hints. For more information on beacon
122 * hints read the documenation for regulatory_hint_found_beacon()
123 * @REGULATORY_COUNTRY_IE_FOLLOW_POWER: for devices that have a preference
124 * that even though they may have programmed their own custom power
125 * setting prior to wiphy registration, they want to ensure their channel
126 * power settings are updated for this connection with the power settings
127 * derived from the regulatory domain. The regulatory domain used will be
128 * based on the ISO3166-alpha2 from country IE provided through
129 * regulatory_hint_country_ie()
130 * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore
131 * all country IE information processed by the regulatory core. This will
132 * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
133 * be ignored.
134 */
135enum ieee80211_regulatory_flags {
136 REGULATORY_CUSTOM_REG = BIT(0),
137 REGULATORY_STRICT_REG = BIT(1),
138 REGULATORY_DISABLE_BEACON_HINTS = BIT(2),
139 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3),
140 REGULATORY_COUNTRY_IE_IGNORE = BIT(4),
141};
142
89struct ieee80211_freq_range { 143struct ieee80211_freq_range {
90 u32 start_freq_khz; 144 u32 start_freq_khz;
91 u32 end_freq_khz; 145 u32 end_freq_khz;
@@ -107,7 +161,7 @@ struct ieee80211_regdomain {
107 struct rcu_head rcu_head; 161 struct rcu_head rcu_head;
108 u32 n_reg_rules; 162 u32 n_reg_rules;
109 char alpha2[2]; 163 char alpha2[2];
110 u8 dfs_region; 164 enum nl80211_dfs_regions dfs_region;
111 struct ieee80211_reg_rule reg_rules[]; 165 struct ieee80211_reg_rule reg_rules[];
112}; 166};
113 167
diff --git a/include/net/route.h b/include/net/route.h
index f68c167280a7..9d1f423d5944 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -36,6 +36,9 @@
36#include <linux/cache.h> 36#include <linux/cache.h>
37#include <linux/security.h> 37#include <linux/security.h>
38 38
39/* IPv4 datagram length is stored into 16bit field (tot_len) */
40#define IP_MAX_MTU 0xFFFFU
41
39#define RTO_ONLINK 0x01 42#define RTO_ONLINK 0x01
40 43
41#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) 44#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE))
@@ -239,14 +242,12 @@ static inline char rt_tos2priority(u8 tos)
239static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, 242static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src,
240 u32 tos, int oif, u8 protocol, 243 u32 tos, int oif, u8 protocol,
241 __be16 sport, __be16 dport, 244 __be16 sport, __be16 dport,
242 struct sock *sk, bool can_sleep) 245 struct sock *sk)
243{ 246{
244 __u8 flow_flags = 0; 247 __u8 flow_flags = 0;
245 248
246 if (inet_sk(sk)->transparent) 249 if (inet_sk(sk)->transparent)
247 flow_flags |= FLOWI_FLAG_ANYSRC; 250 flow_flags |= FLOWI_FLAG_ANYSRC;
248 if (can_sleep)
249 flow_flags |= FLOWI_FLAG_CAN_SLEEP;
250 251
251 flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, 252 flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
252 protocol, flow_flags, dst, src, dport, sport); 253 protocol, flow_flags, dst, src, dport, sport);
@@ -256,13 +257,13 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
256 __be32 dst, __be32 src, u32 tos, 257 __be32 dst, __be32 src, u32 tos,
257 int oif, u8 protocol, 258 int oif, u8 protocol,
258 __be16 sport, __be16 dport, 259 __be16 sport, __be16 dport,
259 struct sock *sk, bool can_sleep) 260 struct sock *sk)
260{ 261{
261 struct net *net = sock_net(sk); 262 struct net *net = sock_net(sk);
262 struct rtable *rt; 263 struct rtable *rt;
263 264
264 ip_route_connect_init(fl4, dst, src, tos, oif, protocol, 265 ip_route_connect_init(fl4, dst, src, tos, oif, protocol,
265 sport, dport, sk, can_sleep); 266 sport, dport, sk);
266 267
267 if (!dst || !src) { 268 if (!dst || !src) {
268 rt = __ip_route_output_key(net, fl4); 269 rt = __ip_route_output_key(net, fl4);
@@ -313,20 +314,4 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst)
313 return hoplimit; 314 return hoplimit;
314} 315}
315 316
316static inline bool ip_sk_accept_pmtu(const struct sock *sk)
317{
318 return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE;
319}
320
321static inline bool ip_sk_use_pmtu(const struct sock *sk)
322{
323 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
324}
325
326static inline int ip_skb_dst_mtu(const struct sk_buff *skb)
327{
328 return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ?
329 dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu;
330}
331
332#endif /* _ROUTE_H */ 317#endif /* _ROUTE_H */
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index bb13a182fba6..661e45d38051 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -79,6 +79,20 @@ struct rtnl_link_ops {
79 const struct net_device *dev); 79 const struct net_device *dev);
80 unsigned int (*get_num_tx_queues)(void); 80 unsigned int (*get_num_tx_queues)(void);
81 unsigned int (*get_num_rx_queues)(void); 81 unsigned int (*get_num_rx_queues)(void);
82
83 int slave_maxtype;
84 const struct nla_policy *slave_policy;
85 int (*slave_validate)(struct nlattr *tb[],
86 struct nlattr *data[]);
87 int (*slave_changelink)(struct net_device *dev,
88 struct net_device *slave_dev,
89 struct nlattr *tb[],
90 struct nlattr *data[]);
91 size_t (*get_slave_size)(const struct net_device *dev,
92 const struct net_device *slave_dev);
93 int (*fill_slave_info)(struct sk_buff *skb,
94 const struct net_device *dev,
95 const struct net_device *slave_dev);
82}; 96};
83 97
84int __rtnl_link_register(struct rtnl_link_ops *ops); 98int __rtnl_link_register(struct rtnl_link_ops *ops);
@@ -115,10 +129,9 @@ struct rtnl_af_ops {
115 const struct nlattr *attr); 129 const struct nlattr *attr);
116}; 130};
117 131
118int __rtnl_af_register(struct rtnl_af_ops *ops);
119void __rtnl_af_unregister(struct rtnl_af_ops *ops); 132void __rtnl_af_unregister(struct rtnl_af_ops *ops);
120 133
121int rtnl_af_register(struct rtnl_af_ops *ops); 134void rtnl_af_register(struct rtnl_af_ops *ops);
122void rtnl_af_unregister(struct rtnl_af_ops *ops); 135void rtnl_af_unregister(struct rtnl_af_ops *ops);
123 136
124struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 137struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index d0a6321c302e..d062f81c692f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -185,7 +185,7 @@ struct tcf_result {
185}; 185};
186 186
187struct tcf_proto_ops { 187struct tcf_proto_ops {
188 struct tcf_proto_ops *next; 188 struct list_head head;
189 char kind[IFNAMSIZ]; 189 char kind[IFNAMSIZ];
190 190
191 int (*classify)(struct sk_buff *, 191 int (*classify)(struct sk_buff *,
@@ -204,7 +204,7 @@ struct tcf_proto_ops {
204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg); 204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
205 205
206 /* rtnetlink specific */ 206 /* rtnetlink specific */
207 int (*dump)(struct tcf_proto*, unsigned long, 207 int (*dump)(struct net*, struct tcf_proto*, unsigned long,
208 struct sk_buff *skb, struct tcmsg*); 208 struct sk_buff *skb, struct tcmsg*);
209 209
210 struct module *owner; 210 struct module *owner;
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index aa80bef3c9d5..f2d58aa37a6f 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -16,9 +16,8 @@
16 * See the GNU General Public License for more details. 16 * See the GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with GNU CC; see the file COPYING. If not, write to 19 * along with GNU CC; see the file COPYING. If not, see
20 * the Free Software Foundation, 59 Temple Place - Suite 330, 20 * <http://www.gnu.org/licenses/>.
21 * Boston, MA 02111-1307, USA.
22 * 21 *
23 * Please send any bug reports or fixes you make to the 22 * Please send any bug reports or fixes you make to the
24 * email address(es): 23 * email address(es):
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 6bd44fe94c26..4a5b9a306c69 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 832f2191489c..4b7cd695e431 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 2f0a565a0fd5..307728f622ef 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index c5fe80697f8d..a3353f45ef94 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -21,9 +21,8 @@
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with GNU CC; see the file COPYING. If not, write to 24 * along with GNU CC; see the file COPYING. If not, see
25 * the Free Software Foundation, 59 Temple Place - Suite 330, 25 * <http://www.gnu.org/licenses/>.
26 * Boston, MA 02111-1307, USA.
27 * 26 *
28 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
29 * email address(es): 28 * email address(es):
@@ -171,25 +170,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
171 * Section: Macros, externs, and inlines 170 * Section: Macros, externs, and inlines
172 */ 171 */
173 172
174/* spin lock wrappers. */
175#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags)
176#define sctp_spin_unlock_irqrestore(lock, flags) \
177 spin_unlock_irqrestore(lock, flags)
178#define sctp_local_bh_disable() local_bh_disable()
179#define sctp_local_bh_enable() local_bh_enable()
180#define sctp_spin_lock(lock) spin_lock(lock)
181#define sctp_spin_unlock(lock) spin_unlock(lock)
182#define sctp_write_lock(lock) write_lock(lock)
183#define sctp_write_unlock(lock) write_unlock(lock)
184#define sctp_read_lock(lock) read_lock(lock)
185#define sctp_read_unlock(lock) read_unlock(lock)
186
187/* sock lock wrappers. */
188#define sctp_lock_sock(sk) lock_sock(sk)
189#define sctp_release_sock(sk) release_sock(sk)
190#define sctp_bh_lock_sock(sk) bh_lock_sock(sk)
191#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk)
192
193/* SCTP SNMP MIB stats handlers */ 173/* SCTP SNMP MIB stats handlers */
194#define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) 174#define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field)
195#define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) 175#define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field)
@@ -354,13 +334,13 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
354{ 334{
355 unsigned long flags; 335 unsigned long flags;
356 336
357 sctp_spin_lock_irqsave(&head->lock, flags); 337 spin_lock_irqsave(&head->lock, flags);
358 sctp_spin_lock(&list->lock); 338 spin_lock(&list->lock);
359 339
360 skb_queue_splice_tail_init(list, head); 340 skb_queue_splice_tail_init(list, head);
361 341
362 sctp_spin_unlock(&list->lock); 342 spin_unlock(&list->lock);
363 sctp_spin_unlock_irqrestore(&head->lock, flags); 343 spin_unlock_irqrestore(&head->lock, flags);
364} 344}
365 345
366/** 346/**
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 4ef75af340b6..7f4eeb340a54 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -21,9 +21,8 @@
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with GNU CC; see the file COPYING. If not, write to 24 * along with GNU CC; see the file COPYING. If not, see
25 * the Free Software Foundation, 59 Temple Place - Suite 330, 25 * <http://www.gnu.org/licenses/>.
26 * Boston, MA 02111-1307, USA.
27 * 26 *
28 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
29 * email addresses: 28 * email addresses:
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0a248b323d87..d992ca3145fe 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email addresses: 26 * email addresses:
@@ -650,7 +649,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
650 struct iovec *data); 649 struct iovec *data);
651void sctp_chunk_free(struct sctp_chunk *); 650void sctp_chunk_free(struct sctp_chunk *);
652void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 651void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
653void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
654struct sctp_chunk *sctp_chunkify(struct sk_buff *, 652struct sctp_chunk *sctp_chunkify(struct sk_buff *,
655 const struct sctp_association *, 653 const struct sctp_association *,
656 struct sock *); 654 struct sock *);
@@ -1358,12 +1356,6 @@ struct sctp_association {
1358 1356
1359 /* This is all information about our peer. */ 1357 /* This is all information about our peer. */
1360 struct { 1358 struct {
1361 /* rwnd
1362 *
1363 * Peer Rwnd : Current calculated value of the peer's rwnd.
1364 */
1365 __u32 rwnd;
1366
1367 /* transport_addr_list 1359 /* transport_addr_list
1368 * 1360 *
1369 * Peer : A list of SCTP transport addresses that the 1361 * Peer : A list of SCTP transport addresses that the
@@ -1381,6 +1373,12 @@ struct sctp_association {
1381 */ 1373 */
1382 struct list_head transport_addr_list; 1374 struct list_head transport_addr_list;
1383 1375
1376 /* rwnd
1377 *
1378 * Peer Rwnd : Current calculated value of the peer's rwnd.
1379 */
1380 __u32 rwnd;
1381
1384 /* transport_count 1382 /* transport_count
1385 * 1383 *
1386 * Peer : A count of the number of peer addresses 1384 * Peer : A count of the number of peer addresses
@@ -1463,6 +1461,20 @@ struct sctp_association {
1463 */ 1461 */
1464 struct sctp_tsnmap tsn_map; 1462 struct sctp_tsnmap tsn_map;
1465 1463
1464 /* This mask is used to disable sending the ASCONF chunk
1465 * with specified parameter to peer.
1466 */
1467 __be16 addip_disabled_mask;
1468
1469 /* These are capabilities which our peer advertised. */
1470 __u8 ecn_capable:1, /* Can peer do ECN? */
1471 ipv4_address:1, /* Peer understands IPv4 addresses? */
1472 ipv6_address:1, /* Peer understands IPv6 addresses? */
1473 hostname_address:1, /* Peer understands DNS addresses? */
1474 asconf_capable:1, /* Does peer support ADDIP? */
1475 prsctp_capable:1, /* Can peer do PR-SCTP? */
1476 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1477
1466 /* Ack State : This flag indicates if the next received 1478 /* Ack State : This flag indicates if the next received
1467 * : packet is to be responded to with a 1479 * : packet is to be responded to with a
1468 * : SACK. This is initializedto 0. When a packet 1480 * : SACK. This is initializedto 0. When a packet
@@ -1477,25 +1489,11 @@ struct sctp_association {
1477 __u32 sack_cnt; 1489 __u32 sack_cnt;
1478 __u32 sack_generation; 1490 __u32 sack_generation;
1479 1491
1480 /* These are capabilities which our peer advertised. */
1481 __u8 ecn_capable:1, /* Can peer do ECN? */
1482 ipv4_address:1, /* Peer understands IPv4 addresses? */
1483 ipv6_address:1, /* Peer understands IPv6 addresses? */
1484 hostname_address:1, /* Peer understands DNS addresses? */
1485 asconf_capable:1, /* Does peer support ADDIP? */
1486 prsctp_capable:1, /* Can peer do PR-SCTP? */
1487 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1488
1489 __u32 adaptation_ind; /* Adaptation Code point. */ 1492 __u32 adaptation_ind; /* Adaptation Code point. */
1490 1493
1491 /* This mask is used to disable sending the ASCONF chunk
1492 * with specified parameter to peer.
1493 */
1494 __be16 addip_disabled_mask;
1495
1496 struct sctp_inithdr_host i; 1494 struct sctp_inithdr_host i;
1497 int cookie_len;
1498 void *cookie; 1495 void *cookie;
1496 int cookie_len;
1499 1497
1500 /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. 1498 /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.
1501 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the 1499 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the
@@ -1527,14 +1525,14 @@ struct sctp_association {
1527 */ 1525 */
1528 sctp_state_t state; 1526 sctp_state_t state;
1529 1527
1530 /* The cookie life I award for any cookie. */
1531 ktime_t cookie_life;
1532
1533 /* Overall : The overall association error count. 1528 /* Overall : The overall association error count.
1534 * Error Count : [Clear this any time I get something.] 1529 * Error Count : [Clear this any time I get something.]
1535 */ 1530 */
1536 int overall_error_count; 1531 int overall_error_count;
1537 1532
1533 /* The cookie life I award for any cookie. */
1534 ktime_t cookie_life;
1535
1538 /* These are the association's initial, max, and min RTO values. 1536 /* These are the association's initial, max, and min RTO values.
1539 * These values will be initialized by system defaults, but can 1537 * These values will be initialized by system defaults, but can
1540 * be modified via the SCTP_RTOINFO socket option. 1538 * be modified via the SCTP_RTOINFO socket option.
@@ -1589,10 +1587,9 @@ struct sctp_association {
1589 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ 1587 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
1590 __u32 param_flags; 1588 __u32 param_flags;
1591 1589
1590 __u32 sackfreq;
1592 /* SACK delay timeout */ 1591 /* SACK delay timeout */
1593 unsigned long sackdelay; 1592 unsigned long sackdelay;
1594 __u32 sackfreq;
1595
1596 1593
1597 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1594 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES];
1598 struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; 1595 struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES];
@@ -1600,12 +1597,12 @@ struct sctp_association {
1600 /* Transport to which SHUTDOWN chunk was last sent. */ 1597 /* Transport to which SHUTDOWN chunk was last sent. */
1601 struct sctp_transport *shutdown_last_sent_to; 1598 struct sctp_transport *shutdown_last_sent_to;
1602 1599
1603 /* How many times have we resent a SHUTDOWN */
1604 int shutdown_retries;
1605
1606 /* Transport to which INIT chunk was last sent. */ 1600 /* Transport to which INIT chunk was last sent. */
1607 struct sctp_transport *init_last_sent_to; 1601 struct sctp_transport *init_last_sent_to;
1608 1602
1603 /* How many times have we resent a SHUTDOWN */
1604 int shutdown_retries;
1605
1609 /* Next TSN : The next TSN number to be assigned to a new 1606 /* Next TSN : The next TSN number to be assigned to a new
1610 * : DATA chunk. This is sent in the INIT or INIT 1607 * : DATA chunk. This is sent in the INIT or INIT
1611 * : ACK chunk to the peer and incremented each 1608 * : ACK chunk to the peer and incremented each
@@ -1810,8 +1807,8 @@ struct sctp_association {
1810 * after reaching 4294967295. 1807 * after reaching 4294967295.
1811 */ 1808 */
1812 __u32 addip_serial; 1809 __u32 addip_serial;
1813 union sctp_addr *asconf_addr_del_pending;
1814 int src_out_of_asoc_ok; 1810 int src_out_of_asoc_ok;
1811 union sctp_addr *asconf_addr_del_pending;
1815 struct sctp_transport *new_transport; 1812 struct sctp_transport *new_transport;
1816 1813
1817 /* SCTP AUTH: list of the endpoint shared keys. These 1814 /* SCTP AUTH: list of the endpoint shared keys. These
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 54bbbe547303..31b8dbaad45a 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -22,9 +22,8 @@
22 * See the GNU General Public License for more details. 22 * See the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to 25 * along with GNU CC; see the file COPYING. If not, see
26 * the Free Software Foundation, 59 Temple Place - Suite 330, 26 * <http://www.gnu.org/licenses/>.
27 * Boston, MA 02111-1307, USA.
28 * 27 *
29 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
30 * email address(es): 29 * email address(es):
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 27b9f5c90153..daacb32b55b5 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -25,9 +25,8 @@
25 * See the GNU General Public License for more details. 25 * See the GNU General Public License for more details.
26 * 26 *
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with GNU CC; see the file COPYING. If not, write to 28 * along with GNU CC; see the file COPYING. If not, see
29 * the Free Software Foundation, 59 Temple Place - Suite 330, 29 * <http://www.gnu.org/licenses/>.
30 * Boston, MA 02111-1307, USA.
31 * 30 *
32 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
33 * email address(es): 32 * email address(es):
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index b0cf5d54d717..e0dce07b8794 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -24,9 +24,8 @@
24 * See the GNU General Public License for more details. 24 * See the GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with GNU CC; see the file COPYING. If not, write to 27 * along with GNU CC; see the file COPYING. If not, see
28 * the Free Software Foundation, 59 Temple Place - Suite 330, 28 * <http://www.gnu.org/licenses/>.
29 * Boston, MA 02111-1307, USA.
30 * 29 *
31 * Please send any bug reports or fixes you make to the 30 * Please send any bug reports or fixes you make to the
32 * email addresses: 31 * email addresses:
diff --git a/include/net/sock.h b/include/net/sock.h
index 2ef3c3eca47a..5c3f7c3624aa 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -395,7 +395,7 @@ struct sock {
395 unsigned short sk_ack_backlog; 395 unsigned short sk_ack_backlog;
396 unsigned short sk_max_ack_backlog; 396 unsigned short sk_max_ack_backlog;
397 __u32 sk_priority; 397 __u32 sk_priority;
398#if IS_ENABLED(CONFIG_NETPRIO_CGROUP) 398#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
399 __u32 sk_cgrp_prioidx; 399 __u32 sk_cgrp_prioidx;
400#endif 400#endif
401 struct pid *sk_peer_pid; 401 struct pid *sk_peer_pid;
@@ -820,30 +820,44 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
820 return sk->sk_backlog_rcv(sk, skb); 820 return sk->sk_backlog_rcv(sk, skb);
821} 821}
822 822
823static inline void sock_rps_record_flow(const struct sock *sk) 823static inline void sock_rps_record_flow_hash(__u32 hash)
824{ 824{
825#ifdef CONFIG_RPS 825#ifdef CONFIG_RPS
826 struct rps_sock_flow_table *sock_flow_table; 826 struct rps_sock_flow_table *sock_flow_table;
827 827
828 rcu_read_lock(); 828 rcu_read_lock();
829 sock_flow_table = rcu_dereference(rps_sock_flow_table); 829 sock_flow_table = rcu_dereference(rps_sock_flow_table);
830 rps_record_sock_flow(sock_flow_table, sk->sk_rxhash); 830 rps_record_sock_flow(sock_flow_table, hash);
831 rcu_read_unlock(); 831 rcu_read_unlock();
832#endif 832#endif
833} 833}
834 834
835static inline void sock_rps_reset_flow(const struct sock *sk) 835static inline void sock_rps_reset_flow_hash(__u32 hash)
836{ 836{
837#ifdef CONFIG_RPS 837#ifdef CONFIG_RPS
838 struct rps_sock_flow_table *sock_flow_table; 838 struct rps_sock_flow_table *sock_flow_table;
839 839
840 rcu_read_lock(); 840 rcu_read_lock();
841 sock_flow_table = rcu_dereference(rps_sock_flow_table); 841 sock_flow_table = rcu_dereference(rps_sock_flow_table);
842 rps_reset_sock_flow(sock_flow_table, sk->sk_rxhash); 842 rps_reset_sock_flow(sock_flow_table, hash);
843 rcu_read_unlock(); 843 rcu_read_unlock();
844#endif 844#endif
845} 845}
846 846
847static inline void sock_rps_record_flow(const struct sock *sk)
848{
849#ifdef CONFIG_RPS
850 sock_rps_record_flow_hash(sk->sk_rxhash);
851#endif
852}
853
854static inline void sock_rps_reset_flow(const struct sock *sk)
855{
856#ifdef CONFIG_RPS
857 sock_rps_reset_flow_hash(sk->sk_rxhash);
858#endif
859}
860
847static inline void sock_rps_save_rxhash(struct sock *sk, 861static inline void sock_rps_save_rxhash(struct sock *sk,
848 const struct sk_buff *skb) 862 const struct sk_buff *skb)
849{ 863{
@@ -1535,8 +1549,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
1535 1549
1536struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, 1550struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
1537 gfp_t priority); 1551 gfp_t priority);
1538struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force,
1539 gfp_t priority);
1540void sock_wfree(struct sk_buff *skb); 1552void sock_wfree(struct sk_buff *skb);
1541void skb_orphan_partial(struct sk_buff *skb); 1553void skb_orphan_partial(struct sk_buff *skb);
1542void sock_rfree(struct sk_buff *skb); 1554void sock_rfree(struct sk_buff *skb);
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h
index e103fe02f375..dd5d86fab030 100644
--- a/include/net/tc_act/tc_skbedit.h
+++ b/include/net/tc_act/tc_skbedit.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: Alexander Duyck <alexander.h.duyck@intel.com> 16 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
18 */ 17 */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 70e55d200610..56fc366da6d5 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -282,6 +282,7 @@ extern int sysctl_tcp_limit_output_bytes;
282extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat; 283extern unsigned int sysctl_tcp_notsent_lowat;
284extern int sysctl_tcp_min_tso_segs; 284extern int sysctl_tcp_min_tso_segs;
285extern int sysctl_tcp_autocorking;
285 286
286extern atomic_long_t tcp_memory_allocated; 287extern atomic_long_t tcp_memory_allocated;
287extern struct percpu_counter tcp_sockets_allocated; 288extern struct percpu_counter tcp_sockets_allocated;
@@ -467,7 +468,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
467 struct tcp_fastopen_cookie *foc); 468 struct tcp_fastopen_cookie *foc);
468int tcp_disconnect(struct sock *sk, int flags); 469int tcp_disconnect(struct sock *sk, int flags);
469 470
470void tcp_connect_init(struct sock *sk);
471void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); 471void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
472int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); 472int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size);
473void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); 473void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
@@ -622,8 +622,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
622 return (tp->srtt >> 3) + tp->rttvar; 622 return (tp->srtt >> 3) + tp->rttvar;
623} 623}
624 624
625void tcp_set_rto(struct sock *sk);
626
627static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) 625static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
628{ 626{
629 tp->pred_flags = htonl((tp->tcp_header_len << 26) | 627 tp->pred_flags = htonl((tp->tcp_header_len << 26) |
@@ -977,13 +975,6 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp)
977} 975}
978bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); 976bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight);
979 977
980static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
981 const struct sk_buff *skb)
982{
983 if (skb->len < mss)
984 tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
985}
986
987static inline void tcp_check_probe_timer(struct sock *sk) 978static inline void tcp_check_probe_timer(struct sock *sk)
988{ 979{
989 const struct tcp_sock *tp = tcp_sk(sk); 980 const struct tcp_sock *tp = tcp_sk(sk);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 48660e50ae90..b927413dde86 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -32,8 +32,13 @@ void tcpv6_exit(void);
32 32
33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); 33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
34 34
35int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, 35/* this does all the common and the specific ctl work */
36 struct sk_buff *skb); 36void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
37 struct sk_buff *skb);
38void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
39 struct sk_buff *skb);
40void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg,
41 struct sk_buff *skb);
37 42
38int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, 43int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
39 struct flowi6 *fl6, struct ipv6_txoptions *opt, 44 struct flowi6 *fl6, struct ipv6_txoptions *opt,
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 6b6d180fb91a..5deef1ae78c9 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -21,6 +21,7 @@ struct vxlan_sock {
21 struct rcu_head rcu; 21 struct rcu_head rcu;
22 struct hlist_head vni_list[VNI_HASH_SIZE]; 22 struct hlist_head vni_list[VNI_HASH_SIZE];
23 atomic_t refcnt; 23 atomic_t refcnt;
24 struct udp_offload udp_offloads;
24}; 25};
25 26
26struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, 27struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 1d535f4d3873..afa5730fb3bd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -53,7 +53,6 @@
53#define XFRM_INC_STATS_USER(net, field) ((void)(net)) 53#define XFRM_INC_STATS_USER(net, field) ((void)(net))
54#endif 54#endif
55 55
56extern struct mutex xfrm_cfg_mutex;
57 56
58/* Organization of SPD aka "XFRM rules" 57/* Organization of SPD aka "XFRM rules"
59 ------------------------------------ 58 ------------------------------------
@@ -1409,7 +1408,7 @@ static inline void xfrm_sysctl_fini(struct net *net)
1409void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); 1408void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto);
1410int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, 1409int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk,
1411 int (*func)(struct xfrm_state *, int, void*), void *); 1410 int (*func)(struct xfrm_state *, int, void*), void *);
1412void xfrm_state_walk_done(struct xfrm_state_walk *walk); 1411void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net);
1413struct xfrm_state *xfrm_state_alloc(struct net *net); 1412struct xfrm_state *xfrm_state_alloc(struct net *net);
1414struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, 1413struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr,
1415 const xfrm_address_t *saddr, 1414 const xfrm_address_t *saddr,
@@ -1422,6 +1421,8 @@ struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark,
1422 xfrm_address_t *saddr, 1421 xfrm_address_t *saddr,
1423 unsigned short family, 1422 unsigned short family,
1424 u8 mode, u8 proto, u32 reqid); 1423 u8 mode, u8 proto, u32 reqid);
1424struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi,
1425 unsigned short family);
1425int xfrm_state_check_expire(struct xfrm_state *x); 1426int xfrm_state_check_expire(struct xfrm_state *x);
1426void xfrm_state_insert(struct xfrm_state *x); 1427void xfrm_state_insert(struct xfrm_state *x);
1427int xfrm_state_add(struct xfrm_state *x); 1428int xfrm_state_add(struct xfrm_state *x);
@@ -1436,12 +1437,12 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1436 unsigned short family); 1437 unsigned short family);
1437#ifdef CONFIG_XFRM_SUB_POLICY 1438#ifdef CONFIG_XFRM_SUB_POLICY
1438int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, 1439int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n,
1439 unsigned short family); 1440 unsigned short family, struct net *net);
1440int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, 1441int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n,
1441 unsigned short family); 1442 unsigned short family);
1442#else 1443#else
1443static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, 1444static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
1444 int n, unsigned short family) 1445 int n, unsigned short family, struct net *net)
1445{ 1446{
1446 return -ENOSYS; 1447 return -ENOSYS;
1447} 1448}
@@ -1553,7 +1554,7 @@ void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
1553int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, 1554int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1554 int (*func)(struct xfrm_policy *, int, int, void*), 1555 int (*func)(struct xfrm_policy *, int, int, void*),
1555 void *); 1556 void *);
1556void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); 1557void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net);
1557int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1558int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1558struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, 1559struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1559 u8 type, int dir, 1560 u8 type, int dir,
@@ -1564,6 +1565,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir,
1564 u32 id, int delete, int *err); 1565 u32 id, int delete, int *err);
1565int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1566int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1566u32 xfrm_get_acqseq(void); 1567u32 xfrm_get_acqseq(void);
1568int verify_spi_info(u8 proto, u32 min, u32 max);
1567int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1569int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1568struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, 1570struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1569 u8 mode, u32 reqid, u8 proto, 1571 u8 mode, u32 reqid, u8 proto,
@@ -1576,12 +1578,12 @@ int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1576int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1578int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1577 const struct xfrm_migrate *m, int num_bundles, 1579 const struct xfrm_migrate *m, int num_bundles,
1578 const struct xfrm_kmaddress *k); 1580 const struct xfrm_kmaddress *k);
1579struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); 1581struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net);
1580struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, 1582struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
1581 struct xfrm_migrate *m); 1583 struct xfrm_migrate *m);
1582int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1584int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1583 struct xfrm_migrate *m, int num_bundles, 1585 struct xfrm_migrate *m, int num_bundles,
1584 struct xfrm_kmaddress *k); 1586 struct xfrm_kmaddress *k, struct net *net);
1585#endif 1587#endif
1586 1588
1587int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1589int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
index f99645d05a8f..a34f27b2e394 100644
--- a/include/trace/events/net.h
+++ b/include/trace/events/net.h
@@ -6,9 +6,67 @@
6 6
7#include <linux/skbuff.h> 7#include <linux/skbuff.h>
8#include <linux/netdevice.h> 8#include <linux/netdevice.h>
9#include <linux/if_vlan.h>
9#include <linux/ip.h> 10#include <linux/ip.h>
10#include <linux/tracepoint.h> 11#include <linux/tracepoint.h>
11 12
13TRACE_EVENT(net_dev_start_xmit,
14
15 TP_PROTO(const struct sk_buff *skb, const struct net_device *dev),
16
17 TP_ARGS(skb, dev),
18
19 TP_STRUCT__entry(
20 __string( name, dev->name )
21 __field( u16, queue_mapping )
22 __field( const void *, skbaddr )
23 __field( bool, vlan_tagged )
24 __field( u16, vlan_proto )
25 __field( u16, vlan_tci )
26 __field( u16, protocol )
27 __field( u8, ip_summed )
28 __field( unsigned int, len )
29 __field( unsigned int, data_len )
30 __field( int, network_offset )
31 __field( bool, transport_offset_valid)
32 __field( int, transport_offset)
33 __field( u8, tx_flags )
34 __field( u16, gso_size )
35 __field( u16, gso_segs )
36 __field( u16, gso_type )
37 ),
38
39 TP_fast_assign(
40 __assign_str(name, dev->name);
41 __entry->queue_mapping = skb->queue_mapping;
42 __entry->skbaddr = skb;
43 __entry->vlan_tagged = vlan_tx_tag_present(skb);
44 __entry->vlan_proto = ntohs(skb->vlan_proto);
45 __entry->vlan_tci = vlan_tx_tag_get(skb);
46 __entry->protocol = ntohs(skb->protocol);
47 __entry->ip_summed = skb->ip_summed;
48 __entry->len = skb->len;
49 __entry->data_len = skb->data_len;
50 __entry->network_offset = skb_network_offset(skb);
51 __entry->transport_offset_valid =
52 skb_transport_header_was_set(skb);
53 __entry->transport_offset = skb_transport_offset(skb);
54 __entry->tx_flags = skb_shinfo(skb)->tx_flags;
55 __entry->gso_size = skb_shinfo(skb)->gso_size;
56 __entry->gso_segs = skb_shinfo(skb)->gso_segs;
57 __entry->gso_type = skb_shinfo(skb)->gso_type;
58 ),
59
60 TP_printk("dev=%s queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d len=%u data_len=%u network_offset=%d transport_offset_valid=%d transport_offset=%d tx_flags=%d gso_size=%d gso_segs=%d gso_type=%#x",
61 __get_str(name), __entry->queue_mapping, __entry->skbaddr,
62 __entry->vlan_tagged, __entry->vlan_proto, __entry->vlan_tci,
63 __entry->protocol, __entry->ip_summed, __entry->len,
64 __entry->data_len,
65 __entry->network_offset, __entry->transport_offset_valid,
66 __entry->transport_offset, __entry->tx_flags,
67 __entry->gso_size, __entry->gso_segs, __entry->gso_type)
68);
69
12TRACE_EVENT(net_dev_xmit, 70TRACE_EVENT(net_dev_xmit,
13 71
14 TP_PROTO(struct sk_buff *skb, 72 TP_PROTO(struct sk_buff *skb,
@@ -78,6 +136,106 @@ DEFINE_EVENT(net_dev_template, netif_rx,
78 136
79 TP_ARGS(skb) 137 TP_ARGS(skb)
80); 138);
139
140DECLARE_EVENT_CLASS(net_dev_rx_verbose_template,
141
142 TP_PROTO(const struct sk_buff *skb),
143
144 TP_ARGS(skb),
145
146 TP_STRUCT__entry(
147 __string( name, skb->dev->name )
148 __field( unsigned int, napi_id )
149 __field( u16, queue_mapping )
150 __field( const void *, skbaddr )
151 __field( bool, vlan_tagged )
152 __field( u16, vlan_proto )
153 __field( u16, vlan_tci )
154 __field( u16, protocol )
155 __field( u8, ip_summed )
156 __field( u32, rxhash )
157 __field( bool, l4_rxhash )
158 __field( unsigned int, len )
159 __field( unsigned int, data_len )
160 __field( unsigned int, truesize )
161 __field( bool, mac_header_valid)
162 __field( int, mac_header )
163 __field( unsigned char, nr_frags )
164 __field( u16, gso_size )
165 __field( u16, gso_type )
166 ),
167
168 TP_fast_assign(
169 __assign_str(name, skb->dev->name);
170#ifdef CONFIG_NET_RX_BUSY_POLL
171 __entry->napi_id = skb->napi_id;
172#else
173 __entry->napi_id = 0;
174#endif
175 __entry->queue_mapping = skb->queue_mapping;
176 __entry->skbaddr = skb;
177 __entry->vlan_tagged = vlan_tx_tag_present(skb);
178 __entry->vlan_proto = ntohs(skb->vlan_proto);
179 __entry->vlan_tci = vlan_tx_tag_get(skb);
180 __entry->protocol = ntohs(skb->protocol);
181 __entry->ip_summed = skb->ip_summed;
182 __entry->rxhash = skb->rxhash;
183 __entry->l4_rxhash = skb->l4_rxhash;
184 __entry->len = skb->len;
185 __entry->data_len = skb->data_len;
186 __entry->truesize = skb->truesize;
187 __entry->mac_header_valid = skb_mac_header_was_set(skb);
188 __entry->mac_header = skb_mac_header(skb) - skb->data;
189 __entry->nr_frags = skb_shinfo(skb)->nr_frags;
190 __entry->gso_size = skb_shinfo(skb)->gso_size;
191 __entry->gso_type = skb_shinfo(skb)->gso_type;
192 ),
193
194 TP_printk("dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d rxhash=0x%08x l4_rxhash=%d len=%u data_len=%u truesize=%u mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x",
195 __get_str(name), __entry->napi_id, __entry->queue_mapping,
196 __entry->skbaddr, __entry->vlan_tagged, __entry->vlan_proto,
197 __entry->vlan_tci, __entry->protocol, __entry->ip_summed,
198 __entry->rxhash, __entry->l4_rxhash, __entry->len,
199 __entry->data_len, __entry->truesize,
200 __entry->mac_header_valid, __entry->mac_header,
201 __entry->nr_frags, __entry->gso_size, __entry->gso_type)
202);
203
204DEFINE_EVENT(net_dev_rx_verbose_template, napi_gro_frags_entry,
205
206 TP_PROTO(const struct sk_buff *skb),
207
208 TP_ARGS(skb)
209);
210
211DEFINE_EVENT(net_dev_rx_verbose_template, napi_gro_receive_entry,
212
213 TP_PROTO(const struct sk_buff *skb),
214
215 TP_ARGS(skb)
216);
217
218DEFINE_EVENT(net_dev_rx_verbose_template, netif_receive_skb_entry,
219
220 TP_PROTO(const struct sk_buff *skb),
221
222 TP_ARGS(skb)
223);
224
225DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_entry,
226
227 TP_PROTO(const struct sk_buff *skb),
228
229 TP_ARGS(skb)
230);
231
232DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_ni_entry,
233
234 TP_PROTO(const struct sk_buff *skb),
235
236 TP_ARGS(skb)
237);
238
81#endif /* _TRACE_NET_H */ 239#endif /* _TRACE_NET_H */
82 240
83/* This part must be outside protection */ 241/* This part must be outside protection */
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index 38f14d0264c3..ea0796bdcf88 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -80,4 +80,6 @@
80 80
81#define SO_MAX_PACING_RATE 47 81#define SO_MAX_PACING_RATE 47
82 82
83#define SO_BPF_EXTENSIONS 48
84
83#endif /* __ASM_GENERIC_SOCKET_H */ 85#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/uapi/linux/if_addr.h b/include/uapi/linux/if_addr.h
index 23357ab81a77..dea10a87dfd1 100644
--- a/include/uapi/linux/if_addr.h
+++ b/include/uapi/linux/if_addr.h
@@ -18,6 +18,9 @@ struct ifaddrmsg {
18 * It makes no difference for normally configured broadcast interfaces, 18 * It makes no difference for normally configured broadcast interfaces,
19 * but for point-to-point IFA_ADDRESS is DESTINATION address, 19 * but for point-to-point IFA_ADDRESS is DESTINATION address,
20 * local address is supplied in IFA_LOCAL attribute. 20 * local address is supplied in IFA_LOCAL attribute.
21 *
22 * IFA_FLAGS is a u32 attribute that extends the u8 field ifa_flags.
23 * If present, the value from struct ifaddrmsg will be ignored.
21 */ 24 */
22enum { 25enum {
23 IFA_UNSPEC, 26 IFA_UNSPEC,
@@ -28,6 +31,7 @@ enum {
28 IFA_ANYCAST, 31 IFA_ANYCAST,
29 IFA_CACHEINFO, 32 IFA_CACHEINFO,
30 IFA_MULTICAST, 33 IFA_MULTICAST,
34 IFA_FLAGS,
31 __IFA_MAX, 35 __IFA_MAX,
32}; 36};
33 37
@@ -44,6 +48,8 @@ enum {
44#define IFA_F_DEPRECATED 0x20 48#define IFA_F_DEPRECATED 0x20
45#define IFA_F_TENTATIVE 0x40 49#define IFA_F_TENTATIVE 0x40
46#define IFA_F_PERMANENT 0x80 50#define IFA_F_PERMANENT 0x80
51#define IFA_F_MANAGETEMPADDR 0x100
52#define IFA_F_NOPREFIXROUTE 0x200
47 53
48struct ifa_cacheinfo { 54struct ifa_cacheinfo {
49 __u32 ifa_prefered; 55 __u32 ifa_prefered;
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index d7fea3496f32..4d024d75d64b 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -94,6 +94,7 @@
94#define ARPHRD_CAIF 822 /* CAIF media type */ 94#define ARPHRD_CAIF 822 /* CAIF media type */
95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ 95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
96#define ARPHRD_NETLINK 824 /* Netlink header */ 96#define ARPHRD_NETLINK 824 /* Netlink header */
97#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */
97 98
98#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 99#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
99#define ARPHRD_NONE 0xFFFE /* zero header length */ 100#define ARPHRD_NONE 0xFFFE /* zero header length */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 6db460121f84..16410b6e7819 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -240,6 +240,8 @@ enum {
240 IFLA_INFO_KIND, 240 IFLA_INFO_KIND,
241 IFLA_INFO_DATA, 241 IFLA_INFO_DATA,
242 IFLA_INFO_XSTATS, 242 IFLA_INFO_XSTATS,
243 IFLA_INFO_SLAVE_KIND,
244 IFLA_INFO_SLAVE_DATA,
243 __IFLA_INFO_MAX, 245 __IFLA_INFO_MAX,
244}; 246};
245 247
@@ -331,11 +333,57 @@ enum {
331 IFLA_BOND_UNSPEC, 333 IFLA_BOND_UNSPEC,
332 IFLA_BOND_MODE, 334 IFLA_BOND_MODE,
333 IFLA_BOND_ACTIVE_SLAVE, 335 IFLA_BOND_ACTIVE_SLAVE,
336 IFLA_BOND_MIIMON,
337 IFLA_BOND_UPDELAY,
338 IFLA_BOND_DOWNDELAY,
339 IFLA_BOND_USE_CARRIER,
340 IFLA_BOND_ARP_INTERVAL,
341 IFLA_BOND_ARP_IP_TARGET,
342 IFLA_BOND_ARP_VALIDATE,
343 IFLA_BOND_ARP_ALL_TARGETS,
344 IFLA_BOND_PRIMARY,
345 IFLA_BOND_PRIMARY_RESELECT,
346 IFLA_BOND_FAIL_OVER_MAC,
347 IFLA_BOND_XMIT_HASH_POLICY,
348 IFLA_BOND_RESEND_IGMP,
349 IFLA_BOND_NUM_PEER_NOTIF,
350 IFLA_BOND_ALL_SLAVES_ACTIVE,
351 IFLA_BOND_MIN_LINKS,
352 IFLA_BOND_LP_INTERVAL,
353 IFLA_BOND_PACKETS_PER_SLAVE,
354 IFLA_BOND_AD_LACP_RATE,
355 IFLA_BOND_AD_SELECT,
356 IFLA_BOND_AD_INFO,
334 __IFLA_BOND_MAX, 357 __IFLA_BOND_MAX,
335}; 358};
336 359
337#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) 360#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
338 361
362enum {
363 IFLA_BOND_AD_INFO_UNSPEC,
364 IFLA_BOND_AD_INFO_AGGREGATOR,
365 IFLA_BOND_AD_INFO_NUM_PORTS,
366 IFLA_BOND_AD_INFO_ACTOR_KEY,
367 IFLA_BOND_AD_INFO_PARTNER_KEY,
368 IFLA_BOND_AD_INFO_PARTNER_MAC,
369 __IFLA_BOND_AD_INFO_MAX,
370};
371
372#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
373
374enum {
375 IFLA_BOND_SLAVE_UNSPEC,
376 IFLA_BOND_SLAVE_STATE,
377 IFLA_BOND_SLAVE_MII_STATUS,
378 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
379 IFLA_BOND_SLAVE_PERM_HWADDR,
380 IFLA_BOND_SLAVE_QUEUE_ID,
381 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
382 __IFLA_BOND_SLAVE_MAX,
383};
384
385#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
386
339/* SR-IOV virtual function management section */ 387/* SR-IOV virtual function management section */
340 388
341enum { 389enum {
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index dbf06667394b..bac27fa05f5b 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -26,8 +26,10 @@ struct sockaddr_ll {
26#define PACKET_MULTICAST 2 /* To group */ 26#define PACKET_MULTICAST 2 /* To group */
27#define PACKET_OTHERHOST 3 /* To someone else */ 27#define PACKET_OTHERHOST 3 /* To someone else */
28#define PACKET_OUTGOING 4 /* Outgoing of any type */ 28#define PACKET_OUTGOING 4 /* Outgoing of any type */
29/* These ones are invisible by user level */
30#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ 29#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
30#define PACKET_USER 6 /* To user space */
31#define PACKET_KERNEL 7 /* To kernel space */
32/* Unused, PACKET_FASTROUTE and PACKET_LOOPBACK are invisible to user space */
31#define PACKET_FASTROUTE 6 /* Fastrouted frame */ 33#define PACKET_FASTROUTE 6 /* Fastrouted frame */
32 34
33/* Packet socket options */ 35/* Packet socket options */
@@ -51,12 +53,14 @@ struct sockaddr_ll {
51#define PACKET_TIMESTAMP 17 53#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18 54#define PACKET_FANOUT 18
53#define PACKET_TX_HAS_OFF 19 55#define PACKET_TX_HAS_OFF 19
56#define PACKET_QDISC_BYPASS 20
54 57
55#define PACKET_FANOUT_HASH 0 58#define PACKET_FANOUT_HASH 0
56#define PACKET_FANOUT_LB 1 59#define PACKET_FANOUT_LB 1
57#define PACKET_FANOUT_CPU 2 60#define PACKET_FANOUT_CPU 2
58#define PACKET_FANOUT_ROLLOVER 3 61#define PACKET_FANOUT_ROLLOVER 3
59#define PACKET_FANOUT_RND 4 62#define PACKET_FANOUT_RND 4
63#define PACKET_FANOUT_QM 5
60#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 64#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
61#define PACKET_FANOUT_FLAG_DEFRAG 0x8000 65#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
62 66
@@ -83,17 +87,18 @@ struct tpacket_auxdata {
83 __u16 tp_mac; 87 __u16 tp_mac;
84 __u16 tp_net; 88 __u16 tp_net;
85 __u16 tp_vlan_tci; 89 __u16 tp_vlan_tci;
86 __u16 tp_padding; 90 __u16 tp_vlan_tpid;
87}; 91};
88 92
89/* Rx ring - header status */ 93/* Rx ring - header status */
90#define TP_STATUS_KERNEL 0 94#define TP_STATUS_KERNEL 0
91#define TP_STATUS_USER (1 << 0) 95#define TP_STATUS_USER (1 << 0)
92#define TP_STATUS_COPY (1 << 1) 96#define TP_STATUS_COPY (1 << 1)
93#define TP_STATUS_LOSING (1 << 2) 97#define TP_STATUS_LOSING (1 << 2)
94#define TP_STATUS_CSUMNOTREADY (1 << 3) 98#define TP_STATUS_CSUMNOTREADY (1 << 3)
95#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */ 99#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
96#define TP_STATUS_BLK_TMO (1 << 5) 100#define TP_STATUS_BLK_TMO (1 << 5)
101#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
97 102
98/* Tx ring - header status */ 103/* Tx ring - header status */
99#define TP_STATUS_AVAILABLE 0 104#define TP_STATUS_AVAILABLE 0
@@ -132,12 +137,15 @@ struct tpacket2_hdr {
132 __u32 tp_sec; 137 __u32 tp_sec;
133 __u32 tp_nsec; 138 __u32 tp_nsec;
134 __u16 tp_vlan_tci; 139 __u16 tp_vlan_tci;
135 __u16 tp_padding; 140 __u16 tp_vlan_tpid;
141 __u8 tp_padding[4];
136}; 142};
137 143
138struct tpacket_hdr_variant1 { 144struct tpacket_hdr_variant1 {
139 __u32 tp_rxhash; 145 __u32 tp_rxhash;
140 __u32 tp_vlan_tci; 146 __u32 tp_vlan_tci;
147 __u16 tp_vlan_tpid;
148 __u16 tp_padding;
141}; 149};
142 150
143struct tpacket3_hdr { 151struct tpacket3_hdr {
@@ -153,6 +161,7 @@ struct tpacket3_hdr {
153 union { 161 union {
154 struct tpacket_hdr_variant1 hv1; 162 struct tpacket_hdr_variant1 hv1;
155 }; 163 };
164 __u8 tp_padding[8];
156}; 165};
157 166
158struct tpacket_bd_ts { 167struct tpacket_bd_ts {
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 440d5c479145..633b93cac1ed 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -85,6 +85,8 @@ struct in6_flowlabel_req {
85 85
86#define IPV6_FL_F_CREATE 1 86#define IPV6_FL_F_CREATE 1
87#define IPV6_FL_F_EXCL 2 87#define IPV6_FL_F_EXCL 2
88#define IPV6_FL_F_REFLECT 4
89#define IPV6_FL_F_REMOTE 8
88 90
89#define IPV6_FL_S_NONE 0 91#define IPV6_FL_S_NONE 0
90#define IPV6_FL_S_EXCL 1 92#define IPV6_FL_S_EXCL 1
@@ -188,6 +190,10 @@ enum {
188#define IPV6_PMTUDISC_WANT 1 190#define IPV6_PMTUDISC_WANT 1
189#define IPV6_PMTUDISC_DO 2 191#define IPV6_PMTUDISC_DO 2
190#define IPV6_PMTUDISC_PROBE 3 192#define IPV6_PMTUDISC_PROBE 3
193/* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4
194 * also see comments on IP_PMTUDISC_INTERFACE
195 */
196#define IPV6_PMTUDISC_INTERFACE 4
191 197
192/* Flowlabel */ 198/* Flowlabel */
193#define IPV6_FLOWLABEL_MGR 32 199#define IPV6_FLOWLABEL_MGR 32
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index ae5df122e42f..f53879c0f590 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -26,17 +26,17 @@ enum {
26}; 26};
27 27
28/** 28/**
29 * struct hwtstamp_config - %SIOCSHWTSTAMP parameter 29 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
30 * 30 *
31 * @flags: no flags defined right now, must be zero 31 * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP
32 * @tx_type: one of HWTSTAMP_TX_* 32 * @tx_type: one of HWTSTAMP_TX_*
33 * @rx_type: one of one of HWTSTAMP_FILTER_* 33 * @rx_filter: one of HWTSTAMP_FILTER_*
34 * 34 *
35 * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to 35 * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a
36 * this structure. dev_ifsioc() in the kernel takes care of the 36 * ifr_data pointer to this structure. For %SIOCSHWTSTAMP, if the
37 * translation between 32 bit userspace and 64 bit kernel. The 37 * driver or hardware does not support the requested @rx_filter value,
38 * structure is intentionally chosen so that it has the same layout on 38 * the driver may use a more general filter mode. In this case
39 * 32 and 64 bit systems, don't break this! 39 * @rx_filter will indicate the actual mode on return.
40 */ 40 */
41struct hwtstamp_config { 41struct hwtstamp_config {
42 int flags; 42 int flags;
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
index 64804a798b0c..669a1f0b1d97 100644
--- a/include/uapi/linux/netconf.h
+++ b/include/uapi/linux/netconf.h
@@ -14,6 +14,7 @@ enum {
14 NETCONFA_FORWARDING, 14 NETCONFA_FORWARDING,
15 NETCONFA_RP_FILTER, 15 NETCONFA_RP_FILTER,
16 NETCONFA_MC_FORWARDING, 16 NETCONFA_MC_FORWARDING,
17 NETCONFA_PROXY_NEIGH,
17 __NETCONFA_MAX 18 __NETCONFA_MAX
18}; 19};
19#define NETCONFA_MAX (__NETCONFA_MAX - 1) 20#define NETCONFA_MAX (__NETCONFA_MAX - 1)
diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
index f7dc0ebeeba5..ef1b1f88ca18 100644
--- a/include/uapi/linux/netfilter.h
+++ b/include/uapi/linux/netfilter.h
@@ -53,6 +53,7 @@ enum nf_inet_hooks {
53 53
54enum { 54enum {
55 NFPROTO_UNSPEC = 0, 55 NFPROTO_UNSPEC = 0,
56 NFPROTO_INET = 1,
56 NFPROTO_IPV4 = 2, 57 NFPROTO_IPV4 = 2,
57 NFPROTO_ARP = 3, 58 NFPROTO_ARP = 3,
58 NFPROTO_BRIDGE = 7, 59 NFPROTO_BRIDGE = 7,
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 17c3af2c4bb9..1d973d2ba417 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -39,6 +39,7 @@ header-y += xt_TEE.h
39header-y += xt_TPROXY.h 39header-y += xt_TPROXY.h
40header-y += xt_addrtype.h 40header-y += xt_addrtype.h
41header-y += xt_bpf.h 41header-y += xt_bpf.h
42header-y += xt_cgroup.h
42header-y += xt_cluster.h 43header-y += xt_cluster.h
43header-y += xt_comment.h 44header-y += xt_comment.h
44header-y += xt_connbytes.h 45header-y += xt_connbytes.h
@@ -54,8 +55,10 @@ header-y += xt_ecn.h
54header-y += xt_esp.h 55header-y += xt_esp.h
55header-y += xt_hashlimit.h 56header-y += xt_hashlimit.h
56header-y += xt_helper.h 57header-y += xt_helper.h
58header-y += xt_ipcomp.h
57header-y += xt_iprange.h 59header-y += xt_iprange.h
58header-y += xt_ipvs.h 60header-y += xt_ipvs.h
61header-y += xt_l2tp.h
59header-y += xt_length.h 62header-y += xt_length.h
60header-y += xt_limit.h 63header-y += xt_limit.h
61header-y += xt_mac.h 64header-y += xt_mac.h
diff --git a/include/uapi/linux/netfilter/nf_nat.h b/include/uapi/linux/netfilter/nf_nat.h
index bf0cc373ffb6..1ad3659102b6 100644
--- a/include/uapi/linux/netfilter/nf_nat.h
+++ b/include/uapi/linux/netfilter/nf_nat.h
@@ -4,10 +4,14 @@
4#include <linux/netfilter.h> 4#include <linux/netfilter.h>
5#include <linux/netfilter/nf_conntrack_tuple_common.h> 5#include <linux/netfilter/nf_conntrack_tuple_common.h>
6 6
7#define NF_NAT_RANGE_MAP_IPS 1 7#define NF_NAT_RANGE_MAP_IPS (1 << 0)
8#define NF_NAT_RANGE_PROTO_SPECIFIED 2 8#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1)
9#define NF_NAT_RANGE_PROTO_RANDOM 4 9#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2)
10#define NF_NAT_RANGE_PERSISTENT 8 10#define NF_NAT_RANGE_PERSISTENT (1 << 3)
11#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)
12
13#define NF_NAT_RANGE_PROTO_RANDOM_ALL \
14 (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)
11 15
12struct nf_nat_ipv4_range { 16struct nf_nat_ipv4_range {
13 unsigned int flags; 17 unsigned int flags;
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index fbfd229a8e99..83c985a6170b 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -110,11 +110,13 @@ enum nft_table_flags {
110 * 110 *
111 * @NFTA_TABLE_NAME: name of the table (NLA_STRING) 111 * @NFTA_TABLE_NAME: name of the table (NLA_STRING)
112 * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) 112 * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32)
113 * @NFTA_TABLE_USE: number of chains in this table (NLA_U32)
113 */ 114 */
114enum nft_table_attributes { 115enum nft_table_attributes {
115 NFTA_TABLE_UNSPEC, 116 NFTA_TABLE_UNSPEC,
116 NFTA_TABLE_NAME, 117 NFTA_TABLE_NAME,
117 NFTA_TABLE_FLAGS, 118 NFTA_TABLE_FLAGS,
119 NFTA_TABLE_USE,
118 __NFTA_TABLE_MAX 120 __NFTA_TABLE_MAX
119}; 121};
120#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) 122#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)
@@ -529,6 +531,8 @@ enum nft_exthdr_attributes {
529 * @NFT_META_NFTRACE: packet nftrace bit 531 * @NFT_META_NFTRACE: packet nftrace bit
530 * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid) 532 * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid)
531 * @NFT_META_SECMARK: packet secmark (skb->secmark) 533 * @NFT_META_SECMARK: packet secmark (skb->secmark)
534 * @NFT_META_NFPROTO: netfilter protocol
535 * @NFT_META_L4PROTO: layer 4 protocol number
532 */ 536 */
533enum nft_meta_keys { 537enum nft_meta_keys {
534 NFT_META_LEN, 538 NFT_META_LEN,
@@ -546,6 +550,8 @@ enum nft_meta_keys {
546 NFT_META_NFTRACE, 550 NFT_META_NFTRACE,
547 NFT_META_RTCLASSID, 551 NFT_META_RTCLASSID,
548 NFT_META_SECMARK, 552 NFT_META_SECMARK,
553 NFT_META_NFPROTO,
554 NFT_META_L4PROTO,
549}; 555};
550 556
551/** 557/**
@@ -553,11 +559,13 @@ enum nft_meta_keys {
553 * 559 *
554 * @NFTA_META_DREG: destination register (NLA_U32) 560 * @NFTA_META_DREG: destination register (NLA_U32)
555 * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys) 561 * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys)
562 * @NFTA_META_SREG: source register (NLA_U32)
556 */ 563 */
557enum nft_meta_attributes { 564enum nft_meta_attributes {
558 NFTA_META_UNSPEC, 565 NFTA_META_UNSPEC,
559 NFTA_META_DREG, 566 NFTA_META_DREG,
560 NFTA_META_KEY, 567 NFTA_META_KEY,
568 NFTA_META_SREG,
561 __NFTA_META_MAX 569 __NFTA_META_MAX
562}; 570};
563#define NFTA_META_MAX (__NFTA_META_MAX - 1) 571#define NFTA_META_MAX (__NFTA_META_MAX - 1)
@@ -601,12 +609,14 @@ enum nft_ct_keys {
601 * @NFTA_CT_DREG: destination register (NLA_U32) 609 * @NFTA_CT_DREG: destination register (NLA_U32)
602 * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys) 610 * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys)
603 * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8) 611 * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8)
612 * @NFTA_CT_SREG: source register (NLA_U32)
604 */ 613 */
605enum nft_ct_attributes { 614enum nft_ct_attributes {
606 NFTA_CT_UNSPEC, 615 NFTA_CT_UNSPEC,
607 NFTA_CT_DREG, 616 NFTA_CT_DREG,
608 NFTA_CT_KEY, 617 NFTA_CT_KEY,
609 NFTA_CT_DIRECTION, 618 NFTA_CT_DIRECTION,
619 NFTA_CT_SREG,
610 __NFTA_CT_MAX 620 __NFTA_CT_MAX
611}; 621};
612#define NFTA_CT_MAX (__NFTA_CT_MAX - 1) 622#define NFTA_CT_MAX (__NFTA_CT_MAX - 1)
@@ -658,6 +668,26 @@ enum nft_log_attributes {
658#define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) 668#define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1)
659 669
660/** 670/**
671 * enum nft_queue_attributes - nf_tables queue expression netlink attributes
672 *
673 * @NFTA_QUEUE_NUM: netlink queue to send messages to (NLA_U16)
674 * @NFTA_QUEUE_TOTAL: number of queues to load balance packets on (NLA_U16)
675 * @NFTA_QUEUE_FLAGS: various flags (NLA_U16)
676 */
677enum nft_queue_attributes {
678 NFTA_QUEUE_UNSPEC,
679 NFTA_QUEUE_NUM,
680 NFTA_QUEUE_TOTAL,
681 NFTA_QUEUE_FLAGS,
682 __NFTA_QUEUE_MAX
683};
684#define NFTA_QUEUE_MAX (__NFTA_QUEUE_MAX - 1)
685
686#define NFT_QUEUE_FLAG_BYPASS 0x01 /* for compatibility with v2 */
687#define NFT_QUEUE_FLAG_CPU_FANOUT 0x02 /* use current CPU (no hashing) */
688#define NFT_QUEUE_FLAG_MASK 0x03
689
690/**
661 * enum nft_reject_types - nf_tables reject expression reject types 691 * enum nft_reject_types - nf_tables reject expression reject types
662 * 692 *
663 * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable 693 * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable
diff --git a/include/uapi/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h
index 0132bad79de7..8dd819e2b5fe 100644
--- a/include/uapi/linux/netfilter/nfnetlink_queue.h
+++ b/include/uapi/linux/netfilter/nfnetlink_queue.h
@@ -47,6 +47,8 @@ enum nfqnl_attr_type {
47 NFQA_CAP_LEN, /* __u32 length of captured packet */ 47 NFQA_CAP_LEN, /* __u32 length of captured packet */
48 NFQA_SKB_INFO, /* __u32 skb meta information */ 48 NFQA_SKB_INFO, /* __u32 skb meta information */
49 NFQA_EXP, /* nf_conntrack_netlink.h */ 49 NFQA_EXP, /* nf_conntrack_netlink.h */
50 NFQA_UID, /* __u32 sk uid */
51 NFQA_GID, /* __u32 sk gid */
50 52
51 __NFQA_MAX 53 __NFQA_MAX
52}; 54};
@@ -99,7 +101,8 @@ enum nfqnl_attr_config {
99#define NFQA_CFG_F_FAIL_OPEN (1 << 0) 101#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
100#define NFQA_CFG_F_CONNTRACK (1 << 1) 102#define NFQA_CFG_F_CONNTRACK (1 << 1)
101#define NFQA_CFG_F_GSO (1 << 2) 103#define NFQA_CFG_F_GSO (1 << 2)
102#define NFQA_CFG_F_MAX (1 << 3) 104#define NFQA_CFG_F_UID_GID (1 << 3)
105#define NFQA_CFG_F_MAX (1 << 4)
103 106
104/* flags for NFQA_SKB_INFO */ 107/* flags for NFQA_SKB_INFO */
105/* packet appears to have wrong checksums, but they are ok */ 108/* packet appears to have wrong checksums, but they are ok */
diff --git a/include/uapi/linux/netfilter/xt_cgroup.h b/include/uapi/linux/netfilter/xt_cgroup.h
new file mode 100644
index 000000000000..43acb7e175f6
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_cgroup.h
@@ -0,0 +1,11 @@
1#ifndef _UAPI_XT_CGROUP_H
2#define _UAPI_XT_CGROUP_H
3
4#include <linux/types.h>
5
6struct xt_cgroup_info {
7 __u32 id;
8 __u32 invert;
9};
10
11#endif /* _UAPI_XT_CGROUP_H */
diff --git a/include/uapi/linux/netfilter/xt_ipcomp.h b/include/uapi/linux/netfilter/xt_ipcomp.h
new file mode 100644
index 000000000000..45c7e40eb8e1
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_ipcomp.h
@@ -0,0 +1,16 @@
1#ifndef _XT_IPCOMP_H
2#define _XT_IPCOMP_H
3
4#include <linux/types.h>
5
6struct xt_ipcomp {
7 __u32 spis[2]; /* Security Parameter Index */
8 __u8 invflags; /* Inverse flags */
9 __u8 hdrres; /* Test of the Reserved Filed */
10};
11
12/* Values for "invflags" field in struct xt_ipcomp. */
13#define XT_IPCOMP_INV_SPI 0x01 /* Invert the sense of spi. */
14#define XT_IPCOMP_INV_MASK 0x01 /* All possible flags. */
15
16#endif /*_XT_IPCOMP_H*/
diff --git a/include/uapi/linux/netfilter/xt_l2tp.h b/include/uapi/linux/netfilter/xt_l2tp.h
new file mode 100644
index 000000000000..7dccfa0acbfa
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_l2tp.h
@@ -0,0 +1,27 @@
1#ifndef _LINUX_NETFILTER_XT_L2TP_H
2#define _LINUX_NETFILTER_XT_L2TP_H
3
4#include <linux/types.h>
5
6enum xt_l2tp_type {
7 XT_L2TP_TYPE_CONTROL,
8 XT_L2TP_TYPE_DATA,
9};
10
11/* L2TP matching stuff */
12struct xt_l2tp_info {
13 __u32 tid; /* tunnel id */
14 __u32 sid; /* session id */
15 __u8 version; /* L2TP protocol version */
16 __u8 type; /* L2TP packet type */
17 __u8 flags; /* which fields to match */
18};
19
20enum {
21 XT_L2TP_TID = (1 << 0), /* match L2TP tunnel id */
22 XT_L2TP_SID = (1 << 1), /* match L2TP session id */
23 XT_L2TP_VERSION = (1 << 2), /* match L2TP protocol version */
24 XT_L2TP_TYPE = (1 << 3), /* match L2TP packet type */
25};
26
27#endif /* _LINUX_NETFILTER_XT_L2TP_H */
diff --git a/include/uapi/linux/netfilter/xt_osf.h b/include/uapi/linux/netfilter/xt_osf.h
index 18afa495f973..5d66caeba3ee 100644
--- a/include/uapi/linux/netfilter/xt_osf.h
+++ b/include/uapi/linux/netfilter/xt_osf.h
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19 18
20#ifndef _XT_OSF_H 19#ifndef _XT_OSF_H
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f752e9821e71..91054fd660e0 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -581,7 +581,14 @@
581 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and 581 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
582 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with 582 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
583 * %NL80211_TDLS_TEARDOWN). 583 * %NL80211_TDLS_TEARDOWN).
584 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. 584 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
585 * %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
586 * sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
587 * 802.11 management frames, while TDLS action codes (802.11-2012
588 * 8.5.13.1) will be encapsulated and sent as data frames. The currently
589 * supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
590 * and the currently supported TDLS actions codes are given in
591 * &enum ieee80211_tdls_actioncode.
585 * 592 *
586 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP 593 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
587 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to 594 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to
@@ -686,6 +693,21 @@
686 * other station that transmission must be blocked until the channel 693 * other station that transmission must be blocked until the channel
687 * switch is complete. 694 * switch is complete.
688 * 695 *
696 * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
697 * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
698 * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
699 * %NL80211_ATTR_VENDOR_DATA.
700 * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
701 * used in the wiphy data as a nested attribute containing descriptions
702 * (&struct nl80211_vendor_cmd_info) of the supported vendor commands.
703 * This may also be sent as an event with the same attributes.
704 *
705 * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
706 * The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
707 * that attribute is not included, QoS mapping is disabled. Since this
708 * QoS mapping is relevant for IP packets, it is only valid during an
709 * association. This is cleared on disassociation and AP restart.
710 *
689 * @NL80211_CMD_MAX: highest used command number 711 * @NL80211_CMD_MAX: highest used command number
690 * @__NL80211_CMD_AFTER_LAST: internal use 712 * @__NL80211_CMD_AFTER_LAST: internal use
691 */ 713 */
@@ -853,6 +875,10 @@ enum nl80211_commands {
853 875
854 NL80211_CMD_CHANNEL_SWITCH, 876 NL80211_CMD_CHANNEL_SWITCH,
855 877
878 NL80211_CMD_VENDOR,
879
880 NL80211_CMD_SET_QOS_MAP,
881
856 /* add new commands above here */ 882 /* add new commands above here */
857 883
858 /* used to define NL80211_CMD_MAX below */ 884 /* used to define NL80211_CMD_MAX below */
@@ -1508,6 +1534,27 @@ enum nl80211_commands {
1508 * to react to radar events, e.g. initiate a channel switch or leave the 1534 * to react to radar events, e.g. initiate a channel switch or leave the
1509 * IBSS network. 1535 * IBSS network.
1510 * 1536 *
1537 * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
1538 * 5 MHz channel bandwidth.
1539 * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
1540 * 10 MHz channel bandwidth.
1541 *
1542 * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
1543 * Notification Element based on association request when used with
1544 * %NL80211_CMD_NEW_STATION; u8 attribute.
1545 *
1546 * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
1547 * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
1548 * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
1549 * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
1550 * attribute is also used for vendor command feature advertisement
1551 * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
1552 * info, containing a nested array of possible events
1553 *
1554 * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
1555 * data is in the format defined for the payload of the QoS Map Set element
1556 * in IEEE Std 802.11-2012, 8.4.2.97.
1557 *
1511 * @NL80211_ATTR_MAX: highest attribute number currently defined 1558 * @NL80211_ATTR_MAX: highest attribute number currently defined
1512 * @__NL80211_ATTR_AFTER_LAST: internal use 1559 * @__NL80211_ATTR_AFTER_LAST: internal use
1513 */ 1560 */
@@ -1824,6 +1871,18 @@ enum nl80211_attrs {
1824 1871
1825 NL80211_ATTR_HANDLE_DFS, 1872 NL80211_ATTR_HANDLE_DFS,
1826 1873
1874 NL80211_ATTR_SUPPORT_5_MHZ,
1875 NL80211_ATTR_SUPPORT_10_MHZ,
1876
1877 NL80211_ATTR_OPMODE_NOTIF,
1878
1879 NL80211_ATTR_VENDOR_ID,
1880 NL80211_ATTR_VENDOR_SUBCMD,
1881 NL80211_ATTR_VENDOR_DATA,
1882 NL80211_ATTR_VENDOR_EVENTS,
1883
1884 NL80211_ATTR_QOS_MAP,
1885
1827 /* add attributes here, update the policy in nl80211.c */ 1886 /* add attributes here, update the policy in nl80211.c */
1828 1887
1829 __NL80211_ATTR_AFTER_LAST, 1888 __NL80211_ATTR_AFTER_LAST,
@@ -2224,10 +2283,9 @@ enum nl80211_band_attr {
2224 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 2283 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
2225 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current 2284 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
2226 * regulatory domain. 2285 * regulatory domain.
2227 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is 2286 * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
2228 * permitted on this channel in current regulatory domain. 2287 * are permitted on this channel, this includes sending probe
2229 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted 2288 * requests, or modes of operation that require beaconing.
2230 * on this channel in current regulatory domain.
2231 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory 2289 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
2232 * on this channel in current regulatory domain. 2290 * on this channel in current regulatory domain.
2233 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 2291 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
@@ -2254,8 +2312,8 @@ enum nl80211_frequency_attr {
2254 __NL80211_FREQUENCY_ATTR_INVALID, 2312 __NL80211_FREQUENCY_ATTR_INVALID,
2255 NL80211_FREQUENCY_ATTR_FREQ, 2313 NL80211_FREQUENCY_ATTR_FREQ,
2256 NL80211_FREQUENCY_ATTR_DISABLED, 2314 NL80211_FREQUENCY_ATTR_DISABLED,
2257 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, 2315 NL80211_FREQUENCY_ATTR_NO_IR,
2258 NL80211_FREQUENCY_ATTR_NO_IBSS, 2316 __NL80211_FREQUENCY_ATTR_NO_IBSS,
2259 NL80211_FREQUENCY_ATTR_RADAR, 2317 NL80211_FREQUENCY_ATTR_RADAR,
2260 NL80211_FREQUENCY_ATTR_MAX_TX_POWER, 2318 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
2261 NL80211_FREQUENCY_ATTR_DFS_STATE, 2319 NL80211_FREQUENCY_ATTR_DFS_STATE,
@@ -2271,6 +2329,9 @@ enum nl80211_frequency_attr {
2271}; 2329};
2272 2330
2273#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER 2331#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
2332#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
2333#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
2334#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
2274 2335
2275/** 2336/**
2276 * enum nl80211_bitrate_attr - bitrate attributes 2337 * enum nl80211_bitrate_attr - bitrate attributes
@@ -2413,8 +2474,9 @@ enum nl80211_sched_scan_match_attr {
2413 * @NL80211_RRF_DFS: DFS support is required to be used 2474 * @NL80211_RRF_DFS: DFS support is required to be used
2414 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links 2475 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
2415 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links 2476 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
2416 * @NL80211_RRF_PASSIVE_SCAN: passive scan is required 2477 * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
2417 * @NL80211_RRF_NO_IBSS: no IBSS is allowed 2478 * this includes probe requests or modes of operation that require
2479 * beaconing.
2418 */ 2480 */
2419enum nl80211_reg_rule_flags { 2481enum nl80211_reg_rule_flags {
2420 NL80211_RRF_NO_OFDM = 1<<0, 2482 NL80211_RRF_NO_OFDM = 1<<0,
@@ -2424,10 +2486,17 @@ enum nl80211_reg_rule_flags {
2424 NL80211_RRF_DFS = 1<<4, 2486 NL80211_RRF_DFS = 1<<4,
2425 NL80211_RRF_PTP_ONLY = 1<<5, 2487 NL80211_RRF_PTP_ONLY = 1<<5,
2426 NL80211_RRF_PTMP_ONLY = 1<<6, 2488 NL80211_RRF_PTMP_ONLY = 1<<6,
2427 NL80211_RRF_PASSIVE_SCAN = 1<<7, 2489 NL80211_RRF_NO_IR = 1<<7,
2428 NL80211_RRF_NO_IBSS = 1<<8, 2490 __NL80211_RRF_NO_IBSS = 1<<8,
2429}; 2491};
2430 2492
2493#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
2494#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
2495#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
2496
2497/* For backport compatibility with older userspace */
2498#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
2499
2431/** 2500/**
2432 * enum nl80211_dfs_regions - regulatory DFS regions 2501 * enum nl80211_dfs_regions - regulatory DFS regions
2433 * 2502 *
@@ -3058,21 +3127,35 @@ enum nl80211_key_attributes {
3058 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with 3127 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
3059 * 1 = 500 kbps) but without the IE length restriction (at most 3128 * 1 = 500 kbps) but without the IE length restriction (at most
3060 * %NL80211_MAX_SUPP_RATES in a single array). 3129 * %NL80211_MAX_SUPP_RATES in a single array).
3061 * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection 3130 * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
3062 * in an array of MCS numbers. 3131 * in an array of MCS numbers.
3132 * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
3133 * see &struct nl80211_txrate_vht
3063 * @__NL80211_TXRATE_AFTER_LAST: internal 3134 * @__NL80211_TXRATE_AFTER_LAST: internal
3064 * @NL80211_TXRATE_MAX: highest TX rate attribute 3135 * @NL80211_TXRATE_MAX: highest TX rate attribute
3065 */ 3136 */
3066enum nl80211_tx_rate_attributes { 3137enum nl80211_tx_rate_attributes {
3067 __NL80211_TXRATE_INVALID, 3138 __NL80211_TXRATE_INVALID,
3068 NL80211_TXRATE_LEGACY, 3139 NL80211_TXRATE_LEGACY,
3069 NL80211_TXRATE_MCS, 3140 NL80211_TXRATE_HT,
3141 NL80211_TXRATE_VHT,
3070 3142
3071 /* keep last */ 3143 /* keep last */
3072 __NL80211_TXRATE_AFTER_LAST, 3144 __NL80211_TXRATE_AFTER_LAST,
3073 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 3145 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
3074}; 3146};
3075 3147
3148#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
3149#define NL80211_VHT_NSS_MAX 8
3150
3151/**
3152 * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
3153 * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
3154 */
3155struct nl80211_txrate_vht {
3156 __u16 mcs[NL80211_VHT_NSS_MAX];
3157};
3158
3076/** 3159/**
3077 * enum nl80211_band - Frequency band 3160 * enum nl80211_band - Frequency band
3078 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band 3161 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
@@ -3934,4 +4017,24 @@ enum nl80211_rxmgmt_flags {
3934 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, 4017 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
3935}; 4018};
3936 4019
4020/*
4021 * If this flag is unset, the lower 24 bits are an OUI, if set
4022 * a Linux nl80211 vendor ID is used (no such IDs are allocated
4023 * yet, so that's not valid so far)
4024 */
4025#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
4026
4027/**
4028 * struct nl80211_vendor_cmd_info - vendor command data
4029 * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
4030 * value is a 24-bit OUI; if it is set then a separately allocated ID
4031 * may be used, but no such IDs are allocated yet. New IDs should be
4032 * added to this file when needed.
4033 * @subcmd: sub-command ID for the command
4034 */
4035struct nl80211_vendor_cmd_info {
4036 __u32 vendor_id;
4037 __u32 subcmd;
4038};
4039
3937#endif /* __LINUX_NL80211_H */ 4040#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index d120f9fe0017..970553cbbc8e 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -40,7 +40,15 @@ struct ovs_header {
40 40
41#define OVS_DATAPATH_FAMILY "ovs_datapath" 41#define OVS_DATAPATH_FAMILY "ovs_datapath"
42#define OVS_DATAPATH_MCGROUP "ovs_datapath" 42#define OVS_DATAPATH_MCGROUP "ovs_datapath"
43#define OVS_DATAPATH_VERSION 0x1 43
44/* V2:
45 * - API users are expected to provide OVS_DP_ATTR_USER_FEATURES
46 * when creating the datapath.
47 */
48#define OVS_DATAPATH_VERSION 2
49
50/* First OVS datapath version to support features */
51#define OVS_DP_VER_FEATURES 2
44 52
45enum ovs_datapath_cmd { 53enum ovs_datapath_cmd {
46 OVS_DP_CMD_UNSPEC, 54 OVS_DP_CMD_UNSPEC,
@@ -75,6 +83,7 @@ enum ovs_datapath_attr {
75 OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ 83 OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */
76 OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ 84 OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */
77 OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ 85 OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */
86 OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */
78 __OVS_DP_ATTR_MAX 87 __OVS_DP_ATTR_MAX
79}; 88};
80 89
@@ -106,6 +115,9 @@ struct ovs_vport_stats {
106 __u64 tx_dropped; /* no space available in linux */ 115 __u64 tx_dropped; /* no space available in linux */
107}; 116};
108 117
118/* Allow last Netlink attribute to be unaligned */
119#define OVS_DP_F_UNALIGNED (1 << 0)
120
109/* Fixed logical ports. */ 121/* Fixed logical ports. */
110#define OVSP_LOCAL ((__u32)0) 122#define OVSP_LOCAL ((__u32)0)
111 123
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index ab6b4e7f6657..30db069bce62 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -489,7 +489,12 @@
489#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ 489#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
490#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ 490#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */
491#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ 491#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
492#define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */
492#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ 493#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */
494#define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */
495#define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */
496#define PCI_EXP_LNKSTA_NLW_X4 0x0040 /* Current Link Width x4 */
497#define PCI_EXP_LNKSTA_NLW_X8 0x0080 /* Current Link Width x8 */
493#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ 498#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */
494#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ 499#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
495#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ 500#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index a806687ad98f..d62316baae94 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -173,6 +173,8 @@ enum {
173 TCA_TBF_PTAB, 173 TCA_TBF_PTAB,
174 TCA_TBF_RATE64, 174 TCA_TBF_RATE64,
175 TCA_TBF_PRATE64, 175 TCA_TBF_PRATE64,
176 TCA_TBF_BURST,
177 TCA_TBF_PBURST,
176 __TCA_TBF_MAX, 178 __TCA_TBF_MAX,
177}; 179};
178 180
@@ -523,6 +525,7 @@ enum {
523 TCA_NETEM_LOSS, 525 TCA_NETEM_LOSS,
524 TCA_NETEM_RATE, 526 TCA_NETEM_RATE,
525 TCA_NETEM_ECN, 527 TCA_NETEM_ECN,
528 TCA_NETEM_RATE64,
526 __TCA_NETEM_MAX, 529 __TCA_NETEM_MAX,
527}; 530};
528 531
@@ -790,4 +793,54 @@ struct tc_fq_qd_stats {
790 __u32 throttled_flows; 793 __u32 throttled_flows;
791 __u32 pad; 794 __u32 pad;
792}; 795};
796
797/* Heavy-Hitter Filter */
798
799enum {
800 TCA_HHF_UNSPEC,
801 TCA_HHF_BACKLOG_LIMIT,
802 TCA_HHF_QUANTUM,
803 TCA_HHF_HH_FLOWS_LIMIT,
804 TCA_HHF_RESET_TIMEOUT,
805 TCA_HHF_ADMIT_BYTES,
806 TCA_HHF_EVICT_TIMEOUT,
807 TCA_HHF_NON_HH_WEIGHT,
808 __TCA_HHF_MAX
809};
810
811#define TCA_HHF_MAX (__TCA_HHF_MAX - 1)
812
813struct tc_hhf_xstats {
814 __u32 drop_overlimit; /* number of times max qdisc packet limit
815 * was hit
816 */
817 __u32 hh_overlimit; /* number of times max heavy-hitters was hit */
818 __u32 hh_tot_count; /* number of captured heavy-hitters so far */
819 __u32 hh_cur_count; /* number of current heavy-hitters */
820};
821
822/* PIE */
823enum {
824 TCA_PIE_UNSPEC,
825 TCA_PIE_TARGET,
826 TCA_PIE_LIMIT,
827 TCA_PIE_TUPDATE,
828 TCA_PIE_ALPHA,
829 TCA_PIE_BETA,
830 TCA_PIE_ECN,
831 TCA_PIE_BYTEMODE,
832 __TCA_PIE_MAX
833};
834#define TCA_PIE_MAX (__TCA_PIE_MAX - 1)
835
836struct tc_pie_xstats {
837 __u32 prob; /* current probability */
838 __u32 delay; /* current delay in ms */
839 __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */
840 __u32 packets_in; /* total number of packets enqueued */
841 __u32 dropped; /* packets dropped due to pie_action */
842 __u32 overlimit; /* dropped due to lack of space in queue */
843 __u32 maxq; /* maximum queue size */
844 __u32 ecn_mark; /* packets marked with ecn*/
845};
793#endif 846#endif
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index ca451e99b28b..266022a2be4a 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -22,9 +22,8 @@
22 * See the GNU General Public License for more details. 22 * See the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to 25 * along with GNU CC; see the file COPYING. If not, see
26 * the Free Software Foundation, 59 Temple Place - Suite 330, 26 * <http://www.gnu.org/licenses/>.
27 * Boston, MA 02111-1307, USA.
28 * 27 *
29 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
30 * email address(es): 29 * email address(es):
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index 1bdb4a39d1e1..bbaba22f2d1b 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -258,6 +258,7 @@ enum
258 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ 258 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
259 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ 259 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
260 LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */ 260 LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */
261 LINUX_MIB_TCPAUTOCORKING, /* TCPAutoCorking */
261 __LINUX_MIB_MAX 262 __LINUX_MIB_MAX
262}; 263};
263 264
diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h
index 7997a506ad41..e888b1aed69f 100644
--- a/include/uapi/linux/sockios.h
+++ b/include/uapi/linux/sockios.h
@@ -125,7 +125,8 @@
125#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ 125#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
126 126
127/* hardware time stamping: parameters in linux/net_tstamp.h */ 127/* hardware time stamping: parameters in linux/net_tstamp.h */
128#define SIOCSHWTSTAMP 0x89b0 128#define SIOCSHWTSTAMP 0x89b0 /* set and get config */
129#define SIOCGHWTSTAMP 0x89b1 /* get config */
129 130
130/* Device private ioctl calls */ 131/* Device private ioctl calls */
131 132
diff --git a/include/uapi/linux/tc_act/tc_ipt.h b/include/uapi/linux/tc_act/tc_ipt.h
index a2335563d21f..130aaadf6fac 100644
--- a/include/uapi/linux/tc_act/tc_ipt.h
+++ b/include/uapi/linux/tc_act/tc_ipt.h
@@ -4,6 +4,7 @@
4#include <linux/pkt_cls.h> 4#include <linux/pkt_cls.h>
5 5
6#define TCA_ACT_IPT 6 6#define TCA_ACT_IPT 6
7#define TCA_ACT_XT 10
7 8
8enum { 9enum {
9 TCA_IPT_UNSPEC, 10 TCA_IPT_UNSPEC,
diff --git a/include/uapi/linux/tcp_metrics.h b/include/uapi/linux/tcp_metrics.h
index cb5157b55f32..54a37b13f2c4 100644
--- a/include/uapi/linux/tcp_metrics.h
+++ b/include/uapi/linux/tcp_metrics.h
@@ -35,6 +35,8 @@ enum {
35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */ 35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */
36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */ 36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */
37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */ 37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */
38 TCP_METRICS_ATTR_SADDR_IPV4, /* u32 */
39 TCP_METRICS_ATTR_SADDR_IPV6, /* binary */
38 40
39 __TCP_METRICS_ATTR_MAX, 41 __TCP_METRICS_ATTR_MAX,
40}; 42};