aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-10-30 16:47:34 -0500
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-11-05 17:56:41 -0500
commit300ce174ebc2fcf2b5111a50fa42f79d891927dd (patch)
treeea7ac40eac2de90be9e5575759bab18029ae2fdf /include/linux/skbuff.h
parent07aaa11540828f4482c09e1a936a1f63cdb9fc9d (diff)
[NETEM]: Support time based reordering
Change netem to support packets getting reordered because of variations in delay. Introduce a special case version of FIFO that queues packets in order based on the netem delay. Since netem is classful, those users that don't want jitter based reordering can just insert a pfifo instead of the default. This required changes to generic skbuff code to allow finer grain manipulation of sk_buff_head. Insertion into the middle and reverse walk. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h38
1 files changed, 30 insertions, 8 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4286d832166f..fdfb8fe8c38c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -603,23 +603,23 @@ static inline void skb_queue_head_init(struct sk_buff_head *list)
603 */ 603 */
604 604
605/** 605/**
606 * __skb_queue_head - queue a buffer at the list head 606 * __skb_queue_after - queue a buffer at the list head
607 * @list: list to use 607 * @list: list to use
608 * @prev: place after this buffer
608 * @newsk: buffer to queue 609 * @newsk: buffer to queue
609 * 610 *
610 * Queue a buffer at the start of a list. This function takes no locks 611 * Queue a buffer int the middle of a list. This function takes no locks
611 * and you must therefore hold required locks before calling it. 612 * and you must therefore hold required locks before calling it.
612 * 613 *
613 * A buffer cannot be placed on two lists at the same time. 614 * A buffer cannot be placed on two lists at the same time.
614 */ 615 */
615extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); 616static inline void __skb_queue_after(struct sk_buff_head *list,
616static inline void __skb_queue_head(struct sk_buff_head *list, 617 struct sk_buff *prev,
617 struct sk_buff *newsk) 618 struct sk_buff *newsk)
618{ 619{
619 struct sk_buff *prev, *next; 620 struct sk_buff *next;
620
621 list->qlen++; 621 list->qlen++;
622 prev = (struct sk_buff *)list; 622
623 next = prev->next; 623 next = prev->next;
624 newsk->next = next; 624 newsk->next = next;
625 newsk->prev = prev; 625 newsk->prev = prev;
@@ -627,6 +627,23 @@ static inline void __skb_queue_head(struct sk_buff_head *list,
627} 627}
628 628
629/** 629/**
630 * __skb_queue_head - queue a buffer at the list head
631 * @list: list to use
632 * @newsk: buffer to queue
633 *
634 * Queue a buffer at the start of a list. This function takes no locks
635 * and you must therefore hold required locks before calling it.
636 *
637 * A buffer cannot be placed on two lists at the same time.
638 */
639extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
640static inline void __skb_queue_head(struct sk_buff_head *list,
641 struct sk_buff *newsk)
642{
643 __skb_queue_after(list, (struct sk_buff *)list, newsk);
644}
645
646/**
630 * __skb_queue_tail - queue a buffer at the list tail 647 * __skb_queue_tail - queue a buffer at the list tail
631 * @list: list to use 648 * @list: list to use
632 * @newsk: buffer to queue 649 * @newsk: buffer to queue
@@ -1203,6 +1220,11 @@ static inline void kunmap_skb_frag(void *vaddr)
1203 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ 1220 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
1204 skb = skb->next) 1221 skb = skb->next)
1205 1222
1223#define skb_queue_reverse_walk(queue, skb) \
1224 for (skb = (queue)->prev; \
1225 prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \
1226 skb = skb->prev)
1227
1206 1228
1207extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, 1229extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
1208 int noblock, int *err); 1230 int noblock, int *err);