Re: [PATCH] netlink: specs: add specification for NBD
- To: Donald Hunter <donald.hunter@gmail.com>
- Cc: Jakub Kicinski <kuba@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, netdev@vger.kernel.org, Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org, nbd@other.debian.org
- Subject: Re: [PATCH] netlink: specs: add specification for NBD
- From: Hristo Venev <hristo@venev.name>
- Date: Tue, 17 Feb 2026 19:40:33 +0200
- Message-id: <[🔎] 6a1339999b091edaaa15e34aceb7961dfc61581b.camel@venev.name>
- In-reply-to: <[🔎] m2o6lnlg2y.fsf@gmail.com>
- References: <[🔎] 20260215180309.2255721-3-hristo@venev.name> <[🔎] m2o6lnlg2y.fsf@gmail.com>
On Tue, 2026-02-17 at 12:17 +0000, Donald Hunter wrote:
> There are yamllint errors:
>
> make -C tools/net/ynl lint
> make: Entering directory '/home/donaldh/net-next/tools/net/ynl'
> yamllint ../../../Documentation/netlink/specs
> ../../../Documentation/netlink/specs/nbd.yaml
> 159:81 error line too long (104 > 80 characters) (line-
> length)
> 169:6 error syntax error: expected <block end>, but found
> '<block mapping start>' (syntax)
> 170:7 error wrong indentation: expected 5 but found 6
> (indentation)
Thanks, I will fix the lint errors in v2.
> > +doc: See :file:`drivers/block/nbd.c`
>
> Prefer to see a meaningful doc string here.
I will add more proper documentation in v2. I couldn't find any
existing documentation of this netlink interface, so I guess I will
write it myself.
> > +attribute-sets:
> > + -
> > + name: nbd-attrs
> > + name-prefix: nbd-attr-
> > + doc: Configuration policy attributes, used for CONNECT
> > + attributes:
> > + -
> > + name: unspec
> > + value: 0
> > + type: unused
>
> No need for unspec in the attribute list, ynl codegen does the right
> thing.
For me `pyynl.ynl_gen_c --mode uapi --header` no longer generates
`NBD_ATTR_UNSPEC` if I remove this. Is there a YNL property to specify
the name of the zero value of the attribute set? If not, should I
remove it anyway, changing the generated header?
> > + name: device-item-attrs
> > + name-prefix: nbd-device-item-
> > + doc: |
> > + This is the format for multiple devices with
> > :code:`NBD_ATTR_DEVICE_LIST`
> > +
> > + .. code-block::
> > +
> > + [NBD_ATTR_DEVICE_LIST]
> > + [NBD_DEVICE_ITEM]
> > + [NBD_DEVICE_INDEX]
> > + [NBD_DEVICE_CONNECTED]
> > + attributes:
> > + -
> > + name: unspec
> > + value: 0
> > + type: unused
>
> Not required.
The same question applies here.
> > + name: device-attrs
> > + name-prefix: nbd-device-
> > + attr-max-name: nbd-device-attr-max
> > + attributes:
> > + -
> > + name: unspec
> > + value: 0
> > + type: unused
>
> Not required.
The same question applies here.
> > + name: sock-item-attrs
> > + name-prefix: nbd-sock-item-
> > + doc: |
> > + This is the format for multiple sockets with
> > :code:`NBD_ATTR_SOCKETS`
> > +
> > + .. code-block::
> > +
> > + [NBD_ATTR_SOCKETS]
> > + [NBD_SOCK_ITEM]
> > + [NBD_SOCK_FD]
> > + [NBD_SOCK_ITEM]
> > + [NBD_SOCK_FD]
> > + attributes:
> > + -
> > + name: unspec
> > + value: 0
> > + type: unused
>
> Not required.
The same question applies here.
> > + name: sock-attrs
> > + name-prefix: nbd-sock-
> > + attributes:
> > + -
> > + name: unspec
> > + value: 0
> > + type: unused
>
> Not required.
The same question applies here.
> > +operations:
> > + enum-model: unified
> > + name-prefix: nbd-cmd-
> > + list:
> > + -
> > + name: unspec
> > + value: 0
> > + doc: NBD_CMD_UNSPEC
A similar question applies here. If I remove this, `pyynl.ynl_gen_c
--mode uapi --header` no longer generates `NBD_CMD_UNSPEC`. Is there a
YNL property to generate it? If not, should I remove it anyway?
> > + -
> > + name: connect
> > + doc: See :file:`drivers/block/nbd.c`,
> > :code:`nbd_genl_connect()`
>
> Prefer to see meaningful doc string (same for other ops)
I guess I will have to document the four operations in v2 as well.
> > + attribute-set: nbd-attrs
> > + dont-validate: [strict]
>
> nbd.c has strict & dump, should this be [strict, dump] ? (same for
> other ops)
The NBD operations don't have `dump`, only `do`, so adding `dump` to
`dont-validate` does not change the output of `pyynl.ynl_gen_c --mode
kernel --source`. Should I add it anyway?
Reply to: