Re: [PATCH RFC 02/20] ctlv: Add the UAPI wire format and family API
From: Jonathan Cameron
Date: Tue Oct 20 2026 - 19:39:36 EST
> > +/**
> > + * struct ctlv_attr - Attr header.
> > + * @len: this header plus its payload, excluding this attr's trailing padding
> > + * @flags: CTLV_ATTR_F_* bits
> > + * @attr_id: complete attr ID, or CTLV_ATTR_ROOT for a message root
> > + *
> > + * Attrs are aligned to CTLV_ALIGNTO, which is why @attr_id is __aligned_u64: a
> > + * 32-bit ABI would otherwise align this structure to four bytes. A nested
> > + * payload is the concatenation of CTLV_ALIGN(child.len) bytes per child, so
> > + * child padding counts inside the containing attr's @len while a leaf's own
>
> Whilst I get what you mean, leaf doesn't feel like a clear concept in this
> comment block. Maybe 'this attrs own padding does not.' or something like that?
Ignore this one - lack of coffee... Leaf is indeed clearly defined as most nested
child.
>
> > + * padding does not. Scalar payloads are native-endian. Within each request
> > + * root or nest, occurrences of one @attr_id are contiguous; different IDs
> > + * otherwise have no required order.
> > + */
> > +struct ctlv_attr {
> > + __u32 len;
> > + __u32 flags;
> > + __aligned_u64 attr_id;
> > +};