Skip to contentSkip to conversation

: net: Add skb_queue_walk_from() and skb_queue_walk_from_safe().

PATCH New David Miller 1 participant 1 message Sep 23, 2008

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 : net: Add skb_queue_walk_from() and skb_queue_walk_from_safe().

net: Add skb_queue_walk_from() and skb_queue_walk_from_safe().

These will be used by TCP write queue handling and elsewhere.

---
 include/linux/skbuff.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
include/linux/skbuff.h +9 -0
index d2f1778..a19ea43 100644
@@ -1571,6 +1571,15 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
 		     skb != (struct sk_buff *)(queue);				\
 		     skb = tmp, tmp = skb->next)
 
+#define skb_queue_walk_from(queue, skb)						\
+		for (; prefetch(skb->next), (skb != (struct sk_buff *)(queue));	\
+		     skb = skb->next)
+
+#define skb_queue_walk_from_safe(queue, skb, tmp)				\
+		for (tmp = skb->next;						\
+		     skb != (struct sk_buff *)(queue);				\
+		     skb = tmp, tmp = skb->next)
+
 #define skb_queue_reverse_walk(queue, skb) \
 		for (skb = (queue)->prev;					\
 		     prefetch(skb->prev), (skb != (struct sk_buff *)(queue));	\
Signature · 1 line
1.5.6.5