From nobody Tue May 31 20:29:08 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 54BB91B48D06; Tue, 31 May 2022 20:29:12 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LCP541NFKz3jVX; Tue, 31 May 2022 20:29:12 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x136.google.com with SMTP id c19so23302617lfv.5; Tue, 31 May 2022 13:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=m02CF5uUr4faJy5bPCyG/6uHsSJ5EP7Jeq/JKwfhE+M=; b=NbJV3RQyym3X4ucxJtlBXNm/AqQ0eH8nrEEx/JU5BggDoGx9ehvZBoSOyv+pCkfHLp 3FQkI85owny/5IV9f9TCt5cEdnb8wQ09Wx+ciiwz/SguTg9S3vXaLcC9IEV6RdabtALY /qEwBLmVcyKP8bSxWEFwJ066hDvHgBd9waNEKOAvvaptU8+iuFddecZupoIOtgqp2EMK IECEcihjG9A6cRfTafQr/rKUCIpoLFOZ6+0Q33ecZosGUzSk3d3wq5W6JbDRTHcqX6wK +3hL731Raj/4HHyUEepaSzD0SB9oXXjgLH+V7GaEHKO10jXhr7rV4i2Mdy3zJxm4odHF eU8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=m02CF5uUr4faJy5bPCyG/6uHsSJ5EP7Jeq/JKwfhE+M=; b=hA4ynEb8Nr8TJ/PH8Vilzjfn3X8hcBCgpQrueoMo06lc+U+b9eIXD42nTcIzCMDRv5 tkUwwcoIKCd+N2Q8WUT0jLBAHLjTIxEgbGnnHzJKFhmyR4VBrVb38YN7d7ZNWY1oTdFh qxXEcDOfg0llMGUoFEsuvkS39NxS5FM39ZF7WMSf5WG92Na4ox2EBamKv3CYxdhCJag/ WEweoAViR+mjDA5Iv+KpS5Qv9fJIpY6osZW0PQrWdJkvpGDo6/Hr+m10RlUkJ2dXAqdI BWNuzSr8JoSmCzY8Omu5wH1ceJUZX4wOAyBRdXLCZEGycrUOljn59d3hRL5CY8sBybXK jjww== X-Gm-Message-State: AOAM5314wSd177smsKPyo82EtMcIIpGzzTGWfBe5SNegQKNHD27MPSUr tlQkqUzDR5XgXaElPoXbA/qjSMWWaWHSj2BhMGMzkkWT X-Google-Smtp-Source: ABdhPJy5SzZptKB0buzOL2Bmm6hC+3Xc6Ke0PyTCRtERnO/lLgInSlvKG91w8hdlQjyMuCQ2egszpmm0vrRHhEfPTsY= X-Received: by 2002:ac2:5f68:0:b0:478:a63f:9485 with SMTP id c8-20020ac25f68000000b00478a63f9485mr22787562lfc.406.1654028950329; Tue, 31 May 2022 13:29:10 -0700 (PDT) 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 Received: by 2002:aa6:c2d2:0:b0:1e6:e5ee:dbad with HTTP; Tue, 31 May 2022 13:29:08 -0700 (PDT) In-Reply-To: <5A6DF60F-9584-43D4-BBF8-18634742A7C3@ipfw.ru> References: <202205301510.24UFAxvj014259@gitrepo.freebsd.org> <8909171653936542@iva6-17bf07036239.qloud-c.yandex.net> <5A6DF60F-9584-43D4-BBF8-18634742A7C3@ipfw.ru> From: Mateusz Guzik Date: Tue, 31 May 2022 22:29:08 +0200 Message-ID: Subject: Re: git: 8c0d1eca7834 - main - sockbuf: retain backward compatibility with userland after d59bc188d652 To: "Alexander V. Chernikov" Cc: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4LCP541NFKz3jVX 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 5/31/22, Alexander V. Chernikov wrote: > > >> On 31 May 2022, at 15:33, Mateusz Guzik wrote: >> >> On 5/30/22, Alexander V. Chernikov wrote: >>> >>> >>> 30.05.2022, 16:18, "Mateusz Guzik" : >>>> >>>> should probably CTASSERT on size then >>> >>> Sorry, I=E2=80=99m afraid I don=E2=80=99t get it. Could you please clar= ify? >>>> >> >> 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; >> }; >> >> +#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 structur= e > 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). > it will prevent accidental changes >> +#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); >> >>>> On 5/30/22, Alexander V. Chernikov wrote: >>>>> >>>>> The branch main has been updated by melifaro: >>>>> >>>>> URL: >>>>> https://cgit.FreeBSD.org/src/commit/?id=3D8c0d1eca7834bfd5a05c86bf20a= 7600917057492 >>>>> >>>>> 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 >>>>> >>>>> sockbuf: retain backward compatibility with userland after >>>>> d59bc188d652 >>>>> >>>>> Add spare fields to xsockbuf in place of sb_mcnt / sb_ccnt to >>>>> avoid >>>>> rebuilding userland binaries like sockstat(1). >>>>> >>>>> Reviewed by: glebius >>>>> --- >>>>> sys/sys/socketvar.h | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> 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; >>>>> >>>> >>>> >>>> -- >>>> Mateusz Guzik >>> >> >> >> -- >> Mateusz Guzik > > --=20 Mateusz Guzik