[Devel] [PATCH RH9 00/47] Annotate skb free sites with reason

2023-01-03 Thread Nikolay Borisov
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(

[Devel] [PATCH 06/47] net: udp: use kfree_skb_reason() in udp_queue_rcv_one_skb()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 02/47] net: ipv4: use kfree_skb_reason() in ip_rcv_core()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 07/47] net: udp: use kfree_skb_reason() in __udp_queue_rcv_skb()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 01/47] net: netfilter: use kfree_drop_reason() for NF_DROP

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 03/47] net: ipv4: use kfree_skb_reason() in ip_rcv_finish_core()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 04/47] net: ipv4: use kfree_skb_reason() in ip_protocol_deliver_rcu()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 05/47] net: socket: rename SKB_DROP_REASON_SOCKET_FILTER

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 03/47] net: ipv4: use kfree_skb_reason() in ip_rcv_finish_core()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 09/47] net: tcp: introduce tcp_drop_reason()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH RH9 00/47] Annotate skb free sites with reason

2023-01-03 Thread Nikolay Borisov
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(

[Devel] [PATCH 01/47] net: netfilter: use kfree_drop_reason() for NF_DROP

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 04/47] net: ipv4: use kfree_skb_reason() in ip_protocol_deliver_rcu()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 02/47] net: ipv4: use kfree_skb_reason() in ip_rcv_core()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 07/47] net: udp: use kfree_skb_reason() in __udp_queue_rcv_skb()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 08/47] ipv6: Add reasons for skb drops to __udp6_lib_rcv

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 05/47] net: socket: rename SKB_DROP_REASON_SOCKET_FILTER

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 06/47] net: udp: use kfree_skb_reason() in udp_queue_rcv_one_skb()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 39/47] net: ipv6: add skb drop reasons to ip6_rcv_core()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 18/47] net: ip: add skb drop reasons for ip egress path

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 44/47] tcp: add drop reason support to tcp_ofo_queue()

2023-01-03 Thread Nikolay Borisov
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 |

[Devel] [PATCH 32/47] net: skb: rename SKB_DROP_REASON_PTYPE_ABSENT

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 41/47] tcp: add drop reasons to tcp_rcv_state_process()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 12/47] net: tcp: add skb drop reasons to tcp_v{4, 6}_inbound_md5_hash()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 10/47] net: tcp: add skb drop reasons to tcp_v4_rcv()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 13/47] net: tcp: add skb drop reasons to tcp_add_backlog()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 35/47] net: ipv4: add skb drop reasons to ip_error()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 19/47] net: neigh: use kfree_skb_reason() for __neigh_event_send()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 29/47] net: tun: track dropped skb via kfree_skb_reason()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 30/47] net: sock: introduce sock_queue_rcv_skb_reason()

2023-01-03 Thread Nikolay Borisov
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_

[Devel] [PATCH 25/47] net: dev: use kfree_skb_reason() for do_xdp_generic()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 27/47] net: dev: use kfree_skb_reason() for __netif_receive_skb_core()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 34/47] skb: add some helpers for skb drop reasons

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 21/47] net: dev: use kfree_skb_reason() for sch_handle_egress()

2023-01-03 Thread Nikolay Borisov
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:

[Devel] [PATCH 36/47] net: ip: add skb drop reasons to ip forwarding

2023-01-03 Thread Nikolay Borisov
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:

[Devel] [PATCH 17/47] net: tcp: use tcp_drop_reason() for tcp_data_queue_ofo()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 33/47] net: icmp: add skb drop reasons to icmp protocol

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 15/47] net: tcp: use tcp_drop_reason() for tcp_rcv_established()

2023-01-03 Thread Nikolay Borisov
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-

[Devel] [PATCH 20/47] net: neigh: add skb drop reasons to arp_error_report()

2023-01-03 Thread Nikolay Borisov
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()

[Devel] [PATCH 11/47] net: tcp: use kfree_skb_reason() for tcp_v6_rcv()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 47/47] net: skb: change the definition SKB_DR_SET()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 46/47] net: skb: check the boundrary of drop reason in kfree_skb_reason()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 22/47] net: skb: introduce the function kfree_skb_list_reason()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 23/47] net: dev: add skb drop reasons to __dev_xmit_skb()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 38/47] net: ipv6: add skb drop reasons to TLV parse

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 28/47] net: tap: track dropped skb via kfree_skb_reason()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 16/47] net: tcp: use tcp_drop_reason() for tcp_data_queue()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 31/47] skb: make drop reason booleanable

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 24/47] net: dev: use kfree_skb_reason() for enqueue_to_backlog()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 37/47] net: icmp: introduce function icmpv6_param_prob_reason()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 40/47] tcp: add drop reason support to tcp_validate_incoming()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 42/47] tcp: add two drop reasons for tcp_ack()

2023-01-03 Thread 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

[Devel] [PATCH 14/47] net: tcp: use kfree_skb_reason() for tcp_v{4, 6}_do_rcv()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 26/47] net: dev: use kfree_skb_reason() for sch_handle_ingress()

2023-01-03 Thread Nikolay Borisov
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

[Devel] [PATCH 45/47] net: dm: check the boundary of skb drop reasons

2023-01-03 Thread Nikolay Borisov
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_

[Devel] [PATCH 43/47] tcp: add drop reason support to tcp_prune_ofo_queue()

2023-01-03 Thread Nikolay Borisov
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