All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Cong Wang <xiyou.wangcong@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	intel-wired-lan <intel-wired-lan@lists.osuosl.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	andre.guedes@intel.com, ivan.briano@intel.com,
	boon.leong.ong@intel.com, richardcochran@gmail.com,
	henrik@austad.us
Subject: Re: [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper (CBS) qdisc
Date: Wed, 27 Sep 2017 15:57:24 -0700	[thread overview]
Message-ID: <4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com> (raw)
In-Reply-To: <87lgkzg7xv.fsf@intel.com>

Hi,


On 09/27/2017 02:14 PM, Vinicius Costa Gomes wrote:
> Hi,
> 
> Cong Wang <xiyou.wangcong@gmail.com> writes:
> 
>> On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes
>> <vinicius.gomes@intel.com> wrote:
>>> +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)
>>> +{
>>> +       struct cbs_sched_data *q = qdisc_priv(sch);
>>> +       struct net_device *dev = qdisc_dev(sch);
>>> +
>>> +       if (!opt)
>>> +               return -EINVAL;
>>> +
>>> +       /* FIXME: this means that we can only install this qdisc
>>> +        * "under" mqprio. Do we need a more generic way to retrieve
>>> +        * the queue, or do we pass the netdev_queue to the driver?
>>> +        */
>>> +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);
>>> +
>>> +       return cbs_change(sch, opt);
>>> +}
>>
>> Yeah it is ugly to assume its parent is mqprio, at least you should
>> error out if it is not the case.
> 
> Will add an error for this, for now.
> 
>>
>> I am not sure how we can solve this elegantly, perhaps you should
>> extend mqprio rather than add a new one?
> 
> Is the alternative hinted in the FIXME worse? Instead of passing the
> index of the hardware queue to the driver we pass the pointer to a
> netdev_queue to the driver and it "discovers" the HW queue from that.

What if we keep passing the index, but calculate it from the netdev_queue
pointer instead?

i.e.:  q->queue = sch->dev_queue - netdev_get_tx_queue(dev, 0);

At least it wouldn't rely on the root qdisc being of any specific type.

Regards,
Jesus

WARNING: multiple messages have this Message-ID (diff)
From: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper (CBS) qdisc
Date: Wed, 27 Sep 2017 15:57:24 -0700	[thread overview]
Message-ID: <4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com> (raw)
In-Reply-To: <87lgkzg7xv.fsf@intel.com>

Hi,


On 09/27/2017 02:14 PM, Vinicius Costa Gomes wrote:
> Hi,
> 
> Cong Wang <xiyou.wangcong@gmail.com> writes:
> 
>> On Tue, Sep 26, 2017 at 4:39 PM, Vinicius Costa Gomes
>> <vinicius.gomes@intel.com> wrote:
>>> +static int cbs_init(struct Qdisc *sch, struct nlattr *opt)
>>> +{
>>> +       struct cbs_sched_data *q = qdisc_priv(sch);
>>> +       struct net_device *dev = qdisc_dev(sch);
>>> +
>>> +       if (!opt)
>>> +               return -EINVAL;
>>> +
>>> +       /* FIXME: this means that we can only install this qdisc
>>> +        * "under" mqprio. Do we need a more generic way to retrieve
>>> +        * the queue, or do we pass the netdev_queue to the driver?
>>> +        */
>>> +       q->queue = TC_H_MIN(sch->parent) - 1 - netdev_get_num_tc(dev);
>>> +
>>> +       return cbs_change(sch, opt);
>>> +}
>>
>> Yeah it is ugly to assume its parent is mqprio, at least you should
>> error out if it is not the case.
> 
> Will add an error for this, for now.
> 
>>
>> I am not sure how we can solve this elegantly, perhaps you should
>> extend mqprio rather than add a new one?
> 
> Is the alternative hinted in the FIXME worse? Instead of passing the
> index of the hardware queue to the driver we pass the pointer to a
> netdev_queue to the driver and it "discovers" the HW queue from that.

What if we keep passing the index, but calculate it from the netdev_queue
pointer instead?

i.e.:  q->queue = sch->dev_queue - netdev_get_tx_queue(dev, 0);

At least it wouldn't rely on the root qdisc being of any specific type.

Regards,
Jesus

  reply	other threads:[~2017-09-27 23:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26 23:39 [next-queue PATCH 0/3] TSN: Add qdisc based config interface for CBS Vinicius Costa Gomes
2017-09-26 23:39 ` [Intel-wired-lan] " Vinicius Costa Gomes
2017-09-26 23:39 ` [next-queue PATCH 1/3] net/sched: Introduce the user API for the CBS shaper Vinicius Costa Gomes
2017-09-26 23:39   ` [Intel-wired-lan] " Vinicius Costa Gomes
2017-09-26 23:39 ` [next-queue PATCH 2/3] net/sched: Introduce Credit Based Shaper (CBS) qdisc Vinicius Costa Gomes
2017-09-26 23:39   ` [Intel-wired-lan] " Vinicius Costa Gomes
2017-09-27 20:23   ` Cong Wang
2017-09-27 20:23     ` [Intel-wired-lan] " Cong Wang
2017-09-27 21:14     ` Vinicius Costa Gomes
2017-09-27 21:14       ` [Intel-wired-lan] " Vinicius Costa Gomes
2017-09-27 22:57       ` Jesus Sanchez-Palencia [this message]
2017-09-27 22:57         ` Jesus Sanchez-Palencia
2017-09-27 23:11         ` Guedes, Andre
2017-09-27 23:11           ` [Intel-wired-lan] " Guedes, Andre
2017-09-28 22:34       ` Cong Wang
2017-09-28 22:34         ` [Intel-wired-lan] " Cong Wang
2017-09-28 23:07         ` Vinicius Costa Gomes
2017-09-28 23:07           ` [Intel-wired-lan] " Vinicius Costa Gomes
2017-09-26 23:39 ` [next-queue PATCH 3/3] igb: Add support for CBS offload Vinicius Costa Gomes
2017-09-26 23:39   ` [Intel-wired-lan] " Vinicius Costa Gomes

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=4b0e1610-c9df-191d-496e-4be04c785d2f@intel.com \
    --to=jesus.sanchez-palencia@intel.com \
    --cc=andre.guedes@intel.com \
    --cc=boon.leong.ong@intel.com \
    --cc=henrik@austad.us \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=ivan.briano@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=vinicius.gomes@intel.com \
    --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 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.