All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bobby Eshleman <bobbyeshleman@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH net-next] vsock: remove dev_hold() and dev_put() in __vsock_deliver_tap_skb()
Date: Mon, 21 Sep 2026 10:32:14 -0700	[thread overview]
Message-ID: <arFqHglxl8e7XB6I@devvm29614.prn0.facebook.com> (raw)
In-Reply-To: <20260921094218.483234-1-edumazet@google.com>

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>

  reply	other threads:[~2026-09-21 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-09-22 10:45 ` Stefano Garzarella
2026-09-22 13:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=arFqHglxl8e7XB6I@devvm29614.prn0.facebook.com \
    --to=bobbyeshleman@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sgarzare@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.