From: Jakub Kicinski <kuba@kernel.org>
To: "Nambiar, Amritha" <amritha.nambiar@intel.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
<sridhar.samudrala@intel.com>
Subject: Re: [net-next PATCH v1 3/9] netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI
Date: Tue, 8 Aug 2023 19:45:11 -0700 [thread overview]
Message-ID: <20230808194511.538a0784@kernel.org> (raw)
In-Reply-To: <ac4374d5-0d39-c15b-15d1-f79c4c0ab3fe@intel.com>
On Tue, 8 Aug 2023 17:17:34 -0700 Nambiar, Amritha wrote:
> > The main thing to focus on for next version is to make the NAPI objects
> > "flat" and individual, rather than entries in multi-attr nest within
> > per-netdev object.
>
> Would this be acceptable:
> $ netdev.yaml --do napi-get --json='{"ifindex": 12}'
>
> {'napi-info': [{'ifindex': 12, 'irq': 293, 'napi-id': 595, ...},
> {'ifindex': 12, 'irq': 292, 'napi-id': 594, ...},
> {'ifindex': 12, 'irq': 291, 'napi-id': 593, ...}]}
>
> Here, "napi-info" represents a list of NAPI objects. A NAPI object is an
> individual element in the list, and are not within per-netdev object.
> The ifindex is just another attribute that is part of the NAPI object.
> The result for non-NAPI devices will just be empty.
>
> I am not sure how to totally avoid multi-attr nest in this case. For the
> 'do napi-get' command, the response is a list of elements with multiple
> attributes and not an individual entry. This transforms to a struct
> array of NAPI objects in the 'do' response, and is achieved with the
> multi-attr nest in the YAML. Subsequently, the 'dump napi-get' response
> is a list of the 'NAPI objects struct list' for all netdevs. Am I
> missing any special type in the YAML that can also give out a
> struct-array in the 'do' response besides using multi-attr nest ?
napi-get needs to take napi-id as an argument, if you want to filter
by ifindex - that means a dump. Dumps work kind-of similar to do, you
still get the attributes for the request (although in a somewhat
convoluted way:
static int your_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
{
const struct genl_dumpit_info *info = genl_dumpit_info(cb);
info->attr[attrs-as-normal]
So if info->attrs[IFINDEX] is provided by the user - limit the dump to
only napis from that netdev.
next prev parent reply other threads:[~2023-08-09 2:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-29 0:46 [net-next PATCH v1 0/9] Introduce NAPI queues support Amritha Nambiar
2023-07-29 0:46 ` [net-next PATCH v1 1/9] net: Introduce new fields for napi and queue associations Amritha Nambiar
2023-07-29 9:55 ` kernel test robot
2023-07-30 17:10 ` Simon Horman
2023-07-31 22:57 ` Nambiar, Amritha
2023-07-29 0:47 ` [net-next PATCH v1 2/9] ice: Add support in the driver for associating napi with queue[s] Amritha Nambiar
2023-07-29 0:47 ` [net-next PATCH v1 3/9] netdev-genl: spec: Extend netdev netlink spec in YAML for NAPI Amritha Nambiar
2023-07-31 19:36 ` Jakub Kicinski
2023-07-31 23:12 ` Nambiar, Amritha
2023-08-01 0:13 ` Jakub Kicinski
2023-08-01 0:24 ` Nambiar, Amritha
2023-08-01 0:35 ` Jakub Kicinski
2023-08-09 0:17 ` Nambiar, Amritha
2023-08-09 2:45 ` Jakub Kicinski [this message]
2023-07-29 0:47 ` [net-next PATCH v1 4/9] net: Move kernel helpers for queue index outside sysfs Amritha Nambiar
2023-07-29 0:47 ` [net-next PATCH v1 5/9] netdev-genl: Add netlink framework functions for napi Amritha Nambiar
2023-07-30 17:15 ` Simon Horman
2023-07-31 23:00 ` Nambiar, Amritha
2023-07-31 19:37 ` Jakub Kicinski
2023-07-31 23:01 ` Nambiar, Amritha
2023-07-29 0:47 ` [net-next PATCH v1 6/9] netdev-genl: spec: Add irq in netdev netlink YAML spec Amritha Nambiar
2023-07-29 0:47 ` [net-next PATCH v1 7/9] net: Add NAPI IRQ support Amritha Nambiar
2023-07-29 4:05 ` Stephen Hemminger
2023-07-31 23:22 ` Nambiar, Amritha
2023-07-29 0:47 ` [net-next PATCH v1 8/9] netdev-genl: spec: Add PID in netdev netlink YAML spec Amritha Nambiar
2023-07-29 0:47 ` [net-next PATCH v1 9/9] 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=20230808194511.538a0784@kernel.org \
--to=kuba@kernel.org \
--cc=amritha.nambiar@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--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).