From: Nishanth Devarajan <ndev2021@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>, David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, doucette@bu.edu, michel@digirati.com.br
Subject: Re: [PATCH v2 net-next] net/sched: add skbprio scheduler
Date: Tue, 26 Jun 2018 04:57:20 +0530 [thread overview]
Message-ID: <20180625232712.GA3708@gmail.com> (raw)
In-Reply-To: <CAM_iQpV9uiSA=T2ZN=gaJSuzB+dci9S9FiUx=dAQYomPORfjLg@mail.gmail.com>
On Sat, Jun 23, 2018 at 02:43:16PM -0700, Cong Wang wrote:
> On Sat, Jun 23, 2018 at 1:47 PM, Nishanth Devarajan <ndev2021@gmail.com> wrote:
> > diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
> > index 37b5096..6fd07e8 100644
> > --- a/include/uapi/linux/pkt_sched.h
> > +++ b/include/uapi/linux/pkt_sched.h
> ...
> > +#define SKBPRIO_MAX_PRIORITY 64
> > +
> > +struct tc_skbprio_qopt {
> > + __u32 limit; /* Queue length in packets. */
> > +};
>
>
> Since this is just an integer, you can just make it NLA_U32 instead
> of a struct?
>
>
Making it NLA_U32, wouldn't that be incurring a nla_policy struct in the
code? I also feel uneasy that we'd be straying convention of having a tc qopt
struct to pass in essential parameters from userspace.
> > +static int skbprio_change(struct Qdisc *sch, struct nlattr *opt,
> > + struct netlink_ext_ack *extack)
> > +{
> > + struct skbprio_sched_data *q = qdisc_priv(sch);
> > + struct tc_skbprio_qopt *ctl = nla_data(opt);
> > + const unsigned int min_limit = 1;
> > +
> > + if (ctl->limit == (typeof(ctl->limit))-1)
> > + q->max_limit = max(qdisc_dev(sch)->tx_queue_len, min_limit);
> > + else if (ctl->limit < min_limit ||
> > + ctl->limit > qdisc_dev(sch)->tx_queue_len)
> > + return -EINVAL;
> > + else
> > + q->max_limit = ctl->limit;
> > +
> > + return 0;
> > +}
>
> Isn't q->max_limit same with sch->limit?
>
q->max_limit was intended to represent the maximum limit that Skbprio could
accomodate i.e the tx queue len of the device attached to the qdisc, to check
the limit parameter passed from userspace. I'll correct this in v3.
> Also, please avoid dev->tx_queue_len here, it may change
> independently of your qdisc change, unless you want to implement
> ops->change_tx_queue_len().
OK, will make this change.
next prev parent reply other threads:[~2018-06-25 23:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-23 20:47 [PATCH v2 net-next] net/sched: add skbprio scheduler Nishanth Devarajan
2018-06-23 21:43 ` Cong Wang
2018-06-25 23:27 ` Nishanth Devarajan [this message]
2018-06-23 22:10 ` Alexander Duyck
2018-06-26 0:11 ` Nishanth Devarajan
2018-06-24 15:43 ` Jamal Hadi Salim
2018-06-26 0:34 ` Nishanth Devarajan
-- strict thread matches above, loose matches on Subject: below --
2018-06-06 15:40 Nishanth Devarajan
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=20180625232712.GA3708@gmail.com \
--to=ndev2021@gmail.com \
--cc=davem@davemloft.net \
--cc=doucette@bu.edu \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=michel@digirati.com.br \
--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).