Subject: Re: [RFC PATCH] genetlink: add multi-version family support for protocol negotiation

From: Jakub Kicinski <[email-masked]>
Date: Mon, 16 Mar 2026 11:37:36 -0700

On Mon, 16 Mar 2026 16:15:06 +0100 Christoph Böhmwalder wrote:
> Extend the genetlink infrastructure to allow families to advertise a
> range of supported protocol versions [min_version, max_version]. This
> enables a single kernel module to serve both old and new userspace by
> letting userspace discover the maximum version via CTRL_ATTR_MAX_VERSION
> and select the desired protocol dialect in genlmsghdr.version.
> 
> Rename genl_family.version to .min_version across all families (pure
> rename, no behavioral change). This avoids updating all callers.
> 
> Add genl_family.max_version. When 0 (default) the family behaves
> exactly as before. When > min_version, the controller advertises
> CTRL_ATTR_MAX_VERSION in CTRL_CMD_GETFAMILY replies.
> 
> When sending a reply, echo the request's genlmsghdr.version, so
> userspace receives responses in the protocol version it spoke.
> Notifications (where info->nlhdr is NULL) continue to use min_version.
> 
> Add genlmsg_put_ver() for families that need to stamp a specific
> version on notifications.
> 
> The immediate motivation is upstreaming DRBD 9 (genl family v1)
> while keeping unmodified DRBD 8 userspace (family v2) working. The
> DRBD family would register with min_version=1, max_version=2 and
> handle both protocol dialects.

What's the delta between the families? Do you have any examples of 
the the version ends up being used?