aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/uapi/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-02-17 05:39:28 -0500
committerIngo Molnar <mingo@kernel.org>2018-02-17 05:39:28 -0500
commit7057bb975dab827997e0ca9dd92cafef0856b0cc (patch)
tree7784dc59c03f25b6bc4fa5cc12d5b61cb8b53765 /tools/include/uapi/linux
parent33ea4b24277b06dbc55d7f5772a46f029600255e (diff)
parent297f9233b53a08fd457815e19f1d6f2c3389857b (diff)
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/include/uapi/linux')
-rw-r--r--tools/include/uapi/linux/bpf.h116
-rw-r--r--tools/include/uapi/linux/bpf_common.h7
-rw-r--r--tools/include/uapi/linux/if_link.h944
-rw-r--r--tools/include/uapi/linux/kvm.h90
-rw-r--r--tools/include/uapi/linux/netlink.h251
-rw-r--r--tools/include/uapi/linux/perf_event.h22
6 files changed, 1422 insertions, 8 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 4c223ab30293..db6bdc375126 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -17,7 +17,7 @@
17#define BPF_ALU64 0x07 /* alu mode in double word width */ 17#define BPF_ALU64 0x07 /* alu mode in double word width */
18 18
19/* ld/ldx fields */ 19/* ld/ldx fields */
20#define BPF_DW 0x18 /* double word */ 20#define BPF_DW 0x18 /* double word (64-bit) */
21#define BPF_XADD 0xc0 /* exclusive add */ 21#define BPF_XADD 0xc0 /* exclusive add */
22 22
23/* alu/jmp fields */ 23/* alu/jmp fields */
@@ -197,8 +197,14 @@ enum bpf_attach_type {
197 */ 197 */
198#define BPF_F_STRICT_ALIGNMENT (1U << 0) 198#define BPF_F_STRICT_ALIGNMENT (1U << 0)
199 199
200/* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */
200#define BPF_PSEUDO_MAP_FD 1 201#define BPF_PSEUDO_MAP_FD 1
201 202
203/* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
204 * offset to another bpf function
205 */
206#define BPF_PSEUDO_CALL 1
207
202/* flags for BPF_MAP_UPDATE_ELEM command */ 208/* flags for BPF_MAP_UPDATE_ELEM command */
203#define BPF_ANY 0 /* create new element or update existing */ 209#define BPF_ANY 0 /* create new element or update existing */
204#define BPF_NOEXIST 1 /* create new element if it didn't exist */ 210#define BPF_NOEXIST 1 /* create new element if it didn't exist */
@@ -239,6 +245,7 @@ union bpf_attr {
239 * BPF_F_NUMA_NODE is set). 245 * BPF_F_NUMA_NODE is set).
240 */ 246 */
241 char map_name[BPF_OBJ_NAME_LEN]; 247 char map_name[BPF_OBJ_NAME_LEN];
248 __u32 map_ifindex; /* ifindex of netdev to create on */
242 }; 249 };
243 250
244 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */ 251 struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
@@ -635,6 +642,14 @@ union bpf_attr {
635 * @optlen: length of optval in bytes 642 * @optlen: length of optval in bytes
636 * Return: 0 or negative error 643 * Return: 0 or negative error
637 * 644 *
645 * int bpf_sock_ops_cb_flags_set(bpf_sock_ops, flags)
646 * Set callback flags for sock_ops
647 * @bpf_sock_ops: pointer to bpf_sock_ops_kern struct
648 * @flags: flags value
649 * Return: 0 for no error
650 * -EINVAL if there is no full tcp socket
651 * bits in flags that are not supported by current kernel
652 *
638 * int bpf_skb_adjust_room(skb, len_diff, mode, flags) 653 * int bpf_skb_adjust_room(skb, len_diff, mode, flags)
639 * Grow or shrink room in sk_buff. 654 * Grow or shrink room in sk_buff.
640 * @skb: pointer to skb 655 * @skb: pointer to skb
@@ -677,6 +692,10 @@ union bpf_attr {
677 * @buf: buf to fill 692 * @buf: buf to fill
678 * @buf_size: size of the buf 693 * @buf_size: size of the buf
679 * Return : 0 on success or negative error code 694 * Return : 0 on success or negative error code
695 *
696 * int bpf_override_return(pt_regs, rc)
697 * @pt_regs: pointer to struct pt_regs
698 * @rc: the return value to set
680 */ 699 */
681#define __BPF_FUNC_MAPPER(FN) \ 700#define __BPF_FUNC_MAPPER(FN) \
682 FN(unspec), \ 701 FN(unspec), \
@@ -736,7 +755,9 @@ union bpf_attr {
736 FN(xdp_adjust_meta), \ 755 FN(xdp_adjust_meta), \
737 FN(perf_event_read_value), \ 756 FN(perf_event_read_value), \
738 FN(perf_prog_read_value), \ 757 FN(perf_prog_read_value), \
739 FN(getsockopt), 758 FN(getsockopt), \
759 FN(override_return), \
760 FN(sock_ops_cb_flags_set),
740 761
741/* integer value in 'imm' field of BPF_CALL instruction selects which helper 762/* integer value in 'imm' field of BPF_CALL instruction selects which helper
742 * function eBPF program intends to call 763 * function eBPF program intends to call
@@ -888,6 +909,9 @@ struct xdp_md {
888 __u32 data; 909 __u32 data;
889 __u32 data_end; 910 __u32 data_end;
890 __u32 data_meta; 911 __u32 data_meta;
912 /* Below access go through struct xdp_rxq_info */
913 __u32 ingress_ifindex; /* rxq->dev->ifindex */
914 __u32 rx_queue_index; /* rxq->queue_index */
891}; 915};
892 916
893enum sk_action { 917enum sk_action {
@@ -910,6 +934,9 @@ struct bpf_prog_info {
910 __u32 nr_map_ids; 934 __u32 nr_map_ids;
911 __aligned_u64 map_ids; 935 __aligned_u64 map_ids;
912 char name[BPF_OBJ_NAME_LEN]; 936 char name[BPF_OBJ_NAME_LEN];
937 __u32 ifindex;
938 __u64 netns_dev;
939 __u64 netns_ino;
913} __attribute__((aligned(8))); 940} __attribute__((aligned(8)));
914 941
915struct bpf_map_info { 942struct bpf_map_info {
@@ -920,6 +947,9 @@ struct bpf_map_info {
920 __u32 max_entries; 947 __u32 max_entries;
921 __u32 map_flags; 948 __u32 map_flags;
922 char name[BPF_OBJ_NAME_LEN]; 949 char name[BPF_OBJ_NAME_LEN];
950 __u32 ifindex;
951 __u64 netns_dev;
952 __u64 netns_ino;
923} __attribute__((aligned(8))); 953} __attribute__((aligned(8)));
924 954
925/* User bpf_sock_ops struct to access socket values and specify request ops 955/* User bpf_sock_ops struct to access socket values and specify request ops
@@ -931,8 +961,9 @@ struct bpf_map_info {
931struct bpf_sock_ops { 961struct bpf_sock_ops {
932 __u32 op; 962 __u32 op;
933 union { 963 union {
934 __u32 reply; 964 __u32 args[4]; /* Optionally passed to bpf program */
935 __u32 replylong[4]; 965 __u32 reply; /* Returned by bpf program */
966 __u32 replylong[4]; /* Optionally returned by bpf prog */
936 }; 967 };
937 __u32 family; 968 __u32 family;
938 __u32 remote_ip4; /* Stored in network byte order */ 969 __u32 remote_ip4; /* Stored in network byte order */
@@ -941,8 +972,45 @@ struct bpf_sock_ops {
941 __u32 local_ip6[4]; /* Stored in network byte order */ 972 __u32 local_ip6[4]; /* Stored in network byte order */
942 __u32 remote_port; /* Stored in network byte order */ 973 __u32 remote_port; /* Stored in network byte order */
943 __u32 local_port; /* stored in host byte order */ 974 __u32 local_port; /* stored in host byte order */
975 __u32 is_fullsock; /* Some TCP fields are only valid if
976 * there is a full socket. If not, the
977 * fields read as zero.
978 */
979 __u32 snd_cwnd;
980 __u32 srtt_us; /* Averaged RTT << 3 in usecs */
981 __u32 bpf_sock_ops_cb_flags; /* flags defined in uapi/linux/tcp.h */
982 __u32 state;
983 __u32 rtt_min;
984 __u32 snd_ssthresh;
985 __u32 rcv_nxt;
986 __u32 snd_nxt;
987 __u32 snd_una;
988 __u32 mss_cache;
989 __u32 ecn_flags;
990 __u32 rate_delivered;
991 __u32 rate_interval_us;
992 __u32 packets_out;
993 __u32 retrans_out;
994 __u32 total_retrans;
995 __u32 segs_in;
996 __u32 data_segs_in;
997 __u32 segs_out;
998 __u32 data_segs_out;
999 __u32 lost_out;
1000 __u32 sacked_out;
1001 __u32 sk_txhash;
1002 __u64 bytes_received;
1003 __u64 bytes_acked;
944}; 1004};
945 1005
1006/* Definitions for bpf_sock_ops_cb_flags */
1007#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0)
1008#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1)
1009#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2)
1010#define BPF_SOCK_OPS_ALL_CB_FLAGS 0x7 /* Mask of all currently
1011 * supported cb flags
1012 */
1013
946/* List of known BPF sock_ops operators. 1014/* List of known BPF sock_ops operators.
947 * New entries can only be added at the end 1015 * New entries can only be added at the end
948 */ 1016 */
@@ -976,6 +1044,43 @@ enum {
976 * a congestion threshold. RTTs above 1044 * a congestion threshold. RTTs above
977 * this indicate congestion 1045 * this indicate congestion
978 */ 1046 */
1047 BPF_SOCK_OPS_RTO_CB, /* Called when an RTO has triggered.
1048 * Arg1: value of icsk_retransmits
1049 * Arg2: value of icsk_rto
1050 * Arg3: whether RTO has expired
1051 */
1052 BPF_SOCK_OPS_RETRANS_CB, /* Called when skb is retransmitted.
1053 * Arg1: sequence number of 1st byte
1054 * Arg2: # segments
1055 * Arg3: return value of
1056 * tcp_transmit_skb (0 => success)
1057 */
1058 BPF_SOCK_OPS_STATE_CB, /* Called when TCP changes state.
1059 * Arg1: old_state
1060 * Arg2: new_state
1061 */
1062};
1063
1064/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
1065 * changes between the TCP and BPF versions. Ideally this should never happen.
1066 * If it does, we need to add code to convert them before calling
1067 * the BPF sock_ops function.
1068 */
1069enum {
1070 BPF_TCP_ESTABLISHED = 1,
1071 BPF_TCP_SYN_SENT,
1072 BPF_TCP_SYN_RECV,
1073 BPF_TCP_FIN_WAIT1,
1074 BPF_TCP_FIN_WAIT2,
1075 BPF_TCP_TIME_WAIT,
1076 BPF_TCP_CLOSE,
1077 BPF_TCP_CLOSE_WAIT,
1078 BPF_TCP_LAST_ACK,
1079 BPF_TCP_LISTEN,
1080 BPF_TCP_CLOSING, /* Now a valid state */
1081 BPF_TCP_NEW_SYN_RECV,
1082
1083 BPF_TCP_MAX_STATES /* Leave at the end! */
979}; 1084};
980 1085
981#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */ 1086#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */
@@ -995,7 +1100,8 @@ struct bpf_perf_event_value {
995#define BPF_DEVCG_DEV_CHAR (1ULL << 1) 1100#define BPF_DEVCG_DEV_CHAR (1ULL << 1)
996 1101
997struct bpf_cgroup_dev_ctx { 1102struct bpf_cgroup_dev_ctx {
998 __u32 access_type; /* (access << 16) | type */ 1103 /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */
1104 __u32 access_type;
999 __u32 major; 1105 __u32 major;
1000 __u32 minor; 1106 __u32 minor;
1001}; 1107};
diff --git a/tools/include/uapi/linux/bpf_common.h b/tools/include/uapi/linux/bpf_common.h
index 18be90725ab0..ee97668bdadb 100644
--- a/tools/include/uapi/linux/bpf_common.h
+++ b/tools/include/uapi/linux/bpf_common.h
@@ -15,9 +15,10 @@
15 15
16/* ld/ldx fields */ 16/* ld/ldx fields */
17#define BPF_SIZE(code) ((code) & 0x18) 17#define BPF_SIZE(code) ((code) & 0x18)
18#define BPF_W 0x00 18#define BPF_W 0x00 /* 32-bit */
19#define BPF_H 0x08 19#define BPF_H 0x08 /* 16-bit */
20#define BPF_B 0x10 20#define BPF_B 0x10 /* 8-bit */
21/* eBPF BPF_DW 0x18 64-bit */
21#define BPF_MODE(code) ((code) & 0xe0) 22#define BPF_MODE(code) ((code) & 0xe0)
22#define BPF_IMM 0x00 23#define BPF_IMM 0x00
23#define BPF_ABS 0x20 24#define BPF_ABS 0x20
diff --git a/tools/include/uapi/linux/if_link.h b/tools/include/uapi/linux/if_link.h
new file mode 100644
index 000000000000..6d9447700e18
--- /dev/null
+++ b/tools/include/uapi/linux/if_link.h
@@ -0,0 +1,944 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UAPI_LINUX_IF_LINK_H
3#define _UAPI_LINUX_IF_LINK_H
4
5#include <linux/types.h>
6#include <linux/netlink.h>
7
8/* This struct should be in sync with struct rtnl_link_stats64 */
9struct rtnl_link_stats {
10 __u32 rx_packets; /* total packets received */
11 __u32 tx_packets; /* total packets transmitted */
12 __u32 rx_bytes; /* total bytes received */
13 __u32 tx_bytes; /* total bytes transmitted */
14 __u32 rx_errors; /* bad packets received */
15 __u32 tx_errors; /* packet transmit problems */
16 __u32 rx_dropped; /* no space in linux buffers */
17 __u32 tx_dropped; /* no space available in linux */
18 __u32 multicast; /* multicast packets received */
19 __u32 collisions;
20
21 /* detailed rx_errors: */
22 __u32 rx_length_errors;
23 __u32 rx_over_errors; /* receiver ring buff overflow */
24 __u32 rx_crc_errors; /* recved pkt with crc error */
25 __u32 rx_frame_errors; /* recv'd frame alignment error */
26 __u32 rx_fifo_errors; /* recv'r fifo overrun */
27 __u32 rx_missed_errors; /* receiver missed packet */
28
29 /* detailed tx_errors */
30 __u32 tx_aborted_errors;
31 __u32 tx_carrier_errors;
32 __u32 tx_fifo_errors;
33 __u32 tx_heartbeat_errors;
34 __u32 tx_window_errors;
35
36 /* for cslip etc */
37 __u32 rx_compressed;
38 __u32 tx_compressed;
39
40 __u32 rx_nohandler; /* dropped, no handler found */
41};
42
43/* The main device statistics structure */
44struct rtnl_link_stats64 {
45 __u64 rx_packets; /* total packets received */
46 __u64 tx_packets; /* total packets transmitted */
47 __u64 rx_bytes; /* total bytes received */
48 __u64 tx_bytes; /* total bytes transmitted */
49 __u64 rx_errors; /* bad packets received */
50 __u64 tx_errors; /* packet transmit problems */
51 __u64 rx_dropped; /* no space in linux buffers */
52 __u64 tx_dropped; /* no space available in linux */
53 __u64 multicast; /* multicast packets received */
54 __u64 collisions;
55
56 /* detailed rx_errors: */
57 __u64 rx_length_errors;
58 __u64 rx_over_errors; /* receiver ring buff overflow */
59 __u64 rx_crc_errors; /* recved pkt with crc error */
60 __u64 rx_frame_errors; /* recv'd frame alignment error */
61 __u64 rx_fifo_errors; /* recv'r fifo overrun */
62 __u64 rx_missed_errors; /* receiver missed packet */
63
64 /* detailed tx_errors */
65 __u64 tx_aborted_errors;
66 __u64 tx_carrier_errors;
67 __u64 tx_fifo_errors;
68 __u64 tx_heartbeat_errors;
69 __u64 tx_window_errors;
70
71 /* for cslip etc */
72 __u64 rx_compressed;
73 __u64 tx_compressed;
74
75 __u64 rx_nohandler; /* dropped, no handler found */
76};
77
78/* The struct should be in sync with struct ifmap */
79struct rtnl_link_ifmap {
80 __u64 mem_start;
81 __u64 mem_end;
82 __u64 base_addr;
83 __u16 irq;
84 __u8 dma;
85 __u8 port;
86};
87
88/*
89 * IFLA_AF_SPEC
90 * Contains nested attributes for address family specific attributes.
91 * Each address family may create a attribute with the address family
92 * number as type and create its own attribute structure in it.
93 *
94 * Example:
95 * [IFLA_AF_SPEC] = {
96 * [AF_INET] = {
97 * [IFLA_INET_CONF] = ...,
98 * },
99 * [AF_INET6] = {
100 * [IFLA_INET6_FLAGS] = ...,
101 * [IFLA_INET6_CONF] = ...,
102 * }
103 * }
104 */
105
106enum {
107 IFLA_UNSPEC,
108 IFLA_ADDRESS,
109 IFLA_BROADCAST,
110 IFLA_IFNAME,
111 IFLA_MTU,
112 IFLA_LINK,
113 IFLA_QDISC,
114 IFLA_STATS,
115 IFLA_COST,
116#define IFLA_COST IFLA_COST
117 IFLA_PRIORITY,
118#define IFLA_PRIORITY IFLA_PRIORITY
119 IFLA_MASTER,
120#define IFLA_MASTER IFLA_MASTER
121 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
122#define IFLA_WIRELESS IFLA_WIRELESS
123 IFLA_PROTINFO, /* Protocol specific information for a link */
124#define IFLA_PROTINFO IFLA_PROTINFO
125 IFLA_TXQLEN,
126#define IFLA_TXQLEN IFLA_TXQLEN
127 IFLA_MAP,
128#define IFLA_MAP IFLA_MAP
129 IFLA_WEIGHT,
130#define IFLA_WEIGHT IFLA_WEIGHT
131 IFLA_OPERSTATE,
132 IFLA_LINKMODE,
133 IFLA_LINKINFO,
134#define IFLA_LINKINFO IFLA_LINKINFO
135 IFLA_NET_NS_PID,
136 IFLA_IFALIAS,
137 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
138 IFLA_VFINFO_LIST,
139 IFLA_STATS64,
140 IFLA_VF_PORTS,
141 IFLA_PORT_SELF,
142 IFLA_AF_SPEC,
143 IFLA_GROUP, /* Group the device belongs to */
144 IFLA_NET_NS_FD,
145 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
146 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
147#define IFLA_PROMISCUITY IFLA_PROMISCUITY
148 IFLA_NUM_TX_QUEUES,
149 IFLA_NUM_RX_QUEUES,
150 IFLA_CARRIER,
151 IFLA_PHYS_PORT_ID,
152 IFLA_CARRIER_CHANGES,
153 IFLA_PHYS_SWITCH_ID,
154 IFLA_LINK_NETNSID,
155 IFLA_PHYS_PORT_NAME,
156 IFLA_PROTO_DOWN,
157 IFLA_GSO_MAX_SEGS,
158 IFLA_GSO_MAX_SIZE,
159 IFLA_PAD,
160 IFLA_XDP,
161 IFLA_EVENT,
162 IFLA_NEW_NETNSID,
163 IFLA_IF_NETNSID,
164 IFLA_CARRIER_UP_COUNT,
165 IFLA_CARRIER_DOWN_COUNT,
166 IFLA_NEW_IFINDEX,
167 __IFLA_MAX
168};
169
170
171#define IFLA_MAX (__IFLA_MAX - 1)
172
173/* backwards compatibility for userspace */
174#ifndef __KERNEL__
175#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
176#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
177#endif
178
179enum {
180 IFLA_INET_UNSPEC,
181 IFLA_INET_CONF,
182 __IFLA_INET_MAX,
183};
184
185#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
186
187/* ifi_flags.
188
189 IFF_* flags.
190
191 The only change is:
192 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
193 more not changeable by user. They describe link media
194 characteristics and set by device driver.
195
196 Comments:
197 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
198 - If neither of these three flags are set;
199 the interface is NBMA.
200
201 - IFF_MULTICAST does not mean anything special:
202 multicasts can be used on all not-NBMA links.
203 IFF_MULTICAST means that this media uses special encapsulation
204 for multicast frames. Apparently, all IFF_POINTOPOINT and
205 IFF_BROADCAST devices are able to use multicasts too.
206 */
207
208/* IFLA_LINK.
209 For usual devices it is equal ifi_index.
210 If it is a "virtual interface" (f.e. tunnel), ifi_link
211 can point to real physical interface (f.e. for bandwidth calculations),
212 or maybe 0, what means, that real media is unknown (usual
213 for IPIP tunnels, when route to endpoint is allowed to change)
214 */
215
216/* Subtype attributes for IFLA_PROTINFO */
217enum {
218 IFLA_INET6_UNSPEC,
219 IFLA_INET6_FLAGS, /* link flags */
220 IFLA_INET6_CONF, /* sysctl parameters */
221 IFLA_INET6_STATS, /* statistics */
222 IFLA_INET6_MCAST, /* MC things. What of them? */
223 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
224 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
225 IFLA_INET6_TOKEN, /* device token */
226 IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
227 __IFLA_INET6_MAX
228};
229
230#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
231
232enum in6_addr_gen_mode {
233 IN6_ADDR_GEN_MODE_EUI64,
234 IN6_ADDR_GEN_MODE_NONE,
235 IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
236 IN6_ADDR_GEN_MODE_RANDOM,
237};
238
239/* Bridge section */
240
241enum {
242 IFLA_BR_UNSPEC,
243 IFLA_BR_FORWARD_DELAY,
244 IFLA_BR_HELLO_TIME,
245 IFLA_BR_MAX_AGE,
246 IFLA_BR_AGEING_TIME,
247 IFLA_BR_STP_STATE,
248 IFLA_BR_PRIORITY,
249 IFLA_BR_VLAN_FILTERING,
250 IFLA_BR_VLAN_PROTOCOL,
251 IFLA_BR_GROUP_FWD_MASK,
252 IFLA_BR_ROOT_ID,
253 IFLA_BR_BRIDGE_ID,
254 IFLA_BR_ROOT_PORT,
255 IFLA_BR_ROOT_PATH_COST,
256 IFLA_BR_TOPOLOGY_CHANGE,
257 IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
258 IFLA_BR_HELLO_TIMER,
259 IFLA_BR_TCN_TIMER,
260 IFLA_BR_TOPOLOGY_CHANGE_TIMER,
261 IFLA_BR_GC_TIMER,
262 IFLA_BR_GROUP_ADDR,
263 IFLA_BR_FDB_FLUSH,
264 IFLA_BR_MCAST_ROUTER,
265 IFLA_BR_MCAST_SNOOPING,
266 IFLA_BR_MCAST_QUERY_USE_IFADDR,
267 IFLA_BR_MCAST_QUERIER,
268 IFLA_BR_MCAST_HASH_ELASTICITY,
269 IFLA_BR_MCAST_HASH_MAX,
270 IFLA_BR_MCAST_LAST_MEMBER_CNT,
271 IFLA_BR_MCAST_STARTUP_QUERY_CNT,
272 IFLA_BR_MCAST_LAST_MEMBER_INTVL,
273 IFLA_BR_MCAST_MEMBERSHIP_INTVL,
274 IFLA_BR_MCAST_QUERIER_INTVL,
275 IFLA_BR_MCAST_QUERY_INTVL,
276 IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
277 IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
278 IFLA_BR_NF_CALL_IPTABLES,
279 IFLA_BR_NF_CALL_IP6TABLES,
280 IFLA_BR_NF_CALL_ARPTABLES,
281 IFLA_BR_VLAN_DEFAULT_PVID,
282 IFLA_BR_PAD,
283 IFLA_BR_VLAN_STATS_ENABLED,
284 IFLA_BR_MCAST_STATS_ENABLED,
285 IFLA_BR_MCAST_IGMP_VERSION,
286 IFLA_BR_MCAST_MLD_VERSION,
287 __IFLA_BR_MAX,
288};
289
290#define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
291
292struct ifla_bridge_id {
293 __u8 prio[2];
294 __u8 addr[6]; /* ETH_ALEN */
295};
296
297enum {
298 BRIDGE_MODE_UNSPEC,
299 BRIDGE_MODE_HAIRPIN,
300};
301
302enum {
303 IFLA_BRPORT_UNSPEC,
304 IFLA_BRPORT_STATE, /* Spanning tree state */
305 IFLA_BRPORT_PRIORITY, /* " priority */
306 IFLA_BRPORT_COST, /* " cost */
307 IFLA_BRPORT_MODE, /* mode (hairpin) */
308 IFLA_BRPORT_GUARD, /* bpdu guard */
309 IFLA_BRPORT_PROTECT, /* root port protection */
310 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
311 IFLA_BRPORT_LEARNING, /* mac learning */
312 IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
313 IFLA_BRPORT_PROXYARP, /* proxy ARP */
314 IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
315 IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
316 IFLA_BRPORT_ROOT_ID, /* designated root */
317 IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
318 IFLA_BRPORT_DESIGNATED_PORT,
319 IFLA_BRPORT_DESIGNATED_COST,
320 IFLA_BRPORT_ID,
321 IFLA_BRPORT_NO,
322 IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
323 IFLA_BRPORT_CONFIG_PENDING,
324 IFLA_BRPORT_MESSAGE_AGE_TIMER,
325 IFLA_BRPORT_FORWARD_DELAY_TIMER,
326 IFLA_BRPORT_HOLD_TIMER,
327 IFLA_BRPORT_FLUSH,
328 IFLA_BRPORT_MULTICAST_ROUTER,
329 IFLA_BRPORT_PAD,
330 IFLA_BRPORT_MCAST_FLOOD,
331 IFLA_BRPORT_MCAST_TO_UCAST,
332 IFLA_BRPORT_VLAN_TUNNEL,
333 IFLA_BRPORT_BCAST_FLOOD,
334 IFLA_BRPORT_GROUP_FWD_MASK,
335 IFLA_BRPORT_NEIGH_SUPPRESS,
336 __IFLA_BRPORT_MAX
337};
338#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
339
340struct ifla_cacheinfo {
341 __u32 max_reasm_len;
342 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
343 __u32 reachable_time;
344 __u32 retrans_time;
345};
346
347enum {
348 IFLA_INFO_UNSPEC,
349 IFLA_INFO_KIND,
350 IFLA_INFO_DATA,
351 IFLA_INFO_XSTATS,
352 IFLA_INFO_SLAVE_KIND,
353 IFLA_INFO_SLAVE_DATA,
354 __IFLA_INFO_MAX,
355};
356
357#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
358
359/* VLAN section */
360
361enum {
362 IFLA_VLAN_UNSPEC,
363 IFLA_VLAN_ID,
364 IFLA_VLAN_FLAGS,
365 IFLA_VLAN_EGRESS_QOS,
366 IFLA_VLAN_INGRESS_QOS,
367 IFLA_VLAN_PROTOCOL,
368 __IFLA_VLAN_MAX,
369};
370
371#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
372
373struct ifla_vlan_flags {
374 __u32 flags;
375 __u32 mask;
376};
377
378enum {
379 IFLA_VLAN_QOS_UNSPEC,
380 IFLA_VLAN_QOS_MAPPING,
381 __IFLA_VLAN_QOS_MAX
382};
383
384#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
385
386struct ifla_vlan_qos_mapping {
387 __u32 from;
388 __u32 to;
389};
390
391/* MACVLAN section */
392enum {
393 IFLA_MACVLAN_UNSPEC,
394 IFLA_MACVLAN_MODE,
395 IFLA_MACVLAN_FLAGS,
396 IFLA_MACVLAN_MACADDR_MODE,
397 IFLA_MACVLAN_MACADDR,
398 IFLA_MACVLAN_MACADDR_DATA,
399 IFLA_MACVLAN_MACADDR_COUNT,
400 __IFLA_MACVLAN_MAX,
401};
402
403#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
404
405enum macvlan_mode {
406 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
407 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
408 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
409 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
410 MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
411};
412
413enum macvlan_macaddr_mode {
414 MACVLAN_MACADDR_ADD,
415 MACVLAN_MACADDR_DEL,
416 MACVLAN_MACADDR_FLUSH,
417 MACVLAN_MACADDR_SET,
418};
419
420#define MACVLAN_FLAG_NOPROMISC 1
421
422/* VRF section */
423enum {
424 IFLA_VRF_UNSPEC,
425 IFLA_VRF_TABLE,
426 __IFLA_VRF_MAX
427};
428
429#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
430
431enum {
432 IFLA_VRF_PORT_UNSPEC,
433 IFLA_VRF_PORT_TABLE,
434 __IFLA_VRF_PORT_MAX
435};
436
437#define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
438
439/* MACSEC section */
440enum {
441 IFLA_MACSEC_UNSPEC,
442 IFLA_MACSEC_SCI,
443 IFLA_MACSEC_PORT,
444 IFLA_MACSEC_ICV_LEN,
445 IFLA_MACSEC_CIPHER_SUITE,
446 IFLA_MACSEC_WINDOW,
447 IFLA_MACSEC_ENCODING_SA,
448 IFLA_MACSEC_ENCRYPT,
449 IFLA_MACSEC_PROTECT,
450 IFLA_MACSEC_INC_SCI,
451 IFLA_MACSEC_ES,
452 IFLA_MACSEC_SCB,
453 IFLA_MACSEC_REPLAY_PROTECT,
454 IFLA_MACSEC_VALIDATION,
455 IFLA_MACSEC_PAD,
456 __IFLA_MACSEC_MAX,
457};
458
459#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
460
461enum macsec_validation_type {
462 MACSEC_VALIDATE_DISABLED = 0,
463 MACSEC_VALIDATE_CHECK = 1,
464 MACSEC_VALIDATE_STRICT = 2,
465 __MACSEC_VALIDATE_END,
466 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
467};
468
469/* IPVLAN section */
470enum {
471 IFLA_IPVLAN_UNSPEC,
472 IFLA_IPVLAN_MODE,
473 IFLA_IPVLAN_FLAGS,
474 __IFLA_IPVLAN_MAX
475};
476
477#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
478
479enum ipvlan_mode {
480 IPVLAN_MODE_L2 = 0,
481 IPVLAN_MODE_L3,
482 IPVLAN_MODE_L3S,
483 IPVLAN_MODE_MAX
484};
485
486#define IPVLAN_F_PRIVATE 0x01
487#define IPVLAN_F_VEPA 0x02
488
489/* VXLAN section */
490enum {
491 IFLA_VXLAN_UNSPEC,
492 IFLA_VXLAN_ID,
493 IFLA_VXLAN_GROUP, /* group or remote address */
494 IFLA_VXLAN_LINK,
495 IFLA_VXLAN_LOCAL,
496 IFLA_VXLAN_TTL,
497 IFLA_VXLAN_TOS,
498 IFLA_VXLAN_LEARNING,
499 IFLA_VXLAN_AGEING,
500 IFLA_VXLAN_LIMIT,
501 IFLA_VXLAN_PORT_RANGE, /* source port */
502 IFLA_VXLAN_PROXY,
503 IFLA_VXLAN_RSC,
504 IFLA_VXLAN_L2MISS,
505 IFLA_VXLAN_L3MISS,
506 IFLA_VXLAN_PORT, /* destination port */
507 IFLA_VXLAN_GROUP6,
508 IFLA_VXLAN_LOCAL6,
509 IFLA_VXLAN_UDP_CSUM,
510 IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
511 IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
512 IFLA_VXLAN_REMCSUM_TX,
513 IFLA_VXLAN_REMCSUM_RX,
514 IFLA_VXLAN_GBP,
515 IFLA_VXLAN_REMCSUM_NOPARTIAL,
516 IFLA_VXLAN_COLLECT_METADATA,
517 IFLA_VXLAN_LABEL,
518 IFLA_VXLAN_GPE,
519 __IFLA_VXLAN_MAX
520};
521#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
522
523struct ifla_vxlan_port_range {
524 __be16 low;
525 __be16 high;
526};
527
528/* GENEVE section */
529enum {
530 IFLA_GENEVE_UNSPEC,
531 IFLA_GENEVE_ID,
532 IFLA_GENEVE_REMOTE,
533 IFLA_GENEVE_TTL,
534 IFLA_GENEVE_TOS,
535 IFLA_GENEVE_PORT, /* destination port */
536 IFLA_GENEVE_COLLECT_METADATA,
537 IFLA_GENEVE_REMOTE6,
538 IFLA_GENEVE_UDP_CSUM,
539 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
540 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
541 IFLA_GENEVE_LABEL,
542 __IFLA_GENEVE_MAX
543};
544#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
545
546/* PPP section */
547enum {
548 IFLA_PPP_UNSPEC,
549 IFLA_PPP_DEV_FD,
550 __IFLA_PPP_MAX
551};
552#define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
553
554/* GTP section */
555
556enum ifla_gtp_role {
557 GTP_ROLE_GGSN = 0,
558 GTP_ROLE_SGSN,
559};
560
561enum {
562 IFLA_GTP_UNSPEC,
563 IFLA_GTP_FD0,
564 IFLA_GTP_FD1,
565 IFLA_GTP_PDP_HASHSIZE,
566 IFLA_GTP_ROLE,
567 __IFLA_GTP_MAX,
568};
569#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
570
571/* Bonding section */
572
573enum {
574 IFLA_BOND_UNSPEC,
575 IFLA_BOND_MODE,
576 IFLA_BOND_ACTIVE_SLAVE,
577 IFLA_BOND_MIIMON,
578 IFLA_BOND_UPDELAY,
579 IFLA_BOND_DOWNDELAY,
580 IFLA_BOND_USE_CARRIER,
581 IFLA_BOND_ARP_INTERVAL,
582 IFLA_BOND_ARP_IP_TARGET,
583 IFLA_BOND_ARP_VALIDATE,
584 IFLA_BOND_ARP_ALL_TARGETS,
585 IFLA_BOND_PRIMARY,
586 IFLA_BOND_PRIMARY_RESELECT,
587 IFLA_BOND_FAIL_OVER_MAC,
588 IFLA_BOND_XMIT_HASH_POLICY,
589 IFLA_BOND_RESEND_IGMP,
590 IFLA_BOND_NUM_PEER_NOTIF,
591 IFLA_BOND_ALL_SLAVES_ACTIVE,
592 IFLA_BOND_MIN_LINKS,
593 IFLA_BOND_LP_INTERVAL,
594 IFLA_BOND_PACKETS_PER_SLAVE,
595 IFLA_BOND_AD_LACP_RATE,
596 IFLA_BOND_AD_SELECT,
597 IFLA_BOND_AD_INFO,
598 IFLA_BOND_AD_ACTOR_SYS_PRIO,
599 IFLA_BOND_AD_USER_PORT_KEY,
600 IFLA_BOND_AD_ACTOR_SYSTEM,
601 IFLA_BOND_TLB_DYNAMIC_LB,
602 __IFLA_BOND_MAX,
603};
604
605#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
606
607enum {
608 IFLA_BOND_AD_INFO_UNSPEC,
609 IFLA_BOND_AD_INFO_AGGREGATOR,
610 IFLA_BOND_AD_INFO_NUM_PORTS,
611 IFLA_BOND_AD_INFO_ACTOR_KEY,
612 IFLA_BOND_AD_INFO_PARTNER_KEY,
613 IFLA_BOND_AD_INFO_PARTNER_MAC,
614 __IFLA_BOND_AD_INFO_MAX,
615};
616
617#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
618
619enum {
620 IFLA_BOND_SLAVE_UNSPEC,
621 IFLA_BOND_SLAVE_STATE,
622 IFLA_BOND_SLAVE_MII_STATUS,
623 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
624 IFLA_BOND_SLAVE_PERM_HWADDR,
625 IFLA_BOND_SLAVE_QUEUE_ID,
626 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
627 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
628 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
629 __IFLA_BOND_SLAVE_MAX,
630};
631
632#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
633
634/* SR-IOV virtual function management section */
635
636enum {
637 IFLA_VF_INFO_UNSPEC,
638 IFLA_VF_INFO,
639 __IFLA_VF_INFO_MAX,
640};
641
642#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
643
644enum {
645 IFLA_VF_UNSPEC,
646 IFLA_VF_MAC, /* Hardware queue specific attributes */
647 IFLA_VF_VLAN, /* VLAN ID and QoS */
648 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
649 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
650 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
651 IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
652 IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
653 * on/off switch
654 */
655 IFLA_VF_STATS, /* network device statistics */
656 IFLA_VF_TRUST, /* Trust VF */
657 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
658 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
659 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
660 __IFLA_VF_MAX,
661};
662
663#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
664
665struct ifla_vf_mac {
666 __u32 vf;
667 __u8 mac[32]; /* MAX_ADDR_LEN */
668};
669
670struct ifla_vf_vlan {
671 __u32 vf;
672 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
673 __u32 qos;
674};
675
676enum {
677 IFLA_VF_VLAN_INFO_UNSPEC,
678 IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
679 __IFLA_VF_VLAN_INFO_MAX,
680};
681
682#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
683#define MAX_VLAN_LIST_LEN 1
684
685struct ifla_vf_vlan_info {
686 __u32 vf;
687 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
688 __u32 qos;
689 __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
690};
691
692struct ifla_vf_tx_rate {
693 __u32 vf;
694 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
695};
696
697struct ifla_vf_rate {
698 __u32 vf;
699 __u32 min_tx_rate; /* Min Bandwidth in Mbps */
700 __u32 max_tx_rate; /* Max Bandwidth in Mbps */
701};
702
703struct ifla_vf_spoofchk {
704 __u32 vf;
705 __u32 setting;
706};
707
708struct ifla_vf_guid {
709 __u32 vf;
710 __u64 guid;
711};
712
713enum {
714 IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
715 IFLA_VF_LINK_STATE_ENABLE, /* link always up */
716 IFLA_VF_LINK_STATE_DISABLE, /* link always down */
717 __IFLA_VF_LINK_STATE_MAX,
718};
719
720struct ifla_vf_link_state {
721 __u32 vf;
722 __u32 link_state;
723};
724
725struct ifla_vf_rss_query_en {
726 __u32 vf;
727 __u32 setting;
728};
729
730enum {
731 IFLA_VF_STATS_RX_PACKETS,
732 IFLA_VF_STATS_TX_PACKETS,
733 IFLA_VF_STATS_RX_BYTES,
734 IFLA_VF_STATS_TX_BYTES,
735 IFLA_VF_STATS_BROADCAST,
736 IFLA_VF_STATS_MULTICAST,
737 IFLA_VF_STATS_PAD,
738 IFLA_VF_STATS_RX_DROPPED,
739 IFLA_VF_STATS_TX_DROPPED,
740 __IFLA_VF_STATS_MAX,
741};
742
743#define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
744
745struct ifla_vf_trust {
746 __u32 vf;
747 __u32 setting;
748};
749
750/* VF ports management section
751 *
752 * Nested layout of set/get msg is:
753 *
754 * [IFLA_NUM_VF]
755 * [IFLA_VF_PORTS]
756 * [IFLA_VF_PORT]
757 * [IFLA_PORT_*], ...
758 * [IFLA_VF_PORT]
759 * [IFLA_PORT_*], ...
760 * ...
761 * [IFLA_PORT_SELF]
762 * [IFLA_PORT_*], ...
763 */
764
765enum {
766 IFLA_VF_PORT_UNSPEC,
767 IFLA_VF_PORT, /* nest */
768 __IFLA_VF_PORT_MAX,
769};
770
771#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
772
773enum {
774 IFLA_PORT_UNSPEC,
775 IFLA_PORT_VF, /* __u32 */
776 IFLA_PORT_PROFILE, /* string */
777 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
778 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
779 IFLA_PORT_HOST_UUID, /* binary UUID */
780 IFLA_PORT_REQUEST, /* __u8 */
781 IFLA_PORT_RESPONSE, /* __u16, output only */
782 __IFLA_PORT_MAX,
783};
784
785#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
786
787#define PORT_PROFILE_MAX 40
788#define PORT_UUID_MAX 16
789#define PORT_SELF_VF -1
790
791enum {
792 PORT_REQUEST_PREASSOCIATE = 0,
793 PORT_REQUEST_PREASSOCIATE_RR,
794 PORT_REQUEST_ASSOCIATE,
795 PORT_REQUEST_DISASSOCIATE,
796};
797
798enum {
799 PORT_VDP_RESPONSE_SUCCESS = 0,
800 PORT_VDP_RESPONSE_INVALID_FORMAT,
801 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
802 PORT_VDP_RESPONSE_UNUSED_VTID,
803 PORT_VDP_RESPONSE_VTID_VIOLATION,
804 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
805 PORT_VDP_RESPONSE_OUT_OF_SYNC,
806 /* 0x08-0xFF reserved for future VDP use */
807 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
808 PORT_PROFILE_RESPONSE_INPROGRESS,
809 PORT_PROFILE_RESPONSE_INVALID,
810 PORT_PROFILE_RESPONSE_BADSTATE,
811 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
812 PORT_PROFILE_RESPONSE_ERROR,
813};
814
815struct ifla_port_vsi {
816 __u8 vsi_mgr_id;
817 __u8 vsi_type_id[3];
818 __u8 vsi_type_version;
819 __u8 pad[3];
820};
821
822
823/* IPoIB section */
824
825enum {
826 IFLA_IPOIB_UNSPEC,
827 IFLA_IPOIB_PKEY,
828 IFLA_IPOIB_MODE,
829 IFLA_IPOIB_UMCAST,
830 __IFLA_IPOIB_MAX
831};
832
833enum {
834 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
835 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
836};
837
838#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
839
840
841/* HSR section */
842
843enum {
844 IFLA_HSR_UNSPEC,
845 IFLA_HSR_SLAVE1,
846 IFLA_HSR_SLAVE2,
847 IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
848 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
849 IFLA_HSR_SEQ_NR,
850 IFLA_HSR_VERSION, /* HSR version */
851 __IFLA_HSR_MAX,
852};
853
854#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
855
856/* STATS section */
857
858struct if_stats_msg {
859 __u8 family;
860 __u8 pad1;
861 __u16 pad2;
862 __u32 ifindex;
863 __u32 filter_mask;
864};
865
866/* A stats attribute can be netdev specific or a global stat.
867 * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
868 */
869enum {
870 IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
871 IFLA_STATS_LINK_64,
872 IFLA_STATS_LINK_XSTATS,
873 IFLA_STATS_LINK_XSTATS_SLAVE,
874 IFLA_STATS_LINK_OFFLOAD_XSTATS,
875 IFLA_STATS_AF_SPEC,
876 __IFLA_STATS_MAX,
877};
878
879#define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
880
881#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
882
883/* These are embedded into IFLA_STATS_LINK_XSTATS:
884 * [IFLA_STATS_LINK_XSTATS]
885 * -> [LINK_XSTATS_TYPE_xxx]
886 * -> [rtnl link type specific attributes]
887 */
888enum {
889 LINK_XSTATS_TYPE_UNSPEC,
890 LINK_XSTATS_TYPE_BRIDGE,
891 __LINK_XSTATS_TYPE_MAX
892};
893#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
894
895/* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
896enum {
897 IFLA_OFFLOAD_XSTATS_UNSPEC,
898 IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
899 __IFLA_OFFLOAD_XSTATS_MAX
900};
901#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
902
903/* XDP section */
904
905#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
906#define XDP_FLAGS_SKB_MODE (1U << 1)
907#define XDP_FLAGS_DRV_MODE (1U << 2)
908#define XDP_FLAGS_HW_MODE (1U << 3)
909#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
910 XDP_FLAGS_DRV_MODE | \
911 XDP_FLAGS_HW_MODE)
912#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
913 XDP_FLAGS_MODES)
914
915/* These are stored into IFLA_XDP_ATTACHED on dump. */
916enum {
917 XDP_ATTACHED_NONE = 0,
918 XDP_ATTACHED_DRV,
919 XDP_ATTACHED_SKB,
920 XDP_ATTACHED_HW,
921};
922
923enum {
924 IFLA_XDP_UNSPEC,
925 IFLA_XDP_FD,
926 IFLA_XDP_ATTACHED,
927 IFLA_XDP_FLAGS,
928 IFLA_XDP_PROG_ID,
929 __IFLA_XDP_MAX,
930};
931
932#define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
933
934enum {
935 IFLA_EVENT_NONE,
936 IFLA_EVENT_REBOOT, /* internal reset / reboot */
937 IFLA_EVENT_FEATURES, /* change in offload features */
938 IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
939 IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
940 IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
941 IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
942};
943
944#endif /* _UAPI_LINUX_IF_LINK_H */
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 8fb90a0819c3..0fb5ef939732 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -1362,6 +1362,96 @@ struct kvm_s390_ucas_mapping {
1362/* Available with KVM_CAP_S390_CMMA_MIGRATION */ 1362/* Available with KVM_CAP_S390_CMMA_MIGRATION */
1363#define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log) 1363#define KVM_S390_GET_CMMA_BITS _IOWR(KVMIO, 0xb8, struct kvm_s390_cmma_log)
1364#define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log) 1364#define KVM_S390_SET_CMMA_BITS _IOW(KVMIO, 0xb9, struct kvm_s390_cmma_log)
1365/* Memory Encryption Commands */
1366#define KVM_MEMORY_ENCRYPT_OP _IOWR(KVMIO, 0xba, unsigned long)
1367
1368struct kvm_enc_region {
1369 __u64 addr;
1370 __u64 size;
1371};
1372
1373#define KVM_MEMORY_ENCRYPT_REG_REGION _IOR(KVMIO, 0xbb, struct kvm_enc_region)
1374#define KVM_MEMORY_ENCRYPT_UNREG_REGION _IOR(KVMIO, 0xbc, struct kvm_enc_region)
1375
1376/* Secure Encrypted Virtualization command */
1377enum sev_cmd_id {
1378 /* Guest initialization commands */
1379 KVM_SEV_INIT = 0,
1380 KVM_SEV_ES_INIT,
1381 /* Guest launch commands */
1382 KVM_SEV_LAUNCH_START,
1383 KVM_SEV_LAUNCH_UPDATE_DATA,
1384 KVM_SEV_LAUNCH_UPDATE_VMSA,
1385 KVM_SEV_LAUNCH_SECRET,
1386 KVM_SEV_LAUNCH_MEASURE,
1387 KVM_SEV_LAUNCH_FINISH,
1388 /* Guest migration commands (outgoing) */
1389 KVM_SEV_SEND_START,
1390 KVM_SEV_SEND_UPDATE_DATA,
1391 KVM_SEV_SEND_UPDATE_VMSA,
1392 KVM_SEV_SEND_FINISH,
1393 /* Guest migration commands (incoming) */
1394 KVM_SEV_RECEIVE_START,
1395 KVM_SEV_RECEIVE_UPDATE_DATA,
1396 KVM_SEV_RECEIVE_UPDATE_VMSA,
1397 KVM_SEV_RECEIVE_FINISH,
1398 /* Guest status and debug commands */
1399 KVM_SEV_GUEST_STATUS,
1400 KVM_SEV_DBG_DECRYPT,
1401 KVM_SEV_DBG_ENCRYPT,
1402 /* Guest certificates commands */
1403 KVM_SEV_CERT_EXPORT,
1404
1405 KVM_SEV_NR_MAX,
1406};
1407
1408struct kvm_sev_cmd {
1409 __u32 id;
1410 __u64 data;
1411 __u32 error;
1412 __u32 sev_fd;
1413};
1414
1415struct kvm_sev_launch_start {
1416 __u32 handle;
1417 __u32 policy;
1418 __u64 dh_uaddr;
1419 __u32 dh_len;
1420 __u64 session_uaddr;
1421 __u32 session_len;
1422};
1423
1424struct kvm_sev_launch_update_data {
1425 __u64 uaddr;
1426 __u32 len;
1427};
1428
1429
1430struct kvm_sev_launch_secret {
1431 __u64 hdr_uaddr;
1432 __u32 hdr_len;
1433 __u64 guest_uaddr;
1434 __u32 guest_len;
1435 __u64 trans_uaddr;
1436 __u32 trans_len;
1437};
1438
1439struct kvm_sev_launch_measure {
1440 __u64 uaddr;
1441 __u32 len;
1442};
1443
1444struct kvm_sev_guest_status {
1445 __u32 handle;
1446 __u32 policy;
1447 __u32 state;
1448};
1449
1450struct kvm_sev_dbg {
1451 __u64 src_uaddr;
1452 __u64 dst_uaddr;
1453 __u32 len;
1454};
1365 1455
1366#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 1456#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1367#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) 1457#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
diff --git a/tools/include/uapi/linux/netlink.h b/tools/include/uapi/linux/netlink.h
new file mode 100644
index 000000000000..776bc92e9118
--- /dev/null
+++ b/tools/include/uapi/linux/netlink.h
@@ -0,0 +1,251 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _UAPI__LINUX_NETLINK_H
3#define _UAPI__LINUX_NETLINK_H
4
5#include <linux/kernel.h>
6#include <linux/socket.h> /* for __kernel_sa_family_t */
7#include <linux/types.h>
8
9#define NETLINK_ROUTE 0 /* Routing/device hook */
10#define NETLINK_UNUSED 1 /* Unused number */
11#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
12#define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */
13#define NETLINK_SOCK_DIAG 4 /* socket monitoring */
14#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
15#define NETLINK_XFRM 6 /* ipsec */
16#define NETLINK_SELINUX 7 /* SELinux event notifications */
17#define NETLINK_ISCSI 8 /* Open-iSCSI */
18#define NETLINK_AUDIT 9 /* auditing */
19#define NETLINK_FIB_LOOKUP 10
20#define NETLINK_CONNECTOR 11
21#define NETLINK_NETFILTER 12 /* netfilter subsystem */
22#define NETLINK_IP6_FW 13
23#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
24#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
25#define NETLINK_GENERIC 16
26/* leave room for NETLINK_DM (DM Events) */
27#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
28#define NETLINK_ECRYPTFS 19
29#define NETLINK_RDMA 20
30#define NETLINK_CRYPTO 21 /* Crypto layer */
31#define NETLINK_SMC 22 /* SMC monitoring */
32
33#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
34
35#define MAX_LINKS 32
36
37struct sockaddr_nl {
38 __kernel_sa_family_t nl_family; /* AF_NETLINK */
39 unsigned short nl_pad; /* zero */
40 __u32 nl_pid; /* port ID */
41 __u32 nl_groups; /* multicast groups mask */
42};
43
44struct nlmsghdr {
45 __u32 nlmsg_len; /* Length of message including header */
46 __u16 nlmsg_type; /* Message content */
47 __u16 nlmsg_flags; /* Additional flags */
48 __u32 nlmsg_seq; /* Sequence number */
49 __u32 nlmsg_pid; /* Sending process port ID */
50};
51
52/* Flags values */
53
54#define NLM_F_REQUEST 0x01 /* It is request message. */
55#define NLM_F_MULTI 0x02 /* Multipart message, terminated by NLMSG_DONE */
56#define NLM_F_ACK 0x04 /* Reply with ack, with zero or error code */
57#define NLM_F_ECHO 0x08 /* Echo this request */
58#define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */
59#define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */
60
61/* Modifiers to GET request */
62#define NLM_F_ROOT 0x100 /* specify tree root */
63#define NLM_F_MATCH 0x200 /* return all matching */
64#define NLM_F_ATOMIC 0x400 /* atomic GET */
65#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
66
67/* Modifiers to NEW request */
68#define NLM_F_REPLACE 0x100 /* Override existing */
69#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
70#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
71#define NLM_F_APPEND 0x800 /* Add to end of list */
72
73/* Modifiers to DELETE request */
74#define NLM_F_NONREC 0x100 /* Do not delete recursively */
75
76/* Flags for ACK message */
77#define NLM_F_CAPPED 0x100 /* request was capped */
78#define NLM_F_ACK_TLVS 0x200 /* extended ACK TVLs were included */
79
80/*
81 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL
82 4.4BSD CHANGE NLM_F_REPLACE
83
84 True CHANGE NLM_F_CREATE|NLM_F_REPLACE
85 Append NLM_F_CREATE
86 Check NLM_F_EXCL
87 */
88
89#define NLMSG_ALIGNTO 4U
90#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
91#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
92#define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
93#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
94#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
95#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
97#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
99 (nlh)->nlmsg_len <= (len))
100#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
101
102#define NLMSG_NOOP 0x1 /* Nothing. */
103#define NLMSG_ERROR 0x2 /* Error */
104#define NLMSG_DONE 0x3 /* End of a dump */
105#define NLMSG_OVERRUN 0x4 /* Data lost */
106
107#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
108
109struct nlmsgerr {
110 int error;
111 struct nlmsghdr msg;
112 /*
113 * followed by the message contents unless NETLINK_CAP_ACK was set
114 * or the ACK indicates success (error == 0)
115 * message length is aligned with NLMSG_ALIGN()
116 */
117 /*
118 * followed by TLVs defined in enum nlmsgerr_attrs
119 * if NETLINK_EXT_ACK was set
120 */
121};
122
123/**
124 * enum nlmsgerr_attrs - nlmsgerr attributes
125 * @NLMSGERR_ATTR_UNUSED: unused
126 * @NLMSGERR_ATTR_MSG: error message string (string)
127 * @NLMSGERR_ATTR_OFFS: offset of the invalid attribute in the original
128 * message, counting from the beginning of the header (u32)
129 * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to
130 * be used - in the success case - to identify a created
131 * object or operation or similar (binary)
132 * @__NLMSGERR_ATTR_MAX: number of attributes
133 * @NLMSGERR_ATTR_MAX: highest attribute number
134 */
135enum nlmsgerr_attrs {
136 NLMSGERR_ATTR_UNUSED,
137 NLMSGERR_ATTR_MSG,
138 NLMSGERR_ATTR_OFFS,
139 NLMSGERR_ATTR_COOKIE,
140
141 __NLMSGERR_ATTR_MAX,
142 NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1
143};
144
145#define NETLINK_ADD_MEMBERSHIP 1
146#define NETLINK_DROP_MEMBERSHIP 2
147#define NETLINK_PKTINFO 3
148#define NETLINK_BROADCAST_ERROR 4
149#define NETLINK_NO_ENOBUFS 5
150#ifndef __KERNEL__
151#define NETLINK_RX_RING 6
152#define NETLINK_TX_RING 7
153#endif
154#define NETLINK_LISTEN_ALL_NSID 8
155#define NETLINK_LIST_MEMBERSHIPS 9
156#define NETLINK_CAP_ACK 10
157#define NETLINK_EXT_ACK 11
158
159struct nl_pktinfo {
160 __u32 group;
161};
162
163struct nl_mmap_req {
164 unsigned int nm_block_size;
165 unsigned int nm_block_nr;
166 unsigned int nm_frame_size;
167 unsigned int nm_frame_nr;
168};
169
170struct nl_mmap_hdr {
171 unsigned int nm_status;
172 unsigned int nm_len;
173 __u32 nm_group;
174 /* credentials */
175 __u32 nm_pid;
176 __u32 nm_uid;
177 __u32 nm_gid;
178};
179
180#ifndef __KERNEL__
181enum nl_mmap_status {
182 NL_MMAP_STATUS_UNUSED,
183 NL_MMAP_STATUS_RESERVED,
184 NL_MMAP_STATUS_VALID,
185 NL_MMAP_STATUS_COPY,
186 NL_MMAP_STATUS_SKIP,
187};
188
189#define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
190#define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
191#define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
192#endif
193
194#define NET_MAJOR 36 /* Major 36 is reserved for networking */
195
196enum {
197 NETLINK_UNCONNECTED = 0,
198 NETLINK_CONNECTED,
199};
200
201/*
202 * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
203 * +---------------------+- - -+- - - - - - - - - -+- - -+
204 * | Header | Pad | Payload | Pad |
205 * | (struct nlattr) | ing | | ing |
206 * +---------------------+- - -+- - - - - - - - - -+- - -+
207 * <-------------- nlattr->nla_len -------------->
208 */
209
210struct nlattr {
211 __u16 nla_len;
212 __u16 nla_type;
213};
214
215/*
216 * nla_type (16 bits)
217 * +---+---+-------------------------------+
218 * | N | O | Attribute Type |
219 * +---+---+-------------------------------+
220 * N := Carries nested attributes
221 * O := Payload stored in network byte order
222 *
223 * Note: The N and O flag are mutually exclusive.
224 */
225#define NLA_F_NESTED (1 << 15)
226#define NLA_F_NET_BYTEORDER (1 << 14)
227#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
228
229#define NLA_ALIGNTO 4
230#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
231#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
232
233/* Generic 32 bitflags attribute content sent to the kernel.
234 *
235 * The value is a bitmap that defines the values being set
236 * The selector is a bitmask that defines which value is legit
237 *
238 * Examples:
239 * value = 0x0, and selector = 0x1
240 * implies we are selecting bit 1 and we want to set its value to 0.
241 *
242 * value = 0x2, and selector = 0x2
243 * implies we are selecting bit 2 and we want to set its value to 1.
244 *
245 */
246struct nla_bitfield32 {
247 __u32 value;
248 __u32 selector;
249};
250
251#endif /* _UAPI__LINUX_NETLINK_H */
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index 5d49cfc509e7..6f873503552d 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -422,6 +422,27 @@ struct perf_event_attr {
422 __u16 __reserved_2; /* align to __u64 */ 422 __u16 __reserved_2; /* align to __u64 */
423}; 423};
424 424
425/*
426 * Structure used by below PERF_EVENT_IOC_QUERY_BPF command
427 * to query bpf programs attached to the same perf tracepoint
428 * as the given perf event.
429 */
430struct perf_event_query_bpf {
431 /*
432 * The below ids array length
433 */
434 __u32 ids_len;
435 /*
436 * Set by the kernel to indicate the number of
437 * available programs
438 */
439 __u32 prog_cnt;
440 /*
441 * User provided buffer to store program ids
442 */
443 __u32 ids[0];
444};
445
425#define perf_flags(attr) (*(&(attr)->read_format + 1)) 446#define perf_flags(attr) (*(&(attr)->read_format + 1))
426 447
427/* 448/*
@@ -437,6 +458,7 @@ struct perf_event_attr {
437#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *) 458#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
438#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32) 459#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32)
439#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) 460#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
461#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
440 462
441enum perf_event_ioc_flags { 463enum perf_event_ioc_flags {
442 PERF_IOC_FLAG_GROUP = 1U << 0, 464 PERF_IOC_FLAG_GROUP = 1U << 0,