From nobody Tue May 31 20:19:42 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 305C51B4764C; Tue, 31 May 2022 20:19:54 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500o.mail.yandex.net (forward500o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::610]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4LCNtK6HMZz3hs5; Tue, 31 May 2022 20:19:53 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from myt5-0656389fa3f6.qloud-c.yandex.net (myt5-0656389fa3f6.qloud-c.yandex.net [IPv6:2a02:6b8:c12:1119:0:640:656:389f]) by forward500o.mail.yandex.net (Yandex) with ESMTP id 041A594202B; Tue, 31 May 2022 23:19:45 +0300 (MSK) Received: from myt5-01d0fbe499ab.qloud-c.yandex.net (myt5-01d0fbe499ab.qloud-c.yandex.net [2a02:6b8:c12:4619:0:640:1d0:fbe4]) by myt5-0656389fa3f6.qloud-c.yandex.net (mxback/Yandex) with ESMTP id YhFTbn5xlo-JigCip1b; Tue, 31 May 2022 23:19:44 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1654028384; bh=uSDbpkZ2t/f4MG0fiydCN1l2f+abklawq5w9IHrqeJU=; h=References:Date:In-Reply-To:Subject:Cc:From:Message-Id:To; b=kMdns5iDd4ATpkWK/v7j1ZvTAdCIRZGZCgZSRW6k0h0mT+tW74cxfwd+C9cENDleY 3O3Lbbfz8g7ugIeOy3S5geVLuQpfcateDdU7MP7sy58PTnQGFmW8aPz1mnXnWBiAcg nfHirfOOwUczP3ihvMPhqThANHtIIpvaQgWOiTdI= Received: by myt5-01d0fbe499ab.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id LVPZ9VAv0V-JhNK85lJ; Tue, 31 May 2022 23:19:44 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Re: git: 8c0d1eca7834 - main - sockbuf: retain backward compatibility with userland after d59bc188d652 From: "Alexander V. Chernikov" In-Reply-To: Date: Tue, 31 May 2022 21:19:42 +0100 Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5A6DF60F-9584-43D4-BBF8-18634742A7C3@ipfw.ru> References: <202205301510.24UFAxvj014259@gitrepo.freebsd.org> <8909171653936542@iva6-17bf07036239.qloud-c.yandex.net> To: Mateusz Guzik X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Rspamd-Queue-Id: 4LCNtK6HMZz3hs5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 31 May 2022, at 15:33, Mateusz Guzik wrote: >=20 > On 5/30/22, Alexander V. Chernikov wrote: >>=20 >>=20 >> 30.05.2022, 16:18, "Mateusz Guzik" : >>>=20 >>> should probably CTASSERT on size then >>=20 >> Sorry, I=E2=80=99m afraid I don=E2=80=99t get it. Could you please = clarify? >>>=20 >=20 > diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h > index 249e0800f915..5fc21206b1bf 100644 > --- a/sys/sys/socketvar.h > +++ b/sys/sys/socketvar.h > @@ -586,6 +586,14 @@ struct xsocket { > } so_rcv, so_snd; > }; >=20 > +#if _LP64 > +_Static_assert(sizeof(struct xsocket) =3D=3D 240, "bad=E2=80=9D) Ah, got it! Well, the rationale for the commit was not to absolutely prevent = structure size changes - there may be many perfectly valid reasons to do = so. IIRC policy suggests it acceptable between the major revisions. In the case of original change - removal of mbuf counters - backward = compatibility (e.g. keeping structure size the same) does not cost us = anything. sockstat(1) from 13 will work on 14 (at least for now). > +#elsif _LP32 > +.... > +#else > +#error "port me" > +#endif > + > #ifdef _KERNEL > void sotoxsocket(struct socket *so, struct xsocket *xso); > void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); >=20 >>> On 5/30/22, Alexander V. Chernikov wrote: >>>>=20 >>>> The branch main has been updated by melifaro: >>>>=20 >>>> URL: >>>> = https://cgit.FreeBSD.org/src/commit/?id=3D8c0d1eca7834bfd5a05c86bf20a76009= 17057492 >>>>=20 >>>> commit 8c0d1eca7834bfd5a05c86bf20a7600917057492 >>>> Author: Alexander V. Chernikov >>>> AuthorDate: 2022-05-30 14:56:25 +0000 >>>> Commit: Alexander V. Chernikov >>>> CommitDate: 2022-05-30 15:10:53 +0000 >>>>=20 >>>> sockbuf: retain backward compatibility with userland after >>>> d59bc188d652 >>>>=20 >>>> Add spare fields to xsockbuf in place of sb_mcnt / sb_ccnt to = avoid >>>> rebuilding userland binaries like sockstat(1). >>>>=20 >>>> Reviewed by: glebius >>>> --- >>>> sys/sys/socketvar.h | 2 ++ >>>> 1 file changed, 2 insertions(+) >>>>=20 >>>> diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h >>>> index 52b9376f0559..249e0800f915 100644 >>>> --- a/sys/sys/socketvar.h >>>> +++ b/sys/sys/socketvar.h >>>> @@ -577,6 +577,8 @@ struct xsocket { >>>> uint32_t sb_cc; >>>> uint32_t sb_hiwat; >>>> uint32_t sb_mbcnt; >>>> + uint32_t sb_spare0; /* was sb_mcnt */ >>>> + uint32_t sb_spare1; /* was sb_ccnt */ >>>> uint32_t sb_mbmax; >>>> int32_t sb_lowat; >>>> int32_t sb_timeo; >>>>=20 >>>=20 >>>=20 >>> -- >>> Mateusz Guzik >>=20 >=20 >=20 > --=20 > Mateusz Guzik