From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; spf=pass (mailfrom) smtp.mailfrom=intel.com (client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=larysa.zaremba@intel.com; receiver=) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HFXyZU2c Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mail.toke.dk (Postfix) with ESMTPS id DD0C8A17719 for ; Thu, 6 Jul 2023 16:55:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688655330; x=1720191330; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=PkbJgzY3EkNix3LwMRGXUMr978vsWJpaNvXd8w5UPwM=; b=HFXyZU2cPWYKbV2+GqeZ3fY3rkrK2lEDiVQA5i5lLCpvC+xZrFw8yH9T lcUuLc1qZLJEdW5A4kSQMb/+QR6iTnLhtVChgwRShOKqhGkJBm1z/Yd/m s+YmzuzcW4sDH9D35pGv2FKYhWaWo5hQsXkcDPFG2mJxL1ToPbIr/WxGd Rk0iqZ51wuAU0xLWDYwDbRZqzISzC6fqVV9y1HQ8xn5Bfsdv+rA1Ki1FT VeDkfNspebC+7RGcJXIcNQzWxZFNQbpBN9sreDP2vLNWQWDdysBepK6LS s1Odx4GpB8687M1aOrjVtt4+Clx1CpjcNJSynZxFB9Ygee4ykIgo4gYf0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="348411159" X-IronPort-AV: E=Sophos;i="6.01,185,1684825200"; d="scan'208";a="348411159" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2023 07:55:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="719610159" X-IronPort-AV: E=Sophos;i="6.01,185,1684825200"; d="scan'208";a="719610159" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP; 06 Jul 2023 07:55:24 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 6 Jul 2023 07:55:22 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 6 Jul 2023 07:55:22 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 6 Jul 2023 07:55:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FGj3bG2dEGcab3WMyab3kJWB45B9l6ymXtdYxwNVAj1MGUzO9yO9gscHn61EC9EbroLwnATp2ol7aqoJ05T7GpeDzkpIN/8QEuGbsmfjehYEXCnxGp+hmaJuqK3rlrWzwUiXJ5+AZyux9/9H7hk06bpXN81IYhB4pafly2aDNjw3b3IFagZ2gM+atvPPrmyJEDdyhrse8jWo9nvvU/o4bGfz5Pawl37yANeK4nwxG9P1yqsLLN2DfThaTjyoosYmW1zpBKub8xiUTVQvaMyVlj3T8qyY71hGSYifK2jNks7VETJdMAkt6+HhngCZSz6hQ009qJ09PbTpFBWZFCOP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+hebLRoctLHgCvl1y4i/FXvM5AMf6Q/uWowMjuuAdwg=; b=VdYIlEv6H5/4ZsDh/9yAtqW3mO99Uw0qtYhWnAscPnYym4JTkzylin3hrFkYorAFUkz0c9uXX0sXmJEHrLR1mX5Lv9uEQLu4dIGAsSZgUUZrniUdtOFnpxThCL1wC36Ti0ACsDmE1WBtphQRfknxaysrddtiKIZCkv5Jp31AwUr3uC3mkERixZ/UB5/8KyU5hSUXseOzA67BblmvFFQaoeJ6j3PQKLgDqXQjRQYL/2cZCL7F3HcJePjD1VwbVqSKwUxDeFTctCfb06DlpupnE2KeuAWNg1cJSbWlSaJp+jhMQlpzKccd6deRuMna8i4knNwn90l/0AqRhAG/UOqzTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SN7PR11MB7540.namprd11.prod.outlook.com (2603:10b6:806:340::7) by DS0PR11MB7457.namprd11.prod.outlook.com (2603:10b6:8:140::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Thu, 6 Jul 2023 14:55:20 +0000 Received: from SN7PR11MB7540.namprd11.prod.outlook.com ([fe80::9376:9c9d:424a:a0fe]) by SN7PR11MB7540.namprd11.prod.outlook.com ([fe80::9376:9c9d:424a:a0fe%6]) with mapi id 15.20.6565.016; Thu, 6 Jul 2023 14:55:20 +0000 Date: Thu, 6 Jul 2023 16:51:22 +0200 From: Larysa Zaremba To: John Fastabend Message-ID: References: <20230703181226.19380-1-larysa.zaremba@intel.com> <20230703181226.19380-16-larysa.zaremba@intel.com> <64a3386623163_65205208fe@john.notmuch> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <64a3386623163_65205208fe@john.notmuch> X-ClientProxiedBy: BE1P281CA0025.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::6) To SN7PR11MB7540.namprd11.prod.outlook.com (2603:10b6:806:340::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR11MB7540:EE_|DS0PR11MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ee95014-721f-4368-c249-08db7e310445 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mjaX2Ioc630yZvIKw9kf9DDQPY++IJEcrZvD22Q8Iv73pKKPCg7zXT9YBGpwfqO+if14rPCwOQGv7bULNgLT4d6DyovArOZPq9YzTZQlkiF49Vb8jdkLvoy/M7DsBs1f22gh5RERHfXxsO1T/FQgGh6KJRmxqwT02fChppxsm+wdSopZH3cEwddClvz8FeD5A9ezQf4K3chMM4eSrvCFuoQgItoFtMuTrpLP7bNwwrLqUv/pIsLOF5jdLAcVV8Iysf3JaGBYubcgCTQCmsBpuyzwBak//nLwygTKrWmivxB3Rt38cuMbp4xY+WsYN9/77dUvTPagM6if080avjvCNXobXKWlYqO69XLs8taLe0F1mvfDOlIOCvdxDtTWME/LYH3YeCM6d+HHhWGvvwanPLHYA+jaKlzO+GmfqlZjpCggITj6rZdLfbkVc8AAcx+YT3KNhzJSB9fxVwbKV6Rp8O6Yh2RQXkrOKDkiP6NhNeEETyr1Ls7p0+uOFb/Ylu9qcp/7OQAD/y7v/BVApPmoBwMrWOjB48Y3FuT+MF1eKPV863JJsrDaq+UvwdmBzWA8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB7540.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(7916004)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199021)(38100700002)(6486002)(478600001)(54906003)(26005)(6506007)(6512007)(9686003)(107886003)(186003)(66946007)(2906002)(33716001)(41300700001)(316002)(4326008)(66476007)(66556008)(6916009)(44832011)(7416002)(8936002)(8676002)(5660300002)(82960400001)(86362001)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?l1IzxMkbS2Dxp40id+Ldsv1jw5TgLiBUpoLvOQhDFLUMv0PY5gfo0FlaRl75?= =?us-ascii?Q?Qj4Ae778BDAGb9t0enkk3d4dh6C+CBWOFNqYASox3HMDQXmL2JjCQ3HeTCSY?= =?us-ascii?Q?9Ntrxc/F/dldyN6ftwgYRxBXnK/bu8Kgv8rPIxwTqqGB7S0aoGzy3NxSgPDf?= =?us-ascii?Q?hiWHTMY5YdHlNzXMjhrhntMtQ59goysFlibJoXcMsWN1LGXruYUssHJ07417?= =?us-ascii?Q?ITzngErDk/LELTaYQ7BeRU5YiMOH+gy6c6eDS0W25yXcksEhaUz7B/oE+j+D?= =?us-ascii?Q?GOVYqNwwf+SAU1flyMjqtCIFWHg6oNN30uzwGal8JMAGOWN0FdZpbSVNoJ7f?= =?us-ascii?Q?liFw1oDthVEzIy/Bc7t2yRROD7jjf5Ny2ToaINTeCX0AnfKbxSxLuZY9Jcmk?= =?us-ascii?Q?kp5yp7yS/Ibybhgjv8RMiVynwJSJuJyU1bP8OGW2NXg8cFWTXAlkobUct4rw?= =?us-ascii?Q?ViutHMeaqP/qz7GbrrOobrlTFT3yhft3yfxLpyLYv7MkYpZ9INWE/Yhl9B/g?= =?us-ascii?Q?O5KsO0VPMvtC2vWKy9UUzcprWAgZNovs2BkEwbyNSIUbnpl6Bb38LVsQQ082?= =?us-ascii?Q?6EYmfITjXcHuo1ABbwzzx8a+Kv4fTzJ93+lO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?VIDDGBcMMrtgw0q/c4WrIfSmjaWyijw7QUG2tCxYL49s+fFho5ZbND+i/zqn?= =?us-ascii?Q?uipZX88LBDJLk1n0hkuVWDwlUPGROmq5Jgm6SmeMV43cWvMLGMEWzSCoY+MH?= =?us-ascii?Q?dQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0ee95014-721f-4368-c249-08db7e310445 X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7540.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 14:55:19.8686 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g4LZKwxGyaPJLCbZUPgzJ0ntB8UYs6DTnG71W8nm/ZWHwErWl0XE7r1unEZlEWcheP0dMauOyNYWAlJHeLreN+ZdgG9ixr8gv5MJO/HkD60= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7457 X-OriginatorOrg: intel.com Message-ID-Hash: 6YMFXDRIATKH5RUHAXUPIH7VKOXCY7NZ X-Message-ID-Hash: 6YMFXDRIATKH5RUHAXUPIH7VKOXCY7NZ X-MailFrom: larysa.zaremba@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org, Aleksander Lobakin X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v2 15/20] net, xdp: allow metadata > 32 List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, Jul 03, 2023 at 02:06:46PM -0700, John Fastabend wrote: > Larysa Zaremba wrote: > > From: Aleksander Lobakin > > > > When using XDP hints, metadata sometimes has to be much bigger > > than 32 bytes. Relax the restriction, allow metadata larger than 32 bytes > > and make __skb_metadata_differs() work with bigger lengths. > > > > Now size of metadata is only limited by the fact it is stored as u8 > > in skb_shared_info, so maximum possible value is 255. Other important > > conditions, such as having enough space for xdp_frame building, are already > > checked in bpf_xdp_adjust_meta(). > > > > The requirement of having its length aligned to 4 bytes is still > > valid. > > > > Signed-off-by: Aleksander Lobakin > > Signed-off-by: Larysa Zaremba > > --- > > include/linux/skbuff.h | 13 ++++++++----- > > include/net/xdp.h | 7 ++++++- > > 2 files changed, 14 insertions(+), 6 deletions(-) > > > > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h > > index 91ed66952580..cd49cdd71019 100644 > > --- a/include/linux/skbuff.h > > +++ b/include/linux/skbuff.h > > @@ -4209,10 +4209,13 @@ static inline bool __skb_metadata_differs(const struct sk_buff *skb_a, > > { > > const void *a = skb_metadata_end(skb_a); > > const void *b = skb_metadata_end(skb_b); > > - /* Using more efficient varaiant than plain call to memcmp(). */ > > -#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 > > Why are we removing the ifdef here? Its adding a runtime 'if' when its not > necessary. I would keep the ifdef and simply add the default case > in the switch. Seems like Alex has missed your message, but we discussed this with him before, so I know the answer: Compiler will 100% convert it into a compile-time 'if' and this looks nicer than preprocessor condition.