From: Matteo Croce <mcroce@linux.microsoft.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH net-next v2 1/3] skbuff: add helper to walk over the fraglist
Date: Mon, 12 Apr 2021 02:38:00 +0200 [thread overview]
Message-ID: <20210412003802.51613-2-mcroce@linux.microsoft.com> (raw)
In-Reply-To: <20210412003802.51613-1-mcroce@linux.microsoft.com>
From: Matteo Croce <mcroce@microsoft.com>
Add an skb_for_each_frag() macro to iterate on SKB fragments.
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
---
include/linux/skbuff.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index dbf820a50a39..a8d4ccacdda5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1528,6 +1528,10 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb); \
(skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL)
+/* Iterate through skb fragments. */
+#define skb_for_each_frag(skb, __i) \
+ for (__i = 0; __i < skb_shinfo(skb)->nr_frags; __i++)
+
static inline void skb_list_del_init(struct sk_buff *skb)
{
__list_del_entry(&skb->list);
--
2.30.2
next prev parent reply other threads:[~2021-04-12 0:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 0:37 [PATCH net-next v2 0/3] introduce skb_for_each_frag() Matteo Croce
2021-04-12 0:38 ` Matteo Croce [this message]
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 ` [PATCH net-next v2 0/3] introduce skb_for_each_frag() David Laight
2021-04-16 22:44 ` 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=20210412003802.51613-2-mcroce@linux.microsoft.com \
--to=mcroce@linux.microsoft.com \
--cc=davem@davemloft.net \
--cc=julia.lawall@inria.fr \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 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.