[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220602041028.95124-2-xiyou.wangcong@gmail.com>
Date: Wed, 1 Jun 2022 21:10:24 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: bpf@...r.kernel.org, Cong Wang <cong.wang@...edance.com>
Subject: [RFC Patch v5 1/5] net: introduce skb_rbtree_walk_safe()
From: Cong Wang <cong.wang@...edance.com>
Signed-off-by: Cong Wang <cong.wang@...edance.com>
---
include/linux/skbuff.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index da96f0d3e753..857fd813c1bc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3929,6 +3929,11 @@ static inline int __skb_grow_rcsum(struct sk_buff *skb, unsigned int len)
for (skb = skb_rb_first(root); skb != NULL; \
skb = skb_rb_next(skb))
+#define skb_rbtree_walk_safe(skb, tmp, root) \
+ for (skb = skb_rb_first(root); \
+ tmp = skb ? skb_rb_next(skb) : NULL, (skb != NULL); \
+ skb = tmp)
+
#define skb_rbtree_walk_from(skb) \
for (; skb != NULL; \
skb = skb_rb_next(skb))
--
2.34.1
Powered by blists - more mailing lists