tcp: prefer sk_skb_reason_drop()
Subsystems (4)
PATCH 1/1 tcp: prefer sk_skb_reason_drop()
Replace two calls to kfree_skb_reason() with sk_skb_reason_drop().
--- net/ipv4/tcp_output.c | 2 +- net/psp/psp_sock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_output.c +1 -1
@@ -1586,7 +1586,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, err =tcp_ao_transmit_skb (sk, skb, key.ao_key, th, opts.hash_location);if (err) { -kfree_skb_reason (skb,SKB_DROP_REASON_NOT_SPECIFIED ); +sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_NOT_SPECIFIED );return -ENOMEM ; } }
net/psp/psp_sock.c +1 -1
@@ -37,7 +37,7 @@ psp_validate_xmit(struct sock *sk, struct net_device *dev, struct sk_buff *skb) good = !pas ||rcu_access_pointer (dev->psp_dev) == pas->psd;rcu_read_unlock ();if (!good) { -kfree_skb_reason (skb,SKB_DROP_REASON_PSP_OUTPUT ); +sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_PSP_OUTPUT );return NULL ; }
Signature · 1 line
2.51.0.384.g4c02a37b29-goog
Quoted 6 lines · Eric Dumazet
Replace two calls to
kfree_skb_reason()withsk_skb_reason_drop().Signed-off-by Eric Dumazet <[email protected]>Cc Daniel Zahka <[email protected]>Cc Dmitry Safonov <[email protected]>
LGTM, thanks!
Side-note: I see that tcp_ao_transmit_skb() can currently fail only due to ENOMEM, IIRC I haven't found more specific reason at that time than just SKB_DROP_REASON_NOT_SPECIFIED, unsure if worth changing that.
Quoted 32 lines
--- net/ipv4/tcp_output.c | 2 +- net/psp/psp_sock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)net/ipv4/tcp_output.c +1
-1@@ -1586,7 +1586,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, err =tcp_ao_transmit_skb (sk, skb, key.ao_key, th, opts.hash_location);if (err) { -kfree_skb_reason (skb,SKB_DROP_REASON_NOT_SPECIFIED ); +sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_NOT_SPECIFIED );return -ENOMEM ; } }net/psp/psp_sock.c +1
-2@@ -37,7 +37,7 @@ psp_validate_xmit(struct sock *sk, struct net_device *dev, struct sk_buff *skb) good = !pas ||rcu_access_pointer (dev->psp_dev) == pas->psd;rcu_read_unlock ();if (!good) { -kfree_skb_reason (skb,SKB_DROP_REASON_PSP_OUTPUT ); +sk_skb_reason_drop (sk, skb,SKB_DROP_REASON_PSP_OUTPUT );return NULL ; } --
Quoted 2 lines
2.51.0.384.g4c02a37b29-goog
--
Dmitry
Quoted 9 lines · Dmitry Safonov
Quoted 6 lines · Eric Dumazet
Replace two calls to
kfree_skb_reason()withsk_skb_reason_drop().Signed-off-by Eric Dumazet <[email protected]>Cc Daniel Zahka <[email protected]>Cc Dmitry Safonov <[email protected]>
Quoted 8 lines
LGTM, thanks!
Reviewed-by Dmitry Safonov <[email protected]>Side-note: I see that
tcp_ao_transmit_skb()can currently fail only due to ENOMEM, IIRC I haven't found more specific reason at that time than justSKB_DROP_REASON_NOT_SPECIFIED, unsure if worth changing that.
We could then use SKB_DROP_REASON_NOMEM.
Quoted 13 lines · Eric Dumazet
Quoted 11 lines · Dmitry Safonov
Quoted 6 lines · Eric Dumazet
Replace two calls to
kfree_skb_reason()withsk_skb_reason_drop().Signed-off-by Eric Dumazet <[email protected]>Cc Daniel Zahka <[email protected]>Cc Dmitry Safonov <[email protected]>LGTM, thanks!
Quoted 8 lines
Quoted 6 lines
Reviewed-by Dmitry Safonov <[email protected]>Side-note: I see that
tcp_ao_transmit_skb()can currently fail only due to ENOMEM, IIRC I haven't found more specific reason at that time than justSKB_DROP_REASON_NOT_SPECIFIED, unsure if worth changing that.We could then use
SKB_DROP_REASON_NOMEM.
Yeah, I think I wasn't sure if it's worth just due to one place. But if it's generally useful, I'd say we could :-)
Thanks,
Dmitry
Quoted 4 lines · Eric Dumazet
Replace two calls to
kfree_skb_reason()withsk_skb_reason_drop().Signed-off-by Eric Dumazet <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Thu, 18 Sep 2025 13:20:07 +0000 you wrote:
Replace two calls to
kfree_skb_reason()withsk_skb_reason_drop().Signed-off-by Eric Dumazet <[email protected]>Cc Daniel Zahka <[email protected]>Cc Dmitry Safonov <[email protected]>--- net/ipv4/tcp_output.c | 2 +- net/psp/psp_sock.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- [net-next] tcp: prefer sk_skb_reason_drop()
https://git.kernel.org/netdev/net-next/c/b02c1230104d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html