* [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
@ 2026-09-21 9:42 Eric Dumazet
2026-09-21 17:32 ` Bobby Eshleman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Eric Dumazet @ 2026-09-21 9:42 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
Eric Dumazet, Stefano Garzarella
__vsock_deliver_tap_skb() is called from vsock_deliver_tap()
under rcu_read_lock().
dev_queue_xmit() does not require the caller to hold a device reference
count, and the device lifetime is already protected by RCU.
Remove the redundant dev_hold(dev) and dev_put(dev) calls.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
---
net/vmw_vsock/af_vsock_tap.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/net/vmw_vsock/af_vsock_tap.c b/net/vmw_vsock/af_vsock_tap.c
index 30ee7e4fe25115cef71b43f335862a09b8c51382..7c5cdceabb2a5f7079faab243ee9de7d6bb8857c 100644
--- a/net/vmw_vsock/af_vsock_tap.c
+++ b/net/vmw_vsock/af_vsock_tap.c
@@ -64,14 +64,10 @@ static int __vsock_deliver_tap_skb(struct sk_buff *skb,
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
if (nskb) {
- dev_hold(dev);
-
nskb->dev = dev;
ret = dev_queue_xmit(nskb);
if (unlikely(ret > 0))
ret = net_xmit_errno(ret);
-
- dev_put(dev);
}
return ret;
--
2.55.0.1082.g2b9226bbc0-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
2026-09-21 9:42 [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb() Eric Dumazet
@ 2026-09-21 17:32 ` Bobby Eshleman
2026-09-22 10:45 ` Stefano Garzarella
2026-09-22 13:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Bobby Eshleman @ 2026-09-21 17:32 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet, Stefano Garzarella
On Mon, Sep 21, 2026 at 09:42:18AM +0000, Eric Dumazet wrote:
> __vsock_deliver_tap_skb() is called from vsock_deliver_tap()
> under rcu_read_lock().
>
> dev_queue_xmit() does not require the caller to hold a device reference
> count, and the device lifetime is already protected by RCU.
>
> Remove the redundant dev_hold(dev) and dev_put(dev) calls.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Stefano Garzarella <sgarzare@redhat.com>
> ---
> net/vmw_vsock/af_vsock_tap.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/net/vmw_vsock/af_vsock_tap.c b/net/vmw_vsock/af_vsock_tap.c
> index 30ee7e4fe25115cef71b43f335862a09b8c51382..7c5cdceabb2a5f7079faab243ee9de7d6bb8857c 100644
> --- a/net/vmw_vsock/af_vsock_tap.c
> +++ b/net/vmw_vsock/af_vsock_tap.c
> @@ -64,14 +64,10 @@ static int __vsock_deliver_tap_skb(struct sk_buff *skb,
> struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
>
> if (nskb) {
> - dev_hold(dev);
> -
> nskb->dev = dev;
> ret = dev_queue_xmit(nskb);
> if (unlikely(ret > 0))
> ret = net_xmit_errno(ret);
> -
> - dev_put(dev);
> }
>
> return ret;
> --
> 2.55.0.1082.g2b9226bbc0-goog
>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
2026-09-21 9:42 [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb() Eric Dumazet
2026-09-21 17:32 ` Bobby Eshleman
@ 2026-09-22 10:45 ` Stefano Garzarella
2026-09-22 13:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Stefano Garzarella @ 2026-09-22 10:45 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet
On Mon, Sep 21, 2026 at 09:42:18AM +0000, Eric Dumazet wrote:
>__vsock_deliver_tap_skb() is called from vsock_deliver_tap()
>under rcu_read_lock().
>
>dev_queue_xmit() does not require the caller to hold a device reference
>count, and the device lifetime is already protected by RCU.
>
>Remove the redundant dev_hold(dev) and dev_put(dev) calls.
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
>Cc: Stefano Garzarella <sgarzare@redhat.com>
>---
> net/vmw_vsock/af_vsock_tap.c | 4 ----
> 1 file changed, 4 deletions(-)
LGTM!
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
2026-09-21 9:42 [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb() Eric Dumazet
2026-09-21 17:32 ` Bobby Eshleman
2026-09-22 10:45 ` Stefano Garzarella
@ 2026-09-22 13:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-22 13:20 UTC (permalink / raw)
To: Eric Dumazet
Cc: davem, kuba, pabeni, horms, kuniyu, netdev, eric.dumazet,
sgarzare
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 21 Sep 2026 09:42:18 +0000 you wrote:
> __vsock_deliver_tap_skb() is called from vsock_deliver_tap()
> under rcu_read_lock().
>
> dev_queue_xmit() does not require the caller to hold a device reference
> count, and the device lifetime is already protected by RCU.
>
> Remove the redundant dev_hold(dev) and dev_put(dev) calls.
>
> [...]
Here is the summary with links:
- [net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
https://git.kernel.org/netdev/net-next/c/6598456d72e4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-22 13:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 9:42 [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb() Eric Dumazet
2026-09-21 17:32 ` Bobby Eshleman
2026-09-22 10:45 ` Stefano Garzarella
2026-09-22 13:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox