All of lore.kernel.org
 help / color / mirror / Atom feed
From: menglong8.dong@gmail.com
To: dsahern@kernel.org, kuba@kernel.org
Cc: rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net,
	yoshfuji@linux-ipv6.org, edumazet@google.com,
	pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de,
	imagedong@tencent.com, alobakin@pm.me, pabeni@redhat.com,
	cong.wang@bytedance.com, talalahmad@google.com,
	haokexin@gmail.com, keescook@chromium.org, memxor@gmail.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	mengensun@tencent.com
Subject: [PATCH v2 net-next 1/8] net: socket: intrudoce SKB_DROP_REASON_SOCKET_FILTER
Date: Thu, 27 Jan 2022 17:13:01 +0800	[thread overview]
Message-ID: <20220127091308.91401-2-imagedong@tencent.com> (raw)
In-Reply-To: <20220127091308.91401-1-imagedong@tencent.com>

From: Menglong Dong <imagedong@tencent.com>

Introduce SKB_DROP_REASON_SOCKET_FILTER, which is used as the reason
of skb drop out of socket filter. Meanwhile, replace
SKB_DROP_REASON_TCP_FILTER with it.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
---
 include/linux/skbuff.h     | 2 +-
 include/trace/events/skb.h | 2 +-
 net/ipv4/tcp_ipv4.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bf11e1fbd69b..8a636e678902 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -318,7 +318,7 @@ enum skb_drop_reason {
 	SKB_DROP_REASON_NO_SOCKET,
 	SKB_DROP_REASON_PKT_TOO_SMALL,
 	SKB_DROP_REASON_TCP_CSUM,
-	SKB_DROP_REASON_TCP_FILTER,
+	SKB_DROP_REASON_SOCKET_FILTER,
 	SKB_DROP_REASON_UDP_CSUM,
 	SKB_DROP_REASON_MAX,
 };
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 3e042ca2cedb..a8a64b97504d 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -14,7 +14,7 @@
 	EM(SKB_DROP_REASON_NO_SOCKET, NO_SOCKET)		\
 	EM(SKB_DROP_REASON_PKT_TOO_SMALL, PKT_TOO_SMALL)	\
 	EM(SKB_DROP_REASON_TCP_CSUM, TCP_CSUM)			\
-	EM(SKB_DROP_REASON_TCP_FILTER, TCP_FILTER)		\
+	EM(SKB_DROP_REASON_SOCKET_FILTER, SOCKET_FILTER)	\
 	EM(SKB_DROP_REASON_UDP_CSUM, UDP_CSUM)			\
 	EMe(SKB_DROP_REASON_MAX, MAX)
 
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index b3f34e366b27..938b59636578 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2095,7 +2095,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
 	nf_reset_ct(skb);
 
 	if (tcp_filter(sk, skb)) {
-		drop_reason = SKB_DROP_REASON_TCP_FILTER;
+		drop_reason = SKB_DROP_REASON_SOCKET_FILTER;
 		goto discard_and_relse;
 	}
 	th = (const struct tcphdr *)skb->data;
-- 
2.34.1


  reply	other threads:[~2022-01-27  9:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  9:13 [PATCH v2 net-next 0/8] net: use kfree_skb_reason() for ip/udp packet receive menglong8.dong
2022-01-27  9:13 ` menglong8.dong [this message]
2022-01-27 15:37   ` [PATCH v2 net-next 1/8] net: socket: intrudoce SKB_DROP_REASON_SOCKET_FILTER David Ahern
2022-01-27 16:42     ` Jakub Kicinski
2022-01-28  7:31       ` Menglong Dong
2022-01-27  9:13 ` [PATCH v2 net-next 2/8] net: skb_drop_reason: add document for drop reasons menglong8.dong
2022-01-27 15:39   ` David Ahern
2022-01-27  9:13 ` [PATCH v2 net-next 3/8] net: netfilter: use kfree_drop_reason() for NF_DROP menglong8.dong
2022-01-27  9:13 ` [PATCH v2 net-next 4/8] net: ipv4: use kfree_skb_reason() in ip_rcv_core() menglong8.dong
2022-01-27 16:33   ` David Ahern
2022-01-27  9:13 ` [PATCH v2 net-next 5/8] net: ipv4: use kfree_skb_reason() in ip_rcv_finish_core() menglong8.dong
2022-01-27  9:13 ` [PATCH v2 net-next 6/8] net: ipv4: use kfree_skb_reason() in ip_protocol_deliver_rcu() menglong8.dong
2022-01-27  9:13 ` [PATCH v2 net-next 7/8] net: udp: use kfree_skb_reason() in udp_queue_rcv_one_skb() menglong8.dong
2022-01-27  9:13 ` [PATCH v2 net-next 8/8] net: udp: use kfree_skb_reason() in __udp_queue_rcv_skb() menglong8.dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220127091308.91401-2-imagedong@tencent.com \
    --to=menglong8.dong@gmail.com \
    --cc=alobakin@pm.me \
    --cc=cong.wang@bytedance.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=haokexin@gmail.com \
    --cc=imagedong@tencent.com \
    --cc=kadlec@netfilter.org \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=mengensun@tencent.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=rostedt@goodmis.org \
    --cc=talalahmad@google.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.