[PATCH v29 02/20] netlink: add new family to manage ULP_DDP enablement and stats
Simon Horman
horms at kernel.org
Tue Jul 1 05:50:08 PDT 2025
On Mon, Jun 30, 2025 at 02:07:19PM +0000, Aurelien Aptel wrote:
> Add a new netlink family to get/set ULP DDP capabilities on a network
> device and to retrieve statistics.
>
> The messages use the genetlink infrastructure and are specified in a
> YAML file which was used to generate some of the files in this commit:
>
> ./tools/net/ynl/ynl-gen-c.py --mode kernel \
> --spec ./Documentation/netlink/specs/ulp_ddp.yaml --header \
> -o net/core/ulp_ddp_gen_nl.h
> ./tools/net/ynl/ynl-gen-c.py --mode kernel \
> --spec ./Documentation/netlink/specs/ulp_ddp.yaml --source \
> -o net/core/ulp_ddp_gen_nl.c
> ./tools/net/ynl/ynl-gen-c.py --mode uapi \
> --spec ./Documentation/netlink/specs/ulp_ddp.yaml --header \
> > include/uapi/linux/ulp_ddp.h
>
> Signed-off-by: Shai Malin <smalin at nvidia.com>
> Signed-off-by: Aurelien Aptel <aaptel at nvidia.com>
> Reviewed-by: Jiri Pirko <jiri at nvidia.com>
> ---
> Documentation/netlink/specs/ulp_ddp.yaml | 172 +++++++++++
> include/net/ulp_ddp.h | 3 +-
> include/uapi/linux/ulp_ddp.h | 61 ++++
> net/core/Makefile | 2 +-
> net/core/ulp_ddp_gen_nl.c | 75 +++++
> net/core/ulp_ddp_gen_nl.h | 30 ++
> net/core/ulp_ddp_nl.c | 348 +++++++++++++++++++++++
> 7 files changed, 689 insertions(+), 2 deletions(-)
> create mode 100644 Documentation/netlink/specs/ulp_ddp.yaml
> create mode 100644 include/uapi/linux/ulp_ddp.h
> create mode 100644 net/core/ulp_ddp_gen_nl.c
> create mode 100644 net/core/ulp_ddp_gen_nl.h
> create mode 100644 net/core/ulp_ddp_nl.c
>
> diff --git a/Documentation/netlink/specs/ulp_ddp.yaml b/Documentation/netlink/specs/ulp_ddp.yaml
> new file mode 100644
> index 000000000000..27a0b905ec28
> --- /dev/null
> +++ b/Documentation/netlink/specs/ulp_ddp.yaml
> @@ -0,0 +1,172 @@
> +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
> +#
> +# Author: Aurelien Aptel <aaptel at nvidia.com>
> +#
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> +#
> +
> +name: ulp_ddp
I think that the name needs to avoid using '_' ('-' seems ok)
in order for make -C tools/net/ynl/ to run successfully
on current net-next.
...
> + name: caps
> + attributes:
> + -
> + name: ifindex
> + doc: Interface index of the net device.
> + type: u32
> + -
> + name: hw
> + doc: Bitmask of the capabilities supported by the device.
> + type: uint
> + enum: cap
> + enum-as-flags: true
> + -
> + name: active
> + doc: Bitmask of the capabilities currently enabled on the device.
> + type: uint
> + enum: cap
> + enum-as-flags: true
> + -
> + name: wanted
> + doc: >
> + New active bit values of the capabilities we want to set on the
> + device.
> + type: uint
> + enum: cap
> + enum-as-flags: true
> + -
> + name: wanted_mask
Likewise here.
> + doc: Bitmask of the meaningful bits in the wanted field.
> + type: uint
> + enum: cap
> + enum-as-flags: true
> +
...
> + name: caps-set
> + doc: Set ULP DDP capabilities.
> + attribute-set: caps
> + do:
> + request:
> + attributes:
> + - ifindex
> + - wanted
> + - wanted_mask
And correspondingly, here.
> + reply:
> + attributes:
> + - ifindex
> + - hw
> + - active
> + pre: ulp_ddp_get_netdev
> + post: ulp_ddp_put_netdev
> + -
> + name: caps-set-ntf
> + doc: Notification for change in ULP DDP capabilities.
> + notify: caps-get
...
More information about the Linux-nvme
mailing list