netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
	Madhu Chittim <madhu.chittim@intel.com>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>,
	Simon Horman <horms@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Sunil Kovvuri Goutham <sgoutham@marvell.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Donald Hunter <donald.hunter@gmail.com>
Subject: Re: [PATCH v4 net-next 00/12] net: introduce TX H/W shaping API
Date: Mon, 26 Aug 2024 19:14:13 -0700	[thread overview]
Message-ID: <20240826191413.1829b8b6@kernel.org> (raw)
In-Reply-To: <d9cfa04f-24dd-4064-80bf-cada8bdcf9cb@redhat.com>

On Fri, 23 Aug 2024 09:51:24 +0200 Paolo Abeni wrote:
> On 8/23/24 02:43, Jakub Kicinski wrote:
> > On Tue, 20 Aug 2024 17:12:21 +0200 Paolo Abeni wrote:  
> >> * Delegation
> >>
> >> A containers wants to limit the aggregate B/W bandwidth of 2 of the 3
> >> queues it owns - the starting configuration is the one from the
> >> previous point:
> >>
> >> SPEC=Documentation/netlink/specs/net_shaper.yaml
> >> ./tools/net/ynl/cli.py --spec $SPEC \
> >> 	--do group --json '{"ifindex":'$IFINDEX',
> >> 			"leaves": [
> >> 			  {"handle": {"scope": "queue", "id":'$QID1' },
> >> 			   "weight": '$W1'},
> >> 			  {"handle": {"scope": "queue", "id":'$QID2' },
> >> 			   "weight": '$W2'}],
> >> 			"root": { "handle": {"scope": "node"},
> >> 				  "parent": {"scope": "node", "id": 0},  
> > 
> > In the delegation use case I was hoping "parent" would be automatic.  
> 
> Currently the parent is automatic/implicit when creating a node directly 
> nested to the the netdev shaper.
> 
> I now see we can use as default parent the current leaves' parent, when 
> that is the same for all the to-be-grouped leaves.
> 
> Actually, if we restrict the group operation to operate only on set of 
> leaves respecting the above, I *guess* we will not lose generality and 
> we could simplify a bit the spec. WDYT?

I remember having a use case in mind where specifying parent would be
very useful. I think it may have been related to atomic changes.
I'm not sure if what I describe below is exactly that case...

Imagine:

Qx -{hierarchy}---\
                   \{hierarchy}-- netdev
Q0-------P0\ SP----/   
Q1--\ RR-P1/
Q2--/

Let's say we own queues 0,1,2 and want to remove the SP layer.
It's convenient to do:

	$node = get($SP-node)
	group(leaves: [Q0, Q1, Q2], parent=$node.parent)

And have the kernel "garbage collect" the old RR node and the old SP
node (since they will now have no children). We want to avoid the
situations where user space has to do complex transitions thru
states which device may not support (make sure Q1, Q2 have right prios,
delete old RR, now we have SP w/ 3 inputs, delete the SP, create a new
group).

For the case above we could technically identify the correct parent by
skipping the nodes which will be garbage collected later. But imagine
that instead of deleting the hierarchy we wanted to move Q1 from P1 
to P0:

	group(leaves: [Q0, Q1], parent=SP, prio=P0)

does the job.

I admit this are somewhat contrived, and I agree that we won't lose
generality, but I think it will narrow the range of hierarchies we
can transition between atomically.

  reply	other threads:[~2024-08-27  2:14 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 15:12 [PATCH v4 net-next 00/12] net: introduce TX H/W shaping API Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 01/12] tools: ynl: lift an assumption about spec file name Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 02/12] netlink: spec: add shaper YAML spec Paolo Abeni
2024-08-23  1:48   ` Jakub Kicinski
2024-08-23  8:35     ` Paolo Abeni
2024-08-23  9:04       ` Paolo Abeni
2024-08-27  1:50       ` Jakub Kicinski
2024-08-27  7:41         ` Paolo Abeni
2024-08-23  1:56   ` Jakub Kicinski
2024-08-20 15:12 ` [PATCH v4 net-next 03/12] net-shapers: implement NL get operation Paolo Abeni
2024-08-23  2:10   ` Jakub Kicinski
2024-08-23  8:52     ` Paolo Abeni
2024-08-27  1:55       ` Jakub Kicinski
2024-08-27  7:36         ` Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 04/12] net-shapers: implement NL set and delete operations Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 05/12] net-shapers: implement NL group operation Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 06/12] net-shapers: implement delete support for NODE scope shaper Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 07/12] netlink: spec: add shaper introspection support Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 08/12] net: shaper: implement " Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 09/12] testing: net-drv: add basic shaper test Paolo Abeni
2024-08-21 16:52   ` kernel test robot
2024-08-22  7:53     ` Paolo Abeni
2024-08-27 14:14       ` Simon Horman
2024-08-20 15:12 ` [PATCH v4 net-next 10/12] virtchnl: support queue rate limit and quanta size configuration Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 11/12] ice: Support VF " Paolo Abeni
2024-08-20 15:12 ` [PATCH v4 net-next 12/12] iavf: Add net_shaper_ops support Paolo Abeni
2024-08-20 23:03   ` kernel test robot
2024-08-22  0:58 ` [PATCH v4 net-next 00/12] net: introduce TX H/W shaping API Jakub Kicinski
2024-08-22  1:10 ` patchwork-bot+netdevbpf
2024-08-23  0:43 ` Jakub Kicinski
2024-08-23  7:51   ` Paolo Abeni
2024-08-27  2:14     ` Jakub Kicinski [this message]
2024-08-27  7:54       ` Paolo Abeni
2024-08-27 13:53         ` Jakub Kicinski

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=20240826191413.1829b8b6@kernel.org \
    --to=kuba@kernel.org \
    --cc=donald.hunter@gmail.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=madhu.chittim@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sgoutham@marvell.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).