[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220304060046.115414-7-imagedong@tencent.com>
Date: Fri, 4 Mar 2022 14:00:45 +0800
From: menglong8.dong@...il.com
To: dsahern@...nel.org, kuba@...nel.org
Cc: rostedt@...dmis.org, mingo@...hat.com, davem@...emloft.net,
ast@...nel.org, daniel@...earbox.net, hawk@...nel.org,
john.fastabend@...il.com, imagedong@...cent.com,
edumazet@...gle.com, talalahmad@...gle.com, keescook@...omium.org,
ilias.apalodimas@...aro.org, alobakin@...me,
flyingpeng@...cent.com, mengensun@...cent.com, atenart@...nel.org,
bigeasy@...utronix.de, memxor@...il.com, arnd@...db.de,
pabeni@...hat.com, willemb@...gle.com, vvs@...tuozzo.com,
cong.wang@...edance.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: [PATCH net-next v2 6/7] net: dev: use kfree_skb_reason() for sch_handle_ingress()
From: Menglong Dong <imagedong@...cent.com>
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 <imagedong@...cent.com>
---
v2:
- rename SKB_DROP_REASON_QDISC_INGRESS to SKB_DROP_REASON_TC_INGRESS
---
include/linux/skbuff.h | 1 +
include/trace/events/skb.h | 1 +
net/core/dev.c | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e13ef6ca5470..d0a10fa477be 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -406,6 +406,7 @@ enum skb_drop_reason {
* net.rst) or RPS flow limit
*/
SKB_DROP_REASON_XDP, /* dropped by XDP in input path */
+ SKB_DROP_REASON_TC_INGRESS, /* dropped in TC ingress HOOK */
SKB_DROP_REASON_MAX,
};
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 8c4c343c830f..514dd2de8776 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -49,6 +49,7 @@
EM(SKB_DROP_REASON_QDISC_DROP, QDISC_DROP) \
EM(SKB_DROP_REASON_CPU_BACKLOG, CPU_BACKLOG) \
EM(SKB_DROP_REASON_XDP, XDP) \
+ EM(SKB_DROP_REASON_TC_INGRESS, TC_INGRESS) \
EMe(SKB_DROP_REASON_MAX, MAX)
#undef EM
diff --git a/net/core/dev.c b/net/core/dev.c
index 5ad74a46452b..7eb293684871 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5012,7 +5012,7 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret,
break;
case TC_ACT_SHOT:
mini_qdisc_qstats_cpu_drop(miniq);
- kfree_skb(skb);
+ kfree_skb_reason(skb, SKB_DROP_REASON_TC_INGRESS);
return NULL;
case TC_ACT_STOLEN:
case TC_ACT_QUEUED:
--
2.35.1
Powered by blists - more mailing lists