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 |
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 --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);
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(-)