diff options
author | David S. Miller <davem@davemloft.net> | 2018-09-10 10:07:01 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-10 10:07:01 -0700 |
commit | fd2b803fa8ef3dd4b6c6a71d5f33bac7ccd76d18 (patch) | |
tree | 6b0444e2e358c0e9f55d4e4ffdbd7263a94f1f09 /include/net/sch_generic.h | |
parent | net/ipv6: Remove rt6i_prefsrc (diff) | |
parent | rtl818x: Remove SKB list assumptions. (diff) | |
download | linux-dev-fd2b803fa8ef3dd4b6c6a71d5f33bac7ccd76d18.tar.xz linux-dev-fd2b803fa8ef3dd4b6c6a71d5f33bac7ccd76d18.zip |
Merge branch 'skb_list_cleanups'
David Miller says:
====================
SKB list handling cleanups
This is a preparatory patch series which cleans up various forms of
sloppy SKB list handling, and makes certain semantics explicit.
We are trying to eliminate code that directly accesses the SKB
list and SKB queue head next/prev members in any way. It is
impossible to convert SKB queue head over the struct list_head
while such code exists.
This patch series does not eliminate all such code, only the simplest
cases. A latter series will tackle the complicated ones.
A helper is added to make the "skb->next == NULL means not on a list"
rule explicit, and another is added to combine this with list_del().
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index a6d00093f35e..fdaa5506e6f7 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -828,8 +828,8 @@ static inline void qdisc_skb_head_init(struct qdisc_skb_head *qh) qh->qlen = 0; } -static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, - struct qdisc_skb_head *qh) +static inline void __qdisc_enqueue_tail(struct sk_buff *skb, + struct qdisc_skb_head *qh) { struct sk_buff *last = qh->tail; @@ -842,14 +842,24 @@ static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, qh->head = skb; } qh->qlen++; - qdisc_qstats_backlog_inc(sch, skb); +} +static inline int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch) +{ + __qdisc_enqueue_tail(skb, &sch->q); + qdisc_qstats_backlog_inc(sch, skb); return NET_XMIT_SUCCESS; } -static inline int qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch) +static inline void __qdisc_enqueue_head(struct sk_buff *skb, + struct qdisc_skb_head *qh) { - return __qdisc_enqueue_tail(skb, sch, &sch->q); + skb->next = qh->head; + + if (!qh->head) + qh->tail = skb; + qh->head = skb; + qh->qlen++; } static inline struct sk_buff *__qdisc_dequeue_head(struct qdisc_skb_head *qh) |