linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 0/7] net: use kfree_skb_reason() for ip/udp packet receive
@ 2022-01-28  7:33 menglong8.dong
  2022-01-28  7:33 ` [PATCH v3 net-next 1/7] net: skb_drop_reason: add document for drop reasons menglong8.dong
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: menglong8.dong @ 2022-01-28  7:33 UTC (permalink / raw)
  To: dsahern, kuba
  Cc: rostedt, mingo, davem, yoshfuji, pablo, kadlec, fw, imagedong,
	edumazet, alobakin, paulb, keescook, talalahmad, haokexin,
	memxor, linux-kernel, netdev, netfilter-devel, coreteam,
	cong.wang, mengensun

From: Menglong Dong <imagedong@tencent.com>

In this series patches, kfree_skb() is replaced with kfree_skb_reason()
during ipv4 and udp4 packet receiving path, and following drop reasons
are introduced:

SKB_DROP_REASON_SOCKET_FILTER
SKB_DROP_REASON_NETFILTER_DROP
SKB_DROP_REASON_OTHERHOST
SKB_DROP_REASON_IP_CSUM
SKB_DROP_REASON_IP_INHDR
SKB_DROP_REASON_IP_RPFILTER
SKB_DROP_REASON_UNICAST_IN_L2_MULTICAST
SKB_DROP_REASON_XFRM_POLICY
SKB_DROP_REASON_IP_NOPROTO
SKB_DROP_REASON_SOCKET_RCVBUFF
SKB_DROP_REASON_PROTO_MEM

TCP is more complex, so I left it in the next series.

I just figure out how __print_symbolic() works. It doesn't base on the
array index, but searching for symbols by loop. So I'm a little afraid
it's performance.

Changes since v2:
- use SKB_DROP_REASON_PKT_TOO_SMALL for a path in ip_rcv_core()

Changes since v1:
- add document for all drop reasons, as David advised
- remove unreleated cleanup
- remove EARLY_DEMUX and IP_ROUTE_INPUT drop reason
- replace {UDP, TCP}_FILTER with SOCKET_FILTER


Menglong Dong (7):
  net: skb_drop_reason: add document for drop reasons
  net: netfilter: use kfree_drop_reason() for NF_DROP
  net: ipv4: use kfree_skb_reason() in ip_rcv_core()
  net: ipv4: use kfree_skb_reason() in ip_rcv_finish_core()
  net: ipv4: use kfree_skb_reason() in ip_protocol_deliver_rcu()
  net: udp: use kfree_skb_reason() in udp_queue_rcv_one_skb()
  net: udp: use kfree_skb_reason() in __udp_queue_rcv_skb()

 include/linux/skbuff.h     | 38 ++++++++++++++++++++++++++++++++------
 include/trace/events/skb.h | 11 +++++++++++
 net/ipv4/ip_input.c        | 31 +++++++++++++++++++++++--------
 net/ipv4/udp.c             | 22 ++++++++++++++++------
 net/netfilter/core.c       |  3 ++-
 5 files changed, 84 insertions(+), 21 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-02-11  8:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28  7:33 [PATCH v3 net-next 0/7] net: use kfree_skb_reason() for ip/udp packet receive menglong8.dong
2022-01-28  7:33 ` [PATCH v3 net-next 1/7] net: skb_drop_reason: add document for drop reasons menglong8.dong
2022-01-31 17:14   ` David Ahern
2022-02-10  3:19     ` Menglong Dong
2022-02-10  5:12       ` Jakub Kicinski
2022-02-10 13:42         ` Menglong Dong
2022-02-10 16:13           ` Jakub Kicinski
2022-02-10 16:29             ` Eric Dumazet
2022-02-11  8:53               ` Menglong Dong
2022-02-11  8:49             ` Menglong Dong
2022-01-28  7:33 ` [PATCH v3 net-next 2/7] net: netfilter: use kfree_drop_reason() for NF_DROP menglong8.dong
2022-01-28  7:33 ` [PATCH v3 net-next 3/7] net: ipv4: use kfree_skb_reason() in ip_rcv_core() menglong8.dong
2022-01-31 18:05   ` David Ahern
2022-02-04 14:42     ` Menglong Dong
2022-01-28  7:33 ` [PATCH v3 net-next 4/7] net: ipv4: use kfree_skb_reason() in ip_rcv_finish_core() menglong8.dong
2022-01-31 17:45   ` David Ahern
2022-01-28  7:33 ` [PATCH v3 net-next 5/7] net: ipv4: use kfree_skb_reason() in ip_protocol_deliver_rcu() menglong8.dong
2022-01-31 17:49   ` David Ahern
2022-01-28  7:33 ` [PATCH v3 net-next 6/7] net: udp: use kfree_skb_reason() in udp_queue_rcv_one_skb() menglong8.dong
2022-01-31 17:50   ` David Ahern
2022-01-28  7:33 ` [PATCH v3 net-next 7/7] net: udp: use kfree_skb_reason() in __udp_queue_rcv_skb() menglong8.dong
2022-01-31 17:53   ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).