From: Antonio Quartulli ordex@autistici.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.