* [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason
@ 2026-05-07 8:43 Eric Dumazet
2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Eric Dumazet @ 2026-05-07 8:43 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell
Cc: Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima,
netdev, eric.dumazet, Eric Dumazet
First patch changes sk_skb_reason_drop() sock to be const.
Second and last patch add SKB_DROP_REASON_IP_OUTNOROUTES
to both tcp_v6_send_response() and inet6_csk_xmit().
Eric Dumazet (3):
net: constify sk_skb_reason_drop() sock parameter
tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response()
ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit()
include/linux/skbuff.h | 3 ++-
include/trace/events/skb.h | 4 ++--
net/core/skbuff.c | 5 +++--
net/ipv6/inet6_connection_sock.c | 3 ++-
net/ipv6/tcp_ipv6.c | 2 +-
5 files changed, 10 insertions(+), 7 deletions(-)
--
2.54.0.563.g4f69b47b94-goog
^ permalink raw reply [flat|nested] 13+ messages in thread* [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter 2026-05-07 8:43 [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet @ 2026-05-07 8:43 ` Eric Dumazet 2026-05-07 15:14 ` David Ahern ` (2 more replies) 2026-05-07 8:43 ` [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() Eric Dumazet ` (2 subsequent siblings) 3 siblings, 3 replies; 13+ messages in thread From: Eric Dumazet @ 2026-05-07 8:43 UTC (permalink / raw) To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima, netdev, eric.dumazet, Eric Dumazet sk_skb_reason_drop() does not change sock parameter, make it const so that we can call it from TCP stack without a cast on a (const) listener socket. Signed-off-by: Eric Dumazet <edumazet@google.com> --- include/linux/skbuff.h | 3 ++- include/trace/events/skb.h | 4 ++-- net/core/skbuff.c | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2bcf78a4de7b9edb0d1342319d4340c0a9997eeb..746e741a8ef99b3052ad581650e5d0db2a95dbb3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1313,7 +1313,8 @@ static inline bool skb_data_unref(const struct sk_buff *skb, return true; } -void __fix_address sk_skb_reason_drop(struct sock *sk, struct sk_buff *skb, +void __fix_address sk_skb_reason_drop(const struct sock *sk, + struct sk_buff *skb, enum skb_drop_reason reason); static inline void diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h index b877133cd93a80f6b130fab64f334ecdeab8c8fd..2945aa7fe9a7ded5bdec5be3a67382de95239517 100644 --- a/include/trace/events/skb.h +++ b/include/trace/events/skb.h @@ -24,14 +24,14 @@ DEFINE_DROP_REASON(FN, FN) TRACE_EVENT(kfree_skb, TP_PROTO(struct sk_buff *skb, void *location, - enum skb_drop_reason reason, struct sock *rx_sk), + enum skb_drop_reason reason, const struct sock *rx_sk), TP_ARGS(skb, location, reason, rx_sk), TP_STRUCT__entry( __field(void *, skbaddr) __field(void *, location) - __field(void *, rx_sk) + __field(const void *, rx_sk) __field(unsigned short, protocol) __field(enum skb_drop_reason, reason) ), diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7dad68e3b5186cf622a3ed5a6e87c09d46bc3fd6..acca1365672c4f98b004c2548133d70c9cf5ddc1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1206,7 +1206,7 @@ void __kfree_skb(struct sk_buff *skb) EXPORT_SYMBOL(__kfree_skb); static __always_inline -bool __sk_skb_reason_drop(struct sock *sk, struct sk_buff *skb, +bool __sk_skb_reason_drop(const struct sock *sk, struct sk_buff *skb, enum skb_drop_reason reason) { if (unlikely(!skb_unref(skb))) @@ -1235,7 +1235,8 @@ bool __sk_skb_reason_drop(struct sock *sk, struct sk_buff *skb, * 'kfree_skb' tracepoint. */ void __fix_address -sk_skb_reason_drop(struct sock *sk, struct sk_buff *skb, enum skb_drop_reason reason) +sk_skb_reason_drop(const struct sock *sk, struct sk_buff *skb, + enum skb_drop_reason reason) { if (__sk_skb_reason_drop(sk, skb, reason)) __kfree_skb(skb); -- 2.54.0.563.g4f69b47b94-goog ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter 2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet @ 2026-05-07 15:14 ` David Ahern 2026-05-07 22:43 ` Kuniyuki Iwashima 2026-05-08 22:15 ` Jakub Kicinski 2 siblings, 0 replies; 13+ messages in thread From: David Ahern @ 2026-05-07 15:14 UTC (permalink / raw) To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, Kuniyuki Iwashima, netdev, eric.dumazet On 5/7/26 2:43 AM, Eric Dumazet wrote: > sk_skb_reason_drop() does not change sock parameter, make it > const so that we can call it from TCP stack without a cast > on a (const) listener socket. > > Signed-off-by: Eric Dumazet <edumazet@google.com> > --- > include/linux/skbuff.h | 3 ++- > include/trace/events/skb.h | 4 ++-- > net/core/skbuff.c | 5 +++-- > 3 files changed, 7 insertions(+), 5 deletions(-) > > Reviewed-by: David Ahern <dsahern@kernel.org> ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter 2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet 2026-05-07 15:14 ` David Ahern @ 2026-05-07 22:43 ` Kuniyuki Iwashima 2026-05-08 22:15 ` Jakub Kicinski 2 siblings, 0 replies; 13+ messages in thread From: Kuniyuki Iwashima @ 2026-05-07 22:43 UTC (permalink / raw) To: Eric Dumazet Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell, Simon Horman, Ido Schimmel, David Ahern, netdev, eric.dumazet On Thu, May 7, 2026 at 1:43 AM Eric Dumazet <edumazet@google.com> wrote: > > sk_skb_reason_drop() does not change sock parameter, make it > const so that we can call it from TCP stack without a cast > on a (const) listener socket. > > Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter 2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet 2026-05-07 15:14 ` David Ahern 2026-05-07 22:43 ` Kuniyuki Iwashima @ 2026-05-08 22:15 ` Jakub Kicinski 2026-05-11 7:16 ` Eric Dumazet 2 siblings, 1 reply; 13+ messages in thread From: Jakub Kicinski @ 2026-05-08 22:15 UTC (permalink / raw) To: Eric Dumazet Cc: David S . Miller, Paolo Abeni, Neal Cardwell, Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima, netdev, eric.dumazet On Thu, 7 May 2026 08:43:03 +0000 Eric Dumazet wrote: > TP_PROTO(struct sk_buff *skb, void *location, > - enum skb_drop_reason reason, struct sock *rx_sk), > + enum skb_drop_reason reason, const struct sock *rx_sk), build says drop_monitor registers for this tracepoint from within the kernel, and needs adjusting. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter 2026-05-08 22:15 ` Jakub Kicinski @ 2026-05-11 7:16 ` Eric Dumazet 0 siblings, 0 replies; 13+ messages in thread From: Eric Dumazet @ 2026-05-11 7:16 UTC (permalink / raw) To: Jakub Kicinski Cc: David S . Miller, Paolo Abeni, Neal Cardwell, Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima, netdev, eric.dumazet On Fri, May 8, 2026 at 3:15 PM Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 7 May 2026 08:43:03 +0000 Eric Dumazet wrote: > > TP_PROTO(struct sk_buff *skb, void *location, > > - enum skb_drop_reason reason, struct sock *rx_sk), > > + enum skb_drop_reason reason, const struct sock *rx_sk), > > build says drop_monitor registers for this tracepoint from within > the kernel, and needs adjusting. Thanks, I fixed this in V2. ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() 2026-05-07 8:43 [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet 2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet @ 2026-05-07 8:43 ` Eric Dumazet 2026-05-07 15:14 ` David Ahern 2026-05-07 22:56 ` Kuniyuki Iwashima 2026-05-07 8:43 ` [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() Eric Dumazet 2026-05-11 7:13 ` [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet 3 siblings, 2 replies; 13+ messages in thread From: Eric Dumazet @ 2026-05-07 8:43 UTC (permalink / raw) To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima, netdev, eric.dumazet, Eric Dumazet Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call, and provide IP_OUTNOROUTES drop reason. Signed-off-by: Eric Dumazet <edumazet@google.com> --- net/ipv6/tcp_ipv6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 2c3f7a739709d7b89f376f79b71173e5f2d8e64e..3574b2c28a55182d46657cfcca528a0ac0de99b7 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -980,7 +980,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 return; } - kfree_skb(buff); + sk_skb_reason_drop(sk, buff, SKB_DROP_REASON_IP_OUTNOROUTES); } static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb, -- 2.54.0.563.g4f69b47b94-goog ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() 2026-05-07 8:43 ` [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() Eric Dumazet @ 2026-05-07 15:14 ` David Ahern 2026-05-07 22:56 ` Kuniyuki Iwashima 1 sibling, 0 replies; 13+ messages in thread From: David Ahern @ 2026-05-07 15:14 UTC (permalink / raw) To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, Kuniyuki Iwashima, netdev, eric.dumazet On 5/7/26 2:43 AM, Eric Dumazet wrote: > Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call, > and provide IP_OUTNOROUTES drop reason. > > Signed-off-by: Eric Dumazet <edumazet@google.com> > --- > net/ipv6/tcp_ipv6.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: David Ahern <dsahern@kernel.org> ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() 2026-05-07 8:43 ` [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() Eric Dumazet 2026-05-07 15:14 ` David Ahern @ 2026-05-07 22:56 ` Kuniyuki Iwashima 1 sibling, 0 replies; 13+ messages in thread From: Kuniyuki Iwashima @ 2026-05-07 22:56 UTC (permalink / raw) To: Eric Dumazet Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell, Simon Horman, Ido Schimmel, David Ahern, netdev, eric.dumazet On Thu, May 7, 2026 at 1:43 AM Eric Dumazet <edumazet@google.com> wrote: > > Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call, > and provide IP_OUTNOROUTES drop reason. > > Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() 2026-05-07 8:43 [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet 2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet 2026-05-07 8:43 ` [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() Eric Dumazet @ 2026-05-07 8:43 ` Eric Dumazet 2026-05-07 15:14 ` David Ahern 2026-05-07 22:56 ` Kuniyuki Iwashima 2026-05-11 7:13 ` [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet 3 siblings, 2 replies; 13+ messages in thread From: Eric Dumazet @ 2026-05-07 8:43 UTC (permalink / raw) To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima, netdev, eric.dumazet, Eric Dumazet Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call, and provide IP_OUTNOROUTES drop reason. Signed-off-by: Eric Dumazet <edumazet@google.com> --- net/ipv6/inet6_connection_sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 37534e1168992c44e1400dacab87e79d04c64a41..4665d84a7380d90b7d180a429017f577fcb6936a 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c @@ -102,7 +102,8 @@ int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused if (IS_ERR(dst)) { WRITE_ONCE(sk->sk_err_soft, -PTR_ERR(dst)); sk->sk_route_caps = 0; - kfree_skb(skb); + sk_skb_reason_drop(sk, skb, + SKB_DROP_REASON_IP_OUTNOROUTES); return PTR_ERR(dst); } /* Restore final destination back after routing done */ -- 2.54.0.563.g4f69b47b94-goog ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() 2026-05-07 8:43 ` [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() Eric Dumazet @ 2026-05-07 15:14 ` David Ahern 2026-05-07 22:56 ` Kuniyuki Iwashima 1 sibling, 0 replies; 13+ messages in thread From: David Ahern @ 2026-05-07 15:14 UTC (permalink / raw) To: Eric Dumazet, David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, Kuniyuki Iwashima, netdev, eric.dumazet On 5/7/26 2:43 AM, Eric Dumazet wrote: > Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call, > and provide IP_OUTNOROUTES drop reason. > > Signed-off-by: Eric Dumazet <edumazet@google.com> > --- > net/ipv6/inet6_connection_sock.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Reviewed-by: David Ahern <dsahern@kernel.org> ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() 2026-05-07 8:43 ` [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() Eric Dumazet 2026-05-07 15:14 ` David Ahern @ 2026-05-07 22:56 ` Kuniyuki Iwashima 1 sibling, 0 replies; 13+ messages in thread From: Kuniyuki Iwashima @ 2026-05-07 22:56 UTC (permalink / raw) To: Eric Dumazet Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell, Simon Horman, Ido Schimmel, David Ahern, netdev, eric.dumazet On Thu, May 7, 2026 at 1:43 AM Eric Dumazet <edumazet@google.com> wrote: > > Replace a bare kfree_skb() with a modern sk_skb_reason_drop() call, > and provide IP_OUTNOROUTES drop reason. > > Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason 2026-05-07 8:43 [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet ` (2 preceding siblings ...) 2026-05-07 8:43 ` [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() Eric Dumazet @ 2026-05-11 7:13 ` Eric Dumazet 3 siblings, 0 replies; 13+ messages in thread From: Eric Dumazet @ 2026-05-11 7:13 UTC (permalink / raw) To: David S . Miller, Jakub Kicinski, Paolo Abeni, Neal Cardwell Cc: Simon Horman, Ido Schimmel, David Ahern, Kuniyuki Iwashima, netdev, eric.dumazet On Thu, May 7, 2026 at 1:43 AM Eric Dumazet <edumazet@google.com> wrote: > > First patch changes sk_skb_reason_drop() sock to be const. > > Second and last patch add SKB_DROP_REASON_IP_OUTNOROUTES > to both tcp_v6_send_response() and inet6_csk_xmit(). > > Eric Dumazet (3): > net: constify sk_skb_reason_drop() sock parameter > tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() > ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() > > include/linux/skbuff.h | 3 ++- > include/trace/events/skb.h | 4 ++-- > net/core/skbuff.c | 5 +++-- > net/ipv6/inet6_connection_sock.c | 3 ++- > net/ipv6/tcp_ipv6.c | 2 +- > 5 files changed, 10 insertions(+), 7 deletions(-) I will send a V2 today, changes to net/core/drop_monitor.c were missed. pw-bot: cr ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-05-11 7:16 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-07 8:43 [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet 2026-05-07 8:43 ` [PATCH net-next 1/3] net: constify sk_skb_reason_drop() sock parameter Eric Dumazet 2026-05-07 15:14 ` David Ahern 2026-05-07 22:43 ` Kuniyuki Iwashima 2026-05-08 22:15 ` Jakub Kicinski 2026-05-11 7:16 ` Eric Dumazet 2026-05-07 8:43 ` [PATCH net-next 2/3] tcp: use SKB_DROP_REASON_IP_OUTNOROUTES in tcp_v6_send_response() Eric Dumazet 2026-05-07 15:14 ` David Ahern 2026-05-07 22:56 ` Kuniyuki Iwashima 2026-05-07 8:43 ` [PATCH net-next 3/3] ipv6: use SKB_DROP_REASON_IP_OUTNOROUTES in inet6_csk_xmit() Eric Dumazet 2026-05-07 15:14 ` David Ahern 2026-05-07 22:56 ` Kuniyuki Iwashima 2026-05-11 7:13 ` [PATCH net-next 0/3] net: use IP_OUTNOROUTES drop reason Eric Dumazet
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox