[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1347808032.13258.275.camel@deadeye.wl.decadent.org.uk>
Date: Sun, 16 Sep 2012 16:07:12 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: <netdev@...r.kernel.org>, Herbert Xu <herbert@...dor.hengli.com.au>
Subject: Re: skb_linearize
On Sun, 2012-09-16 at 12:17 +0300, Michael S. Tsirkin wrote:
> I notice that dev_hard_start_xmit might invoke
> __skb_linearize e.g. if device does not support NETIF_F_SG.
>
> This in turn onvokes __pskb_pull_tail, and
> documentation of __pskb_pull_tail says:
> &sk_buff MUST have reference count of 1.
>
> I am guessing 'reference count' means users in this context, right?
> IIUC this is because it modifies skb in a way that
> isn't safe if anyone else is looking at the skb.
>
>
> However, I don't see what guarantees that reference
> count is 1 when dev_hard_start_xmit invokes
> linearize. In particular it calls dev_queue_xmit_nit
> which could queue packets on a network tap.
>
> Could someone help me understand please?
Reference count here means references to struct sk_buff itself. The
header area and data fragments are allowed to be shared.
dev_queue_xmit_nit() clones the skb for each tap, so the reference count
on the original skb remains 1.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists