netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
	Madhu Chittim <madhu.chittim@intel.com>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>
Subject: Re: [RFC] HW TX Rate Limiting Driver API
Date: Mon, 22 Apr 2024 11:06:54 -0700	[thread overview]
Message-ID: <20240422110654.2f843133@kernel.org> (raw)
In-Reply-To: <0c1528838ebafdbe275ad69febb24b056895f94a.camel@redhat.com>

On Fri, 19 Apr 2024 13:53:53 +0200 Paolo Abeni wrote:
> > They don't have to be nodes. They can appear as parent or child of 
> > a real node, but they don't themselves carry any configuration.
> > 
> > IOW you can represent them as a special encoding of the ID field,
> > rather than a real node.  
> 
> I'm sorry for the latency, I got distracted elsewhere. 
> 
> It's not clear the benefit of introducing this 'attach points' concept.
> 
> With the current proposal, configuring a queue shaper would be:
> 
> info.bw_min = ...
> dev->shaper_ops->set(dev, SHAPER_LOOKUP_BY_QUEUE, queue_id, &info, &ack);
> 
> and restoring the default could be either:
> 
> info.bw_min = 0;
> dev->shaper_ops->set(dev, SHAPER_LOOKUP_BY_QUEUE, queue_id, &info, &ack);

And presumably also bw_max = 0 also means "delete" or will it be bw_max
= ~0 ?

> or:
> 
> dev->shaper_ops->delete(dev, SHAPER_LOOKUP_BY_QUEUE, queue_id, &info, &ack);

Which confusingly will not actually delete the node, subsequent get()
will still return it.

> With the 'attach points' I guess it will be something alike the
> following (am not defining a different node type here just to keep the
> example short):
> 
> # configure a queue shaper
> struct shaper_info attach_info;
> dev->shaper_ops->get(dev, SHAPER_LOOKUP_BY_QUEUE, queue_id, &attach_info, &ack);
> info.parent_id = attach_info.id;
> info.bw_min = ...
> new_node_id = dev->shaper_ops->add(dev, &info, &ack);
>
> # restore defaults:
> dev->shaper_ops->delete(dev, SHAPER_LOOKUP_BY_TREE_ID, new_node_id, &info, &ack);
> 
> likely some additional operation would be needed to traverse/fetch
> directly the actual shaper present at the attach points???

Whether type + ID (here SHAPER_LOOKUP_BY_QUEUE, queue_id) identifies
the node sufficiently to avoid the get is orthogonal. Your ->set
example assumes you don't have to do a get first to find exact
(synthetic) node ID. The same can be true for an ->add, if you prefer.
 
> I think the operations will be simpler without the 'attach points', am
> I missing something? 
> 
> A clear conventions/definition about the semantic of deleting shapers
> at specific locations (e.g. restoring the default behaviour) should
> suffice, together with the current schema.

I guess. I do find it odd that we have objects in multiple places of 
the hierarchy when there is no configuration intended. Especially that
the HW may actually not support such configuration (say there is always
a DRR before the egress, now we insert a shaping stage there).

  reply	other threads:[~2024-04-22 18:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 10:23 [RFC] HW TX Rate Limiting Driver API Simon Horman
2024-04-05 13:33 ` Jamal Hadi Salim
2024-04-05 17:06   ` Paolo Abeni
2024-04-06 13:48     ` Jamal Hadi Salim
2024-04-10  9:41       ` Paolo Abeni
2024-04-05 14:34 ` John Fastabend
2024-04-05 16:25   ` Paolo Abeni
2024-04-09 22:32 ` Jakub Kicinski
2024-04-10  8:33   ` Paolo Abeni
2024-04-10 14:57     ` Jakub Kicinski
2024-04-11 15:58       ` Paolo Abeni
2024-04-11 16:03         ` Jakub Kicinski
2024-04-19 11:53           ` Paolo Abeni
2024-04-22 18:06             ` Jakub Kicinski [this message]
2024-04-23 17:25               ` Paolo Abeni
2024-04-24 23:57                 ` Jakub Kicinski
2024-04-11 23:51 ` Vinicius Costa Gomes
2024-04-12  4:39   ` John Fastabend
2024-04-22 11:30 ` Sunil Kovvuri Goutham
2024-04-23 14:07   ` Paolo Abeni
2024-04-23 15:56     ` Sunil Kovvuri Goutham

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=20240422110654.2f843133@kernel.org \
    --to=kuba@kernel.org \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=madhu.chittim@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sridhar.samudrala@intel.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).