mbox series

[net-next,v2,0/7] net: dev: add skb drop reasons to net/core/dev.c

Message ID 20220304060046.115414-1-imagedong@tencent.com (mailing list archive)
Headers show
Series net: dev: add skb drop reasons to net/core/dev.c | expand

Message

Menglong Dong March 4, 2022, 6 a.m. UTC
From: Menglong Dong <imagedong@tencent.com>

In the commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()"),
we added the support of reporting the reasons of skb drops to kfree_skb
tracepoint. And in this series patches, reasons for skb drops are added
to the link layer, which means that 'net/core/dev.c' is our target.

Following functions are processed:

sch_handle_egress()
__dev_xmit_skb()
enqueue_to_backlog()
do_xdp_generic()
sch_handle_ingress()
__netif_receive_skb_core()

and following new drop reasons are added (what they mean can be see in
the document of them):

SKB_DROP_REASON_TC_EGRESS
SKB_DROP_REASON_QDISC_DROP
SKB_DROP_REASON_CPU_BACKLOG
SKB_DROP_REASON_XDP
SKB_DROP_REASON_TC_INGRESS
SKB_DROP_REASON_PTYPE_ABSENT

In order to add skb drop reasons to kfree_skb_list(), the function
kfree_skb_list_reason() is introduced in the 2th patch, which will be
used in __dev_xmit_skb() in the 3th patch.

Changes since v1:
- rename SKB_DROP_REASON_QDISC_EGRESS to SKB_DROP_REASON_TC_EGRESS in the
  1th patch
- remove the 'else' in the 4th patch
- rename SKB_DROP_REASON_QDISC_INGRESS to SKB_DROP_REASON_TC_INGRESS in
  the 6th patch

Menglong Dong (7):
  net: dev: use kfree_skb_reason() for sch_handle_egress()
  net: skb: introduce the function kfree_skb_list_reason()
  net: dev: add skb drop reasons to __dev_xmit_skb()
  net: dev: use kfree_skb_reason() for enqueue_to_backlog()
  net: dev: use kfree_skb_reason() for do_xdp_generic()
  net: dev: use kfree_skb_reason() for sch_handle_ingress()
  net: dev: use kfree_skb_reason() for __netif_receive_skb_core()

 include/linux/skbuff.h     | 26 +++++++++++++++++++++++++-
 include/trace/events/skb.h |  6 ++++++
 net/core/dev.c             | 24 +++++++++++++++---------
 net/core/skbuff.c          |  7 ++++---
 4 files changed, 50 insertions(+), 13 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 4, 2022, 12:30 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri,  4 Mar 2022 14:00:39 +0800 you wrote:
> From: Menglong Dong <imagedong@tencent.com>
> 
> In the commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()"),
> we added the support of reporting the reasons of skb drops to kfree_skb
> tracepoint. And in this series patches, reasons for skb drops are added
> to the link layer, which means that 'net/core/dev.c' is our target.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/7] net: dev: use kfree_skb_reason() for sch_handle_egress()
    https://git.kernel.org/netdev/net-next/c/98b4d7a4e737
  - [net-next,v2,2/7] net: skb: introduce the function kfree_skb_list_reason()
    https://git.kernel.org/netdev/net-next/c/215b0f1963d4
  - [net-next,v2,3/7] net: dev: add skb drop reasons to __dev_xmit_skb()
    https://git.kernel.org/netdev/net-next/c/7faef0547f4c
  - [net-next,v2,4/7] net: dev: use kfree_skb_reason() for enqueue_to_backlog()
    https://git.kernel.org/netdev/net-next/c/44f0bd40803c
  - [net-next,v2,5/7] net: dev: use kfree_skb_reason() for do_xdp_generic()
    https://git.kernel.org/netdev/net-next/c/7e726ed81e1d
  - [net-next,v2,6/7] net: dev: use kfree_skb_reason() for sch_handle_ingress()
    https://git.kernel.org/netdev/net-next/c/a568aff26ac0
  - [net-next,v2,7/7] net: dev: use kfree_skb_reason() for __netif_receive_skb_core()
    https://git.kernel.org/netdev/net-next/c/6c2728b7c141

You are awesome, thank you!