sch_fifo.c (a1926d1745114789687ac029ae8c58944b7d2256) | sch_fifo.c (cc7ec456f82da7f89a5b376e613b3ac4311b3e9a) |
---|---|
1/* 2 * net/sched/sch_fifo.c The simplest FIFO queue. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 5 unchanged lines hidden (view full) --- 14#include <linux/types.h> 15#include <linux/kernel.h> 16#include <linux/errno.h> 17#include <linux/skbuff.h> 18#include <net/pkt_sched.h> 19 20/* 1 band FIFO pseudo-"scheduler" */ 21 | 1/* 2 * net/sched/sch_fifo.c The simplest FIFO queue. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 5 unchanged lines hidden (view full) --- 14#include <linux/types.h> 15#include <linux/kernel.h> 16#include <linux/errno.h> 17#include <linux/skbuff.h> 18#include <net/pkt_sched.h> 19 20/* 1 band FIFO pseudo-"scheduler" */ 21 |
22struct fifo_sched_data 23{ | 22struct fifo_sched_data { |
24 u32 limit; 25}; 26 | 23 u32 limit; 24}; 25 |
27static int bfifo_enqueue(struct sk_buff *skb, struct Qdisc* sch) | 26static int bfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch) |
28{ 29 struct fifo_sched_data *q = qdisc_priv(sch); 30 31 if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= q->limit)) 32 return qdisc_enqueue_tail(skb, sch); 33 34 return qdisc_reshape_fail(skb, sch); 35} 36 | 27{ 28 struct fifo_sched_data *q = qdisc_priv(sch); 29 30 if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= q->limit)) 31 return qdisc_enqueue_tail(skb, sch); 32 33 return qdisc_reshape_fail(skb, sch); 34} 35 |
37static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc* sch) | 36static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch) |
38{ 39 struct fifo_sched_data *q = qdisc_priv(sch); 40 41 if (likely(skb_queue_len(&sch->q) < q->limit)) 42 return qdisc_enqueue_tail(skb, sch); 43 44 return qdisc_reshape_fail(skb, sch); 45} 46 | 37{ 38 struct fifo_sched_data *q = qdisc_priv(sch); 39 40 if (likely(skb_queue_len(&sch->q) < q->limit)) 41 return qdisc_enqueue_tail(skb, sch); 42 43 return qdisc_reshape_fail(skb, sch); 44} 45 |
47static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc* sch) | 46static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch) |
48{ 49 struct sk_buff *skb_head; 50 struct fifo_sched_data *q = qdisc_priv(sch); 51 52 if (likely(skb_queue_len(&sch->q) < q->limit)) 53 return qdisc_enqueue_tail(skb, sch); 54 55 /* queue full, remove one skb to fulfill the limit */ --- 129 unchanged lines hidden --- | 47{ 48 struct sk_buff *skb_head; 49 struct fifo_sched_data *q = qdisc_priv(sch); 50 51 if (likely(skb_queue_len(&sch->q) < q->limit)) 52 return qdisc_enqueue_tail(skb, sch); 53 54 /* queue full, remove one skb to fulfill the limit */ --- 129 unchanged lines hidden --- |