|
@@ -521,11 +521,38 @@ static inline void qdisc_bstats_update(struct Qdisc *sch,
|
|
bstats_update(&sch->bstats, skb);
|
|
bstats_update(&sch->bstats, skb);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline void qdisc_qstats_backlog_dec(struct Qdisc *sch,
|
|
|
|
+ const struct sk_buff *skb)
|
|
|
|
+{
|
|
|
|
+ sch->qstats.backlog -= qdisc_pkt_len(skb);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void qdisc_qstats_backlog_inc(struct Qdisc *sch,
|
|
|
|
+ const struct sk_buff *skb)
|
|
|
|
+{
|
|
|
|
+ sch->qstats.backlog += qdisc_pkt_len(skb);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void __qdisc_qstats_drop(struct Qdisc *sch, int count)
|
|
|
|
+{
|
|
|
|
+ sch->qstats.drops += count;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void qdisc_qstats_drop(struct Qdisc *sch)
|
|
|
|
+{
|
|
|
|
+ sch->qstats.drops++;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void qdisc_qstats_overlimit(struct Qdisc *sch)
|
|
|
|
+{
|
|
|
|
+ sch->qstats.overlimits++;
|
|
|
|
+}
|
|
|
|
+
|
|
static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
|
|
static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
|
|
struct sk_buff_head *list)
|
|
struct sk_buff_head *list)
|
|
{
|
|
{
|
|
__skb_queue_tail(list, skb);
|
|
__skb_queue_tail(list, skb);
|
|
- sch->qstats.backlog += qdisc_pkt_len(skb);
|
|
|
|
|
|
+ qdisc_qstats_backlog_inc(sch, skb);
|
|
|
|
|
|
return NET_XMIT_SUCCESS;
|
|
return NET_XMIT_SUCCESS;
|
|
}
|
|
}
|
|
@@ -541,7 +568,7 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct Qdisc *sch,
|
|
struct sk_buff *skb = __skb_dequeue(list);
|
|
struct sk_buff *skb = __skb_dequeue(list);
|
|
|
|
|
|
if (likely(skb != NULL)) {
|
|
if (likely(skb != NULL)) {
|
|
- sch->qstats.backlog -= qdisc_pkt_len(skb);
|
|
|
|
|
|
+ qdisc_qstats_backlog_dec(sch, skb);
|
|
qdisc_bstats_update(sch, skb);
|
|
qdisc_bstats_update(sch, skb);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -560,7 +587,7 @@ static inline unsigned int __qdisc_queue_drop_head(struct Qdisc *sch,
|
|
|
|
|
|
if (likely(skb != NULL)) {
|
|
if (likely(skb != NULL)) {
|
|
unsigned int len = qdisc_pkt_len(skb);
|
|
unsigned int len = qdisc_pkt_len(skb);
|
|
- sch->qstats.backlog -= len;
|
|
|
|
|
|
+ qdisc_qstats_backlog_dec(sch, skb);
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
return len;
|
|
return len;
|
|
}
|
|
}
|
|
@@ -579,7 +606,7 @@ static inline struct sk_buff *__qdisc_dequeue_tail(struct Qdisc *sch,
|
|
struct sk_buff *skb = __skb_dequeue_tail(list);
|
|
struct sk_buff *skb = __skb_dequeue_tail(list);
|
|
|
|
|
|
if (likely(skb != NULL))
|
|
if (likely(skb != NULL))
|
|
- sch->qstats.backlog -= qdisc_pkt_len(skb);
|
|
|
|
|
|
+ qdisc_qstats_backlog_dec(sch, skb);
|
|
|
|
|
|
return skb;
|
|
return skb;
|
|
}
|
|
}
|
|
@@ -661,14 +688,14 @@ static inline unsigned int qdisc_queue_drop(struct Qdisc *sch)
|
|
static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
|
|
static inline int qdisc_drop(struct sk_buff *skb, struct Qdisc *sch)
|
|
{
|
|
{
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
- sch->qstats.drops++;
|
|
|
|
|
|
+ qdisc_qstats_drop(sch);
|
|
|
|
|
|
return NET_XMIT_DROP;
|
|
return NET_XMIT_DROP;
|
|
}
|
|
}
|
|
|
|
|
|
static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
|
|
static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
|
|
{
|
|
{
|
|
- sch->qstats.drops++;
|
|
|
|
|
|
+ qdisc_qstats_drop(sch);
|
|
|
|
|
|
#ifdef CONFIG_NET_CLS_ACT
|
|
#ifdef CONFIG_NET_CLS_ACT
|
|
if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
|
|
if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
|