All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Zhu Yi <yi.zhu@intel.com>
Cc: David Miller <davem@davemloft.net>,
	"mel@csn.ul.ie" <mel@csn.ul.ie>,
	"Chatre, Reinette" <reinette.chatre@intel.com>,
	"elendil@planet.nl" <elendil@planet.nl>,
	"Larry.Finger@lwfinger.net" <Larry.Finger@lwfinger.net>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"penberg@cs.helsinki.fi" <penberg@cs.helsinki.fi>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"ipw3945-devel@lists.sourceforge.net"
	<ipw3945-devel@lists.sourceforge.net>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"cl@linux-foundation.org" <cl@linux-foundation.org>,
	"Krauss, Assaf" <assaf.krauss@intel.com>,
	"Abbas, Mohamed" <mohamed.abbas@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: alloc skb based on a given data buffer
Date: Tue, 15 Sep 2009 08:30:31 -0700	[thread overview]
Message-ID: <1253028631.23427.55.camel@johannes.local> (raw)
In-Reply-To: <1253006111.7549.61.camel@debian>

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Tue, 2009-09-15 at 17:15 +0800, Zhu Yi wrote:
> On Tue, 2009-09-15 at 17:09 +0800, David Miller wrote:
> > From: Zhu Yi <yi.zhu@intel.com>
> > Date: Tue, 15 Sep 2009 16:57:29 +0800
> > 
> > > 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.
> > 
> > You have to pre-pull the link level protocol headers into the
> > linear area, but that's it.
> > 
> > Again, see niu.c for details, it does:
> > 
> > static void niu_rx_skb_append(struct sk_buff *skb, struct page *page,
> > 			      u32 offset, u32 size)
> > {
> > 	int i = skb_shinfo(skb)->nr_frags;
> > 	skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
> > 
> > 	frag->page = page;
> > 	frag->page_offset = offset;
> > 	frag->size = size;
> > 
> > 	skb->len += size;
> > 	skb->data_len += size;
> > 	skb->truesize += size;
> > 
> > 	skb_shinfo(skb)->nr_frags = i + 1;
> > }
> > 
> > to add pages to SKBs and then at the end it goes:
> > 
> > 	skb_reserve(skb, NET_IP_ALIGN);
> > 	__pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
> > 
> > Right before giving the SKB to the networking stack.  NIU_RXPULL_MAX
> > should be a value that will be large enough to cover the largest
> > possible link level header.
> 
> I see. Thanks for this info. I'll try implementing the same for iwlagn.

Hold, mac80211 can't cope with that at this point for sw crypto and
possibly other things.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: Zhu Yi <yi.zhu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	"mel-wPRd99KPJ+uzQB+pC5nmwQ@public.gmane.org"
	<mel-wPRd99KPJ+uzQB+pC5nmwQ@public.gmane.org>,
	"Chatre,
	Reinette"
	<reinette.chatre-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"elendil-EIBgga6/0yRmR6Xm/wNWPw@public.gmane.org"
	<elendil-EIBgga6/0yRmR6Xm/wNWPw@public.gmane.org>,
	"Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org"
	<Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>,
	"linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>,
	"penberg-bbCR+/B0CizivPeTLB3BmA@public.gmane.org"
	<penberg-bbCR+/B0CizivPeTLB3BmA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"ipw3945-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<ipw3945-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	"akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org"
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	"cl-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org"
	<cl-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	"Krauss,
	Assaf" <assaf.krauss-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Abbas,
	Mohamed" <mohamed.abbas-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: alloc skb based on a given data buffer
Date: Tue, 15 Sep 2009 08:30:31 -0700	[thread overview]
Message-ID: <1253028631.23427.55.camel@johannes.local> (raw)
In-Reply-To: <1253006111.7549.61.camel@debian>

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

On Tue, 2009-09-15 at 17:15 +0800, Zhu Yi wrote:
> On Tue, 2009-09-15 at 17:09 +0800, David Miller wrote:
> > From: Zhu Yi <yi.zhu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > Date: Tue, 15 Sep 2009 16:57:29 +0800
> > 
> > > 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.
> > 
> > You have to pre-pull the link level protocol headers into the
> > linear area, but that's it.
> > 
> > Again, see niu.c for details, it does:
> > 
> > static void niu_rx_skb_append(struct sk_buff *skb, struct page *page,
> > 			      u32 offset, u32 size)
> > {
> > 	int i = skb_shinfo(skb)->nr_frags;
> > 	skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
> > 
> > 	frag->page = page;
> > 	frag->page_offset = offset;
> > 	frag->size = size;
> > 
> > 	skb->len += size;
> > 	skb->data_len += size;
> > 	skb->truesize += size;
> > 
> > 	skb_shinfo(skb)->nr_frags = i + 1;
> > }
> > 
> > to add pages to SKBs and then at the end it goes:
> > 
> > 	skb_reserve(skb, NET_IP_ALIGN);
> > 	__pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
> > 
> > Right before giving the SKB to the networking stack.  NIU_RXPULL_MAX
> > should be a value that will be large enough to cover the largest
> > possible link level header.
> 
> I see. Thanks for this info. I'll try implementing the same for iwlagn.

Hold, mac80211 can't cope with that at this point for sw crypto and
possibly other things.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2009-09-15 15:31 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-06  7:40 iwlagn: order 2 page allocation failures Frans Pop
2009-09-06  8:14 ` Pekka Enberg
2009-09-06  8:28   ` Frans Pop
2009-09-06  8:35     ` Pekka Enberg
2009-09-08 10:54       ` Mel Gorman
2009-09-08 11:11         ` Pekka Enberg
2009-09-08 14:17           ` John W. Linville
2009-09-08 14:59             ` Larry Finger
2009-09-09 15:04               ` Mel Gorman
2009-09-09 15:59                 ` Frans Pop
2009-09-09 16:55                   ` Mel Gorman
2009-09-09 17:19                     ` Frans Pop
2009-09-16 14:36                       ` Frans Pop
2009-09-16 15:02                         ` Mel Gorman
2009-09-16 15:37                           ` Frans Pop
2009-09-16 16:26                           ` reinette chatre
2009-09-16 16:26                             ` reinette chatre
2009-09-09 20:05                     ` reinette chatre
2009-09-09 20:05                       ` reinette chatre
2009-09-10  1:48                       ` Frans Pop
2009-09-10  1:48                         ` Frans Pop
2009-09-10  9:02                       ` Mel Gorman
2009-09-10  9:02                         ` Mel Gorman
2009-09-10 18:15                         ` reinette chatre
2009-09-10 18:15                           ` reinette chatre
2009-09-10 18:43                           ` Frans Pop
2009-09-10 18:43                             ` Frans Pop
2009-09-10 18:50                             ` reinette chatre
2009-09-10 18:50                               ` reinette chatre
2009-09-11  8:45                           ` Mel Gorman
2009-09-11  8:45                             ` Mel Gorman
2009-09-11 16:14                             ` reinette chatre
2009-09-11 16:14                               ` reinette chatre
2009-09-10 21:14                         ` reinette chatre
2009-09-10 21:14                           ` reinette chatre
2009-09-11  8:47                           ` Mel Gorman
2009-09-11  8:47                             ` Mel Gorman
2009-09-14  3:01                             ` Zhu Yi
2009-09-14  3:01                               ` Zhu Yi
2009-09-14 13:06                               ` Mel Gorman
2009-09-14 13:06                                 ` Mel Gorman
2009-09-15  8:30                                 ` alloc skb based on a given data buffer Zhu Yi
2009-09-15  8:30                                   ` Zhu Yi
2009-09-15  8:33                                   ` David Miller
2009-09-15  8:33                                     ` David Miller
2009-09-15  8:57                                     ` Zhu Yi
2009-09-15  8:57                                       ` Zhu Yi
2009-09-15  9:09                                       ` David Miller
2009-09-15  9:15                                         ` Zhu Yi
2009-09-15  9:15                                           ` Zhu Yi
2009-09-15 15:30                                           ` Johannes Berg [this message]
2009-09-15 15:30                                             ` Johannes Berg
2009-09-15 15:30                                             ` Johannes Berg
2009-09-15 21:16                                             ` David Miller
2009-09-15 21:16                                               ` David Miller
2009-09-19  5:56                                               ` Johannes Berg
2009-09-14 15:42                               ` iwlagn: order 2 page allocation failures Christoph Lameter
2009-09-14 15:42                                 ` Christoph Lameter
2009-09-14 17:59                                 ` Mel Gorman
2009-09-14 17:59                                   ` Mel Gorman
2009-09-14 18:04                                   ` Christoph Lameter
2009-09-14 18:04                                     ` Christoph Lameter
2009-09-10  8:18                     ` Pekka Enberg
2009-09-10 12:34                       ` Mel Gorman
2009-09-10 12:39                         ` Pekka Enberg
2009-09-10 12:58                           ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1253028631.23427.55.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=Larry.Finger@lwfinger.net \
    --cc=akpm@linux-foundation.org \
    --cc=assaf.krauss@intel.com \
    --cc=cl@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=elendil@planet.nl \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mel@csn.ul.ie \
    --cc=mohamed.abbas@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=reinette.chatre@intel.com \
    --cc=yi.zhu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.