Bug 25506 - net: Add a proc interface to display the counts of skb drop reasons
Summary: net: Add a proc interface to display the counts of skb drop reasons
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: net (show other bugs) net
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: XuanZhuo
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-26 09:26 UTC by wangyaxin
Modified: 2025-09-26 09:31 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wangyaxin 2025-09-26 09:26:25 UTC
Problems:
1.kfree_skb_reason provides tools for monitoring packet drop reasons 
  but cannot retain historical drop counts.
2.There is no unified interface to display all packet drop statistics.

Solution:
1.Implement skb drop reason counting through the tracepoint of kfree_skb 
  to decouple the functionality.
2.Implement a proc interface to display the counts of skb drop reasons.

Usage:
bash-4.4# cat /proc/net/drop_reason_stat
REASON                     TOTAL    GROUP      DESC
---------------------------------------------------------------------------
NOT_SPECIFIED              0        Other      Drop reason not specified
NO_SOCKET                  0        Input      Socket not found
PKT_TOO_SMALL              0        Input      Packet size too small
TCP_CSUM                   0        TCP        TCP checksum error
SOCKET_FILTER              0        Input      Dropped by socket filter
UDP_CSUM                   0        UDP        UDP checksum error
NETFILTER_DROP             0        Input      Dropped by netfilter
OTHERHOST                  0        Input      Packet not for this host
IP_CSUM                    0        IP         IP checksum error
IP_INHDR                   0        IP         IP header error
IP_RPFILTER                0        IP         IP rpfilter failed
UNICAST_IN_L2_MULTICAST    0        Input      L2 multicast, L3 unicast
XFRM_POLICY                0        IPSec      XFRM policy check failed
IP_NOPROTO                 0        IP         No support for IP protocol
SOCKET_RCVBUFF             0        Input      Socket receive buffer full
PROTO_MEM                  0        Input      Protocol memory limit
TCP_MD5NOTFOUND            0        TCP        TCP-MD5 not found
...
IPV6_NDISC_HOP_LIMIT       0        IPv6       IPv6 NDISC hop limit
IPV6_NDISC_BAD_CODE        0        IPv6       IPv6 NDISC bad code
IPV6_NDISC_BAD_OPTIONS     0        IPv6       IPv6 NDISC bad options
IPV6_NDISC_NS_OTHERHOST    0        IPv6       IPv6 NDISC NS for other host
QUEUE_PURGE                0        Other      Queue purged
Comment 1 小龙 admin 2025-09-26 09:31:33 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5826