lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1253028631.23427.55.camel@johannes.local>
Date:	Tue, 15 Sep 2009 08:30:31 -0700
From:	Johannes Berg <johannes@...solutions.net>
To:	Zhu Yi <yi.zhu@...el.com>
Cc:	David Miller <davem@...emloft.net>,
	"mel@....ul.ie" <mel@....ul.ie>,
	"Chatre, Reinette" <reinette.chatre@...el.com>,
	"elendil@...net.nl" <elendil@...net.nl>,
	"Larry.Finger@...inger.net" <Larry.Finger@...inger.net>,
	"linville@...driver.com" <linville@...driver.com>,
	"penberg@...helsinki.fi" <penberg@...helsinki.fi>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
	"ipw3945-devel@...ts.sourceforge.net" 
	<ipw3945-devel@...ts.sourceforge.net>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"cl@...ux-foundation.org" <cl@...ux-foundation.org>,
	"Krauss, Assaf" <assaf.krauss@...el.com>,
	"Abbas, Mohamed" <mohamed.abbas@...el.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: alloc skb based on a given data buffer

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@...el.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

Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ