Return-path: Received: from mail-qy0-f174.google.com ([209.85.216.174]:53309 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553Ab1EPNN7 convert rfc822-to-8bit (ORCPT ); Mon, 16 May 2011 09:13:59 -0400 MIME-Version: 1.0 In-Reply-To: References: From: =?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= Date: Mon, 16 May 2011 15:13:38 +0200 Message-ID: (sfid-20110516_151409_902093_0204A4F6) Subject: Re: several packets in a single buffer in Rx To: Emmanuel Grumbach Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Johannes Berg , "Guy, Wey-Yi" , guy.cohen@intel.com Content-Type: text/plain; charset=ISO-8859-2 Sender: linux-wireless-owner@vger.kernel.org List-ID: W dniu 16 maja 2011 14:59 u?ytkownik Emmanuel Grumbach napisa?: > 2011/5/16 Micha? Miros?aw : >> 2011/5/16 Emmanuel Grumbach : >>> I would like to be able to deliver the same page several times to the >>> stack without having the stack consume it before the last time I >>> deliver it. >>> Of course I would like to avoid cloning it. >> >> Just do get_page() on the page having another packet in it before >> passing skb up. >> > > I can see the path: > __kfree_skb -> skb_release_all -> skb_release_data -> put_page > put_page will free the page iff the _count variable reaches 0. Of course, > _count is incremented by get_page. > > I will give it try. > > I understand that this will work regardless the order given to > alloc_pages right ? Yes. Remember that if you put a lot of packets in a big-order page then the memory will be freed only after all packets are freed. Best Regards, Micha? Miros?aw