Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1150364rdb; Fri, 1 Dec 2023 08:13:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfcjSL9VdYgB1HVSffy0t87C9VGsmoLwV//IpfqkPviYdDlcsFYlWhs1Fx55V5NAK0If7X X-Received: by 2002:a17:902:e88b:b0:1cf:d404:5e7c with SMTP id w11-20020a170902e88b00b001cfd4045e7cmr21288294plg.42.1701447217620; Fri, 01 Dec 2023 08:13:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701447217; cv=none; d=google.com; s=arc-20160816; b=zGZn5+ua92uYAMGOhXm9NbL+Z7N/9i18Uuyh9NVbOIcNS7MbF+fndFzbvI1Z/irqjZ F2skDhtLN/A9fHcOcAQV4WpkaRuiO2B20n6GHqwz75tLvXojZFWNyZGwQ+TwEMoCh94n MpjCi1A10khryamfh3b8wZINxbIj9/BflvLhDDavyd89BDM+WvH0qkN3iO36e0l20xHq 27VruM64sg9fKtpaZpPlU8IM7C2MUIN/9wUxdlT+p3bbbv3apzdw8v93nhhkGeAEwuRk OneE1PMigEEH9fbhgBcEMU3KdvVXLkCpmcZ1JWR+U1l2wW5nWGMRfpPTj3TeUk2lA0xf OOFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:autocrypt:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=wIiVfGjOqLbqrFMUXwsWqhKvCLy0+YRMCVG4285ndOk=; fh=uhA96PNxHUAdzbe86ITJ1oeKPLHJs70duMwd/CBGOeI=; b=u57na8zf7ezBLDr9HgVG6auYfZbcQDwr7S/YGPMK/189s2p3lctxpY9hmvdreLXrV+ w5wo8bi8vYFSgp8ZtHJErc0Lsm9lbdwa+Sm3/uWMvJgFWNhEwansIIVk7b/iiNm99YKd w7ucDU1jzgaNoldTQx9Id+y/poEQyDtYlXpso+RzS5qJpfHuFXl9RozPYbJq2hBaH52j Z3xvkFvOmge27QrrXAp/jU9/gHx4BLccpn26dRIQWKTfa9VtuWUFGl8T4xUT0jpsCdHp bt7+tKLVAVbqR0k6o2eDAzRidoSaK6YXpYh0cG6YjxViC3ttIWnfo10P35M05UF7eci0 /4pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eZ6Fg5nw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id h10-20020a170902f7ca00b001cfb65f4c9asi818957plw.570.2023.12.01.08.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:13:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eZ6Fg5nw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4871083D7E03; Fri, 1 Dec 2023 08:13:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjLAQNV (ORCPT + 99 others); Fri, 1 Dec 2023 11:13:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378214AbjLAQNU (ORCPT ); Fri, 1 Dec 2023 11:13:20 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4ADFB2; Fri, 1 Dec 2023 08:13:26 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-54c11430624so3354083a12.1; Fri, 01 Dec 2023 08:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701447205; x=1702052005; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to; bh=wIiVfGjOqLbqrFMUXwsWqhKvCLy0+YRMCVG4285ndOk=; b=eZ6Fg5nwC6wL1t03K/dv5dwlbMG2M+u55VESUlN37M5FGY/rpGPSS+bwYyi6qkdNt3 fAykxQjHxnTcn2vDP9JPuq5Cx/jyx3HAZE12LC2vSe43JkAiGlEmQ2tcLgeM4jQmgh6x pMnWiHa174x1onP3leoFrIbWpyxHL0D+AbQkuVuyY+5tL2RW2LKV8VRNHydTqdWqTbNY XeX2NFsAh2cnZmE8Lhnjqj7m6oMaWJlboDl6KPR1SP9XBHoyX42/bYyMS4TmNQLTqeEp n0jq5ohEPLaGtMbgmCFL2gWeF78EOcxlQlgTADu6tYTSMzOurI7j8fMxaj9aiHuu64Ug GUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701447205; x=1702052005; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wIiVfGjOqLbqrFMUXwsWqhKvCLy0+YRMCVG4285ndOk=; b=RCVDKmHz/PKUVGp9puXdQ0Id6TWvE0Y7ZuoBPi7S27pnE0NL7/dE5oNlAgp0QQX+Ft NHo3dt4dA+VWwwwlpSMBr8nqDNp+CeHl6wvt0VeysFYMrz2rpM23+kpmj2iLOMuucGld p9yfNKHbIOFmo8C4V/EJm0QHjSSeiif8LjONTkJbmlL67B8XkmHT+GM4bYTqW1ILydIk sc/MpTrFsRXnbshniWr5tU6mojJ7XJIERMbYa1ORpQndIsN7AXMARK9UaGLX+smdLhTh oHE3Stb67iPSls8Fr7WoNAsmKIwewupiFfQ9RqDiCHiIKbbmBLl0PWGluPZR+LSkV3UF nNSg== X-Gm-Message-State: AOJu0YxrGqvjcrr4nZbQIiK45J/4+e9NrxF0iXzmDEfK7ccVxgg4hgUn ImLFw6IJnhbpADGsXtD//BY= X-Received: by 2002:a17:906:9b44:b0:a19:a409:37de with SMTP id ep4-20020a1709069b4400b00a19a40937demr1403155ejc.55.1701447205044; Fri, 01 Dec 2023 08:13:25 -0800 (PST) Received: from [192.168.1.95] (host-176-36-0-241.b024.la.net.ua. [176.36.0.241]) by smtp.gmail.com with ESMTPSA id c6-20020a170906694600b00a0aca4d2b25sm2043603ejs.180.2023.12.01.08.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:13:24 -0800 (PST) Message-ID: <18808a1815e76a3c3fb661ff6a588a50389b1475.camel@gmail.com> Subject: Re: [PATCH ipsec-next v2 3/6] libbpf: Add BPF_CORE_WRITE_BITFIELD() macro From: Eduard Zingerman To: Daniel Xu Cc: ndesaulniers@google.com, andrii@kernel.org, nathan@kernel.org, daniel@iogearbox.net, ast@kernel.org, steffen.klassert@secunet.com, antony.antony@secunet.com, alexei.starovoitov@gmail.com, yonghong.song@linux.dev, martin.lau@linux.dev, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, trix@redhat.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, devel@linux-ipsec.org, netdev@vger.kernel.org Date: Fri, 01 Dec 2023 18:13:22 +0200 In-Reply-To: References: <20c593b6f31720a3d24d75e5e5cc3245b67249d1.camel@gmail.com> Autocrypt: addr=eddyz87@gmail.com; prefer-encrypt=mutual; keydata=mQGNBGKNNQEBDACwcUNXZOGTzn4rr7Sd18SA5Wv0Wna/ONE0ZwZEx+sIjyGrPOIhR14/DsOr3ZJer9UJ/WAJwbxOBj6E5Y2iF7grehljNbLr/jMjzPJ+hJpfOEAb5xjCB8xIqDoric1WRcCaRB+tDSk7jcsIIiMish0diTK3qTdu4MB6i/sh4aeFs2nifkNi3LdBuk8Xnk+RJHRoKFJ+C+EoSmQPuDQIRaF9N2m4yO0eG36N8jLwvUXnZzGvHkphoQ9ztbRJp58oh6xT7uH62m98OHbsVgzYKvHyBu/IU2ku5kVG9pLrFp25xfD4YdlMMkJH6l+jk+cpY0cvMTS1b6/g+1fyPM+uzD8Wy+9LtZ4PHwLZX+t4ONb/48i5AKq/jSsb5HWdciLuKEwlMyFAihZamZpEj+9n91NLPX4n7XeThXHaEvaeVVl4hfW/1Qsao7l1YjU/NCHuLaDeH4U1P59bagjwo9d1n5/PESeuD4QJFNqW+zkmE4tmyTZ6bPV6T5xdDRHeiITGc00AEQEAAbQkRWR1YXJkIFppbmdlcm1hbiA8ZWRkeXo4N0BnbWFpbC5jb20+iQHUBBMBCgA+FiEEx+6LrjApQyqnXCYELgxleklgRAkFAmKNNQECGwMFCQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQLgxleklgRAlWZAv/cJ5v3zlEyP0/jMKQBqbVCCHTirPEw+nqxbkeSO6r2FUds0NnGA9a6NPOpBH+qW7a6+n6q3sIbvH7jlss4pzLI7LYlDC6z+egTv7KR5X1xFrY1uR5UGs1beAjnzYeV2hK4yqRUfygsT0Wk5e4FiNBv4+DUZ8r0cNDkO6swJxU55DO21mcteC147+4aDoHZ40R0tsAu+brDGSSoOPpb0RWVsEf9XOB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9pNJM+wPrDRmGfchLDUmf6CffaUYCbu4FiId+9+dcTCDvxbABRy1C3OJ8QY7cxfJ+pEZW18fRJ0XCl/fiV/ecAOfB3HsqgTzAn555h0rkFgay0hAvMU/mAW/CFNSIxV397zm749ZNLA0L2dMy1AKuOqH+/B+/ImBfJMDjmdyJQ8WU/OFRuGLdqOd2oZrA1iuPIa+yUYyZkaZfz/emQwpIL1+Q4p1R/OplA4yc301AqruXXUcVDbEB+joHW3hy5FwK5t5OwTKatrSJBkydSF9zdXy98fYzGniRyRA65P0Ix/8J3BYB4edY2/w0Ip/mdYsYQljBY0A== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 08:13:34 -0800 (PST) On Thu, 2023-11-30 at 18:33 -0700, Daniel Xu wrote: [...] > Good call about adding tests -- I found a few bugs with the code from > the other thread. But boy did they take a lot of brain cells to figure > out. >=20 > There was some 6th grade algebra involved too -- I'll do my best to > explain it in the commit msg for v3. >=20 > Here are the fixes in case you are curious: Ouch, I knew my code from 3am can't be trusted, sorry for that. Your math seem to make sense, thank you. [...]