Re: git: 349d1366edd2 - main - socket: Export the FIB number of sockets

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Tue, 12 Nov 2024 14:15:27 UTC

> On Nov 12, 2024, at 8:56 AM, Gleb Smirnoff <glebius@freebsd.org> wrote:
> 
> On Mon, Nov 04, 2024 at 02:56:33PM +0000, Mark Johnston wrote:
> M> diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
> M> index 40464f555816..fda8d23f5649 100644
> M> --- a/sys/sys/socketvar.h
> M> +++ b/sys/sys/socketvar.h
> M> @@ -615,7 +615,8 @@ struct xsocket {
> M>  	uint32_t	so_qlimit;
> M>  	pid_t		so_pgid;
> M>  	uid_t		so_uid;
> M> -	int32_t		so_spare32[8];
> M> +	int32_t		so_fibnum;
> M> +	int32_t		so_spare32[7];
> M>  	int16_t		so_type;
> M>  	int16_t		so_options;
> M>  	int16_t		so_linger;
> 
> I would suggest not to spend the spares in the main branch.
> So this commit should add the field, keeping 8 spares. But
> the merge to stable/14 should use a spare.
> 
> Otherwise we eventually will run out of spares in main
> and also nearly run out of spares in some stable/22 branch.
> 
> I'd suggest to follow the policy of not spending spares
> in the main branch for all structures, not just xsocket.

IIUC, those spares are reserved for **future** new features while keep API / ABI compatibility.

If we lack spares, or in a foresee future we will lack then we should reserve large quantity of spares.

If we happen to run out of them, then no choices but we have to break the API / ABI compatibility, then this should
be done in CURRENT.

Right now there are still 7 spares not used, and I guess it is not urgent to add extra spares.

Please correct me if wrong.

Best regards,
Zhenlei

> 
> -- 
> Gleb Smirnoff