]> git.baikalelectronics.ru Git - kernel.git/commit
net: skb: use kfree_skb_reason() in tcp_v4_rcv()
authorMenglong Dong <imagedong@tencent.com>
Sun, 9 Jan 2022 06:36:27 +0000 (14:36 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 10 Jan 2022 00:30:34 +0000 (16:30 -0800)
commit6c0dcab5aa21ec8a7cb77731f182b39363514f82
tree10a76ff72bf482d9e89e41fcf4d12ca5f0194d36
parentdb9598297c1cda80b11b511b90cf9b07e7e0c07c
net: skb: use kfree_skb_reason() in tcp_v4_rcv()

Replace kfree_skb() with kfree_skb_reason() in tcp_v4_rcv(). Following
drop reasons are added:

SKB_DROP_REASON_NO_SOCKET
SKB_DROP_REASON_PKT_TOO_SMALL
SKB_DROP_REASON_TCP_CSUM
SKB_DROP_REASON_TCP_FILTER

After this patch, 'kfree_skb' event will print message like this:

$           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
$              | |         |   |||||     |         |
          <idle>-0       [000] ..s1.    36.113438: kfree_skb: skbaddr=(____ptrval____) protocol=2048 location=(____ptrval____) reason: NO_SOCKET

The reason of skb drop is printed too.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/skbuff.h
include/trace/events/skb.h
net/ipv4/tcp_ipv4.c