lkml.org 
[lkml]   [2022]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH RFC v1 net-next 2/4] net/sched: sch_tbf: Use Qdisc backpressure infrastructure
    Date
    From: Peilin Ye <peilin.ye@bytedance.com>

    Recently we introduced a Qdisc backpressure infrastructure for TCP and
    UDP sockets. Use it in TBF.

    Suggested-by: Cong Wang <cong.wang@bytedance.com>
    Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
    ---
    net/sched/sch_tbf.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
    index 72102277449e..06229765290b 100644
    --- a/net/sched/sch_tbf.c
    +++ b/net/sched/sch_tbf.c
    @@ -250,6 +250,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch,
    }
    ret = qdisc_enqueue(skb, q->qdisc, to_free);
    if (ret != NET_XMIT_SUCCESS) {
    + qdisc_backpressure_overlimit(sch, skb);
    if (net_xmit_drop_count(ret))
    qdisc_qstats_drop(sch);
    return ret;
    @@ -306,6 +307,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc *sch)
    return skb;
    }

    + qdisc_backpressure_throttle(sch);
    qdisc_watchdog_schedule_ns(&q->watchdog,
    now + max_t(long, -toks, -ptoks));

    --
    2.20.1
    \
     
     \ /
      Last update: 2022-05-06 21:46    [W:2.384 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site