[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160630104912.GB31866@stefanha-x1.localdomain>
Date: Thu, 30 Jun 2016 11:49:12 +0100
From: Stefan Hajnoczi <stefanha@...hat.com>
To: ggarcia@...a.uab.cat
Cc: netdev@...r.kernel.org, jhansen@...are.com
Subject: Re: [RFC v2 1/3] vsockmon: Add tap functions
On Wed, Jun 22, 2016 at 06:11:00PM +0200, ggarcia@...a.uab.cat wrote:
> +int __vsock_remove_tap(struct vsock_tap *vt) {
This function should be static, it's not used outside this source file.
> +static int __vsock_deliver_tap_skb(struct sk_buff *skb,
> + struct net_device *dev)
> +{
> + int ret = 0;
> +
> + if (skb) {
> + dev_hold(dev);
I don't understand the need for this dev_hold()/dev_put(). Can anyone
explain why it is necessary?
> + /* Take skb ownership so it is not consumed in dev_queue_xmit.
> + * dev_queue_xmit will drop a reference so the reference count
> + * will reset.
> + */
> + skb_get(skb);
> + skb->dev = dev;
> + ret = dev_queue_xmit(skb);
> + if (unlikely(ret > 0))
> + ret = net_xmit_errno(ret);
> +
> + dev_put(dev);
> + }
> +
> + return ret;
> +}
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists