diff options
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 964ffa0d8815..84b3fc2aef0f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -45,6 +45,7 @@ struct Qdisc | |||
45 | #define TCQ_F_BUILTIN 1 | 45 | #define TCQ_F_BUILTIN 1 |
46 | #define TCQ_F_THROTTLED 2 | 46 | #define TCQ_F_THROTTLED 2 |
47 | #define TCQ_F_INGRESS 4 | 47 | #define TCQ_F_INGRESS 4 |
48 | #define TCQ_F_CAN_BYPASS 8 | ||
48 | #define TCQ_F_WARN_NONWC (1 << 16) | 49 | #define TCQ_F_WARN_NONWC (1 << 16) |
49 | int padded; | 50 | int padded; |
50 | struct Qdisc_ops *ops; | 51 | struct Qdisc_ops *ops; |
@@ -182,6 +183,11 @@ struct qdisc_skb_cb { | |||
182 | char data[]; | 183 | char data[]; |
183 | }; | 184 | }; |
184 | 185 | ||
186 | static inline int qdisc_qlen(struct Qdisc *q) | ||
187 | { | ||
188 | return q->q.qlen; | ||
189 | } | ||
190 | |||
185 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) | 191 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) |
186 | { | 192 | { |
187 | return (struct qdisc_skb_cb *)skb->cb; | 193 | return (struct qdisc_skb_cb *)skb->cb; |
@@ -387,13 +393,18 @@ static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch) | |||
387 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; | 393 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; |
388 | } | 394 | } |
389 | 395 | ||
396 | static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len) | ||
397 | { | ||
398 | sch->bstats.bytes += len; | ||
399 | sch->bstats.packets++; | ||
400 | } | ||
401 | |||
390 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | 402 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, |
391 | struct sk_buff_head *list) | 403 | struct sk_buff_head *list) |
392 | { | 404 | { |
393 | __skb_queue_tail(list, skb); | 405 | __skb_queue_tail(list, skb); |
394 | sch->qstats.backlog += qdisc_pkt_len(skb); | 406 | sch->qstats.backlog += qdisc_pkt_len(skb); |
395 | sch->bstats.bytes += qdisc_pkt_len(skb); | 407 | __qdisc_update_bstats(sch, qdisc_pkt_len(skb)); |
396 | sch->bstats.packets++; | ||
397 | 408 | ||
398 | return NET_XMIT_SUCCESS; | 409 | return NET_XMIT_SUCCESS; |
399 | } | 410 | } |