7
7
8
8
/* This struct should be in sync with struct rtnl_link_stats64 */
9
9
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 ;
19
19
__u32 collisions ;
20
-
21
20
/* detailed rx_errors: */
22
21
__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 ;
28
27
29
28
/* detailed tx_errors */
30
29
__u32 tx_aborted_errors ;
@@ -37,29 +36,201 @@ struct rtnl_link_stats {
37
36
__u32 rx_compressed ;
38
37
__u32 tx_compressed ;
39
38
40
- __u32 rx_nohandler ; /* dropped, no handler found */
39
+ __u32 rx_nohandler ;
41
40
};
42
41
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 may include packets discarded
79
+ * due to L2 address filtering but should not include packets dropped
80
+ * by the device due to buffer exhaustion which are counted separately in
81
+ * @rx_missed_errors (since procfs folds those two counters together).
82
+ *
83
+ * @tx_dropped: Number of packets dropped on their way to transmission,
84
+ * e.g. due to lack of resources.
85
+ *
86
+ * @multicast: Multicast packets received.
87
+ * For hardware interfaces this statistic is commonly calculated
88
+ * at the device level (unlike @rx_packets) and therefore may include
89
+ * packets which did not reach the host.
90
+ *
91
+ * For IEEE 802.3 devices this counter may be equivalent to:
92
+ *
93
+ * - 30.3.1.1.21 aMulticastFramesReceivedOK
94
+ *
95
+ * @collisions: Number of collisions during packet transmissions.
96
+ *
97
+ * @rx_length_errors: Number of packets dropped due to invalid length.
98
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
99
+ *
100
+ * For IEEE 802.3 devices this counter should be equivalent to a sum
101
+ * of the following attributes:
102
+ *
103
+ * - 30.3.1.1.23 aInRangeLengthErrors
104
+ * - 30.3.1.1.24 aOutOfRangeLengthField
105
+ * - 30.3.1.1.25 aFrameTooLongErrors
106
+ *
107
+ * @rx_over_errors: Receiver FIFO overflow event counter.
108
+ *
109
+ * Historically the count of overflow events. Such events may be
110
+ * reported in the receive descriptors or via interrupts, and may
111
+ * not correspond one-to-one with dropped packets.
112
+ *
113
+ * The recommended interpretation for high speed interfaces is -
114
+ * number of packets dropped because they did not fit into buffers
115
+ * provided by the host, e.g. packets larger than MTU or next buffer
116
+ * in the ring was not available for a scatter transfer.
117
+ *
118
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
119
+ *
120
+ * This statistics was historically used interchangeably with
121
+ * @rx_fifo_errors.
122
+ *
123
+ * This statistic corresponds to hardware events and is not commonly used
124
+ * on software devices.
125
+ *
126
+ * @rx_crc_errors: Number of packets received with a CRC error.
127
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
128
+ *
129
+ * For IEEE 802.3 devices this counter must be equivalent to:
130
+ *
131
+ * - 30.3.1.1.6 aFrameCheckSequenceErrors
132
+ *
133
+ * @rx_frame_errors: Receiver frame alignment errors.
134
+ * Part of aggregate "frame" errors in `/proc/net/dev`.
135
+ *
136
+ * For IEEE 802.3 devices this counter should be equivalent to:
137
+ *
138
+ * - 30.3.1.1.7 aAlignmentErrors
139
+ *
140
+ * @rx_fifo_errors: Receiver FIFO error counter.
141
+ *
142
+ * Historically the count of overflow events. Those events may be
143
+ * reported in the receive descriptors or via interrupts, and may
144
+ * not correspond one-to-one with dropped packets.
145
+ *
146
+ * This statistics was used interchangeably with @rx_over_errors.
147
+ * Not recommended for use in drivers for high speed interfaces.
148
+ *
149
+ * This statistic is used on software devices, e.g. to count software
150
+ * packet queue overflow (can) or sequencing errors (GRE).
151
+ *
152
+ * @rx_missed_errors: Count of packets missed by the host.
153
+ * Folded into the "drop" counter in `/proc/net/dev`.
154
+ *
155
+ * Counts number of packets dropped by the device due to lack
156
+ * of buffer space. This usually indicates that the host interface
157
+ * is slower than the network interface, or host is not keeping up
158
+ * with the receive packet rate.
159
+ *
160
+ * This statistic corresponds to hardware events and is not used
161
+ * on software devices.
162
+ *
163
+ * @tx_aborted_errors:
164
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
165
+ * For IEEE 802.3 devices capable of half-duplex operation this counter
166
+ * must be equivalent to:
167
+ *
168
+ * - 30.3.1.1.11 aFramesAbortedDueToXSColls
169
+ *
170
+ * High speed interfaces may use this counter as a general device
171
+ * discard counter.
172
+ *
173
+ * @tx_carrier_errors: Number of frame transmission errors due to loss
174
+ * of carrier during transmission.
175
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
176
+ *
177
+ * For IEEE 802.3 devices this counter must be equivalent to:
178
+ *
179
+ * - 30.3.1.1.13 aCarrierSenseErrors
180
+ *
181
+ * @tx_fifo_errors: Number of frame transmission errors due to device
182
+ * FIFO underrun / underflow. This condition occurs when the device
183
+ * begins transmission of a frame but is unable to deliver the
184
+ * entire frame to the transmitter in time for transmission.
185
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
186
+ *
187
+ * @tx_heartbeat_errors: Number of Heartbeat / SQE Test errors for
188
+ * old half-duplex Ethernet.
189
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
190
+ *
191
+ * For IEEE 802.3 devices possibly equivalent to:
192
+ *
193
+ * - 30.3.2.1.4 aSQETestErrors
194
+ *
195
+ * @tx_window_errors: Number of frame transmission errors due
196
+ * to late collisions (for Ethernet - after the first 64B of transmission).
197
+ * Part of aggregate "carrier" errors in `/proc/net/dev`.
198
+ *
199
+ * For IEEE 802.3 devices this counter must be equivalent to:
200
+ *
201
+ * - 30.3.1.1.10 aLateCollisions
202
+ *
203
+ * @rx_compressed: Number of correctly received compressed packets.
204
+ * This counters is only meaningful for interfaces which support
205
+ * packet compression (e.g. CSLIP, PPP).
206
+ *
207
+ * @tx_compressed: Number of transmitted compressed packets.
208
+ * This counters is only meaningful for interfaces which support
209
+ * packet compression (e.g. CSLIP, PPP).
210
+ *
211
+ * @rx_nohandler: Number of packets received on the interface
212
+ * but dropped by the networking stack because the device is
213
+ * not designated to receive packets (e.g. backup link in a bond).
214
+ */
44
215
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 */
216
+ __u64 rx_packets ;
217
+ __u64 tx_packets ;
218
+ __u64 rx_bytes ;
219
+ __u64 tx_bytes ;
220
+ __u64 rx_errors ;
221
+ __u64 tx_errors ;
222
+ __u64 rx_dropped ;
223
+ __u64 tx_dropped ;
224
+ __u64 multicast ;
54
225
__u64 collisions ;
55
226
56
227
/* detailed rx_errors: */
57
228
__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 */
229
+ __u64 rx_over_errors ;
230
+ __u64 rx_crc_errors ;
231
+ __u64 rx_frame_errors ;
232
+ __u64 rx_fifo_errors ;
233
+ __u64 rx_missed_errors ;
63
234
64
235
/* detailed tx_errors */
65
236
__u64 tx_aborted_errors ;
@@ -71,8 +242,7 @@ struct rtnl_link_stats64 {
71
242
/* for cslip etc */
72
243
__u64 rx_compressed ;
73
244
__u64 tx_compressed ;
74
-
75
- __u64 rx_nohandler ; /* dropped, no handler found */
245
+ __u64 rx_nohandler ;
76
246
};
77
247
78
248
/* The struct should be in sync with struct ifmap */
@@ -170,12 +340,29 @@ enum {
170
340
IFLA_PROP_LIST ,
171
341
IFLA_ALT_IFNAME , /* Alternative ifname */
172
342
IFLA_PERM_ADDRESS ,
343
+ IFLA_PROTO_DOWN_REASON ,
344
+
345
+ /* device (sysfs) name as parent, used instead
346
+ * of IFLA_LINK where there's no parent netdev
347
+ */
348
+ IFLA_PARENT_DEV_NAME ,
349
+ IFLA_PARENT_DEV_BUS_NAME ,
350
+
173
351
__IFLA_MAX
174
352
};
175
353
176
354
177
355
#define IFLA_MAX (__IFLA_MAX - 1)
178
356
357
+ enum {
358
+ IFLA_PROTO_DOWN_REASON_UNSPEC ,
359
+ IFLA_PROTO_DOWN_REASON_MASK , /* u32, mask for reason bits */
360
+ IFLA_PROTO_DOWN_REASON_VALUE , /* u32, reason bit value */
361
+
362
+ __IFLA_PROTO_DOWN_REASON_CNT ,
363
+ IFLA_PROTO_DOWN_REASON_MAX = __IFLA_PROTO_DOWN_REASON_CNT - 1
364
+ };
365
+
179
366
/* backwards compatibility for userspace */
180
367
#ifndef __KERNEL__
181
368
#define IFLA_RTA (r ) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
@@ -293,6 +480,7 @@ enum {
293
480
IFLA_BR_MCAST_MLD_VERSION ,
294
481
IFLA_BR_VLAN_STATS_PER_PORT ,
295
482
IFLA_BR_MULTI_BOOLOPT ,
483
+ IFLA_BR_MCAST_QUERIER_STATE ,
296
484
__IFLA_BR_MAX ,
297
485
};
298
486
@@ -346,6 +534,8 @@ enum {
346
534
IFLA_BRPORT_BACKUP_PORT ,
347
535
IFLA_BRPORT_MRP_RING_OPEN ,
348
536
IFLA_BRPORT_MRP_IN_OPEN ,
537
+ IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT ,
538
+ IFLA_BRPORT_MCAST_EHT_HOSTS_CNT ,
349
539
__IFLA_BRPORT_MAX
350
540
};
351
541
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
@@ -433,6 +623,7 @@ enum macvlan_macaddr_mode {
433
623
};
434
624
435
625
#define MACVLAN_FLAG_NOPROMISC 1
626
+ #define MACVLAN_FLAG_NODST 2 /* skip dst macvlan if matching src macvlan */
436
627
437
628
/* VRF section */
438
629
enum {
@@ -597,6 +788,18 @@ enum ifla_geneve_df {
597
788
GENEVE_DF_MAX = __GENEVE_DF_END - 1 ,
598
789
};
599
790
791
+ /* Bareudp section */
792
+ enum {
793
+ IFLA_BAREUDP_UNSPEC ,
794
+ IFLA_BAREUDP_PORT ,
795
+ IFLA_BAREUDP_ETHERTYPE ,
796
+ IFLA_BAREUDP_SRCPORT_MIN ,
797
+ IFLA_BAREUDP_MULTIPROTO_MODE ,
798
+ __IFLA_BAREUDP_MAX
799
+ };
800
+
801
+ #define IFLA_BAREUDP_MAX (__IFLA_BAREUDP_MAX - 1)
802
+
600
803
/* PPP section */
601
804
enum {
602
805
IFLA_PPP_UNSPEC ,
@@ -899,7 +1102,14 @@ enum {
899
1102
#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
900
1103
901
1104
902
- /* HSR section */
1105
+ /* HSR/PRP section, both uses same interface */
1106
+
1107
+ /* Different redundancy protocols for hsr device */
1108
+ enum {
1109
+ HSR_PROTOCOL_HSR ,
1110
+ HSR_PROTOCOL_PRP ,
1111
+ HSR_PROTOCOL_MAX ,
1112
+ };
903
1113
904
1114
enum {
905
1115
IFLA_HSR_UNSPEC ,
@@ -909,6 +1119,9 @@ enum {
909
1119
IFLA_HSR_SUPERVISION_ADDR , /* Supervision frame multicast addr */
910
1120
IFLA_HSR_SEQ_NR ,
911
1121
IFLA_HSR_VERSION , /* HSR version */
1122
+ IFLA_HSR_PROTOCOL , /* Indicate different protocol than
1123
+ * HSR. For example PRP.
1124
+ */
912
1125
__IFLA_HSR_MAX ,
913
1126
};
914
1127
@@ -1033,6 +1246,8 @@ enum {
1033
1246
#define RMNET_FLAGS_INGRESS_MAP_COMMANDS (1U << 1)
1034
1247
#define RMNET_FLAGS_INGRESS_MAP_CKSUMV4 (1U << 2)
1035
1248
#define RMNET_FLAGS_EGRESS_MAP_CKSUMV4 (1U << 3)
1249
+ #define RMNET_FLAGS_INGRESS_MAP_CKSUMV5 (1U << 4)
1250
+ #define RMNET_FLAGS_EGRESS_MAP_CKSUMV5 (1U << 5)
1036
1251
1037
1252
enum {
1038
1253
IFLA_RMNET_UNSPEC ,
@@ -1048,4 +1263,14 @@ struct ifla_rmnet_flags {
1048
1263
__u32 mask ;
1049
1264
};
1050
1265
1266
+ /* MCTP section */
1267
+
1268
+ enum {
1269
+ IFLA_MCTP_UNSPEC ,
1270
+ IFLA_MCTP_NET ,
1271
+ __IFLA_MCTP_MAX ,
1272
+ };
1273
+
1274
+ #define IFLA_MCTP_MAX (__IFLA_MCTP_MAX - 1)
1275
+
1051
1276
#endif /* _UAPI_LINUX_IF_LINK_H */
0 commit comments