Re: [RFC net-next v4 6/9] netdev-genl: Support setting per-NAPI config values

Joe Damato
2024-10-08T18:20:52Z

On Tue, Oct 01, 2024 at 11:52:37PM +0000, Joe Damato wrote:
> Add support to set per-NAPI defer_hard_irqs and gro_flush_timeout.
>
> Signed-off-by: Joe Damato <jdamato@fastly.com>
> ---
> Documentation/netlink/specs/netdev.yaml | 11 ++++++
> include/uapi/linux/netdev.h | 1 +
> net/core/netdev-genl-gen.c | 14 ++++++++
> net/core/netdev-genl-gen.h | 1 +
> net/core/netdev-genl.c | 45 +++++++++++++++++++++++++
> tools/include/uapi/linux/netdev.h | 1 +
> 6 files changed, 73 insertions(+)

[...]

> diff --git a/net/core/netdev-genl-gen.c b/net/core/netdev-genl-gen.c
> index b28424ae06d5..901c6f65b735 100644
> --- a/net/core/netdev-genl-gen.c
> +++ b/net/core/netdev-genl-gen.c
> @@ -87,6 +87,13 @@ static const struct nla_policy netdev_bind_rx_nl_policy[NETDEV_A_DMABUF_FD + 1]
> [NETDEV_A_DMABUF_QUEUES] = NLA_POLICY_NESTED(netdev_queue_id_nl_policy),
> };
>
> +/* NETDEV_CMD_NAPI_SET - set */
> +static const struct nla_policy netdev_napi_set_nl_policy[NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT + 1] = {
> + [NETDEV_A_NAPI_ID] = { .type = NLA_U32, },
> + [NETDEV_A_NAPI_DEFER_HARD_IRQS] = { .type = NLA_S32 },

Noticed this while re-reading the code; planning on changing this
from NLA_S32 to NLA_U32 for v5.