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]
Date:	Wed, 24 Aug 2011 08:49:56 +0100
From:	Ian Campbell <Ian.Campbell@...citrix.com>
To:	Michał Mirosław <mirqus@...il.com>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Michał Mirosław <mirq-linux@...e.qmqm.pl>
Subject: Re: [PATCH 1/4] net: convert core to skb paged frag APIs

On Tue, 2011-08-23 at 19:34 +0100, Michał Mirosław wrote:
> 2011/8/23 Ian Campbell <ian.campbell@...rix.com>:
> > +               for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
> > +                       skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
> 
> This is a rather common construct, so it might be worth it to
> introduce something like for_each_skb_frag().

I agree. My first stab at this helper (which was untenable for other
reasons, I never posted it) had such a helper. I decided not to tackle
it on this pass since it touches a bunch of places which even this
enormous series doesn't. I've got it on my list to do some time after
this series as a cleanup though.

Some places want the frag nr and others want the skb_frag_t* so I think
you'd end up with
	for_each_skb_frag(skb, frag) { ... }
and
	for_each_skb_frag_nr(skb, i) { ... }
a few places use both frag and i within the loop but not enough to
warrant an explicit helper, I don't think.

An "skb_frag(skb, i)" helper for the &skb_shinfo(skb)->frags[i]
construct might be nice too.

Ian.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ