History

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

Pull networking updates from David Miller: "Highlights: 1) Support more Realtek wireless chips, from Jes Sorenson. 2) New BPF types for per-cpu hash and arrap maps, from Alexei Starovoitov. 3) Make several TCP sysctls per-namespace, from Nikolay Borisov. 4) Allow the use of SO_REUSEPORT in order to do per-thread processing of incoming TCP/UDP connections. The muxing can be done using a BPF program which hashes the incoming packet. From Craig Gallek. 5) Add a multiplexer for TCP streams, to provide a messaged based interface. BPF programs can be used to determine the message boundaries. From Tom Herbert. 6) Add 802.1AE MACSEC support, from Sabrina Dubroca. 7) Avoid factorial complexity when taking down an inetdev interface with lots of configured addresses. We were doing things like traversing the entire address less for each address removed, and flushing the entire netfilter conntrack table for every address as well. 8) Add and use SKB bulk free infrastructure, from Jesper Brouer. 9) Allow offloading u32 classifiers to hardware, and implement for ixgbe, from John Fastabend. 10) Allow configuring IRQ coalescing parameters on a per-queue basis, from Kan Liang. 11) Extend ethtool so that larger link mode masks can be supported. From David Decotigny. 12) Introduce devlink, which can be used to configure port link types (ethernet vs Infiniband, etc.), port splitting, and switch device level attributes as a whole. From Jiri Pirko. 13) Hardware offload support for flower classifiers, from Amir Vadai. 14) Add "Local Checksum Offload". Basically, for a tunneled packet the checksum of the outer header is 'constant' (because with the checksum field filled into the inner protocol header, the payload of the outer frame checksums to 'zero'), and we can take advantage of that in various ways. From Edward Cree" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1548 commits) bonding: fix bond_get_stats() net: bcmgenet: fix dma api length mismatch net/mlx4_core: Fix backward compatibility on VFs phy: mdio-thunder: Fix some Kconfig typos lan78xx: add ndo_get_stats64 lan78xx: handle statistics counter rollover RDS: TCP: Remove unused constant RDS: TCP: Add sysctl tunables for sndbuf/rcvbuf on rds-tcp socket net: smc911x: convert pxa dma to dmaengine team: remove duplicate set of flag IFF_MULTICAST bonding: remove duplicate set of flag IFF_MULTICAST net: fix a comment typo ethernet: micrel: fix some error codes ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it bpf, dst: add and use dst_tclassid helper bpf: make skb->tc_classid also readable net: mvneta: bm: clarify dependencies cls_bpf: reset class and reuse major in da ldmvsw: Checkpatch sunvnet.c and sunvnet_common.c ldmvsw: Add ldmvsw.c driver code ...

Linus Torvalds committed 10 years ago

Commit 1200b682 parents 6b5f04b fe309371281 files · +79030 −34010Browse files

Showing the changes to include/uapi (27 of 1281 files). Show all

Unified · Split

27 files
  1. include/uapi/asm-generic/socket.h +2 −0
  2. include/uapi/linux/Kbuild +1 −0
  3. include/uapi/linux/bpf.h +52 −0
  4. include/uapi/linux/devlink.h +72 −0
  5. include/uapi/linux/ethtool.h +362 −75
  6. include/uapi/linux/genetlink.h +1 −0
  7. include/uapi/linux/if.h +1 −1
  8. include/uapi/linux/if_bridge.h +35 −2
  9. include/uapi/linux/if_ether.h +1 −0
  10. include/uapi/linux/if_link.h +43 −0
  11. include/uapi/linux/if_macsec.h +161 −0
  12. include/uapi/linux/ip.h +2 −0
  13. include/uapi/linux/ipv6.h +3 −0
  14. include/uapi/linux/kcm.h +40 −0
  15. include/uapi/linux/kernel.h +1 −0
  16. include/uapi/linux/mroute6.h +2 −7
  17. include/uapi/linux/netconf.h +1 −0
  18. include/uapi/linux/netfilter/nf_conntrack_common.h +9 −3
  19. include/uapi/linux/netfilter/nf_tables.h +6 −0
  20. include/uapi/linux/netlink.h +4 −0
  21. include/uapi/linux/netlink_diag.h +2 −0
  22. include/uapi/linux/nl80211.h +14 −0
  23. include/uapi/linux/openvswitch.h +49 −0
  24. include/uapi/linux/pkt_cls.h +3 −0
  25. include/uapi/linux/rfkill.h +2 −0
  26. include/uapi/linux/tc_act/tc_ife.h +38 −0
  27. include/uapi/linux/tcp.h +5 −0
include/uapi/asm-generic/socket.h+2−0
@@ -90,4 +90,6 @@ · 89 unmodified lines
9090 #define SO_ATTACH_REUSEPORT_CBPF 51
9191 #define SO_ATTACH_REUSEPORT_EBPF 52
9292
93+#define SO_CNX_ADVICE 53
94+
9395 #endif /* __ASM_GENERIC_SOCKET_H */
include/uapi/linux/Kbuild+1−0
@@ -174,6 +174,7 @@ header-y += if_hippi.h · 173 unmodified lines
174174 header-y += if_infiniband.h
175175 header-y += if_link.h
176176 header-y += if_ltalk.h
177+header-y += if_macsec.h
177178 header-y += if_packet.h
178179 header-y += if_phonet.h
179180 header-y += if_plip.h
include/uapi/linux/bpf.h+52−0
@@ -81,6 +81,9 @@ enum bpf_map_type { · 80 unmodified lines
8181 BPF_MAP_TYPE_ARRAY,
8282 BPF_MAP_TYPE_PROG_ARRAY,
8383 BPF_MAP_TYPE_PERF_EVENT_ARRAY,
84+ BPF_MAP_TYPE_PERCPU_HASH,
85+ BPF_MAP_TYPE_PERCPU_ARRAY,
86+ BPF_MAP_TYPE_STACK_TRACE,
8487 };
8588
8689 enum bpf_prog_type {
@@ -98,12 +101,15 @@ enum bpf_prog_type { · 11 unmodified lines
98101 #define BPF_NOEXIST 1 /* create new element if it didn't exist */
99102 #define BPF_EXIST 2 /* update existing element */
100103
104+#define BPF_F_NO_PREALLOC (1U << 0)
105+
101106 union bpf_attr {
102107 struct { /* anonymous struct used by BPF_MAP_CREATE command */
103108 __u32 map_type; /* one of enum bpf_map_type */
104109 __u32 key_size; /* size of key in bytes */
105110 __u32 value_size; /* size of value in bytes */
106111 __u32 max_entries; /* max number of entries in a map */
112+ __u32 map_flags; /* prealloc or not */
107113 };
108114
109115 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
@@ -270,6 +276,42 @@ enum bpf_func_id { · 160 unmodified lines
270276 */
271277 BPF_FUNC_perf_event_output,
272278 BPF_FUNC_skb_load_bytes,
279+
280+ /**
281+ * bpf_get_stackid(ctx, map, flags) - walk user or kernel stack and return id
282+ * @ctx: struct pt_regs*
283+ * @map: pointer to stack_trace map
284+ * @flags: bits 0-7 - numer of stack frames to skip
285+ * bit 8 - collect user stack instead of kernel
286+ * bit 9 - compare stacks by hash only
287+ * bit 10 - if two different stacks hash into the same stackid
288+ * discard old
289+ * other bits - reserved
290+ * Return: >= 0 stackid on success or negative error
291+ */
292+ BPF_FUNC_get_stackid,
293+
294+ /**
295+ * bpf_csum_diff(from, from_size, to, to_size, seed) - calculate csum diff
296+ * @from: raw from buffer
297+ * @from_size: length of from buffer
298+ * @to: raw to buffer
299+ * @to_size: length of to buffer
300+ * @seed: optional seed
301+ * Return: csum result
302+ */
303+ BPF_FUNC_csum_diff,
304+
305+ /**
306+ * bpf_skb_[gs]et_tunnel_opt(skb, opt, size)
307+ * retrieve or populate tunnel options metadata
308+ * @skb: pointer to skb
309+ * @opt: pointer to raw tunnel option data
310+ * @size: size of @opt
311+ * Return: 0 on success for set, option size for get
312+ */
313+ BPF_FUNC_skb_get_tunnel_opt,
314+ BPF_FUNC_skb_set_tunnel_opt,
273315 __BPF_FUNC_MAX_ID,
274316 };
275317
@@ -277,6 +319,7 @@ enum bpf_func_id { · 1 unmodified line
277319
278320 /* BPF_FUNC_skb_store_bytes flags. */
279321 #define BPF_F_RECOMPUTE_CSUM (1ULL << 0)
322+#define BPF_F_INVALIDATE_HASH (1ULL << 1)
280323
281324 /* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags.
282325 * First 4 bits are for passing the header field size.
@@ -285,6 +328,7 @@ enum bpf_func_id { · 2 unmodified lines
285328
286329 /* BPF_FUNC_l4_csum_replace flags. */
287330 #define BPF_F_PSEUDO_HDR (1ULL << 4)
331+#define BPF_F_MARK_MANGLED_0 (1ULL << 5)
288332
289333 /* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
290334 #define BPF_F_INGRESS (1ULL << 0)
@@ -292,8 +336,15 @@ enum bpf_func_id { · 1 unmodified line
292336 /* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
293337 #define BPF_F_TUNINFO_IPV6 (1ULL << 0)
294338
339+/* BPF_FUNC_get_stackid flags. */
340+#define BPF_F_SKIP_FIELD_MASK 0xffULL
341+#define BPF_F_USER_STACK (1ULL << 8)
342+#define BPF_F_FAST_STACK_CMP (1ULL << 9)
343+#define BPF_F_REUSE_STACKID (1ULL << 10)
344+
295345 /* BPF_FUNC_skb_set_tunnel_key flags. */
296346 #define BPF_F_ZERO_CSUM_TX (1ULL << 1)
347+#define BPF_F_DONT_FRAGMENT (1ULL << 2)
297348
298349 /* user accessible mirror of in-kernel sk_buff.
299350 * new fields can only be added to the end of this structure
@@ -324,6 +375,7 @@ struct bpf_tunnel_key { · 24 unmodified lines
324375 };
325376 __u8 tunnel_tos;
326377 __u8 tunnel_ttl;
378+ __u32 tunnel_label;
327379 };
328380
329381 #endif /* _UAPI__LINUX_BPF_H__ */
include/uapi/linux/devlink.h+72−0
@@ -0,0 +1,72 @@
1+/*
2+ * include/uapi/linux/devlink.h - Network physical device Netlink interface
3+ * Copyright (c) 2016 Mellanox Technologies. All rights reserved.
4+ * Copyright (c) 2016 Jiri Pirko <jiri@mellanox.com>
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ */
11+
12+#ifndef _UAPI_LINUX_DEVLINK_H_
13+#define _UAPI_LINUX_DEVLINK_H_
14+
15+#define DEVLINK_GENL_NAME "devlink"
16+#define DEVLINK_GENL_VERSION 0x1
17+#define DEVLINK_GENL_MCGRP_CONFIG_NAME "config"
18+
19+enum devlink_command {
20+ /* don't change the order or add anything between, this is ABI! */
21+ DEVLINK_CMD_UNSPEC,
22+
23+ DEVLINK_CMD_GET, /* can dump */
24+ DEVLINK_CMD_SET,
25+ DEVLINK_CMD_NEW,
26+ DEVLINK_CMD_DEL,
27+
28+ DEVLINK_CMD_PORT_GET, /* can dump */
29+ DEVLINK_CMD_PORT_SET,
30+ DEVLINK_CMD_PORT_NEW,
31+ DEVLINK_CMD_PORT_DEL,
32+
33+ DEVLINK_CMD_PORT_SPLIT,
34+ DEVLINK_CMD_PORT_UNSPLIT,
35+
36+ /* add new commands above here */
37+
38+ __DEVLINK_CMD_MAX,
39+ DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
40+};
41+
42+enum devlink_port_type {
43+ DEVLINK_PORT_TYPE_NOTSET,
44+ DEVLINK_PORT_TYPE_AUTO,
45+ DEVLINK_PORT_TYPE_ETH,
46+ DEVLINK_PORT_TYPE_IB,
47+};
48+
49+enum devlink_attr {
50+ /* don't change the order or add anything between, this is ABI! */
51+ DEVLINK_ATTR_UNSPEC,
52+
53+ /* bus name + dev name together are a handle for devlink entity */
54+ DEVLINK_ATTR_BUS_NAME, /* string */
55+ DEVLINK_ATTR_DEV_NAME, /* string */
56+
57+ DEVLINK_ATTR_PORT_INDEX, /* u32 */
58+ DEVLINK_ATTR_PORT_TYPE, /* u16 */
59+ DEVLINK_ATTR_PORT_DESIRED_TYPE, /* u16 */
60+ DEVLINK_ATTR_PORT_NETDEV_IFINDEX, /* u32 */
61+ DEVLINK_ATTR_PORT_NETDEV_NAME, /* string */
62+ DEVLINK_ATTR_PORT_IBDEV_NAME, /* string */
63+ DEVLINK_ATTR_PORT_SPLIT_COUNT, /* u32 */
64+ DEVLINK_ATTR_PORT_SPLIT_GROUP, /* u32 */
65+
66+ /* add new attributes above here, update the policy in devlink.c */
67+
68+ __DEVLINK_ATTR_MAX,
69+ DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1
70+};
71+
72+#endif /* _UAPI_LINUX_DEVLINK_H_ */
include/uapi/linux/ethtool.h+362−75
@@ -13,15 +13,21 @@ · 12 unmodified lines
1313 #ifndef _UAPI_LINUX_ETHTOOL_H
1414 #define _UAPI_LINUX_ETHTOOL_H
1515
16+#include <linux/kernel.h>
1617 #include <linux/types.h>
1718 #include <linux/if_ether.h>
1819
20+#ifndef __KERNEL__
21+#include <limits.h> /* for INT_MAX */
22+#endif
23+
1924 /* All structures exposed to userland should be defined such that they
2025 * have the same layout for 32-bit and 64-bit userland.
2126 */
2227
2328 /**
24− * struct ethtool_cmd - link control and status
29+ * struct ethtool_cmd - DEPRECATED, link control and status
30+ * This structure is DEPRECATED, please use struct ethtool_link_settings.
2531 * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET
2632 * @supported: Bitmask of %SUPPORTED_* flags for the link modes,
2733 * physical connectors and other link features for which the
@@ -31,7 +37,7 @@ · 3 unmodified lines
3137 * physical connectors and other link features that are
3238 * advertised through autonegotiation or enabled for
3339 * auto-detection.
34− * @speed: Low bits of the speed
40+ * @speed: Low bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
3541 * @duplex: Duplex mode; one of %DUPLEX_*
3642 * @port: Physical connector type; one of %PORT_*
3743 * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
@@ -47,7 +53,7 @@ · 9 unmodified lines
4753 * obsoleted by &struct ethtool_coalesce. Read-only; deprecated.
4854 * @maxrxpkt: Historically used to report RX IRQ coalescing; now
4955 * obsoleted by &struct ethtool_coalesce. Read-only; deprecated.
50− * @speed_hi: High bits of the speed
56+ * @speed_hi: High bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
5157 * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
5258 * %ETH_TP_MDI_*. If the status is unknown or not applicable, the
5359 * value will be %ETH_TP_MDI_INVALID. Read-only.
@@ -748,6 +754,56 @@ struct ethtool_usrip4_spec { · 694 unmodified lines
748754 __u8 proto;
749755 };
750756
757+/**
758+ * struct ethtool_tcpip6_spec - flow specification for TCP/IPv6 etc.
759+ * @ip6src: Source host
760+ * @ip6dst: Destination host
761+ * @psrc: Source port
762+ * @pdst: Destination port
763+ * @tclass: Traffic Class
764+ *
765+ * This can be used to specify a TCP/IPv6, UDP/IPv6 or SCTP/IPv6 flow.
766+ */
767+struct ethtool_tcpip6_spec {
768+ __be32 ip6src[4];
769+ __be32 ip6dst[4];
770+ __be16 psrc;
771+ __be16 pdst;
772+ __u8 tclass;
773+};
774+
775+/**
776+ * struct ethtool_ah_espip6_spec - flow specification for IPsec/IPv6
777+ * @ip6src: Source host
778+ * @ip6dst: Destination host
779+ * @spi: Security parameters index
780+ * @tclass: Traffic Class
781+ *
782+ * This can be used to specify an IPsec transport or tunnel over IPv6.
783+ */
784+struct ethtool_ah_espip6_spec {
785+ __be32 ip6src[4];
786+ __be32 ip6dst[4];
787+ __be32 spi;
788+ __u8 tclass;
789+};
790+
791+/**
792+ * struct ethtool_usrip6_spec - general flow specification for IPv6
793+ * @ip6src: Source host
794+ * @ip6dst: Destination host
795+ * @l4_4_bytes: First 4 bytes of transport (layer 4) header
796+ * @tclass: Traffic Class
797+ * @l4_proto: Transport protocol number (nexthdr after any Extension Headers)
798+ */
799+struct ethtool_usrip6_spec {
800+ __be32 ip6src[4];
801+ __be32 ip6dst[4];
802+ __be32 l4_4_bytes;
803+ __u8 tclass;
804+ __u8 l4_proto;
805+};
806+
751807 union ethtool_flow_union {
752808 struct ethtool_tcpip4_spec tcp_ip4_spec;
753809 struct ethtool_tcpip4_spec udp_ip4_spec;
@@ -755,6 +811,12 @@ union ethtool_flow_union { · 1 unmodified line
755811 struct ethtool_ah_espip4_spec ah_ip4_spec;
756812 struct ethtool_ah_espip4_spec esp_ip4_spec;
757813 struct ethtool_usrip4_spec usr_ip4_spec;
814+ struct ethtool_tcpip6_spec tcp_ip6_spec;
815+ struct ethtool_tcpip6_spec udp_ip6_spec;
816+ struct ethtool_tcpip6_spec sctp_ip6_spec;
817+ struct ethtool_ah_espip6_spec ah_ip6_spec;
818+ struct ethtool_ah_espip6_spec esp_ip6_spec;
819+ struct ethtool_usrip6_spec usr_ip6_spec;
758820 struct ethhdr ether_spec;
759821 __u8 hdata[52];
760822 };
@@ -1146,10 +1208,29 @@ enum ethtool_sfeatures_retval_bits { · 385 unmodified lines
11461208 #define ETHTOOL_F_WISH (1 << ETHTOOL_F_WISH__BIT)
11471209 #define ETHTOOL_F_COMPAT (1 << ETHTOOL_F_COMPAT__BIT)
11481210
1211+#define MAX_NUM_QUEUE 4096
1212+
1213+/**
1214+ * struct ethtool_per_queue_op - apply sub command to the queues in mask.
1215+ * @cmd: ETHTOOL_PERQUEUE
1216+ * @sub_command: the sub command which apply to each queues
1217+ * @queue_mask: Bitmap of the queues which sub command apply to
1218+ * @data: A complete command structure following for each of the queues addressed
1219+ */
1220+struct ethtool_per_queue_op {
1221+ __u32 cmd;
1222+ __u32 sub_command;
1223+ __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)];
1224+ char data[];
1225+};
11491226
11501227 /* CMDs currently supported */
1151−#define ETHTOOL_GSET 0x00000001 /* Get settings. */
1152−#define ETHTOOL_SSET 0x00000002 /* Set settings. */
1228+#define ETHTOOL_GSET 0x00000001 /* DEPRECATED, Get settings.
1229+ * Please use ETHTOOL_GLINKSETTINGS
1230+ */
1231+#define ETHTOOL_SSET 0x00000002 /* DEPRECATED, Set settings.
1232+ * Please use ETHTOOL_SLINKSETTINGS
1233+ */
11531234 #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */
11541235 #define ETHTOOL_GREGS 0x00000004 /* Get NIC registers. */
11551236 #define ETHTOOL_GWOL 0x00000005 /* Get wake-on-lan options. */
@@ -1229,73 +1310,141 @@ enum ethtool_sfeatures_retval_bits { · 73 unmodified lines
12291310 #define ETHTOOL_STUNABLE 0x00000049 /* Set tunable configuration */
12301311 #define ETHTOOL_GPHYSTATS 0x0000004a /* get PHY-specific statistics */
12311312
1313+#define ETHTOOL_PERQUEUE 0x0000004b /* Set per queue options */
1314+
1315+#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */
1316+#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */
1317+
1318+
12321319 /* compatibility with older code */
12331320 #define SPARC_ETH_GSET ETHTOOL_GSET
12341321 #define SPARC_ETH_SSET ETHTOOL_SSET
12351322
1236−#define SUPPORTED_10baseT_Half (1 << 0)
1237−#define SUPPORTED_10baseT_Full (1 << 1)
1238−#define SUPPORTED_100baseT_Half (1 << 2)
1239−#define SUPPORTED_100baseT_Full (1 << 3)
1240−#define SUPPORTED_1000baseT_Half (1 << 4)
1241−#define SUPPORTED_1000baseT_Full (1 << 5)
1242−#define SUPPORTED_Autoneg (1 << 6)
1243−#define SUPPORTED_TP (1 << 7)
1244−#define SUPPORTED_AUI (1 << 8)
1245−#define SUPPORTED_MII (1 << 9)
1246−#define SUPPORTED_FIBRE (1 << 10)
1247−#define SUPPORTED_BNC (1 << 11)
1248−#define SUPPORTED_10000baseT_Full (1 << 12)
1249−#define SUPPORTED_Pause (1 << 13)
1250−#define SUPPORTED_Asym_Pause (1 << 14)
1251−#define SUPPORTED_2500baseX_Full (1 << 15)
1252−#define SUPPORTED_Backplane (1 << 16)
1253−#define SUPPORTED_1000baseKX_Full (1 << 17)
1254−#define SUPPORTED_10000baseKX4_Full (1 << 18)
1255−#define SUPPORTED_10000baseKR_Full (1 << 19)
1256−#define SUPPORTED_10000baseR_FEC (1 << 20)
1257−#define SUPPORTED_20000baseMLD2_Full (1 << 21)
1258−#define SUPPORTED_20000baseKR2_Full (1 << 22)
1259−#define SUPPORTED_40000baseKR4_Full (1 << 23)
1260−#define SUPPORTED_40000baseCR4_Full (1 << 24)
1261−#define SUPPORTED_40000baseSR4_Full (1 << 25)
1262−#define SUPPORTED_40000baseLR4_Full (1 << 26)
1263−#define SUPPORTED_56000baseKR4_Full (1 << 27)
1264−#define SUPPORTED_56000baseCR4_Full (1 << 28)
1265−#define SUPPORTED_56000baseSR4_Full (1 << 29)
1266−#define SUPPORTED_56000baseLR4_Full (1 << 30)
1267−
1268−#define ADVERTISED_10baseT_Half (1 << 0)
1269−#define ADVERTISED_10baseT_Full (1 << 1)
1270−#define ADVERTISED_100baseT_Half (1 << 2)
1271−#define ADVERTISED_100baseT_Full (1 << 3)
1272−#define ADVERTISED_1000baseT_Half (1 << 4)
1273−#define ADVERTISED_1000baseT_Full (1 << 5)
1274−#define ADVERTISED_Autoneg (1 << 6)
1275−#define ADVERTISED_TP (1 << 7)
1276−#define ADVERTISED_AUI (1 << 8)
1277−#define ADVERTISED_MII (1 << 9)
1278−#define ADVERTISED_FIBRE (1 << 10)
1279−#define ADVERTISED_BNC (1 << 11)
1280−#define ADVERTISED_10000baseT_Full (1 << 12)
1281−#define ADVERTISED_Pause (1 << 13)
1282−#define ADVERTISED_Asym_Pause (1 << 14)
1283−#define ADVERTISED_2500baseX_Full (1 << 15)
1284−#define ADVERTISED_Backplane (1 << 16)
1285−#define ADVERTISED_1000baseKX_Full (1 << 17)
1286−#define ADVERTISED_10000baseKX4_Full (1 << 18)
1287−#define ADVERTISED_10000baseKR_Full (1 << 19)
1288−#define ADVERTISED_10000baseR_FEC (1 << 20)
1289−#define ADVERTISED_20000baseMLD2_Full (1 << 21)
1290−#define ADVERTISED_20000baseKR2_Full (1 << 22)
1291−#define ADVERTISED_40000baseKR4_Full (1 << 23)
1292−#define ADVERTISED_40000baseCR4_Full (1 << 24)
1293−#define ADVERTISED_40000baseSR4_Full (1 << 25)
1294−#define ADVERTISED_40000baseLR4_Full (1 << 26)
1295−#define ADVERTISED_56000baseKR4_Full (1 << 27)
1296−#define ADVERTISED_56000baseCR4_Full (1 << 28)
1297−#define ADVERTISED_56000baseSR4_Full (1 << 29)
1298−#define ADVERTISED_56000baseLR4_Full (1 << 30)
1323+/* Link mode bit indices */
1324+enum ethtool_link_mode_bit_indices {
1325+ ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0,
1326+ ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1,
1327+ ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2,
1328+ ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3,
1329+ ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4,
1330+ ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5,
1331+ ETHTOOL_LINK_MODE_Autoneg_BIT = 6,
1332+ ETHTOOL_LINK_MODE_TP_BIT = 7,
1333+ ETHTOOL_LINK_MODE_AUI_BIT = 8,
1334+ ETHTOOL_LINK_MODE_MII_BIT = 9,
1335+ ETHTOOL_LINK_MODE_FIBRE_BIT = 10,
1336+ ETHTOOL_LINK_MODE_BNC_BIT = 11,
1337+ ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12,
1338+ ETHTOOL_LINK_MODE_Pause_BIT = 13,
1339+ ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14,
1340+ ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15,
1341+ ETHTOOL_LINK_MODE_Backplane_BIT = 16,
1342+ ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17,
1343+ ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18,
1344+ ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19,
1345+ ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20,
1346+ ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21,
1347+ ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22,
1348+ ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23,
1349+ ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24,
1350+ ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25,
1351+ ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26,
1352+ ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27,
1353+ ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28,
1354+ ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
1355+ ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
1356+
1357+ /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
1358+ * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
1359+ * macro for bits > 31. The only way to use indices > 31 is to
1360+ * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
1361+ */
1362+
1363+ __ETHTOOL_LINK_MODE_LAST
1364+ = ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT,
1365+};
1366+
1367+#define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \
1368+ (1UL << (ETHTOOL_LINK_MODE_ ## base_name ## _BIT))
1369+
1370+/* DEPRECATED macros. Please migrate to
1371+ * ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. Please do NOT
1372+ * define any new SUPPORTED_* macro for bits > 31.
1373+ */
1374+#define SUPPORTED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
1375+#define SUPPORTED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
1376+#define SUPPORTED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
1377+#define SUPPORTED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
1378+#define SUPPORTED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
1379+#define SUPPORTED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
1380+#define SUPPORTED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
1381+#define SUPPORTED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
1382+#define SUPPORTED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
1383+#define SUPPORTED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
1384+#define SUPPORTED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
1385+#define SUPPORTED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
1386+#define SUPPORTED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
1387+#define SUPPORTED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
1388+#define SUPPORTED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
1389+#define SUPPORTED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
1390+#define SUPPORTED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
1391+#define SUPPORTED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
1392+#define SUPPORTED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
1393+#define SUPPORTED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
1394+#define SUPPORTED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
1395+#define SUPPORTED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
1396+#define SUPPORTED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
1397+#define SUPPORTED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
1398+#define SUPPORTED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
1399+#define SUPPORTED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
1400+#define SUPPORTED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
1401+#define SUPPORTED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
1402+#define SUPPORTED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
1403+#define SUPPORTED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
1404+#define SUPPORTED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
1405+/* Please do not define any new SUPPORTED_* macro for bits > 31, see
1406+ * notice above.
1407+ */
1408+
1409+/*
1410+ * DEPRECATED macros. Please migrate to
1411+ * ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. Please do NOT
1412+ * define any new ADERTISE_* macro for bits > 31.
1413+ */
1414+#define ADVERTISED_10baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Half)
1415+#define ADVERTISED_10baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10baseT_Full)
1416+#define ADVERTISED_100baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Half)
1417+#define ADVERTISED_100baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(100baseT_Full)
1418+#define ADVERTISED_1000baseT_Half __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Half)
1419+#define ADVERTISED_1000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseT_Full)
1420+#define ADVERTISED_Autoneg __ETHTOOL_LINK_MODE_LEGACY_MASK(Autoneg)
1421+#define ADVERTISED_TP __ETHTOOL_LINK_MODE_LEGACY_MASK(TP)
1422+#define ADVERTISED_AUI __ETHTOOL_LINK_MODE_LEGACY_MASK(AUI)
1423+#define ADVERTISED_MII __ETHTOOL_LINK_MODE_LEGACY_MASK(MII)
1424+#define ADVERTISED_FIBRE __ETHTOOL_LINK_MODE_LEGACY_MASK(FIBRE)
1425+#define ADVERTISED_BNC __ETHTOOL_LINK_MODE_LEGACY_MASK(BNC)
1426+#define ADVERTISED_10000baseT_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseT_Full)
1427+#define ADVERTISED_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause)
1428+#define ADVERTISED_Asym_Pause __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
1429+#define ADVERTISED_2500baseX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(2500baseX_Full)
1430+#define ADVERTISED_Backplane __ETHTOOL_LINK_MODE_LEGACY_MASK(Backplane)
1431+#define ADVERTISED_1000baseKX_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(1000baseKX_Full)
1432+#define ADVERTISED_10000baseKX4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKX4_Full)
1433+#define ADVERTISED_10000baseKR_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseKR_Full)
1434+#define ADVERTISED_10000baseR_FEC __ETHTOOL_LINK_MODE_LEGACY_MASK(10000baseR_FEC)
1435+#define ADVERTISED_20000baseMLD2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseMLD2_Full)
1436+#define ADVERTISED_20000baseKR2_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(20000baseKR2_Full)
1437+#define ADVERTISED_40000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseKR4_Full)
1438+#define ADVERTISED_40000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseCR4_Full)
1439+#define ADVERTISED_40000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseSR4_Full)
1440+#define ADVERTISED_40000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(40000baseLR4_Full)
1441+#define ADVERTISED_56000baseKR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseKR4_Full)
1442+#define ADVERTISED_56000baseCR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseCR4_Full)
1443+#define ADVERTISED_56000baseSR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseSR4_Full)
1444+#define ADVERTISED_56000baseLR4_Full __ETHTOOL_LINK_MODE_LEGACY_MASK(56000baseLR4_Full)
1445+/* Please do not define any new ADVERTISED_* macro for bits > 31, see
1446+ * notice above.
1447+ */
12991448
13001449 /* The following are all involved in forcing a particular link
13011450 * mode for the device for setting things. When getting the
@@ -1303,7 +1452,7 @@ enum ethtool_sfeatures_retval_bits { · 1 unmodified line
13031452 * it was forced up into this mode or autonegotiated.
13041453 */
13051454
1306−/* The forced speed, 10Mb, 100Mb, gigabit, [2.5|5|10|20|25|40|50|56|100]GbE. */
1455+/* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. */
13071456 #define SPEED_10 10
13081457 #define SPEED_100 100
13091458 #define SPEED_1000 1000
@@ -1319,11 +1468,28 @@ enum ethtool_sfeatures_retval_bits { · 9 unmodified lines
13191468
13201469 #define SPEED_UNKNOWN -1
13211470
1471+static inline int ethtool_validate_speed(__u32 speed)
1472+{
1473+ return speed <= INT_MAX || speed == SPEED_UNKNOWN;
1474+}
1475+
13221476 /* Duplex, half or full. */
13231477 #define DUPLEX_HALF 0x00
13241478 #define DUPLEX_FULL 0x01
13251479 #define DUPLEX_UNKNOWN 0xff
13261480
1481+static inline int ethtool_validate_duplex(__u8 duplex)
1482+{
1483+ switch (duplex) {
1484+ case DUPLEX_HALF:
1485+ case DUPLEX_FULL:
1486+ case DUPLEX_UNKNOWN:
1487+ return 1;
1488+ }
1489+
1490+ return 0;
1491+}
1492+
13271493 /* Which connector port. */
13281494 #define PORT_TP 0x00
13291495 #define PORT_AUI 0x01
@@ -1367,15 +1533,17 @@ enum ethtool_sfeatures_retval_bits { · 37 unmodified lines
13671533 #define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
13681534 #define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
13691535 #define AH_ESP_V4_FLOW 0x04 /* hash only */
1370−#define TCP_V6_FLOW 0x05 /* hash only */
1371−#define UDP_V6_FLOW 0x06 /* hash only */
1372−#define SCTP_V6_FLOW 0x07 /* hash only */
1536+#define TCP_V6_FLOW 0x05 /* hash or spec (tcp_ip6_spec; nfc only) */
1537+#define UDP_V6_FLOW 0x06 /* hash or spec (udp_ip6_spec; nfc only) */
1538+#define SCTP_V6_FLOW 0x07 /* hash or spec (sctp_ip6_spec; nfc only) */
13731539 #define AH_ESP_V6_FLOW 0x08 /* hash only */
13741540 #define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
13751541 #define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
1376−#define AH_V6_FLOW 0x0b /* hash only */
1377−#define ESP_V6_FLOW 0x0c /* hash only */
1378−#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
1542+#define AH_V6_FLOW 0x0b /* hash or spec (ah_ip6_spec; nfc only) */
1543+#define ESP_V6_FLOW 0x0c /* hash or spec (esp_ip6_spec; nfc only) */
1544+#define IPV4_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
1545+#define IP_USER_FLOW IPV4_USER_FLOW
1546+#define IPV6_USER_FLOW 0x0e /* spec only (usr_ip6_spec; nfc only) */
13791547 #define IPV4_FLOW 0x10 /* hash only */
13801548 #define IPV6_FLOW 0x11 /* hash only */
13811549 #define ETHER_FLOW 0x12 /* spec only (ether_spec) */
@@ -1441,4 +1609,123 @@ enum ethtool_reset_flags { · 59 unmodified lines
14411609 };
14421610 #define ETH_RESET_SHARED_SHIFT 16
14431611
1612+
1613+/**
1614+ * struct ethtool_link_settings - link control and status
1615+ *
1616+ * IMPORTANT, Backward compatibility notice: When implementing new
1617+ * user-space tools, please first try %ETHTOOL_GLINKSETTINGS, and
1618+ * if it succeeds use %ETHTOOL_SLINKSETTINGS to change link
1619+ * settings; do not use %ETHTOOL_SSET if %ETHTOOL_GLINKSETTINGS
1620+ * succeeded: stick to %ETHTOOL_GLINKSETTINGS/%SLINKSETTINGS in
1621+ * that case. Conversely, if %ETHTOOL_GLINKSETTINGS fails, use
1622+ * %ETHTOOL_GSET to query and %ETHTOOL_SSET to change link
1623+ * settings; do not use %ETHTOOL_SLINKSETTINGS if
1624+ * %ETHTOOL_GLINKSETTINGS failed: stick to
1625+ * %ETHTOOL_GSET/%ETHTOOL_SSET in that case.
1626+ *
1627+ * @cmd: Command number = %ETHTOOL_GLINKSETTINGS or %ETHTOOL_SLINKSETTINGS
1628+ * @speed: Link speed (Mbps)
1629+ * @duplex: Duplex mode; one of %DUPLEX_*
1630+ * @port: Physical connector type; one of %PORT_*
1631+ * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
1632+ * applicable. For clause 45 PHYs this is the PRTAD.
1633+ * @autoneg: Enable/disable autonegotiation and auto-detection;
1634+ * either %AUTONEG_DISABLE or %AUTONEG_ENABLE
1635+ * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
1636+ * protocols supported by the interface; 0 if unknown.
1637+ * Read-only.
1638+ * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
1639+ * %ETH_TP_MDI_*. If the status is unknown or not applicable, the
1640+ * value will be %ETH_TP_MDI_INVALID. Read-only.
1641+ * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
1642+ * %ETH_TP_MDI_*. If MDI(-X) control is not implemented, reads
1643+ * yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
1644+ * When written successfully, the link should be renegotiated if
1645+ * necessary.
1646+ * @link_mode_masks_nwords: Number of 32-bit words for each of the
1647+ * supported, advertising, lp_advertising link mode bitmaps. For
1648+ * %ETHTOOL_GLINKSETTINGS: on entry, number of words passed by user
1649+ * (>= 0); on return, if handshake in progress, negative if
1650+ * request size unsupported by kernel: absolute value indicates
1651+ * kernel recommended size and cmd field is 0, as well as all the
1652+ * other fields; otherwise (handshake completed), strictly
1653+ * positive to indicate size used by kernel and cmd field is
1654+ * %ETHTOOL_GLINKSETTINGS, all other fields populated by driver. For
1655+ * %ETHTOOL_SLINKSETTINGS: must be valid on entry, ie. a positive
1656+ * value returned previously by %ETHTOOL_GLINKSETTINGS, otherwise
1657+ * refused. For drivers: ignore this field (use kernel's
1658+ * __ETHTOOL_LINK_MODE_MASK_NBITS instead), any change to it will
1659+ * be overwritten by kernel.
1660+ * @supported: Bitmap with each bit meaning given by
1661+ * %ethtool_link_mode_bit_indices for the link modes, physical
1662+ * connectors and other link features for which the interface
1663+ * supports autonegotiation or auto-detection. Read-only.
1664+ * @advertising: Bitmap with each bit meaning given by
1665+ * %ethtool_link_mode_bit_indices for the link modes, physical
1666+ * connectors and other link features that are advertised through
1667+ * autonegotiation or enabled for auto-detection.
1668+ * @lp_advertising: Bitmap with each bit meaning given by
1669+ * %ethtool_link_mode_bit_indices for the link modes, and other
1670+ * link features that the link partner advertised through
1671+ * autonegotiation; 0 if unknown or not applicable. Read-only.
1672+ *
1673+ * If autonegotiation is disabled, the speed and @duplex represent the
1674+ * fixed link mode and are writable if the driver supports multiple
1675+ * link modes. If it is enabled then they are read-only; if the link
1676+ * is up they represent the negotiated link mode; if the link is down,
1677+ * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
1678+ * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.
1679+ *
1680+ * Some hardware interfaces may have multiple PHYs and/or physical
1681+ * connectors fitted or do not allow the driver to detect which are
1682+ * fitted. For these interfaces @port and/or @phy_address may be
1683+ * writable, possibly dependent on @autoneg being %AUTONEG_DISABLE.
1684+ * Otherwise, attempts to write different values may be ignored or
1685+ * rejected.
1686+ *
1687+ * Deprecated %ethtool_cmd fields transceiver, maxtxpkt and maxrxpkt
1688+ * are not available in %ethtool_link_settings. Until all drivers are
1689+ * converted to ignore them or to the new %ethtool_link_settings API,
1690+ * for both queries and changes, users should always try
1691+ * %ETHTOOL_GLINKSETTINGS first, and if it fails with -ENOTSUPP stick
1692+ * only to %ETHTOOL_GSET and %ETHTOOL_SSET consistently. If it
1693+ * succeeds, then users should stick to %ETHTOOL_GLINKSETTINGS and
1694+ * %ETHTOOL_SLINKSETTINGS (which would support drivers implementing
1695+ * either %ethtool_cmd or %ethtool_link_settings).
1696+ *
1697+ * Users should assume that all fields not marked read-only are
1698+ * writable and subject to validation by the driver. They should use
1699+ * %ETHTOOL_GLINKSETTINGS to get the current values before making specific
1700+ * changes and then applying them with %ETHTOOL_SLINKSETTINGS.
1701+ *
1702+ * Drivers that implement %get_link_ksettings and/or
1703+ * %set_link_ksettings should ignore the @cmd
1704+ * and @link_mode_masks_nwords fields (any change to them overwritten
1705+ * by kernel), and rely only on kernel's internal
1706+ * %__ETHTOOL_LINK_MODE_MASK_NBITS and
1707+ * %ethtool_link_mode_mask_t. Drivers that implement
1708+ * %set_link_ksettings() should validate all fields other than @cmd
1709+ * and @link_mode_masks_nwords that are not described as read-only or
1710+ * deprecated, and must ignore all fields described as read-only.
1711+ */
1712+struct ethtool_link_settings {
1713+ __u32 cmd;
1714+ __u32 speed;
1715+ __u8 duplex;
1716+ __u8 port;
1717+ __u8 phy_address;
1718+ __u8 autoneg;
1719+ __u8 mdio_support;
1720+ __u8 eth_tp_mdix;
1721+ __u8 eth_tp_mdix_ctrl;
1722+ __s8 link_mode_masks_nwords;
1723+ __u32 reserved[8];
1724+ __u32 link_mode_masks[0];
1725+ /* layout of link_mode_masks fields:
1726+ * __u32 map_supported[link_mode_masks_nwords];
1727+ * __u32 map_advertising[link_mode_masks_nwords];
1728+ * __u32 map_lp_advertising[link_mode_masks_nwords];
1729+ */
1730+};
14441731 #endif /* _UAPI_LINUX_ETHTOOL_H */
include/uapi/linux/genetlink.h+1−0
@@ -21,6 +21,7 @@ struct genlmsghdr { · 20 unmodified lines
2121 #define GENL_CMD_CAP_DO 0x02
2222 #define GENL_CMD_CAP_DUMP 0x04
2323 #define GENL_CMD_CAP_HASPOL 0x08
24+#define GENL_UNS_ADMIN_PERM 0x10
2425
2526 /*
2627 * List of reserved static generic netlink identifiers:
include/uapi/linux/if.h+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 * are shared for all types of net_devices. The sysfs entries are available
3838 * via /sys/class/net/<dev>/flags. Flags which can be toggled through sysfs
3939 * are annotated below, note that only a few flags can be toggled and some
40− * other flags are always always preserved from the original net_device flags
40+ * other flags are always preserved from the original net_device flags
4141 * even if you try to set them via sysfs. Flags which are always preserved
4242 * are kept under the flag grouping @IFF_VOLATILE. Flags which are volatile
4343 * are annotated below as such.
include/uapi/linux/if_bridge.h+35−2
@@ -137,11 +137,17 @@ struct bridge_vlan_info { · 136 unmodified lines
137137 /* Bridge multicast database attributes
138138 * [MDBA_MDB] = {
139139 * [MDBA_MDB_ENTRY] = {
140− * [MDBA_MDB_ENTRY_INFO]
140+ * [MDBA_MDB_ENTRY_INFO] {
141+ * struct br_mdb_entry
142+ * [MDBA_MDB_EATTR attributes]
143+ * }
141144 * }
142145 * }
143146 * [MDBA_ROUTER] = {
144− * [MDBA_ROUTER_PORT]
147+ * [MDBA_ROUTER_PORT] = {
148+ * u32 ifindex
149+ * [MDBA_ROUTER_PATTR attributes]
150+ * }
145151 * }
146152 */
147153 enum {
@@ -166,6 +172,22 @@ enum { · 18 unmodified lines
166172 };
167173 #define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
168174
175+/* per mdb entry additional attributes */
176+enum {
177+ MDBA_MDB_EATTR_UNSPEC,
178+ MDBA_MDB_EATTR_TIMER,
179+ __MDBA_MDB_EATTR_MAX
180+};
181+#define MDBA_MDB_EATTR_MAX (__MDBA_MDB_EATTR_MAX - 1)
182+
183+/* multicast router types */
184+enum {
185+ MDB_RTR_TYPE_DISABLED,
186+ MDB_RTR_TYPE_TEMP_QUERY,
187+ MDB_RTR_TYPE_PERM,
188+ MDB_RTR_TYPE_TEMP
189+};
190+
169191 enum {
170192 MDBA_ROUTER_UNSPEC,
171193 MDBA_ROUTER_PORT,
@@ -173,6 +195,15 @@ enum { · 1 unmodified line
173195 };
174196 #define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
175197
198+/* router port attributes */
199+enum {
200+ MDBA_ROUTER_PATTR_UNSPEC,
201+ MDBA_ROUTER_PATTR_TIMER,
202+ MDBA_ROUTER_PATTR_TYPE,
203+ __MDBA_ROUTER_PATTR_MAX
204+};
205+#define MDBA_ROUTER_PATTR_MAX (__MDBA_ROUTER_PATTR_MAX - 1)
206+
176207 struct br_port_msg {
177208 __u8 family;
178209 __u32 ifindex;
@@ -183,6 +214,8 @@ struct br_mdb_entry { · 4 unmodified lines
183214 #define MDB_TEMPORARY 0
184215 #define MDB_PERMANENT 1
185216 __u8 state;
217+#define MDB_FLAGS_OFFLOAD (1 << 0)
218+ __u8 flags;
186219 __u16 vid;
187220 struct {
188221 union {
include/uapi/linux/if_ether.h+1−0
@@ -83,6 +83,7 @@ · 82 unmodified lines
8383 #define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
8484 #define ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
8585 #define ETH_P_TIPC 0x88CA /* TIPC */
86+#define ETH_P_MACSEC 0x88E5 /* 802.1ae MACsec */
8687 #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
8788 #define ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */
8889 #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
include/uapi/linux/if_link.h+43−0
@@ -35,6 +35,8 @@ struct rtnl_link_stats { · 34 unmodified lines
3535 /* for cslip etc */
3636 __u32 rx_compressed;
3737 __u32 tx_compressed;
38+
39+ __u32 rx_nohandler; /* dropped, no handler found */
3840 };
3941
4042 /* The main device statistics structure */
@@ -68,6 +70,8 @@ struct rtnl_link_stats64 { · 27 unmodified lines
6870 /* for cslip etc */
6971 __u64 rx_compressed;
7072 __u64 tx_compressed;
73+
74+ __u64 rx_nohandler; /* dropped, no handler found */
7175 };
7276
7377 /* The struct should be in sync with struct ifmap */
@@ -401,6 +405,43 @@ enum { · 327 unmodified lines
401405
402406 #define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
403407
408+enum {
409+ IFLA_VRF_PORT_UNSPEC,
410+ IFLA_VRF_PORT_TABLE,
411+ __IFLA_VRF_PORT_MAX
412+};
413+
414+#define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
415+
416+/* MACSEC section */
417+enum {
418+ IFLA_MACSEC_UNSPEC,
419+ IFLA_MACSEC_SCI,
420+ IFLA_MACSEC_PORT,
421+ IFLA_MACSEC_ICV_LEN,
422+ IFLA_MACSEC_CIPHER_SUITE,
423+ IFLA_MACSEC_WINDOW,
424+ IFLA_MACSEC_ENCODING_SA,
425+ IFLA_MACSEC_ENCRYPT,
426+ IFLA_MACSEC_PROTECT,
427+ IFLA_MACSEC_INC_SCI,
428+ IFLA_MACSEC_ES,
429+ IFLA_MACSEC_SCB,
430+ IFLA_MACSEC_REPLAY_PROTECT,
431+ IFLA_MACSEC_VALIDATION,
432+ __IFLA_MACSEC_MAX,
433+};
434+
435+#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
436+
437+enum macsec_validation_type {
438+ MACSEC_VALIDATE_DISABLED = 0,
439+ MACSEC_VALIDATE_CHECK = 1,
440+ MACSEC_VALIDATE_STRICT = 2,
441+ __MACSEC_VALIDATE_END,
442+ MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
443+};
444+
404445 /* IPVLAN section */
405446 enum {
406447 IFLA_IPVLAN_UNSPEC,
@@ -444,6 +485,7 @@ enum { · 37 unmodified lines
444485 IFLA_VXLAN_GBP,
445486 IFLA_VXLAN_REMCSUM_NOPARTIAL,
446487 IFLA_VXLAN_COLLECT_METADATA,
488+ IFLA_VXLAN_LABEL,
447489 __IFLA_VXLAN_MAX
448490 };
449491 #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
@@ -466,6 +508,7 @@ enum { · 16 unmodified lines
466508 IFLA_GENEVE_UDP_CSUM,
467509 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
468510 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
511+ IFLA_GENEVE_LABEL,
469512 __IFLA_GENEVE_MAX
470513 };
471514 #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
include/uapi/linux/if_macsec.h+161−0
@@ -0,0 +1,161 @@
1+/*
2+ * include/uapi/linux/if_macsec.h - MACsec device
3+ *
4+ * Copyright (c) 2015 Sabrina Dubroca <sd@queasysnail.net>
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation; either version 2 of the License, or
9+ * (at your option) any later version.
10+ */
11+
12+#ifndef _UAPI_MACSEC_H
13+#define _UAPI_MACSEC_H
14+
15+#include <linux/types.h>
16+
17+#define MACSEC_GENL_NAME "macsec"
18+#define MACSEC_GENL_VERSION 1
19+
20+#define MACSEC_MAX_KEY_LEN 128
21+
22+#define DEFAULT_CIPHER_ID 0x0080020001000001ULL
23+#define DEFAULT_CIPHER_ALT 0x0080C20001000001ULL
24+
25+#define MACSEC_MIN_ICV_LEN 8
26+#define MACSEC_MAX_ICV_LEN 32
27+
28+enum macsec_attrs {
29+ MACSEC_ATTR_UNSPEC,
30+ MACSEC_ATTR_IFINDEX, /* u32, ifindex of the MACsec netdevice */
31+ MACSEC_ATTR_RXSC_CONFIG, /* config, nested macsec_rxsc_attrs */
32+ MACSEC_ATTR_SA_CONFIG, /* config, nested macsec_sa_attrs */
33+ MACSEC_ATTR_SECY, /* dump, nested macsec_secy_attrs */
34+ MACSEC_ATTR_TXSA_LIST, /* dump, nested, macsec_sa_attrs for each TXSA */
35+ MACSEC_ATTR_RXSC_LIST, /* dump, nested, macsec_rxsc_attrs for each RXSC */
36+ MACSEC_ATTR_TXSC_STATS, /* dump, nested, macsec_txsc_stats_attr */
37+ MACSEC_ATTR_SECY_STATS, /* dump, nested, macsec_secy_stats_attr */
38+ __MACSEC_ATTR_END,
39+ NUM_MACSEC_ATTR = __MACSEC_ATTR_END,
40+ MACSEC_ATTR_MAX = __MACSEC_ATTR_END - 1,
41+};
42+
43+enum macsec_secy_attrs {
44+ MACSEC_SECY_ATTR_UNSPEC,
45+ MACSEC_SECY_ATTR_SCI,
46+ MACSEC_SECY_ATTR_ENCODING_SA,
47+ MACSEC_SECY_ATTR_WINDOW,
48+ MACSEC_SECY_ATTR_CIPHER_SUITE,
49+ MACSEC_SECY_ATTR_ICV_LEN,
50+ MACSEC_SECY_ATTR_PROTECT,
51+ MACSEC_SECY_ATTR_REPLAY,
52+ MACSEC_SECY_ATTR_OPER,
53+ MACSEC_SECY_ATTR_VALIDATE,
54+ MACSEC_SECY_ATTR_ENCRYPT,
55+ MACSEC_SECY_ATTR_INC_SCI,
56+ MACSEC_SECY_ATTR_ES,
57+ MACSEC_SECY_ATTR_SCB,
58+ __MACSEC_SECY_ATTR_END,
59+ NUM_MACSEC_SECY_ATTR = __MACSEC_SECY_ATTR_END,
60+ MACSEC_SECY_ATTR_MAX = __MACSEC_SECY_ATTR_END - 1,
61+};
62+
63+enum macsec_rxsc_attrs {
64+ MACSEC_RXSC_ATTR_UNSPEC,
65+ MACSEC_RXSC_ATTR_SCI, /* config/dump, u64 */
66+ MACSEC_RXSC_ATTR_ACTIVE, /* config/dump, u8 0..1 */
67+ MACSEC_RXSC_ATTR_SA_LIST, /* dump, nested */
68+ MACSEC_RXSC_ATTR_STATS, /* dump, nested, macsec_rxsc_stats_attr */
69+ __MACSEC_RXSC_ATTR_END,
70+ NUM_MACSEC_RXSC_ATTR = __MACSEC_RXSC_ATTR_END,
71+ MACSEC_RXSC_ATTR_MAX = __MACSEC_RXSC_ATTR_END - 1,
72+};
73+
74+enum macsec_sa_attrs {
75+ MACSEC_SA_ATTR_UNSPEC,
76+ MACSEC_SA_ATTR_AN, /* config/dump, u8 0..3 */
77+ MACSEC_SA_ATTR_ACTIVE, /* config/dump, u8 0..1 */
78+ MACSEC_SA_ATTR_PN, /* config/dump, u32 */
79+ MACSEC_SA_ATTR_KEY, /* config, data */
80+ MACSEC_SA_ATTR_KEYID, /* config/dump, u64 */
81+ MACSEC_SA_ATTR_STATS, /* dump, nested, macsec_sa_stats_attr */
82+ __MACSEC_SA_ATTR_END,
83+ NUM_MACSEC_SA_ATTR = __MACSEC_SA_ATTR_END,
84+ MACSEC_SA_ATTR_MAX = __MACSEC_SA_ATTR_END - 1,
85+};
86+
87+enum macsec_nl_commands {
88+ MACSEC_CMD_GET_TXSC,
89+ MACSEC_CMD_ADD_RXSC,
90+ MACSEC_CMD_DEL_RXSC,
91+ MACSEC_CMD_UPD_RXSC,
92+ MACSEC_CMD_ADD_TXSA,
93+ MACSEC_CMD_DEL_TXSA,
94+ MACSEC_CMD_UPD_TXSA,
95+ MACSEC_CMD_ADD_RXSA,
96+ MACSEC_CMD_DEL_RXSA,
97+ MACSEC_CMD_UPD_RXSA,
98+};
99+
100+/* u64 per-RXSC stats */
101+enum macsec_rxsc_stats_attr {
102+ MACSEC_RXSC_STATS_ATTR_UNSPEC,
103+ MACSEC_RXSC_STATS_ATTR_IN_OCTETS_VALIDATED,
104+ MACSEC_RXSC_STATS_ATTR_IN_OCTETS_DECRYPTED,
105+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNCHECKED,
106+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_DELAYED,
107+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_OK,
108+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_INVALID,
109+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_LATE,
110+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_VALID,
111+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_NOT_USING_SA,
112+ MACSEC_RXSC_STATS_ATTR_IN_PKTS_UNUSED_SA,
113+ __MACSEC_RXSC_STATS_ATTR_END,
114+ NUM_MACSEC_RXSC_STATS_ATTR = __MACSEC_RXSC_STATS_ATTR_END,
115+ MACSEC_RXSC_STATS_ATTR_MAX = __MACSEC_RXSC_STATS_ATTR_END - 1,
116+};
117+
118+/* u32 per-{RX,TX}SA stats */
119+enum macsec_sa_stats_attr {
120+ MACSEC_SA_STATS_ATTR_UNSPEC,
121+ MACSEC_SA_STATS_ATTR_IN_PKTS_OK,
122+ MACSEC_SA_STATS_ATTR_IN_PKTS_INVALID,
123+ MACSEC_SA_STATS_ATTR_IN_PKTS_NOT_VALID,
124+ MACSEC_SA_STATS_ATTR_IN_PKTS_NOT_USING_SA,
125+ MACSEC_SA_STATS_ATTR_IN_PKTS_UNUSED_SA,
126+ MACSEC_SA_STATS_ATTR_OUT_PKTS_PROTECTED,
127+ MACSEC_SA_STATS_ATTR_OUT_PKTS_ENCRYPTED,
128+ __MACSEC_SA_STATS_ATTR_END,
129+ NUM_MACSEC_SA_STATS_ATTR = __MACSEC_SA_STATS_ATTR_END,
130+ MACSEC_SA_STATS_ATTR_MAX = __MACSEC_SA_STATS_ATTR_END - 1,
131+};
132+
133+/* u64 per-TXSC stats */
134+enum macsec_txsc_stats_attr {
135+ MACSEC_TXSC_STATS_ATTR_UNSPEC,
136+ MACSEC_TXSC_STATS_ATTR_OUT_PKTS_PROTECTED,
137+ MACSEC_TXSC_STATS_ATTR_OUT_PKTS_ENCRYPTED,
138+ MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_PROTECTED,
139+ MACSEC_TXSC_STATS_ATTR_OUT_OCTETS_ENCRYPTED,
140+ __MACSEC_TXSC_STATS_ATTR_END,
141+ NUM_MACSEC_TXSC_STATS_ATTR = __MACSEC_TXSC_STATS_ATTR_END,
142+ MACSEC_TXSC_STATS_ATTR_MAX = __MACSEC_TXSC_STATS_ATTR_END - 1,
143+};
144+
145+/* u64 per-SecY stats */
146+enum macsec_secy_stats_attr {
147+ MACSEC_SECY_STATS_ATTR_UNSPEC,
148+ MACSEC_SECY_STATS_ATTR_OUT_PKTS_UNTAGGED,
149+ MACSEC_SECY_STATS_ATTR_IN_PKTS_UNTAGGED,
150+ MACSEC_SECY_STATS_ATTR_OUT_PKTS_TOO_LONG,
151+ MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_TAG,
152+ MACSEC_SECY_STATS_ATTR_IN_PKTS_BAD_TAG,
153+ MACSEC_SECY_STATS_ATTR_IN_PKTS_UNKNOWN_SCI,
154+ MACSEC_SECY_STATS_ATTR_IN_PKTS_NO_SCI,
155+ MACSEC_SECY_STATS_ATTR_IN_PKTS_OVERRUN,
156+ __MACSEC_SECY_STATS_ATTR_END,
157+ NUM_MACSEC_SECY_STATS_ATTR = __MACSEC_SECY_STATS_ATTR_END,
158+ MACSEC_SECY_STATS_ATTR_MAX = __MACSEC_SECY_STATS_ATTR_END - 1,
159+};
160+
161+#endif /* _UAPI_MACSEC_H */
include/uapi/linux/ip.h+2−0
@@ -165,6 +165,8 @@ enum · 164 unmodified lines
165165 IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
166166 IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
167167 IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
168+ IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
169+ IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
168170 __IPV4_DEVCONF_MAX
169171 };
170172
include/uapi/linux/ipv6.h+3−0
@@ -174,6 +174,9 @@ enum { · 173 unmodified lines
174174 DEVCONF_USE_OIF_ADDRS_ONLY,
175175 DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT,
176176 DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
177+ DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
178+ DEVCONF_DROP_UNSOLICITED_NA,
179+ DEVCONF_KEEP_ADDR_ON_DOWN,
177180 DEVCONF_MAX
178181 };
179182
include/uapi/linux/kcm.h+40−0
@@ -0,0 +1,40 @@
1+/*
2+ * Kernel Connection Multiplexor
3+ *
4+ * Copyright (c) 2016 Tom Herbert <tom@herbertland.com>
5+ *
6+ * This program is free software; you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License version 2
8+ * as published by the Free Software Foundation.
9+ *
10+ * User API to clone KCM sockets and attach transport socket to a KCM
11+ * multiplexor.
12+ */
13+
14+#ifndef KCM_KERNEL_H
15+#define KCM_KERNEL_H
16+
17+struct kcm_attach {
18+ int fd;
19+ int bpf_fd;
20+};
21+
22+struct kcm_unattach {
23+ int fd;
24+};
25+
26+struct kcm_clone {
27+ int fd;
28+};
29+
30+#define SIOCKCMATTACH (SIOCPROTOPRIVATE + 0)
31+#define SIOCKCMUNATTACH (SIOCPROTOPRIVATE + 1)
32+#define SIOCKCMCLONE (SIOCPROTOPRIVATE + 2)
33+
34+#define KCMPROTO_CONNECTED 0
35+
36+/* Socket options */
37+#define KCM_RECV_DISABLE 1
38+
39+#endif
40+
include/uapi/linux/kernel.h+1−0
@@ -9,5 +9,6 @@ · 8 unmodified lines
99 #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
1010 #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
1111
12+#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
1213
1314 #endif /* _UAPI_LINUX_KERNEL_H */
include/uapi/linux/mroute6.h+2−7
@@ -1,6 +1,7 @@
11 #ifndef _UAPI__LINUX_MROUTE6_H
22 #define _UAPI__LINUX_MROUTE6_H
33
4+#include <linux/kernel.h>
45 #include <linux/types.h>
56 #include <linux/sockios.h>
67
@@ -46,14 +47,8 @@ typedef unsigned short mifi_t; · 39 unmodified lines
4647 typedef __u32 if_mask;
4748 #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
4849
49−#if !defined(__KERNEL__)
50−#if !defined(DIV_ROUND_UP)
51−#define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
52−#endif
53−#endif
54−
5550 typedef struct if_set {
56− if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
51+ if_mask ifs_bits[__KERNEL_DIV_ROUND_UP(IF_SETSIZE, NIFBITS)];
5752 } if_set;
5853
5954 #define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
include/uapi/linux/netconf.h+1−0
@@ -19,6 +19,7 @@ enum { · 18 unmodified lines
1919 __NETCONFA_MAX
2020 };
2121 #define NETCONFA_MAX (__NETCONFA_MAX - 1)
22+#define NETCONFA_ALL -1
2223
2324 #define NETCONFA_IFINDEX_ALL -1
2425 #define NETCONFA_IFINDEX_DEFAULT -2
include/uapi/linux/netfilter/nf_conntrack_common.h+9−3
@@ -20,9 +20,15 @@ enum ip_conntrack_info { · 19 unmodified lines
2020
2121 IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
2222 IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
23− IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
24− /* Number of distinct IP_CT types (no NEW in reply dirn). */
25− IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
23+ /* No NEW in reply direction. */
24+
25+ /* Number of distinct IP_CT types. */
26+ IP_CT_NUMBER,
27+
28+ /* only for userspace compatibility */
29+#ifndef __KERNEL__
30+ IP_CT_NEW_REPLY = IP_CT_NUMBER,
31+#endif
2632 };
2733
2834 #define NF_CT_STATE_INVALID_BIT (1 << 0)
include/uapi/linux/netfilter/nf_tables.h+6−0
@@ -681,6 +681,7 @@ enum nft_exthdr_attributes { · 680 unmodified lines
681681 * @NFT_META_IIFGROUP: packet input interface group
682682 * @NFT_META_OIFGROUP: packet output interface group
683683 * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid)
684+ * @NFT_META_PRANDOM: a 32bit pseudo-random number
684685 */
685686 enum nft_meta_keys {
686687 NFT_META_LEN,
@@ -707,6 +708,7 @@ enum nft_meta_keys { · 20 unmodified lines
707708 NFT_META_IIFGROUP,
708709 NFT_META_OIFGROUP,
709710 NFT_META_CGROUP,
711+ NFT_META_PRANDOM,
710712 };
711713
712714 /**
@@ -949,10 +951,14 @@ enum nft_nat_attributes { · 236 unmodified lines
949951 * enum nft_masq_attributes - nf_tables masquerade expression attributes
950952 *
951953 * @NFTA_MASQ_FLAGS: NAT flags (see NF_NAT_RANGE_* in linux/netfilter/nf_nat.h) (NLA_U32)
954+ * @NFTA_MASQ_REG_PROTO_MIN: source register of proto range start (NLA_U32: nft_registers)
955+ * @NFTA_MASQ_REG_PROTO_MAX: source register of proto range end (NLA_U32: nft_registers)
952956 */
953957 enum nft_masq_attributes {
954958 NFTA_MASQ_UNSPEC,
955959 NFTA_MASQ_FLAGS,
960+ NFTA_MASQ_REG_PROTO_MIN,
961+ NFTA_MASQ_REG_PROTO_MAX,
956962 __NFTA_MASQ_MAX
957963 };
958964 #define NFTA_MASQ_MAX (__NFTA_MASQ_MAX - 1)
include/uapi/linux/netlink.h+4−0
@@ -107,8 +107,10 @@ struct nlmsgerr { · 106 unmodified lines
107107 #define NETLINK_PKTINFO 3
108108 #define NETLINK_BROADCAST_ERROR 4
109109 #define NETLINK_NO_ENOBUFS 5
110+#ifndef __KERNEL__
110111 #define NETLINK_RX_RING 6
111112 #define NETLINK_TX_RING 7
113+#endif
112114 #define NETLINK_LISTEN_ALL_NSID 8
113115 #define NETLINK_LIST_MEMBERSHIPS 9
114116 #define NETLINK_CAP_ACK 10
@@ -134,6 +136,7 @@ struct nl_mmap_hdr { · 19 unmodified lines
134136 __u32 nm_gid;
135137 };
136138
139+#ifndef __KERNEL__
137140 enum nl_mmap_status {
138141 NL_MMAP_STATUS_UNUSED,
139142 NL_MMAP_STATUS_RESERVED,
@@ -145,6 +148,7 @@ enum nl_mmap_status { · 5 unmodified lines
145148 #define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
146149 #define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
147150 #define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
151+#endif
148152
149153 #define NET_MAJOR 36 /* Major 36 is reserved for networking */
150154
include/uapi/linux/netlink_diag.h+2−0
@@ -48,6 +48,8 @@ enum { · 47 unmodified lines
4848
4949 #define NDIAG_SHOW_MEMINFO 0x00000001 /* show memory info of a socket */
5050 #define NDIAG_SHOW_GROUPS 0x00000002 /* show groups of a netlink socket */
51+#ifndef __KERNEL__
5152 #define NDIAG_SHOW_RING_CFG 0x00000004 /* show ring configuration */
53+#endif
5254
5355 #endif
include/uapi/linux/nl80211.h+14−0
@@ -1727,6 +1727,8 @@ enum nl80211_commands { · 1726 unmodified lines
17271727 * underlying device supports these minimal RRM features:
17281728 * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
17291729 * %NL80211_FEATURE_QUIET,
1730+ * Or, if global RRM is supported, see:
1731+ * %NL80211_EXT_FEATURE_RRM
17301732 * If this flag is used, driver must add the Power Capabilities IE to the
17311733 * association request. In addition, it must also set the RRM capability
17321734 * flag in the association request's Capability Info field.
@@ -1789,6 +1791,10 @@ enum nl80211_commands { · 56 unmodified lines
17891791 * thus it must not specify the number of iterations, only the interval
17901792 * between scans. The scan plans are executed sequentially.
17911793 * Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan.
1794+ * @NL80211_ATTR_PBSS: flag attribute. If set it means operate
1795+ * in a PBSS. Specified in %NL80211_CMD_CONNECT to request
1796+ * connecting to a PCP, and in %NL80211_CMD_START_AP to start
1797+ * a PCP instead of AP. Relevant for DMG networks only.
17921798 *
17931799 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
17941800 * @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2164,6 +2170,8 @@ enum nl80211_attrs { · 369 unmodified lines
21642170 NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
21652171 NL80211_ATTR_SCHED_SCAN_PLANS,
21662172
2173+ NL80211_ATTR_PBSS,
2174+
21672175 /* add attributes here, update the policy in nl80211.c */
21682176
21692177 __NL80211_ATTR_AFTER_LAST,
@@ -4396,12 +4404,18 @@ enum nl80211_feature_flags { · 2226 unmodified lines
43964404 /**
43974405 * enum nl80211_ext_feature_index - bit index of extended features.
43984406 * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
4407+ * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can
4408+ * can request to use RRM (see %NL80211_ATTR_USE_RRM) with
4409+ * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
4410+ * the ASSOC_REQ_USE_RRM flag in the association request even if
4411+ * NL80211_FEATURE_QUIET is not advertized.
43994412 *
44004413 * @NUM_NL80211_EXT_FEATURES: number of extended features.
44014414 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
44024415 */
44034416 enum nl80211_ext_feature_index {
44044417 NL80211_EXT_FEATURE_VHT_IBSS,
4418+ NL80211_EXT_FEATURE_RRM,
44054419
44064420 /* add new features before the definition below */
44074421 NUM_NL80211_EXT_FEATURES,
include/uapi/linux/openvswitch.h+49−0
@@ -454,6 +454,14 @@ struct ovs_key_ct_labels { · 453 unmodified lines
454454 #define OVS_CS_F_REPLY_DIR 0x08 /* Flow is in the reply direction. */
455455 #define OVS_CS_F_INVALID 0x10 /* Could not track connection. */
456456 #define OVS_CS_F_TRACKED 0x20 /* Conntrack has occurred. */
457+#define OVS_CS_F_SRC_NAT 0x40 /* Packet's source address/port was
458+ * mangled by NAT.
459+ */
460+#define OVS_CS_F_DST_NAT 0x80 /* Packet's destination address/port
461+ * was mangled by NAT.
462+ */
463+
464+#define OVS_CS_F_NAT_MASK (OVS_CS_F_SRC_NAT | OVS_CS_F_DST_NAT)
457465
458466 /**
459467 * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands.
@@ -632,6 +640,8 @@ struct ovs_action_hash { · 172 unmodified lines
632640 * mask. For each bit set in the mask, the corresponding bit in the value is
633641 * copied to the connection tracking label field in the connection.
634642 * @OVS_CT_ATTR_HELPER: variable length string defining conntrack ALG.
643+ * @OVS_CT_ATTR_NAT: Nested OVS_NAT_ATTR_* for performing L3 network address
644+ * translation (NAT) on the packet.
635645 */
636646 enum ovs_ct_attr {
637647 OVS_CT_ATTR_UNSPEC,
@@ -641,11 +651,50 @@ enum ovs_ct_attr { · 3 unmodified lines
641651 OVS_CT_ATTR_LABELS, /* labels to associate with this connection. */
642652 OVS_CT_ATTR_HELPER, /* netlink helper to assist detection of
643653 related connections. */
654+ OVS_CT_ATTR_NAT, /* Nested OVS_NAT_ATTR_* */
644655 __OVS_CT_ATTR_MAX
645656 };
646657
647658 #define OVS_CT_ATTR_MAX (__OVS_CT_ATTR_MAX - 1)
648659
660+/**
661+ * enum ovs_nat_attr - Attributes for %OVS_CT_ATTR_NAT.
662+ *
663+ * @OVS_NAT_ATTR_SRC: Flag for Source NAT (mangle source address/port).
664+ * @OVS_NAT_ATTR_DST: Flag for Destination NAT (mangle destination
665+ * address/port). Only one of (@OVS_NAT_ATTR_SRC, @OVS_NAT_ATTR_DST) may be
666+ * specified. Effective only for packets for ct_state NEW connections.
667+ * Packets of committed connections are mangled by the NAT action according to
668+ * the committed NAT type regardless of the flags specified. As a corollary, a
669+ * NAT action without a NAT type flag will only mangle packets of committed
670+ * connections. The following NAT attributes only apply for NEW
671+ * (non-committed) connections, and they may be included only when the CT
672+ * action has the @OVS_CT_ATTR_COMMIT flag and either @OVS_NAT_ATTR_SRC or
673+ * @OVS_NAT_ATTR_DST is also included.
674+ * @OVS_NAT_ATTR_IP_MIN: struct in_addr or struct in6_addr
675+ * @OVS_NAT_ATTR_IP_MAX: struct in_addr or struct in6_addr
676+ * @OVS_NAT_ATTR_PROTO_MIN: u16 L4 protocol specific lower boundary (port)
677+ * @OVS_NAT_ATTR_PROTO_MAX: u16 L4 protocol specific upper boundary (port)
678+ * @OVS_NAT_ATTR_PERSISTENT: Flag for persistent IP mapping across reboots
679+ * @OVS_NAT_ATTR_PROTO_HASH: Flag for pseudo random L4 port mapping (MD5)
680+ * @OVS_NAT_ATTR_PROTO_RANDOM: Flag for fully randomized L4 port mapping
681+ */
682+enum ovs_nat_attr {
683+ OVS_NAT_ATTR_UNSPEC,
684+ OVS_NAT_ATTR_SRC,
685+ OVS_NAT_ATTR_DST,
686+ OVS_NAT_ATTR_IP_MIN,
687+ OVS_NAT_ATTR_IP_MAX,
688+ OVS_NAT_ATTR_PROTO_MIN,
689+ OVS_NAT_ATTR_PROTO_MAX,
690+ OVS_NAT_ATTR_PERSISTENT,
691+ OVS_NAT_ATTR_PROTO_HASH,
692+ OVS_NAT_ATTR_PROTO_RANDOM,
693+ __OVS_NAT_ATTR_MAX,
694+};
695+
696+#define OVS_NAT_ATTR_MAX (__OVS_NAT_ATTR_MAX - 1)
697+
649698 /**
650699 * enum ovs_action_attr - Action types.
651700 *
include/uapi/linux/pkt_cls.h+3−0
@@ -172,6 +172,7 @@ enum { · 171 unmodified lines
172172 TCA_U32_INDEV,
173173 TCA_U32_PCNT,
174174 TCA_U32_MARK,
175+ TCA_U32_FLAGS,
175176 __TCA_U32_MAX
176177 };
177178
@@ -416,6 +417,8 @@ enum { · 238 unmodified lines
416417 TCA_FLOWER_KEY_TCP_DST, /* be16 */
417418 TCA_FLOWER_KEY_UDP_SRC, /* be16 */
418419 TCA_FLOWER_KEY_UDP_DST, /* be16 */
420+
421+ TCA_FLOWER_FLAGS,
419422 __TCA_FLOWER_MAX,
420423 };
421424
include/uapi/linux/rfkill.h+2−0
@@ -59,6 +59,8 @@ enum rfkill_type { · 58 unmodified lines
5959 * @RFKILL_OP_DEL: a device was removed
6060 * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
6161 * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
62+ * into a state, also updating the default state used for devices that
63+ * are hot-plugged later.
6264 */
6365 enum rfkill_operation {
6466 RFKILL_OP_ADD = 0,
include/uapi/linux/tc_act/tc_ife.h+38−0
@@ -0,0 +1,38 @@
1+#ifndef __UAPI_TC_IFE_H
2+#define __UAPI_TC_IFE_H
3+
4+#include <linux/types.h>
5+#include <linux/pkt_cls.h>
6+
7+#define TCA_ACT_IFE 25
8+/* Flag bits for now just encoding/decoding; mutually exclusive */
9+#define IFE_ENCODE 1
10+#define IFE_DECODE 0
11+
12+struct tc_ife {
13+ tc_gen;
14+ __u16 flags;
15+};
16+
17+/*XXX: We need to encode the total number of bytes consumed */
18+enum {
19+ TCA_IFE_UNSPEC,
20+ TCA_IFE_PARMS,
21+ TCA_IFE_TM,
22+ TCA_IFE_DMAC,
23+ TCA_IFE_SMAC,
24+ TCA_IFE_TYPE,
25+ TCA_IFE_METALST,
26+ __TCA_IFE_MAX
27+};
28+#define TCA_IFE_MAX (__TCA_IFE_MAX - 1)
29+
30+#define IFE_META_SKBMARK 1
31+#define IFE_META_HASHID 2
32+#define IFE_META_PRIO 3
33+#define IFE_META_QMAP 4
34+/*Can be overridden at runtime by module option*/
35+#define __IFE_META_MAX 5
36+#define IFE_META_MAX (__IFE_META_MAX - 1)
37+
38+#endif
include/uapi/linux/tcp.h+5−0
@@ -196,6 +196,11 @@ struct tcp_info { · 195 unmodified lines
196196 __u64 tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
197197 __u32 tcpi_segs_out; /* RFC4898 tcpEStatsPerfSegsOut */
198198 __u32 tcpi_segs_in; /* RFC4898 tcpEStatsPerfSegsIn */
199+
200+ __u32 tcpi_notsent_bytes;
201+ __u32 tcpi_min_rtt;
202+ __u32 tcpi_data_segs_in; /* RFC4898 tcpEStatsDataSegsIn */
203+ __u32 tcpi_data_segs_out; /* RFC4898 tcpEStatsDataSegsOut */
199204 };
200205
201206 /* for TCP_MD5SIG socket option */