Re: [RFC net-next v2 4/9] netdev-genl: Dump napi_defer_hard_irqs

From: Joe Damato
Date: Sun Sep 08 2024 - 16:36:24 EST


On Sun, Sep 08, 2024 at 04:06:38PM +0000, Joe Damato wrote:
> Support dumping defer_hard_irqs for a NAPI ID.
>
> Signed-off-by: Joe Damato <jdamato@xxxxxxxxxx>
> ---
> Documentation/netlink/specs/netdev.yaml | 8 ++++++++
> include/uapi/linux/netdev.h | 1 +
> net/core/netdev-genl.c | 5 +++++
> tools/include/uapi/linux/netdev.h | 1 +
> 4 files changed, 15 insertions(+)

[...]

> diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
> index 9561841b9d2d..f1e505ad069f 100644
> --- a/net/core/netdev-genl.c
> +++ b/net/core/netdev-genl.c
> @@ -160,6 +160,7 @@ static int
> netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
> const struct genl_info *info)
> {
> + int napi_defer_hard_irqs;

I've already made this a u32 in my rfcv2 branch.

> void *hdr;
> pid_t pid;
>
> @@ -191,6 +192,10 @@ netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
> goto nla_put_failure;
> }
>
> + napi_defer_hard_irqs = napi_get_defer_hard_irqs(napi);
> + if (nla_put_s32(rsp, NETDEV_A_NAPI_DEFER_HARD_IRQS, napi_defer_hard_irqs))
> + goto nla_put_failure;
> +
> genlmsg_end(rsp, hdr);
>
> return 0;