[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <F612F48C-8072-4588-B38A-2F366F53040A@vmware.com>
Date: Thu, 20 Apr 2017 12:27:37 +0000
From: "Jorgen S. Hansen" <jhansen@...are.com>
To: Stefan Hajnoczi <stefanha@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Zhu Yanjun <zyjzyj2000@...il.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Gerard Garcia <ggarcia@...a.uab.cat>
Subject: Re: [PATCH v4 1/3] VSOCK: Add vsockmon tap functions
> On Apr 13, 2017, at 6:18 PM, Stefan Hajnoczi <stefanha@...hat.com> wrote:
>
> +
> +static void __vsock_deliver_tap(struct sk_buff *skb)
> +{
> + int ret;
> + struct vsock_tap *tmp;
> +
> + list_for_each_entry_rcu(tmp, &vsock_tap_all, list) {
> + ret = __vsock_deliver_tap_skb(skb, tmp->dev);
> + if (unlikely(ret))
> + break;
> + }
> +
> + consume_skb(skb);
It looks like the caller will allocate the skb regardless of whether vsock_tap_all is empty, so shouldn’t the skb be consumed in vsock_deliver_tap?
> +}
> +
> +void vsock_deliver_tap(struct sk_buff *skb)
> +{
> + rcu_read_lock();
> +
> + if (unlikely(!list_empty(&vsock_tap_all)))
> + __vsock_deliver_tap(skb);
> +
> + rcu_read_unlock();
> +}
> +EXPORT_SYMBOL_GPL(vsock_deliver_tap);
> --
> 2.9.3
>
Powered by blists - more mailing lists