[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27b172a5-5161-4fe2-90b1-83b83ef3b073@kernel.org>
Date: Wed, 22 Nov 2023 15:39:48 +0100
From: Jesper Dangaard Brouer <hawk@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
almasrymina@...gle.com, ilias.apalodimas@...aro.org, dsahern@...il.com,
dtatulea@...dia.com, willemb@...gle.com
Subject: Re: [PATCH net-next v3 07/13] net: page_pool: implement GET in the
netlink API
On 11/22/23 04:44, Jakub Kicinski wrote:
> Expose the very basic page pool information via netlink.
>
> Example using ynl-py for a system with 9 queues:
>
> $ ./cli.py --no-schema --spec netlink/specs/netdev.yaml \
> --dump page-pool-get
> [{'id': 19, 'ifindex': 2, 'napi-id': 147},
> {'id': 18, 'ifindex': 2, 'napi-id': 146},
> {'id': 17, 'ifindex': 2, 'napi-id': 145},
> {'id': 16, 'ifindex': 2, 'napi-id': 144},
> {'id': 15, 'ifindex': 2, 'napi-id': 143},
> {'id': 14, 'ifindex': 2, 'napi-id': 142},
> {'id': 13, 'ifindex': 2, 'napi-id': 141},
> {'id': 12, 'ifindex': 2, 'napi-id': 140},
> {'id': 11, 'ifindex': 2, 'napi-id': 139},
> {'id': 10, 'ifindex': 2, 'napi-id': 138}]
>
> Signed-off-by: Jakub Kicinski<kuba@...nel.org>
> ---
> include/uapi/linux/netdev.h | 10 +++
> net/core/netdev-genl-gen.c | 27 ++++++++
> net/core/netdev-genl-gen.h | 3 +
> net/core/page_pool_user.c | 127 ++++++++++++++++++++++++++++++++++++
> 4 files changed, 167 insertions(+)
Acked-by: Jesper Dangaard Brouer <hawk@...nel.org>
Can we still somehow list "detached" page_pool's with ifindex==1
(LOOPBACK_IFINDEX) ?
page_pool_unreg_netdev() does pool->slow.netdev = lo;
> [...]
> +page_pool_nl_fill(struct sk_buff *rsp, const struct page_pool *pool,
> + const struct genl_info *info)
> +{
> + void *hdr;
> +
> + hdr = genlmsg_iput(rsp, info);
> + if (!hdr)
> + return -EMSGSIZE;
> +
> + if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_ID, pool->user.id))
> + goto err_cancel;
> +
> + if (pool->slow.netdev->ifindex != LOOPBACK_IFINDEX &&
> + nla_put_u32(rsp, NETDEV_A_PAGE_POOL_IFINDEX,
> + pool->slow.netdev->ifindex))
> + goto err_cancel;
> + if (pool->user.napi_id &&
> + nla_put_uint(rsp, NETDEV_A_PAGE_POOL_NAPI_ID, pool->user.napi_id))
> + goto err_cancel;
> +
> + genlmsg_end(rsp, hdr);
> +
> + return 0;
> +err_cancel:
> + genlmsg_cancel(rsp, hdr);
> + return -EMSGSIZE;
> +}
Powered by blists - more mailing lists