diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/pkt_sched.h | 3 | ||||
| -rw-r--r-- | include/net/sch_generic.h | 15 |
2 files changed, 16 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 82a3191375f5..f911ec7598ef 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
| @@ -87,6 +87,9 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, | |||
| 87 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); | 87 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); |
| 88 | extern void qdisc_put_stab(struct qdisc_size_table *tab); | 88 | extern void qdisc_put_stab(struct qdisc_size_table *tab); |
| 89 | extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); | 89 | extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); |
| 90 | extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, | ||
| 91 | struct net_device *dev, struct netdev_queue *txq, | ||
| 92 | spinlock_t *root_lock); | ||
| 90 | 93 | ||
| 91 | extern void __qdisc_run(struct Qdisc *q); | 94 | extern void __qdisc_run(struct Qdisc *q); |
| 92 | 95 | ||
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 | } |
