@@ -1501,6 +1501,22 @@ static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
}
/**
+ * skb_queue_for_each - iterate over an skb queue
+ * @pos: the &struct sk_buff to use as a loop cursor.
+ * @head: the &struct sk_buff_head for your list.
+ *
+ * The reference count is not incremented and the reference is therefore
+ * volatile; the list lock is not taken either. Use with caution.
+ *
+ * The list must not be modified (though the individual skbs can be)
+ * within the loop body.
+ *
+ * After loop completion, @pos will be %NULL.
+ */
+#define skb_queue_for_each(pos, head) \
+ for (pos = skb_peek(head); pos != NULL; pos = skb_peek_next(pos, head))
+
+/**
* skb_queue_len - get queue length
* @list_: list to measure
*
@@ -222,6 +222,13 @@ DEFINE_EVENT(net_dev_rx_verbose_template, netif_receive_skb_entry,
TP_ARGS(skb)
);
+DEFINE_EVENT(net_dev_rx_verbose_template, netif_receive_skb_list_entry,
+
+ TP_PROTO(const struct sk_buff *skb),
+
+ TP_ARGS(skb)
+);
+
DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_entry,
TP_PROTO(const struct sk_buff *skb),
@@ -4307,8 +4307,10 @@ void netif_receive_skb_list(struct sk_buff_head *list)
{
struct sk_buff *skb;
+ skb_queue_for_each(skb, list)
+ trace_netif_receive_skb_list_entry(skb);
while ((skb = __skb_dequeue(list)) != NULL)
- netif_receive_skb(skb);
+ netif_receive_skb_internal(skb);
}
EXPORT_SYMBOL(netif_receive_skb_list);
Adds iterator skb_queue_for_each() to run over a list without modifying it. Signed-off-by: Edward Cree <ecree@solarflare.com> --- include/linux/skbuff.h | 16 ++++++++++++++++ include/trace/events/net.h | 7 +++++++ net/core/dev.c | 4 +++- 3 files changed, 26 insertions(+), 1 deletion(-)