hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/include/uapi/linux/if_link.h
....@@ -7,24 +7,23 @@
77
88 /* This struct should be in sync with struct rtnl_link_stats64 */
99 struct 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 */
10
+ __u32 rx_packets;
11
+ __u32 tx_packets;
12
+ __u32 rx_bytes;
13
+ __u32 tx_bytes;
14
+ __u32 rx_errors;
15
+ __u32 tx_errors;
16
+ __u32 rx_dropped;
17
+ __u32 tx_dropped;
18
+ __u32 multicast;
1919 __u32 collisions;
20
-
2120 /* detailed rx_errors: */
2221 __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 */
22
+ __u32 rx_over_errors;
23
+ __u32 rx_crc_errors;
24
+ __u32 rx_frame_errors;
25
+ __u32 rx_fifo_errors;
26
+ __u32 rx_missed_errors;
2827
2928 /* detailed tx_errors */
3029 __u32 tx_aborted_errors;
....@@ -37,29 +36,200 @@
3736 __u32 rx_compressed;
3837 __u32 tx_compressed;
3938
40
- __u32 rx_nohandler; /* dropped, no handler found */
39
+ __u32 rx_nohandler;
4140 };
4241
43
-/* The main device statistics structure */
42
+/**
43
+ * struct rtnl_link_stats64 - The main device statistics structure.
44
+ *
45
+ * @rx_packets: Number of good packets received by the interface.
46
+ * For hardware interfaces counts all good packets received from the device
47
+ * by the host, including packets which host had to drop at various stages
48
+ * of processing (even in the driver).
49
+ *
50
+ * @tx_packets: Number of packets successfully transmitted.
51
+ * For hardware interfaces counts packets which host was able to successfully
52
+ * hand over to the device, which does not necessarily mean that packets
53
+ * had been successfully transmitted out of the device, only that device
54
+ * acknowledged it copied them out of host memory.
55
+ *
56
+ * @rx_bytes: Number of good received bytes, corresponding to @rx_packets.
57
+ *
58
+ * For IEEE 802.3 devices should count the length of Ethernet Frames
59
+ * excluding the FCS.
60
+ *
61
+ * @tx_bytes: Number of good transmitted bytes, corresponding to @tx_packets.
62
+ *
63
+ * For IEEE 802.3 devices should count the length of Ethernet Frames
64
+ * excluding the FCS.
65
+ *
66
+ * @rx_errors: Total number of bad packets received on this network device.
67
+ * This counter must include events counted by @rx_length_errors,
68
+ * @rx_crc_errors, @rx_frame_errors and other errors not otherwise
69
+ * counted.
70
+ *
71
+ * @tx_errors: Total number of transmit problems.
72
+ * This counter must include events counter by @tx_aborted_errors,
73
+ * @tx_carrier_errors, @tx_fifo_errors, @tx_heartbeat_errors,
74
+ * @tx_window_errors and other errors not otherwise counted.
75
+ *
76
+ * @rx_dropped: Number of packets received but not processed,
77
+ * e.g. due to lack of resources or unsupported protocol.
78
+ * For hardware interfaces this counter should not include packets
79
+ * dropped by the device which are counted separately in
80
+ * @rx_missed_errors (since procfs folds those two counters together).
81
+ *
82
+ * @tx_dropped: Number of packets dropped on their way to transmission,
83
+ * e.g. due to lack of resources.
84
+ *
85
+ * @multicast: Multicast packets received.
86
+ * For hardware interfaces this statistic is commonly calculated
87
+ * at the device level (unlike @rx_packets) and therefore may include
88
+ * packets which did not reach the host.
89
+ *
90
+ * For IEEE 802.3 devices this counter may be equivalent to:
91
+ *
92
+ * - 30.3.1.1.21 aMulticastFramesReceivedOK
93
+ *
94
+ * @collisions: Number of collisions during packet transmissions.
95
+ *
96
+ * @rx_length_errors: Number of packets dropped due to invalid length.
97
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
98
+ *
99
+ * For IEEE 802.3 devices this counter should be equivalent to a sum
100
+ * of the following attributes:
101
+ *
102
+ * - 30.3.1.1.23 aInRangeLengthErrors
103
+ * - 30.3.1.1.24 aOutOfRangeLengthField
104
+ * - 30.3.1.1.25 aFrameTooLongErrors
105
+ *
106
+ * @rx_over_errors: Receiver FIFO overflow event counter.
107
+ *
108
+ * Historically the count of overflow events. Such events may be
109
+ * reported in the receive descriptors or via interrupts, and may
110
+ * not correspond one-to-one with dropped packets.
111
+ *
112
+ * The recommended interpretation for high speed interfaces is -
113
+ * number of packets dropped because they did not fit into buffers
114
+ * provided by the host, e.g. packets larger than MTU or next buffer
115
+ * in the ring was not available for a scatter transfer.
116
+ *
117
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
118
+ *
119
+ * This statistics was historically used interchangeably with
120
+ * @rx_fifo_errors.
121
+ *
122
+ * This statistic corresponds to hardware events and is not commonly used
123
+ * on software devices.
124
+ *
125
+ * @rx_crc_errors: Number of packets received with a CRC error.
126
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
127
+ *
128
+ * For IEEE 802.3 devices this counter must be equivalent to:
129
+ *
130
+ * - 30.3.1.1.6 aFrameCheckSequenceErrors
131
+ *
132
+ * @rx_frame_errors: Receiver frame alignment errors.
133
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
134
+ *
135
+ * For IEEE 802.3 devices this counter should be equivalent to:
136
+ *
137
+ * - 30.3.1.1.7 aAlignmentErrors
138
+ *
139
+ * @rx_fifo_errors: Receiver FIFO error counter.
140
+ *
141
+ * Historically the count of overflow events. Those events may be
142
+ * reported in the receive descriptors or via interrupts, and may
143
+ * not correspond one-to-one with dropped packets.
144
+ *
145
+ * This statistics was used interchangeably with @rx_over_errors.
146
+ * Not recommended for use in drivers for high speed interfaces.
147
+ *
148
+ * This statistic is used on software devices, e.g. to count software
149
+ * packet queue overflow (can) or sequencing errors (GRE).
150
+ *
151
+ * @rx_missed_errors: Count of packets missed by the host.
152
+ * Folded into the "drop" counter in `/proc/net/dev`.
153
+ *
154
+ * Counts number of packets dropped by the device due to lack
155
+ * of buffer space. This usually indicates that the host interface
156
+ * is slower than the network interface, or host is not keeping up
157
+ * with the receive packet rate.
158
+ *
159
+ * This statistic corresponds to hardware events and is not used
160
+ * on software devices.
161
+ *
162
+ * @tx_aborted_errors:
163
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
164
+ * For IEEE 802.3 devices capable of half-duplex operation this counter
165
+ * must be equivalent to:
166
+ *
167
+ * - 30.3.1.1.11 aFramesAbortedDueToXSColls
168
+ *
169
+ * High speed interfaces may use this counter as a general device
170
+ * discard counter.
171
+ *
172
+ * @tx_carrier_errors: Number of frame transmission errors due to loss
173
+ * of carrier during transmission.
174
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
175
+ *
176
+ * For IEEE 802.3 devices this counter must be equivalent to:
177
+ *
178
+ * - 30.3.1.1.13 aCarrierSenseErrors
179
+ *
180
+ * @tx_fifo_errors: Number of frame transmission errors due to device
181
+ * FIFO underrun / underflow. This condition occurs when the device
182
+ * begins transmission of a frame but is unable to deliver the
183
+ * entire frame to the transmitter in time for transmission.
184
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
185
+ *
186
+ * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
187
+ * old half-duplex Ethernet.
188
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
189
+ *
190
+ * For IEEE 802.3 devices possibly equivalent to:
191
+ *
192
+ * - 30.3.2.1.4 aSQETestErrors
193
+ *
194
+ * @tx_window_errors: Number of frame transmission errors due
195
+ * to late collisions (for Ethernet - after the first 64B of transmission).
196
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
197
+ *
198
+ * For IEEE 802.3 devices this counter must be equivalent to:
199
+ *
200
+ * - 30.3.1.1.10 aLateCollisions
201
+ *
202
+ * @rx_compressed: Number of correctly received compressed packets.
203
+ * This counters is only meaningful for interfaces which support
204
+ * packet compression (e.g. CSLIP, PPP).
205
+ *
206
+ * @tx_compressed: Number of transmitted compressed packets.
207
+ * This counters is only meaningful for interfaces which support
208
+ * packet compression (e.g. CSLIP, PPP).
209
+ *
210
+ * @rx_nohandler: Number of packets received on the interface
211
+ * but dropped by the networking stack because the device is
212
+ * not designated to receive packets (e.g. backup link in a bond).
213
+ */
44214 struct 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 */
215
+ __u64 rx_packets;
216
+ __u64 tx_packets;
217
+ __u64 rx_bytes;
218
+ __u64 tx_bytes;
219
+ __u64 rx_errors;
220
+ __u64 tx_errors;
221
+ __u64 rx_dropped;
222
+ __u64 tx_dropped;
223
+ __u64 multicast;
54224 __u64 collisions;
55225
56226 /* detailed rx_errors: */
57227 __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 */
228
+ __u64 rx_over_errors;
229
+ __u64 rx_crc_errors;
230
+ __u64 rx_frame_errors;
231
+ __u64 rx_fifo_errors;
232
+ __u64 rx_missed_errors;
63233
64234 /* detailed tx_errors */
65235 __u64 tx_aborted_errors;
....@@ -71,8 +241,7 @@
71241 /* for cslip etc */
72242 __u64 rx_compressed;
73243 __u64 tx_compressed;
74
-
75
- __u64 rx_nohandler; /* dropped, no handler found */
244
+ __u64 rx_nohandler;
76245 };
77246
78247 /* The struct should be in sync with struct ifmap */
....@@ -161,16 +330,30 @@
161330 IFLA_EVENT,
162331 IFLA_NEW_NETNSID,
163332 IFLA_IF_NETNSID,
333
+ IFLA_TARGET_NETNSID = IFLA_IF_NETNSID, /* new alias */
164334 IFLA_CARRIER_UP_COUNT,
165335 IFLA_CARRIER_DOWN_COUNT,
166336 IFLA_NEW_IFINDEX,
167337 IFLA_MIN_MTU,
168338 IFLA_MAX_MTU,
339
+ IFLA_PROP_LIST,
340
+ IFLA_ALT_IFNAME, /* Alternative ifname */
341
+ IFLA_PERM_ADDRESS,
342
+ IFLA_PROTO_DOWN_REASON,
169343 __IFLA_MAX
170344 };
171345
172346
173347 #define IFLA_MAX (__IFLA_MAX - 1)
348
+
349
+enum {
350
+ IFLA_PROTO_DOWN_REASON_UNSPEC,
351
+ IFLA_PROTO_DOWN_REASON_MASK, /* u32, mask for reason bits */
352
+ IFLA_PROTO_DOWN_REASON_VALUE, /* u32, reason bit value */
353
+
354
+ __IFLA_PROTO_DOWN_REASON_CNT,
355
+ IFLA_PROTO_DOWN_REASON_MAX = __IFLA_PROTO_DOWN_REASON_CNT - 1
356
+};
174357
175358 /* backwards compatibility for userspace */
176359 #ifndef __KERNEL__
....@@ -286,6 +469,8 @@
286469 IFLA_BR_MCAST_STATS_ENABLED,
287470 IFLA_BR_MCAST_IGMP_VERSION,
288471 IFLA_BR_MCAST_MLD_VERSION,
472
+ IFLA_BR_VLAN_STATS_PER_PORT,
473
+ IFLA_BR_MULTI_BOOLOPT,
289474 __IFLA_BR_MAX,
290475 };
291476
....@@ -337,6 +522,8 @@
337522 IFLA_BRPORT_NEIGH_SUPPRESS,
338523 IFLA_BRPORT_ISOLATED,
339524 IFLA_BRPORT_BACKUP_PORT,
525
+ IFLA_BRPORT_MRP_RING_OPEN,
526
+ IFLA_BRPORT_MRP_IN_OPEN,
340527 __IFLA_BRPORT_MAX
341528 };
342529 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
....@@ -457,6 +644,7 @@
457644 IFLA_MACSEC_REPLAY_PROTECT,
458645 IFLA_MACSEC_VALIDATION,
459646 IFLA_MACSEC_PAD,
647
+ IFLA_MACSEC_OFFLOAD,
460648 __IFLA_MACSEC_MAX,
461649 };
462650
....@@ -478,6 +666,14 @@
478666 MACSEC_VALIDATE_STRICT = 2,
479667 __MACSEC_VALIDATE_END,
480668 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
669
+};
670
+
671
+enum macsec_offload {
672
+ MACSEC_OFFLOAD_OFF = 0,
673
+ MACSEC_OFFLOAD_PHY = 1,
674
+ MACSEC_OFFLOAD_MAC = 2,
675
+ __MACSEC_OFFLOAD_END,
676
+ MACSEC_OFFLOAD_MAX = __MACSEC_OFFLOAD_END - 1,
481677 };
482678
483679 /* IPVLAN section */
....@@ -531,6 +727,7 @@
531727 IFLA_VXLAN_LABEL,
532728 IFLA_VXLAN_GPE,
533729 IFLA_VXLAN_TTL_INHERIT,
730
+ IFLA_VXLAN_DF,
534731 __IFLA_VXLAN_MAX
535732 };
536733 #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
....@@ -538,6 +735,14 @@
538735 struct ifla_vxlan_port_range {
539736 __be16 low;
540737 __be16 high;
738
+};
739
+
740
+enum ifla_vxlan_df {
741
+ VXLAN_DF_UNSET = 0,
742
+ VXLAN_DF_SET,
743
+ VXLAN_DF_INHERIT,
744
+ __VXLAN_DF_END,
745
+ VXLAN_DF_MAX = __VXLAN_DF_END - 1,
541746 };
542747
543748 /* GENEVE section */
....@@ -554,9 +759,31 @@
554759 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
555760 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
556761 IFLA_GENEVE_LABEL,
762
+ IFLA_GENEVE_TTL_INHERIT,
763
+ IFLA_GENEVE_DF,
557764 __IFLA_GENEVE_MAX
558765 };
559766 #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
767
+
768
+enum ifla_geneve_df {
769
+ GENEVE_DF_UNSET = 0,
770
+ GENEVE_DF_SET,
771
+ GENEVE_DF_INHERIT,
772
+ __GENEVE_DF_END,
773
+ GENEVE_DF_MAX = __GENEVE_DF_END - 1,
774
+};
775
+
776
+/* Bareudp section */
777
+enum {
778
+ IFLA_BAREUDP_UNSPEC,
779
+ IFLA_BAREUDP_PORT,
780
+ IFLA_BAREUDP_ETHERTYPE,
781
+ IFLA_BAREUDP_SRCPORT_MIN,
782
+ IFLA_BAREUDP_MULTIPROTO_MODE,
783
+ __IFLA_BAREUDP_MAX
784
+};
785
+
786
+#define IFLA_BAREUDP_MAX (__IFLA_BAREUDP_MAX - 1)
560787
561788 /* PPP section */
562789 enum {
....@@ -614,6 +841,7 @@
614841 IFLA_BOND_AD_USER_PORT_KEY,
615842 IFLA_BOND_AD_ACTOR_SYSTEM,
616843 IFLA_BOND_TLB_DYNAMIC_LB,
844
+ IFLA_BOND_PEER_NOTIF_DELAY,
617845 __IFLA_BOND_MAX,
618846 };
619847
....@@ -672,6 +900,7 @@
672900 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
673901 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
674902 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
903
+ IFLA_VF_BROADCAST, /* VF broadcast */
675904 __IFLA_VF_MAX,
676905 };
677906
....@@ -680,6 +909,10 @@
680909 struct ifla_vf_mac {
681910 __u32 vf;
682911 __u8 mac[32]; /* MAX_ADDR_LEN */
912
+};
913
+
914
+struct ifla_vf_broadcast {
915
+ __u8 broadcast[32];
683916 };
684917
685918 struct ifla_vf_vlan {
....@@ -853,7 +1086,14 @@
8531086 #define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
8541087
8551088
856
-/* HSR section */
1089
+/* HSR/PRP section, both uses same interface */
1090
+
1091
+/* Different redundancy protocols for hsr device */
1092
+enum {
1093
+ HSR_PROTOCOL_HSR,
1094
+ HSR_PROTOCOL_PRP,
1095
+ HSR_PROTOCOL_MAX,
1096
+};
8571097
8581098 enum {
8591099 IFLA_HSR_UNSPEC,
....@@ -863,6 +1103,9 @@
8631103 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
8641104 IFLA_HSR_SEQ_NR,
8651105 IFLA_HSR_VERSION, /* HSR version */
1106
+ IFLA_HSR_PROTOCOL, /* Indicate different protocol than
1107
+ * HSR. For example PRP.
1108
+ */
8661109 __IFLA_HSR_MAX,
8671110 };
8681111
....@@ -903,6 +1146,7 @@
9031146 enum {
9041147 LINK_XSTATS_TYPE_UNSPEC,
9051148 LINK_XSTATS_TYPE_BRIDGE,
1149
+ LINK_XSTATS_TYPE_BOND,
9061150 __LINK_XSTATS_TYPE_MAX
9071151 };
9081152 #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
....@@ -921,11 +1165,12 @@
9211165 #define XDP_FLAGS_SKB_MODE (1U << 1)
9221166 #define XDP_FLAGS_DRV_MODE (1U << 2)
9231167 #define XDP_FLAGS_HW_MODE (1U << 3)
1168
+#define XDP_FLAGS_REPLACE (1U << 4)
9241169 #define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
9251170 XDP_FLAGS_DRV_MODE | \
9261171 XDP_FLAGS_HW_MODE)
9271172 #define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
928
- XDP_FLAGS_MODES)
1173
+ XDP_FLAGS_MODES | XDP_FLAGS_REPLACE)
9291174
9301175 /* These are stored into IFLA_XDP_ATTACHED on dump. */
9311176 enum {
....@@ -945,6 +1190,7 @@
9451190 IFLA_XDP_DRV_PROG_ID,
9461191 IFLA_XDP_SKB_PROG_ID,
9471192 IFLA_XDP_HW_PROG_ID,
1193
+ IFLA_XDP_EXPECTED_FD,
9481194 __IFLA_XDP_MAX,
9491195 };
9501196