Project

General

Profile

Feature #3465

Loop head macros support

Added by Mikhail Mandrykin about 7 years ago. Updated about 7 years ago.

Status:
Open
Priority:
Low
Category:
-
Start date:
09/20/2012
Due date:
% Done:

0%

Estimated time:
Published in build:

Description

There are some marco definitions intended for some specific list or queue traverses. For instance,

#define skb_queue_walk_safe(queue, skb, tmp)                                    \
                for (skb = (queue)->next, tmp = skb->next;                      \
                     skb != (struct sk_buff *)(queue);                          \
                     skb = tmp, tmp = skb->next)

It's desirable sometimes to have some instructions executed at each iteration of such loops. Here, for example, this macro enables us to detect assignments to skb varaible which is useful in checking for double skb deallocations.
skb_queue_walk_safe(tx_skb_queue, skb, tmp) {
        if (...) {
                ...
                kfree_skb(skb);
        }
}

History

#1

Updated by Mikhail Mandrykin about 7 years ago

  • Description updated (diff)
#2

Updated by Evgeny Novikov about 7 years ago

  • Status changed from New to Open
  • Assignee set to Evgeny Novikov

Rather interesting feature of Aspectator, but it has low priority now.

Also available in: Atom PDF