Skip to content

Commit b160f72

Browse files
menglongdongPaolo Abeni
authored andcommitted
net: dropreason: reformat the comment fo skb drop reasons
To make the code clear, reformat the comment in dropreason.h to k-doc style. Now, the comment can pass the check of kernel-doc without warnning: $ ./scripts/kernel-doc -v -none include/linux/dropreason.h include/linux/dropreason.h:7: info: Scanning doc for enum skb_drop_reason Signed-off-by: Menglong Dong <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent ec43908 commit b160f72

File tree

1 file changed

+226
-156
lines changed

1 file changed

+226
-156
lines changed

include/net/dropreason.h

Lines changed: 226 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -3,168 +3,238 @@
33
#ifndef _LINUX_DROPREASON_H
44
#define _LINUX_DROPREASON_H
55

6-
/* The reason of skb drop, which is used in kfree_skb_reason().
7-
* en...maybe they should be splited by group?
6+
/**
7+
* enum skb_drop_reason - the reasons of skb drops
88
*
9-
* Each item here should also be in 'TRACE_SKB_DROP_REASON', which is
10-
* used to translate the reason to string.
9+
* The reason of skb drop, which is used in kfree_skb_reason().
1110
*/
1211
enum skb_drop_reason {
12+
/**
13+
* @SKB_NOT_DROPPED_YET: skb is not dropped yet (used for no-drop case)
14+
*/
1315
SKB_NOT_DROPPED_YET = 0,
14-
SKB_DROP_REASON_NOT_SPECIFIED, /* drop reason is not specified */
15-
SKB_DROP_REASON_NO_SOCKET, /* socket not found */
16-
SKB_DROP_REASON_PKT_TOO_SMALL, /* packet size is too small */
17-
SKB_DROP_REASON_TCP_CSUM, /* TCP checksum error */
18-
SKB_DROP_REASON_SOCKET_FILTER, /* dropped by socket filter */
19-
SKB_DROP_REASON_UDP_CSUM, /* UDP checksum error */
20-
SKB_DROP_REASON_NETFILTER_DROP, /* dropped by netfilter */
21-
SKB_DROP_REASON_OTHERHOST, /* packet don't belong to current
22-
* host (interface is in promisc
23-
* mode)
24-
*/
25-
SKB_DROP_REASON_IP_CSUM, /* IP checksum error */
26-
SKB_DROP_REASON_IP_INHDR, /* there is something wrong with
27-
* IP header (see
28-
* IPSTATS_MIB_INHDRERRORS)
29-
*/
30-
SKB_DROP_REASON_IP_RPFILTER, /* IP rpfilter validate failed.
31-
* see the document for rp_filter
32-
* in ip-sysctl.rst for more
33-
* information
34-
*/
35-
SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST, /* destination address of L2
36-
* is multicast, but L3 is
37-
* unicast.
38-
*/
39-
SKB_DROP_REASON_XFRM_POLICY, /* xfrm policy check failed */
40-
SKB_DROP_REASON_IP_NOPROTO, /* no support for IP protocol */
41-
SKB_DROP_REASON_SOCKET_RCVBUFF, /* socket receive buff is full */
42-
SKB_DROP_REASON_PROTO_MEM, /* proto memory limition, such as
43-
* udp packet drop out of
44-
* udp_memory_allocated.
45-
*/
46-
SKB_DROP_REASON_TCP_MD5NOTFOUND, /* no MD5 hash and one
47-
* expected, corresponding
48-
* to LINUX_MIB_TCPMD5NOTFOUND
49-
*/
50-
SKB_DROP_REASON_TCP_MD5UNEXPECTED, /* MD5 hash and we're not
51-
* expecting one, corresponding
52-
* to LINUX_MIB_TCPMD5UNEXPECTED
53-
*/
54-
SKB_DROP_REASON_TCP_MD5FAILURE, /* MD5 hash and its wrong,
55-
* corresponding to
56-
* LINUX_MIB_TCPMD5FAILURE
57-
*/
58-
SKB_DROP_REASON_SOCKET_BACKLOG, /* failed to add skb to socket
59-
* backlog (see
60-
* LINUX_MIB_TCPBACKLOGDROP)
61-
*/
62-
SKB_DROP_REASON_TCP_FLAGS, /* TCP flags invalid */
63-
SKB_DROP_REASON_TCP_ZEROWINDOW, /* TCP receive window size is zero,
64-
* see LINUX_MIB_TCPZEROWINDOWDROP
65-
*/
66-
SKB_DROP_REASON_TCP_OLD_DATA, /* the TCP data reveived is already
67-
* received before (spurious retrans
68-
* may happened), see
69-
* LINUX_MIB_DELAYEDACKLOST
70-
*/
71-
SKB_DROP_REASON_TCP_OVERWINDOW, /* the TCP data is out of window,
72-
* the seq of the first byte exceed
73-
* the right edges of receive
74-
* window
75-
*/
76-
SKB_DROP_REASON_TCP_OFOMERGE, /* the data of skb is already in
77-
* the ofo queue, corresponding to
78-
* LINUX_MIB_TCPOFOMERGE
79-
*/
80-
SKB_DROP_REASON_TCP_RFC7323_PAWS, /* PAWS check, corresponding to
81-
* LINUX_MIB_PAWSESTABREJECTED
82-
*/
83-
SKB_DROP_REASON_TCP_INVALID_SEQUENCE, /* Not acceptable SEQ field */
84-
SKB_DROP_REASON_TCP_RESET, /* Invalid RST packet */
85-
SKB_DROP_REASON_TCP_INVALID_SYN, /* Incoming packet has unexpected SYN flag */
86-
SKB_DROP_REASON_TCP_CLOSE, /* TCP socket in CLOSE state */
87-
SKB_DROP_REASON_TCP_FASTOPEN, /* dropped by FASTOPEN request socket */
88-
SKB_DROP_REASON_TCP_OLD_ACK, /* TCP ACK is old, but in window */
89-
SKB_DROP_REASON_TCP_TOO_OLD_ACK, /* TCP ACK is too old */
90-
SKB_DROP_REASON_TCP_ACK_UNSENT_DATA, /* TCP ACK for data we haven't sent yet */
91-
SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE, /* pruned from TCP OFO queue */
92-
SKB_DROP_REASON_TCP_OFO_DROP, /* data already in receive queue */
93-
SKB_DROP_REASON_IP_OUTNOROUTES, /* route lookup failed */
94-
SKB_DROP_REASON_BPF_CGROUP_EGRESS, /* dropped by
95-
* BPF_PROG_TYPE_CGROUP_SKB
96-
* eBPF program
97-
*/
98-
SKB_DROP_REASON_IPV6DISABLED, /* IPv6 is disabled on the device */
99-
SKB_DROP_REASON_NEIGH_CREATEFAIL, /* failed to create neigh
100-
* entry
101-
*/
102-
SKB_DROP_REASON_NEIGH_FAILED, /* neigh entry in failed state */
103-
SKB_DROP_REASON_NEIGH_QUEUEFULL, /* arp_queue for neigh
104-
* entry is full
105-
*/
106-
SKB_DROP_REASON_NEIGH_DEAD, /* neigh entry is dead */
107-
SKB_DROP_REASON_TC_EGRESS, /* dropped in TC egress HOOK */
108-
SKB_DROP_REASON_QDISC_DROP, /* dropped by qdisc when packet
109-
* outputting (failed to enqueue to
110-
* current qdisc)
111-
*/
112-
SKB_DROP_REASON_CPU_BACKLOG, /* failed to enqueue the skb to
113-
* the per CPU backlog queue. This
114-
* can be caused by backlog queue
115-
* full (see netdev_max_backlog in
116-
* net.rst) or RPS flow limit
117-
*/
118-
SKB_DROP_REASON_XDP, /* dropped by XDP in input path */
119-
SKB_DROP_REASON_TC_INGRESS, /* dropped in TC ingress HOOK */
120-
SKB_DROP_REASON_UNHANDLED_PROTO, /* protocol not implemented
121-
* or not supported
122-
*/
123-
SKB_DROP_REASON_SKB_CSUM, /* sk_buff checksum computation
124-
* error
125-
*/
126-
SKB_DROP_REASON_SKB_GSO_SEG, /* gso segmentation error */
127-
SKB_DROP_REASON_SKB_UCOPY_FAULT, /* failed to copy data from
128-
* user space, e.g., via
129-
* zerocopy_sg_from_iter()
130-
* or skb_orphan_frags_rx()
131-
*/
132-
SKB_DROP_REASON_DEV_HDR, /* device driver specific
133-
* header/metadata is invalid
134-
*/
135-
/* the device is not ready to xmit/recv due to any of its data
136-
* structure that is not up/ready/initialized, e.g., the IFF_UP is
137-
* not set, or driver specific tun->tfiles[txq] is not initialized
16+
/** @SKB_DROP_REASON_NOT_SPECIFIED: drop reason is not specified */
17+
SKB_DROP_REASON_NOT_SPECIFIED,
18+
/** @SKB_DROP_REASON_NO_SOCKET: socket not found */
19+
SKB_DROP_REASON_NO_SOCKET,
20+
/** @SKB_DROP_REASON_PKT_TOO_SMALL: packet size is too small */
21+
SKB_DROP_REASON_PKT_TOO_SMALL,
22+
/** @SKB_DROP_REASON_TCP_CSUM: TCP checksum error */
23+
SKB_DROP_REASON_TCP_CSUM,
24+
/** @SKB_DROP_REASON_SOCKET_FILTER: dropped by socket filter */
25+
SKB_DROP_REASON_SOCKET_FILTER,
26+
/** @SKB_DROP_REASON_UDP_CSUM: UDP checksum error */
27+
SKB_DROP_REASON_UDP_CSUM,
28+
/** @SKB_DROP_REASON_NETFILTER_DROP: dropped by netfilter */
29+
SKB_DROP_REASON_NETFILTER_DROP,
30+
/**
31+
* @SKB_DROP_REASON_OTHERHOST: packet don't belong to current host
32+
* (interface is in promisc mode)
33+
*/
34+
SKB_DROP_REASON_OTHERHOST,
35+
/** @SKB_DROP_REASON_IP_CSUM: IP checksum error */
36+
SKB_DROP_REASON_IP_CSUM,
37+
/**
38+
* @SKB_DROP_REASON_IP_INHDR: there is something wrong with IP header (see
39+
* IPSTATS_MIB_INHDRERRORS)
40+
*/
41+
SKB_DROP_REASON_IP_INHDR,
42+
/**
43+
* @SKB_DROP_REASON_IP_RPFILTER: IP rpfilter validate failed. see the
44+
* document for rp_filter in ip-sysctl.rst for more information
45+
*/
46+
SKB_DROP_REASON_IP_RPFILTER,
47+
/**
48+
* @SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST: destination address of L2 is
49+
* multicast, but L3 is unicast.
50+
*/
51+
SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST,
52+
/** @SKB_DROP_REASON_XFRM_POLICY: xfrm policy check failed */
53+
SKB_DROP_REASON_XFRM_POLICY,
54+
/** @SKB_DROP_REASON_IP_NOPROTO: no support for IP protocol */
55+
SKB_DROP_REASON_IP_NOPROTO,
56+
/** @SKB_DROP_REASON_SOCKET_RCVBUFF: socket receive buff is full */
57+
SKB_DROP_REASON_SOCKET_RCVBUFF,
58+
/**
59+
* @SKB_DROP_REASON_PROTO_MEM: proto memory limition, such as udp packet
60+
* drop out of udp_memory_allocated.
61+
*/
62+
SKB_DROP_REASON_PROTO_MEM,
63+
/**
64+
* @SKB_DROP_REASON_TCP_MD5NOTFOUND: no MD5 hash and one expected,
65+
* corresponding to LINUX_MIB_TCPMD5NOTFOUND
66+
*/
67+
SKB_DROP_REASON_TCP_MD5NOTFOUND,
68+
/**
69+
* @SKB_DROP_REASON_TCP_MD5UNEXPECTED: MD5 hash and we're not expecting
70+
* one, corresponding to LINUX_MIB_TCPMD5UNEXPECTED
71+
*/
72+
SKB_DROP_REASON_TCP_MD5UNEXPECTED,
73+
/**
74+
* @SKB_DROP_REASON_TCP_MD5FAILURE: MD5 hash and its wrong, corresponding
75+
* to LINUX_MIB_TCPMD5FAILURE
76+
*/
77+
SKB_DROP_REASON_TCP_MD5FAILURE,
78+
/**
79+
* @SKB_DROP_REASON_SOCKET_BACKLOG: failed to add skb to socket backlog (
80+
* see LINUX_MIB_TCPBACKLOGDROP)
81+
*/
82+
SKB_DROP_REASON_SOCKET_BACKLOG,
83+
/** @SKB_DROP_REASON_TCP_FLAGS: TCP flags invalid */
84+
SKB_DROP_REASON_TCP_FLAGS,
85+
/**
86+
* @SKB_DROP_REASON_TCP_ZEROWINDOW: TCP receive window size is zero,
87+
* see LINUX_MIB_TCPZEROWINDOWDROP
88+
*/
89+
SKB_DROP_REASON_TCP_ZEROWINDOW,
90+
/**
91+
* @SKB_DROP_REASON_TCP_OLD_DATA: the TCP data reveived is already
92+
* received before (spurious retrans may happened), see
93+
* LINUX_MIB_DELAYEDACKLOST
94+
*/
95+
SKB_DROP_REASON_TCP_OLD_DATA,
96+
/**
97+
* @SKB_DROP_REASON_TCP_OVERWINDOW: the TCP data is out of window,
98+
* the seq of the first byte exceed the right edges of receive
99+
* window
100+
*/
101+
SKB_DROP_REASON_TCP_OVERWINDOW,
102+
/**
103+
* @SKB_DROP_REASON_TCP_OFOMERGE: the data of skb is already in the ofo
104+
* queue, corresponding to LINUX_MIB_TCPOFOMERGE
105+
*/
106+
SKB_DROP_REASON_TCP_OFOMERGE,
107+
/**
108+
* @SKB_DROP_REASON_TCP_RFC7323_PAWS: PAWS check, corresponding to
109+
* LINUX_MIB_PAWSESTABREJECTED
110+
*/
111+
SKB_DROP_REASON_TCP_RFC7323_PAWS,
112+
/** @SKB_DROP_REASON_TCP_INVALID_SEQUENCE: Not acceptable SEQ field */
113+
SKB_DROP_REASON_TCP_INVALID_SEQUENCE,
114+
/** @SKB_DROP_REASON_TCP_RESET: Invalid RST packet */
115+
SKB_DROP_REASON_TCP_RESET,
116+
/**
117+
* @SKB_DROP_REASON_TCP_INVALID_SYN: Incoming packet has unexpected
118+
* SYN flag
119+
*/
120+
SKB_DROP_REASON_TCP_INVALID_SYN,
121+
/** @SKB_DROP_REASON_TCP_CLOSE: TCP socket in CLOSE state */
122+
SKB_DROP_REASON_TCP_CLOSE,
123+
/** @SKB_DROP_REASON_TCP_FASTOPEN: dropped by FASTOPEN request socket */
124+
SKB_DROP_REASON_TCP_FASTOPEN,
125+
/** @SKB_DROP_REASON_TCP_OLD_ACK: TCP ACK is old, but in window */
126+
SKB_DROP_REASON_TCP_OLD_ACK,
127+
/** @SKB_DROP_REASON_TCP_TOO_OLD_ACK: TCP ACK is too old */
128+
SKB_DROP_REASON_TCP_TOO_OLD_ACK,
129+
/**
130+
* @SKB_DROP_REASON_TCP_ACK_UNSENT_DATA: TCP ACK for data we haven't
131+
* sent yet
132+
*/
133+
SKB_DROP_REASON_TCP_ACK_UNSENT_DATA,
134+
/** @SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE: pruned from TCP OFO queue */
135+
SKB_DROP_REASON_TCP_OFO_QUEUE_PRUNE,
136+
/** @SKB_DROP_REASON_TCP_OFO_DROP: data already in receive queue */
137+
SKB_DROP_REASON_TCP_OFO_DROP,
138+
/** @SKB_DROP_REASON_IP_OUTNOROUTES: route lookup failed */
139+
SKB_DROP_REASON_IP_OUTNOROUTES,
140+
/**
141+
* @SKB_DROP_REASON_BPF_CGROUP_EGRESS: dropped by BPF_PROG_TYPE_CGROUP_SKB
142+
* eBPF program
143+
*/
144+
SKB_DROP_REASON_BPF_CGROUP_EGRESS,
145+
/** @SKB_DROP_REASON_IPV6DISABLED: IPv6 is disabled on the device */
146+
SKB_DROP_REASON_IPV6DISABLED,
147+
/** @SKB_DROP_REASON_NEIGH_CREATEFAIL: failed to create neigh entry */
148+
SKB_DROP_REASON_NEIGH_CREATEFAIL,
149+
/** @SKB_DROP_REASON_NEIGH_FAILED: neigh entry in failed state */
150+
SKB_DROP_REASON_NEIGH_FAILED,
151+
/** @SKB_DROP_REASON_NEIGH_QUEUEFULL: arp_queue for neigh entry is full */
152+
SKB_DROP_REASON_NEIGH_QUEUEFULL,
153+
/** @SKB_DROP_REASON_NEIGH_DEAD: neigh entry is dead */
154+
SKB_DROP_REASON_NEIGH_DEAD,
155+
/** @SKB_DROP_REASON_TC_EGRESS: dropped in TC egress HOOK */
156+
SKB_DROP_REASON_TC_EGRESS,
157+
/**
158+
* @SKB_DROP_REASON_QDISC_DROP: dropped by qdisc when packet outputting (
159+
* failed to enqueue to current qdisc)
160+
*/
161+
SKB_DROP_REASON_QDISC_DROP,
162+
/**
163+
* @SKB_DROP_REASON_CPU_BACKLOG: failed to enqueue the skb to the per CPU
164+
* backlog queue. This can be caused by backlog queue full (see
165+
* netdev_max_backlog in net.rst) or RPS flow limit
166+
*/
167+
SKB_DROP_REASON_CPU_BACKLOG,
168+
/** @SKB_DROP_REASON_XDP: dropped by XDP in input path */
169+
SKB_DROP_REASON_XDP,
170+
/** @SKB_DROP_REASON_TC_INGRESS: dropped in TC ingress HOOK */
171+
SKB_DROP_REASON_TC_INGRESS,
172+
/** @SKB_DROP_REASON_UNHANDLED_PROTO: protocol not implemented or not supported */
173+
SKB_DROP_REASON_UNHANDLED_PROTO,
174+
/** @SKB_DROP_REASON_SKB_CSUM: sk_buff checksum computation error */
175+
SKB_DROP_REASON_SKB_CSUM,
176+
/** @SKB_DROP_REASON_SKB_GSO_SEG: gso segmentation error */
177+
SKB_DROP_REASON_SKB_GSO_SEG,
178+
/**
179+
* @SKB_DROP_REASON_SKB_UCOPY_FAULT: failed to copy data from user space,
180+
* e.g., via zerocopy_sg_from_iter() or skb_orphan_frags_rx()
181+
*/
182+
SKB_DROP_REASON_SKB_UCOPY_FAULT,
183+
/** @SKB_DROP_REASON_DEV_HDR: device driver specific header/metadata is invalid */
184+
SKB_DROP_REASON_DEV_HDR,
185+
/**
186+
* @SKB_DROP_REASON_DEV_READY: the device is not ready to xmit/recv due to
187+
* any of its data structure that is not up/ready/initialized,
188+
* e.g., the IFF_UP is not set, or driver specific tun->tfiles[txq]
189+
* is not initialized
138190
*/
139191
SKB_DROP_REASON_DEV_READY,
140-
SKB_DROP_REASON_FULL_RING, /* ring buffer is full */
141-
SKB_DROP_REASON_NOMEM, /* error due to OOM */
142-
SKB_DROP_REASON_HDR_TRUNC, /* failed to trunc/extract the header
143-
* from networking data, e.g., failed
144-
* to pull the protocol header from
145-
* frags via pskb_may_pull()
146-
*/
147-
SKB_DROP_REASON_TAP_FILTER, /* dropped by (ebpf) filter directly
148-
* attached to tun/tap, e.g., via
149-
* TUNSETFILTEREBPF
150-
*/
151-
SKB_DROP_REASON_TAP_TXFILTER, /* dropped by tx filter implemented
152-
* at tun/tap, e.g., check_filter()
153-
*/
154-
SKB_DROP_REASON_ICMP_CSUM, /* ICMP checksum error */
155-
SKB_DROP_REASON_INVALID_PROTO, /* the packet doesn't follow RFC
156-
* 2211, such as a broadcasts
157-
* ICMP_TIMESTAMP
158-
*/
159-
SKB_DROP_REASON_IP_INADDRERRORS, /* host unreachable, corresponding
160-
* to IPSTATS_MIB_INADDRERRORS
161-
*/
162-
SKB_DROP_REASON_IP_INNOROUTES, /* network unreachable, corresponding
163-
* to IPSTATS_MIB_INADDRERRORS
164-
*/
165-
SKB_DROP_REASON_PKT_TOO_BIG, /* packet size is too big (maybe exceed
166-
* the MTU)
167-
*/
192+
/** @SKB_DROP_REASON_FULL_RING: ring buffer is full */
193+
SKB_DROP_REASON_FULL_RING,
194+
/** @SKB_DROP_REASON_NOMEM: error due to OOM */
195+
SKB_DROP_REASON_NOMEM,
196+
/**
197+
* @SKB_DROP_REASON_HDR_TRUNC: failed to trunc/extract the header from
198+
* networking data, e.g., failed to pull the protocol header from
199+
* frags via pskb_may_pull()
200+
*/
201+
SKB_DROP_REASON_HDR_TRUNC,
202+
/**
203+
* @SKB_DROP_REASON_TAP_FILTER: dropped by (ebpf) filter directly attached
204+
* to tun/tap, e.g., via TUNSETFILTEREBPF
205+
*/
206+
SKB_DROP_REASON_TAP_FILTER,
207+
/**
208+
* @SKB_DROP_REASON_TAP_TXFILTER: dropped by tx filter implemented at
209+
* tun/tap, e.g., check_filter()
210+
*/
211+
SKB_DROP_REASON_TAP_TXFILTER,
212+
/** @SKB_DROP_REASON_ICMP_CSUM: ICMP checksum error */
213+
SKB_DROP_REASON_ICMP_CSUM,
214+
/**
215+
* @SKB_DROP_REASON_INVALID_PROTO: the packet doesn't follow RFC 2211,
216+
* such as a broadcasts ICMP_TIMESTAMP
217+
*/
218+
SKB_DROP_REASON_INVALID_PROTO,
219+
/**
220+
* @SKB_DROP_REASON_IP_INADDRERRORS: host unreachable, corresponding to
221+
* IPSTATS_MIB_INADDRERRORS
222+
*/
223+
SKB_DROP_REASON_IP_INADDRERRORS,
224+
/**
225+
* @SKB_DROP_REASON_IP_INNOROUTES: network unreachable, corresponding to
226+
* IPSTATS_MIB_INADDRERRORS
227+
*/
228+
SKB_DROP_REASON_IP_INNOROUTES,
229+
/**
230+
* @SKB_DROP_REASON_PKT_TOO_BIG: packet size is too big (maybe exceed the
231+
* MTU)
232+
*/
233+
SKB_DROP_REASON_PKT_TOO_BIG,
234+
/**
235+
* @SKB_DROP_REASON_MAX: the maximum of drop reason, which shouldn't be
236+
* used as a real 'reason'
237+
*/
168238
SKB_DROP_REASON_MAX,
169239
};
170240

0 commit comments

Comments
 (0)