Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751370AbZIOI5h (ORCPT ); Tue, 15 Sep 2009 04:57:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751043AbZIOI5c (ORCPT ); Tue, 15 Sep 2009 04:57:32 -0400 Received: from mga03.intel.com ([143.182.124.21]:64475 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbZIOI5b (ORCPT ); Tue, 15 Sep 2009 04:57:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,388,1249282800"; d="scan'208";a="187727551" Subject: Re: alloc skb based on a given data buffer From: Zhu Yi To: David Miller Cc: "mel@csn.ul.ie" , "Chatre, Reinette" , "elendil@planet.nl" , "Larry.Finger@lwfinger.net" , "linville@tuxdriver.com" , "penberg@cs.helsinki.fi" , "linux-kernel@vger.kernel.org" , "linux-wireless@vger.kernel.org" , "ipw3945-devel@lists.sourceforge.net" , "akpm@linux-foundation.org" , "cl@linux-foundation.org" , "Krauss, Assaf" , "johannes@sipsolutions.net" , "Abbas, Mohamed" , "netdev@vger.kernel.org" In-Reply-To: <20090915.013321.07006714.davem@davemloft.net> References: <1252897270.5650.169.camel@debian> <20090914130612.GA11778@csn.ul.ie> <1253003420.7549.51.camel@debian> <20090915.013321.07006714.davem@davemloft.net> Content-Type: text/plain Date: Tue, 15 Sep 2009 16:57:29 +0800 Message-Id: <1253005050.7549.58.camel@debian> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1200 Lines: 28 On Tue, 2009-09-15 at 16:33 +0800, David Miller wrote: > From: Zhu Yi > Date: Tue, 15 Sep 2009 16:30:20 +0800 > > > This way, device drivers can allocate the Rx buffers with their own size > > and alignment requirement. i.e. do an order-1 page allocation directly > > with free_pages() in the iwlagn driver for a 256 bytes aligned 8K Rx > > buffer. After DMA is finished, drivers can use the above function to > > assemble an skb based on the Rx buffer. It should resolve the problem > > for requiring an order-2 allocation by alloc_skb() in the first place. > > You can create paged RX skbs just like drivers such as niu.c > and others already do, there is no need for special APIs for > this. Thanks. So we can put the 8K buffer into 2 skb_shinfo()->frags[] slots and set nr_frags to 2, right? Is this supported allover the network code already? At a first glance, I didn't find any frags handling in mac80211 stack. Thanks, -yi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/