Re: [PATCH RFC 11/20] ctlv: Prepare runtime introspection

From: Jiri Pirko

Date: Tue Oct 27 2026 - 06:25:28 EST


Mon, Oct 26, 2026 at 03:07:54PM +0100, jgg@xxxxxxxxxx wrote:
>> [ ... 53 lines skipped ... ]
>> +/* A cursor packs the record and member where fragmentation resumes. */
>> +#define CTLV_INTROSPECTION_MEMBER_SHIFT 48
>> +#define CTLV_INTROSPECTION_RECORD_MASK GENMASK_ULL(CTLV_INTROSPECTION_MEMBER_SHIFT - 1, 0)
>
>Use genmask for everything:
>
> #define CTLV_INTROSPECTION_MEMBER_MASK GENMASK_U64(63, 48)
> #define CTLV_INTROSPECTION_RECORD_MASK GENMASK_U64(47, 0)
>
> pos->record = FIELD_GET(CTLV_INTROSPECTION_RECORD_MASK, cursor);
> pos->member = FIELD_GET(CTLV_INTROSPECTION_MEMBER_MASK, cursor);
>
> return FIELD_PREP(CTLV_INTROSPECTION_RECORD_MASK, pos->record) |
> FIELD_PREP(CTLV_INTROSPECTION_MEMBER_MASK, pos->member);
>

Okay.


>> +
>> +struct ctlv_introspection_dump_position {
>> + u64 record;
>> + u32 member;
>
>Maybe a comment describing how record and member are encoded for each
>of the users?

Okay.


>
>> [ ... 13 lines skipped ... ]
>> +/* The immutable root-first chain always has generation zero. */
>
>This comment seems out of place, it should be closer to the 0's it
>refers to a function below

Okay.


>
>> +static bool ctlv_introspection_family_record(struct ctlv_cursor *reply, struct ctlv_cursor *entry,
>> + const struct ctlv_family *family,
>> + struct ctlv_introspection_dump_position *pos)
>> +{
>> + const struct ctlv_family_schema *schema = family->schema;
>> +
>> + if (!ctlv_family_entry_start(reply, entry))
>> + return false;
>

[..]