From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Michel Machado <michel@digirati.com.br>,
Nishanth Devarajan <ndev2021@gmail.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>, David Miller <davem@davemloft.net>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
Cody Doucette <doucette@bu.edu>
Subject: Re: [PATCH v3 net-next] net/sched: add skbprio scheduler
Date: Sat, 14 Jul 2018 01:39:19 -0300 [thread overview]
Message-ID: <20180714043917.GA20383@localhost.localdomain> (raw)
In-Reply-To: <CAM_iQpW0bf_9T55kg3cOdf-PKwnsF8ohJTtmtrOYCyHrY9jPrw@mail.gmail.com>
On Fri, Jul 13, 2018 at 11:26:28AM -0700, Cong Wang wrote:
> On Fri, Jul 13, 2018 at 6:04 AM Marcelo Ricardo Leitner
> <marcelo.leitner@gmail.com> wrote:
> >
> > On Thu, Jul 12, 2018 at 11:05:45PM -0700, Cong Wang wrote:
> > > On Wed, Jul 11, 2018 at 12:33 PM Marcelo Ricardo Leitner
> > > <marcelo.leitner@gmail.com> wrote:
> > > >
> > > > On Tue, Jul 10, 2018 at 07:25:53PM -0700, Cong Wang wrote:
> > > > > On Mon, Jul 9, 2018 at 2:40 PM Marcelo Ricardo Leitner
> > > > > <marcelo.leitner@gmail.com> wrote:
> > > > > >
> > > > > > On Mon, Jul 09, 2018 at 05:03:31PM -0400, Michel Machado wrote:
> > > > > > > Changing TC_PRIO_MAX from 15 to 63 risks breaking backward compatibility
> > > > > > > with applications.
> > > > > >
> > > > > > If done, it needs to be done carefully, indeed. I don't know if it's
> > > > > > doable, neither I know how hard is your requirement for 64 different
> > > > > > priorities.
> > > > >
> > > > > struct tc_prio_qopt {
> > > > > int bands; /* Number of bands */
> > > > > __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
> > > > > };
> > > > >
> > > > > How would you do it carefully?
> > > >
> > > > quick shot, multiplex v1 and v2 formats based on bands and sizeof():
> > > >
> > > > #define TCQ_PRIO_BANDS_V1 16
> > > > #define TCQ_PRIO_BANDS_V2 64
> > > > #define TC_PRIO_MAX_V2 64
> > > >
> > > > struct tc_prio_qopt_v2 {
> > > > int bands; /* Number of bands */
> > > > __u8 priomap[TC_PRIO_MAX_V2+1]; /* Map: logical priority -> PRIO band */
> > > > };
> > > >
> > >
> > > Good try, but:
> > >
> > > 1. You don't take padding into account, although the difference
> > > between 16 and 64 is big here. If it were 16 and 20, almost certainly
> > > wouldn't work.
> >
> > It still would work, no matter how much padding you have, as currently
> > you can't use more than 3 bands.
>
> I am lost.
>
> With your proposal above, you have 16 bands for V1 and 64 bands
> for V2, where does 3 come from???
My bad. s/3/16/
>
>
> >
> > >
> > > 2. What if I compile a new iproute2 on an old kernel? The iproute2
> > > will use V2, while old kernel has no knowledge of V2, so it only
> > > copies a part of V2 in the end....
> >
> > Yes, and that's not a problem:
> > - Either bands is > 3 and it will return EINVAL, protecting from
> > reading beyond the buffer.
> > - Or 2 <= bands <= 3 and it will handle it as a _v1 struct, and use
> > only the original size.
>
> Again why 3 not 16 or 64 ??
Again, s/3/16/
>
> Also, why does an old kernel has the logic in its binary to determine
> this?
It won't, and it doesn't need to. If you use bands > 16 with an old
kernel, it will reject per current code (that I already pasted):
if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < 2)
return -EINVAL;
Simple as that. If you try to use more bands than it supports, it will
reject it.
>
> >
> > iproute2 (or other app) may still use _v1 if it wants, btw.
>
> Yes, old iproute2 must still have v1, what's point? Are you
??
> suggesting new iproute2 should still have v1 after you propose
> v1 and v2 for kernel?
I'm only saying that both versions will be accepted by a new kernel.
>
> I must seriously miss something. Please help.
>
> Thanks!
next prev parent reply other threads:[~2018-07-14 4:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-07 10:13 [PATCH v3 net-next] net/sched: add skbprio scheduler Nishanth Devarajan
2018-07-09 15:44 ` Marcelo Ricardo Leitner
2018-07-09 18:18 ` Michel Machado
2018-07-09 19:53 ` Marcelo Ricardo Leitner
2018-07-09 21:03 ` Michel Machado
2018-07-09 21:40 ` Marcelo Ricardo Leitner
2018-07-10 14:03 ` Michel Machado
2018-07-10 14:33 ` Marcelo Ricardo Leitner
2018-07-11 2:25 ` Cong Wang
2018-07-11 19:33 ` Marcelo Ricardo Leitner
2018-07-13 6:05 ` Cong Wang
2018-07-13 13:04 ` Marcelo Ricardo Leitner
2018-07-13 18:26 ` Cong Wang
2018-07-14 4:39 ` Marcelo Ricardo Leitner [this message]
2018-07-17 6:41 ` Cong Wang
2018-07-11 2:32 ` Cong Wang
2018-07-11 18:37 ` Marcelo Ricardo Leitner
2018-07-13 5:07 ` Cong Wang
2018-07-13 13:00 ` Marcelo Ricardo Leitner
2018-07-13 18:17 ` Cong Wang
2018-07-14 4:51 ` Marcelo Ricardo Leitner
2018-07-17 5:36 ` Cong Wang
2018-07-11 2:38 ` Cong Wang
2018-07-11 2:57 ` Cong Wang
2018-07-11 15:24 ` Michel Machado
2018-07-19 18:39 ` Cong Wang
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=20180714043917.GA20383@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=davem@davemloft.net \
--cc=doucette@bu.edu \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=michel@digirati.com.br \
--cc=ndev2021@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).