From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: pull request: batman-adv 2011-11-26 Date: Fri, 02 Dec 2011 20:59:55 -0500 (EST) Message-ID: <20111202.205955.840690319685535229.davem@davemloft.net> References: <20111202171216.GA4561@ritirata.org> <20111202.125725.896787381527077500.davem@davemloft.net> <20111203015528.GB3148@ritirata.org> Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org, lindner_marek-LWAfsSFWpa4@public.gmane.org To: ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org Return-path: In-Reply-To: <20111203015528.GB3148-E/2OGukznS5g9hUCZPvPmw@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: b.a.t.m.a.n-bounces-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org Errors-To: b.a.t.m.a.n-bounces-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org List-Id: netdev.vger.kernel.org From: Antonio Quartulli 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.