diff mbox series

[net-next,1/2] net: dropreason: add SKB_DROP_REASON_BLACKHOLE

Message ID 20250212164323.2183023-2-edumazet@google.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: better support of blackholes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 42 this patch: 42
netdev/build_tools success Errors and warnings before: 26 (+1) this patch: 26 (+1)
netdev/cc_maintainers warning 1 maintainers not CCed: lucien.xin@gmail.com
netdev/build_clang success Errors and warnings before: 7662 this patch: 7662
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4968 this patch: 4968
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 25 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2025-02-13--00-00 (tests: 889)

Commit Message

Eric Dumazet Feb. 12, 2025, 4:43 p.m. UTC
Use this new drop reason from dst_discard_out().

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/dropreason-core.h | 5 +++++
 net/core/dst.c                | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

David Ahern Feb. 12, 2025, 5:57 p.m. UTC | #1
On 2/12/25 9:43 AM, Eric Dumazet wrote:
> Use this new drop reason from dst_discard_out().
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/net/dropreason-core.h | 5 +++++
>  net/core/dst.c                | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>
diff mbox series

Patch

diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
index 32a34dfe8cc58fb1afda8922a52249080f1183b5..de42577f16dd199790cea9ac07b326864f2103e3 100644
--- a/include/net/dropreason-core.h
+++ b/include/net/dropreason-core.h
@@ -117,6 +117,7 @@ 
 	FN(ARP_PVLAN_DISABLE)		\
 	FN(MAC_IEEE_MAC_CONTROL)	\
 	FN(BRIDGE_INGRESS_STP_STATE)	\
+	FN(BLACKHOLE)			\
 	FNe(MAX)
 
 /**
@@ -554,6 +555,10 @@  enum skb_drop_reason {
 	 * ingress bridge port does not allow frames to be forwarded.
 	 */
 	SKB_DROP_REASON_BRIDGE_INGRESS_STP_STATE,
+	/**
+	 * @SKB_DROP_REASON_BLACKHOLE: blackhole route.
+	 */
+	SKB_DROP_REASON_BLACKHOLE,
 	/**
 	 * @SKB_DROP_REASON_MAX: the maximum of core drop reasons, which
 	 * shouldn't be used as a real 'reason' - only for tracing code gen
diff --git a/net/core/dst.c b/net/core/dst.c
index 9552a90d4772dce49b5fe94d2f1d8da6979d9908..0cbbad4d7c07fa397f66a2d252a636f90dafddee 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -29,7 +29,7 @@ 
 
 int dst_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
-	kfree_skb(skb);
+	kfree_skb_reason(skb, SKB_DROP_REASON_BLACKHOLE);
 	return 0;
 }
 EXPORT_SYMBOL(dst_discard_out);