[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20111202.205955.840690319685535229.davem@davemloft.net>
Date: Fri, 02 Dec 2011 20:59:55 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: ordex@...istici.org
Cc: lindner_marek@...oo.de, netdev@...r.kernel.org,
b.a.t.m.a.n@...ts.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] pull request: batman-adv 2011-11-26
From: Antonio Quartulli <ordex@...istici.org>
Date: Sat, 3 Dec 2011 02:55:29 +0100
> We first call pskb_may_pull() to pull the header only and then, under certain
> conditions, we linearise the whole skb to access it all. Should I use
> pskb_may_pull() even in this case?
Why would you need to access the whole thing?
There are only two types of possible accesses:
1) Header parsing --> use pskb_may_pull() as needed.
2) Copying the data to some other location, such as a user
buffer. Use skb_copy_datagram_iovec or similar which handle
fragmented SKBs just fine.
You should handle fragmented SKBs as much as possible, because
linearization is expensive and often amounts to a memory allocation
plus a copy if you linearize the whole thing.
--
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