This series backports most of the patches that add a reason to skb free sites.
Each individual patch has been compile-tested so I don't expect any breakage.
David Ahern (1):
ipv6: Add reasons for skb drops to __udp6_lib_rcv
Dongli Zhang (2):
net: tap: track dropped skb via kfree_skb_reason(
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in udp_queue_rcv_one_skb().
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
net/ipv4/udp.c | 12 +---
1 file changed, 9
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in ip_rcv_core(). Three new
drop reasons are introduced:
SKB_DROP_REASON_OTHERHOST
SKB_DROP_REASON_IP_CSUM
SKB_DROP_REASON_IP_INHDR
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: N
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in __udp_queue_rcv_skb().
Following new drop reasons are introduced:
SKB_DROP_REASON_SOCKET_RCVBUFF
SKB_DROP_REASON_PROTO_MEM
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikolay
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in nf_hook_slow() when
skb is dropped by reason of NF_DROP. Following new drop reasons
are introduced:
SKB_DROP_REASON_NETFILTER_DROP
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-o
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in ip_rcv_finish_core(),
following drop reasons are introduced:
SKB_DROP_REASON_IP_RPFILTER
SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: N
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in ip_protocol_deliver_rcu().
Following new drop reasons are introduced:
SKB_DROP_REASON_XFRM_POLICY
SKB_DROP_REASON_IP_NOPROTO
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikol
From: Menglong Dong
Rename SKB_DROP_REASON_SOCKET_FILTER, which is used
as the reason of skb drop out of socket filter before
it's part of a released kernel. It will be used for
more protocols than just TCP in future series.
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Link: https://l
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in ip_rcv_finish_core(),
following drop reasons are introduced:
SKB_DROP_REASON_IP_RPFILTER
SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: N
From: Menglong Dong
For TCP protocol, tcp_drop() is used to free the skb when it needs
to be dropped. To make use of kfree_skb_reason() and pass the drop
reason to it, introduce the function tcp_drop_reason(). Meanwhile,
make tcp_drop() an inline call to tcp_drop_reason().
Reviewed-by: Mengen Su
This series backports most of the patches that add a reason to skb free sites.
Each individual patch has been compile-tested so I don't expect any breakage.
David Ahern (1):
ipv6: Add reasons for skb drops to __udp6_lib_rcv
Dongli Zhang (2):
net: tap: track dropped skb via kfree_skb_reason(
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in nf_hook_slow() when
skb is dropped by reason of NF_DROP. Following new drop reasons
are introduced:
SKB_DROP_REASON_NETFILTER_DROP
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-o
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in ip_protocol_deliver_rcu().
Following new drop reasons are introduced:
SKB_DROP_REASON_XFRM_POLICY
SKB_DROP_REASON_IP_NOPROTO
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikol
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in ip_rcv_core(). Three new
drop reasons are introduced:
SKB_DROP_REASON_OTHERHOST
SKB_DROP_REASON_IP_CSUM
SKB_DROP_REASON_IP_INHDR
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: N
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in __udp_queue_rcv_skb().
Following new drop reasons are introduced:
SKB_DROP_REASON_SOCKET_RCVBUFF
SKB_DROP_REASON_PROTO_MEM
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikolay
From: David Ahern
Add reasons to __udp6_lib_rcv for skb drops. The only twist is that the
NO_SOCKET takes precedence over the CSUM or other counters for that
path (motivation behind this patch - csum counter was misleading).
Signed-off-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: N
From: Menglong Dong
Rename SKB_DROP_REASON_SOCKET_FILTER, which is used
as the reason of skb drop out of socket filter before
it's part of a released kernel. It will be used for
more protocols than just TCP in future series.
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Link: https://l
From: Menglong Dong
Replace kfree_skb() with kfree_skb_reason() in udp_queue_rcv_one_skb().
Signed-off-by: Menglong Dong
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
net/ipv4/udp.c | 12 +---
1 file changed, 9
From: Menglong Dong
Replace kfree_skb() used in ip6_rcv_core() with kfree_skb_reason().
No new drop reasons are added.
Seems now we use 'SKB_DROP_REASON_IP_INHDR' for too many case during
ipv6 header parse or check, just like what 'IPSTATS_MIB_INHDRERRORS'
do. Will it be too general and hard to
From: Menglong Dong
Replace kfree_skb() which is used in the packet egress path of IP layer
with kfree_skb_reason(). Functions that are involved include:
__ip_queue_xmit()
ip_finish_output()
ip_mc_finish_output()
ip6_output()
ip6_finish_output()
ip6_finish_output2()
Following new drop reasons a
From: Eric Dumazet
packets in OFO queue might be redundant, and dropped.
tcp_drop() is no longer needed.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
include/linux/skbuff.h | 1 +
include/trace/events/skb.h |
From: Menglong Dong
As David Ahern suggested, the reasons for skb drops should be more
general and not be code based.
Therefore, rename SKB_DROP_REASON_PTYPE_ABSENT to
SKB_DROP_REASON_UNHANDLED_PROTO, which is used for the cases of no
L3 protocol handler, no L4 protocol handler, version extensio
From: Eric Dumazet
Add basic support for drop reasons in tcp_rcv_state_process()
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
include/linux/skbuff.h | 3 +++
include/trace/events/skb.h | 7 +--
net/ipv4/tcp
From: Menglong Dong
Pass the address of drop reason to tcp_v4_inbound_md5_hash() and
tcp_v6_inbound_md5_hash() to store the reasons for skb drops when this
function fails. Therefore, the drop reason can be passed to
kfree_skb_reason() when the skb needs to be freed.
Following drop reasons are ad
From: Menglong Dong
Use kfree_skb_reason() for some path in tcp_v4_rcv() that missed before,
including:
SKB_DROP_REASON_SOCKET_FILTER
SKB_DROP_REASON_XFRM_POLICY
Reviewed-by: Mengen Sun
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Reviewed-by: Eric Dumazet
Reviewed-by: David Ahern
Si
From: Menglong Dong
Pass the address of drop_reason to tcp_add_backlog() to store the
reasons for skb drops when fails. Following drop reasons are
introduced:
SKB_DROP_REASON_SOCKET_BACKLOG
Reviewed-by: Mengen Sun
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Reviewed-by: Eric Dumazet
From: Menglong Dong
Eventually, I find out the handler function for inputting route lookup
fail: ip_error().
The drop reasons we used in ip_error() are almost corresponding to
IPSTATS_MIB_*, and following new reasons are introduced:
SKB_DROP_REASON_IP_INADDRERRORS
SKB_DROP_REASON_IP_INNOROUTES
From: Menglong Dong
Replace kfree_skb() used in __neigh_event_send() with
kfree_skb_reason(). Following drop reasons are added:
SKB_DROP_REASON_NEIGH_FAILED
SKB_DROP_REASON_NEIGH_QUEUEFULL
SKB_DROP_REASON_NEIGH_DEAD
The first two reasons above should be the hot path that skb drops
in neighbour
From: Dongli Zhang
The TUN can be used as vhost-net backend. E.g, the tun_net_xmit() is the
interface to forward the skb from TUN to vhost-net/virtio-net.
However, there are many "goto drop" in the TUN driver. Therefore, the
kfree_skb_reason() is involved at each "goto drop" to help userspace
ft
From: Menglong Dong
In order to report the reasons of skb drops in 'sock_queue_rcv_skb()',
introduce the function 'sock_queue_rcv_skb_reason()'.
As the return value of 'sock_queue_rcv_skb()' is used as the error code,
we can't make it as drop reason and have to pass extra output argument.
'sock_
From: Menglong Dong
Replace kfree_skb() used in do_xdp_generic() with kfree_skb_reason().
The drop reason SKB_DROP_REASON_XDP is introduced for this case.
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
include/linux/s
From: Menglong Dong
Add reason for skb drops to __netif_receive_skb_core() when packet_type
not found to handle the skb. For this purpose, the drop reason
SKB_DROP_REASON_PTYPE_ABSENT is introduced. Take ether packets for
example, this case mainly happens when L3 protocol is not supported.
Signe
From: Menglong Dong
In order to simply the definition and assignment for
'enum skb_drop_reason', introduce some helpers.
SKB_DR() is used to define a variable of type 'enum skb_drop_reason'
with the 'SKB_DROP_REASON_NOT_SPECIFIED' initial value.
SKB_DR_SET() is used to set the value of the vari
From: Menglong Dong
Replace kfree_skb() used in sch_handle_egress() with kfree_skb_reason().
The drop reason SKB_DROP_REASON_TC_EGRESS is introduced. Considering
the code path of tc egerss, we make it distinct with the drop reason
of SKB_DROP_REASON_QDISC_DROP in the next commit.
Signed-off-by:
From: Menglong Dong
Replace kfree_skb() which is used in ip6_forward() and ip_forward()
with kfree_skb_reason().
The new drop reason 'SKB_DROP_REASON_PKT_TOO_BIG' is introduced for
the case that the length of the packet exceeds MTU and can't
fragment.
Signed-off-by: Menglong Dong
Reviewed-by:
From: Menglong Dong
Replace tcp_drop() used in tcp_data_queue_ofo with tcp_drop_reason().
Following drop reasons are introduced:
SKB_DROP_REASON_TCP_OFOMERGE
Reviewed-by: Mengen Sun
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Reviewed-by: Eric Dumazet
Reviewed-by: David Ahern
Signed
From: Menglong Dong
Replace kfree_skb() used in icmp_rcv() and icmpv6_rcv() with
kfree_skb_reason().
In order to get the reasons of the skb drops after icmp message handle,
we change the return type of 'handler()' in 'struct icmp_control' from
'bool' to 'enum skb_drop_reason'. This may change it
From: Menglong Dong
Replace tcp_drop() used in tcp_rcv_established() with tcp_drop_reason().
Following drop reasons are added:
SKB_DROP_REASON_TCP_FLAGS
Reviewed-by: Mengen Sun
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Reviewed-by: Eric Dumazet
Reviewed-by: David Ahern
Signed-off-
From: Menglong Dong
When neighbour become invalid or destroyed, neigh_invalidate() will be
called. neigh->ops->error_report() will be called if the neighbour's
state is NUD_FAILED, and seems here is the only use of error_report().
So we can tell that the reason of skb drops in arp_error_report()
From: Menglong Dong
Replace kfree_skb() used in tcp_v6_rcv() with kfree_skb_reason().
Reviewed-by: Mengen Sun
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Reviewed-by: Eric Dumazet
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikol
From: Menglong Dong
The SKB_DR_OR() is used to set the drop reason to a value when it is
not set or specified yet. SKB_NOT_DROPPED_YET should also be considered
as not set.
Reviewed-by: Jiang Biao
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nik
From: Menglong Dong
Sometimes, we may forget to reset skb drop reason to NOT_SPECIFIED after
we make it the return value of the functions with return type of enum
skb_drop_reason, such as tcp_inbound_md5_hash. Therefore, its value can
be SKB_NOT_DROPPED_YET(0), which is invalid for kfree_skb_reas
From: Menglong Dong
To report reasons of skb drops, introduce the function
kfree_skb_list_reason() and make kfree_skb_list() an inline call to
it. This function will be used in the next commit in
__dev_xmit_skb().
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nikolay Bo
From: Menglong Dong
Add reasons for skb drops to __dev_xmit_skb() by replacing
kfree_skb_list() with kfree_skb_list_reason(). The drop reason of
SKB_DROP_REASON_QDISC_DROP is introduced for qdisc enqueue fails.
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nikolay Boris
From: Menglong Dong
Replace kfree_skb() used in TLV encoded option header parsing with
kfree_skb_reason(). Following functions are involved:
ip6_parse_tlv()
ipv6_hop_ra()
ipv6_hop_ioam()
ipv6_hop_jumbo()
ipv6_hop_calipso()
ipv6_dest_hao()
Most skb drops during this process are regarded as 'InHd
From: Dongli Zhang
The TAP can be used as vhost-net backend. E.g., the tap_handle_frame() is
the interface to forward the skb from TAP to vhost-net/virtio-net.
However, there are many "goto drop" in the TAP driver. Therefore, the
kfree_skb_reason() is involved at each "goto drop" to help userspa
From: Menglong Dong
Replace tcp_drop() used in tcp_data_queue() with tcp_drop_reason().
Following drop reasons are introduced:
SKB_DROP_REASON_TCP_ZEROWINDOW
SKB_DROP_REASON_TCP_OLD_DATA
SKB_DROP_REASON_TCP_OVERWINDOW
SKB_DROP_REASON_TCP_OLD_DATA is used for the case that end_seq of skb
less th
From: Jakub Kicinski
We have a number of cases where function returns drop/no drop
decision as a boolean. Now that we want to report the reason
code as well we have to pass extra output arguments.
We can make the reason code evaluate correctly as bool.
I believe we're good to reorder the reason
From: Menglong Dong
Replace kfree_skb() used in enqueue_to_backlog() with
kfree_skb_reason(). The skb rop reason SKB_DROP_REASON_CPU_BACKLOG is
introduced for the case of failing to enqueue the skb to the per CPU
backlog queue. The further reason can be backlog queue full or RPS
flow limition, an
From: Menglong Dong
In order to add the skb drop reasons support to icmpv6_param_prob(),
introduce the function icmpv6_param_prob_reason() and make
icmpv6_param_prob() an inline call to it. This new function will be
used in the following patches.
Signed-off-by: Menglong Dong
Reviewed-by: Jiang
From: Eric Dumazet
Creates four new drop reasons for the following cases:
1) packet being rejected by RFC 7323 PAWS check
2) packet being rejected by SEQUENCE check
3) Invalid RST packet
4) Invalid SYN packet
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
From: Eric Dumazet
Add TCP_TOO_OLD_ACK and TCP_ACK_UNSENT_DATA drop
reasons so that tcp_rcv_established() can report
them.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
include/linux/skbuff.h | 2 ++
include/trace
From: Menglong Dong
Replace kfree_skb() used in tcp_v4_do_rcv() and tcp_v6_do_rcv() with
kfree_skb_reason().
Reviewed-by: Mengen Sun
Reviewed-by: Hao Peng
Signed-off-by: Menglong Dong
Reviewed-by: Eric Dumazet
Reviewed-by: David Ahern
Signed-off-by: David S. Miller
Acked-by: Nikolay Boriso
From: Menglong Dong
Replace kfree_skb() used in sch_handle_ingress() with
kfree_skb_reason(). Following drop reasons are introduced:
SKB_DROP_REASON_TC_INGRESS
Signed-off-by: Menglong Dong
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
include/l
From: Menglong Dong
The 'reason' will be set to 'SKB_DROP_REASON_NOT_SPECIFIED' if it not
small that SKB_DROP_REASON_MAX in net_dm_packet_trace_kfree_skb_hit(),
but it can't avoid it to be 0, which is invalid and can cause NULL
pointer in drop_reasons.
Therefore, reset it to SKB_DROP_REASON_NOT_
From: Eric Dumazet
Add one reason for packets dropped from OFO queue because
of memory pressure.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller
Acked-by: Nikolay Borisov
Signed-off-by: Nikolay Borisov
---
include/linux/skbuff.h | 1 +
include/trace/events/skb.h | 2 ++
net/i
56 matches
Mail list logo