From: David Laight <David.Laight@ACULAB.COM>
To: 'Matteo Croce' <mcroce@linux.microsoft.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Julia Lawall <julia.lawall@inria.fr>
Subject: RE: [PATCH net-next v2 0/3] introduce skb_for_each_frag()
Date: Tue, 13 Apr 2021 07:53:14 +0000 [thread overview]
Message-ID: <75045c087db24b6e87b7ed14aa5a721c@AcuMS.aculab.com> (raw)
In-Reply-To: <20210412003802.51613-1-mcroce@linux.microsoft.com>
From: Matteo Croce
> Sent: 12 April 2021 01:38
>
> Introduce skb_for_each_frag, an helper macro to iterate over the SKB frags.
The real question is why, the change is:
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+ skb_for_each_frag(skb, i) {
The existing code isn't complicated or obscure and 'does what it
says on the tin'.
The 'helper' requires you go and look up its definition to see
what it is really doing.
Unless you have a cunning plan to change the definition
there is zero point.
A more interesting change would be something that generated:
unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
for (i = 0; i < nr_frags; i++) {
since that will run faster for most loops.
But that is ~impossible to do since you can't declare
variables inside the (...) that are scoped to the loop.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2021-04-13 7:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 0:37 Matteo Croce
2021-04-12 0:38 ` [PATCH net-next v2 1/3] skbuff: add helper to walk over the fraglist Matteo Croce
2021-04-12 0:38 ` [PATCH net-next v2 2/3] net: use skb_for_each_frag() helper where possible Matteo Croce
2021-04-12 7:40 ` Eric Dumazet
2021-04-12 0:38 ` [PATCH net-next v2 3/3] net: use skb_for_each_frag() in illegal_highdma() Matteo Croce
2021-04-13 7:53 ` David Laight [this message]
2021-04-16 22:44 ` [PATCH net-next v2 0/3] introduce skb_for_each_frag() Matteo Croce
2021-04-17 11:07 ` David Laight
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=75045c087db24b6e87b7ed14aa5a721c@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=davem@davemloft.net \
--cc=julia.lawall@inria.fr \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcroce@linux.microsoft.com \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®