All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Cake List <cake@lists.bufferbloat.net>
Subject: Re: [PATCH net-next v8 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc
Date: Mon, 7 May 2018 09:35:30 -0700	[thread overview]
Message-ID: <CAM_iQpV4qThp2+_sKC7ZBgUCUu0BSZvOkT0tvf2ATdMFgu+YPg@mail.gmail.com> (raw)
In-Reply-To: <87in831bl2.fsf@toke.dk>

On Fri, May 4, 2018 at 12:10 PM, Toke Høiland-Jørgensen <toke@toke.dk> wrote:
> Thank you for the review! A few comments below, I'll fix the rest.
>
>> [...]
>>
>> So sch_cake doesn't accept normal tc filters? Is this intentional?
>> If so, why?
>
> For two reasons:
>
> - The two-level scheduling used in CAKE (tins / diffserv classes, and
>   flow hashing) does not map in an obvious way to the classification
>   index of tc filters.

Sounds like you need to extend struct tcf_result?

>
> - No one has asked for it. We have done our best to accommodate the
>   features people want in a home router qdisc directly in CAKE, and the
>   ability to integrate tc filters has never been requested.

It is not hard to integrate, basically you need to call tcf_classify().
Although it is not mandatory, it is odd to merge a qdisc doesn't work
with existing tc filters (and actions too).


>>> +static int cake_init(struct Qdisc *sch, struct nlattr *opt,
>>> +                    struct netlink_ext_ack *extack)
>>> +{
>>> +       struct cake_sched_data *q = qdisc_priv(sch);
>>> +       int i, j;
>>> +
>>> +       sch->limit = 10240;
>>> +       q->tin_mode = CAKE_DIFFSERV_BESTEFFORT;
>>> +       q->flow_mode  = CAKE_FLOW_TRIPLE;
>>> +
>>> +       q->rate_bps = 0; /* unlimited by default */
>>> +
>>> +       q->interval = 100000; /* 100ms default */
>>> +       q->target   =   5000; /* 5ms: codel RFC argues
>>> +                              * for 5 to 10% of interval
>>> +                              */
>>> +
>>> +       q->cur_tin = 0;
>>> +       q->cur_flow  = 0;
>>> +
>>> +       if (opt) {
>>> +               int err = cake_change(sch, opt, extack);
>>> +
>>> +               if (err)
>>> +                       return err;
>>
>>
>> Not sure if you really want to reallocate q->tines below for this
>> case.
>
> I'm not sure what you mean here? If there's an error we return it and
> the qdisc is not created. If there's not, we allocate and on subsequent
> changes cake_change() will be called directly, or? Can the init function
> ever be called again during the lifetime of the qdisc?
>

In non-error case, you call cake_change() first and then allocate ->tins
with kvzalloc() below. For me it looks like you don't need to allocate it
again when ->tins!=NULL.

  reply	other threads:[~2018-05-07 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 14:02 [PATCH net-next v8 0/7] sched: Add Common Applications Kept Enhanced (cake) qdisc Toke Høiland-Jørgensen
2018-05-04 14:02 ` [PATCH net-next v8 4/7] sch_cake: Add NAT awareness to packet classifier Toke Høiland-Jørgensen
2018-05-04 14:02 ` [PATCH net-next v8 3/7] sch_cake: Add optional ACK filter Toke Høiland-Jørgensen
2018-05-04 14:02 ` [PATCH net-next v8 7/7] sch_cake: Conditionally split GSO segments Toke Høiland-Jørgensen
2018-05-04 14:02 ` [PATCH net-next v8 5/7] sch_cake: Add DiffServ handling Toke Høiland-Jørgensen
2018-05-04 14:02 ` [PATCH net-next v8 6/7] sch_cake: Add overhead compensation support to the rate shaper Toke Høiland-Jørgensen
2018-05-04 14:02 ` [PATCH net-next v8 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc Toke Høiland-Jørgensen
2018-05-04 17:57   ` Cong Wang
2018-05-04 19:10     ` Toke Høiland-Jørgensen
2018-05-07 16:35       ` Cong Wang [this message]
2018-05-07 18:37         ` Toke Høiland-Jørgensen
2018-05-08  4:11           ` Cong Wang
2018-05-04 14:02 ` [PATCH net-next v8 2/7] sch_cake: Add ingress mode Toke Høiland-Jørgensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM_iQpV4qThp2+_sKC7ZBgUCUu0BSZvOkT0tvf2ATdMFgu+YPg@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=netdev@vger.kernel.org \
    --cc=toke@toke.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.