From: Jakub Kicinski <kuba@kernel.org>
To: "Nambiar, Amritha" <amritha.nambiar@intel.com>
Cc: <netdev@vger.kernel.org>, <pabeni@redhat.com>,
<sridhar.samudrala@intel.com>
Subject: Re: [net-next PATCH v7 01/10] netdev-genl: spec: Extend netdev netlink spec in YAML for queue
Date: Thu, 16 Nov 2023 00:53:27 -0500 [thread overview]
Message-ID: <20231116005327.365065ab@kernel.org> (raw)
In-Reply-To: <3edec947-a760-4605-9334-81c40ce62670@intel.com>
On Wed, 15 Nov 2023 13:05:24 -0800 Nambiar, Amritha wrote:
> We could drop the word "queue" from all attrs of queue-object and also
> the word "napi" from all attrs of napi-object. Only concern is, queue
> object will have NAPI-ID as "napi-id" while the napi object will have
> NAPI-ID as "id". Same values but referred to as "id" and "napi-id"
> depending on the object (although should be fine as the command names
> carry the object names).
> Here's an example how this would look:
>
> $ queue-get --json='{"ifindex": 12, "id": 0, "type": 0}'
> {'ifindex': 12, 'napi-id': 593, 'id': 0, 'type': 'rx'}
>
> $ napi-get --json='{"id": 593}'
> {'ifindex': 12, 'irq': 291, 'id': 593, 'pid': 3817}
>
> Let me know if this is okay.
It's a bit of a judgment call. The CLI JSON obviously looks fine with
the $obj-id format, perhaps even a tiny bit more consistent.
But the C uAPI defines are unpleasant with the NETDEV_$OBJ_$OBJ_ID
repetition. And I think the same thing would happen in Python code.
I'm guessing user may end up writing code like:
queue = netdev.get_queue({'id': X, 'type': "rx"})
do_something_with(queue_id=queue["id"])
which seems pretty clear. With the $obj-id it'd be:
queue = netdev.get_queue({'queue-id': X, 'queue-type': "rx"})
^^^^^ ^^^^^ ^^^^^
do_something_with(queue_id=queue["queue-id"])
^^^^^ ^^^^^ ^^^^^
IOW we'd also say "queue" a lot...
So yes, I'm only 80% sure we won't regret this but let's drop the
$obj AKA queue / napi prefix.
next prev parent reply other threads:[~2023-11-16 5:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 0:29 [net-next PATCH v7 00/10] Introduce queue and NAPI support in netdev-genl (Was: Introduce NAPI queues support) Amritha Nambiar
2023-11-14 0:29 ` [net-next PATCH v7 01/10] netdev-genl: spec: Extend netdev netlink spec in YAML for queue Amritha Nambiar
2023-11-15 4:48 ` Jakub Kicinski
2023-11-15 21:05 ` Nambiar, Amritha
2023-11-16 5:53 ` Jakub Kicinski [this message]
2023-11-14 0:29 ` [net-next PATCH v7 02/10] net: Add queue and napi association Amritha Nambiar
2023-11-14 0:29 ` [net-next PATCH v7 03/10] ice: Add support in the driver for associating queue with napi Amritha Nambiar
2023-11-14 0:29 ` [net-next PATCH v7 04/10] netdev-genl: Add netlink framework functions for queue Amritha Nambiar
2023-11-14 0:29 ` [net-next PATCH v7 05/10] netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI Amritha Nambiar
2023-11-15 4:49 ` Jakub Kicinski
2023-11-14 0:30 ` [net-next PATCH v7 06/10] netdev-genl: Add netlink framework functions for napi Amritha Nambiar
2023-11-14 0:30 ` [net-next PATCH v7 07/10] netdev-genl: spec: Add irq in netdev netlink YAML spec Amritha Nambiar
2023-11-14 0:30 ` [net-next PATCH v7 08/10] net: Add NAPI IRQ support Amritha Nambiar
2023-11-14 0:30 ` [net-next PATCH v7 09/10] netdev-genl: spec: Add PID in netdev netlink YAML spec Amritha Nambiar
2023-11-14 0:30 ` [net-next PATCH v7 10/10] netdev-genl: Add PID for the NAPI thread Amritha Nambiar
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=20231116005327.365065ab@kernel.org \
--to=kuba@kernel.org \
--cc=amritha.nambiar@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 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.