From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=198.175.65.20 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796220950; b=gEH4eXK/qkFZ9QvbyWW867NkW68KEnODwVsM+k9E7Wrh7AliahpjZUJ/GuYL++6armGC Sxk4PpQoapC/XJnZZx6k5oHE3hABz9iRziSobTknx3XCz3f64ag0VxdjmEaiKkJaLJepN ke+ASULfcUq2s4H9xMI4UcYLE1XcZQ2sSv4DelEC2mCBNxsW0/JU8YCZYpi/Re2va1iZe dlc2//B+lIRoo2xHI+OLQgcmwl/tww0bMnY/ALfAb/FGqvKJHppSwtYQuSjoHIqsV9pGW oDjfpDixLZ/09xmzoa5z4TRBBSH0zRzd6i6pmE/BXes5p3zp3ip5/8cEQIHcFY3eWdQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220950; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Received: Received:Received:Received:Date:From:To:CC:Subject:Message-ID: References:Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; bh=W1Dd9GnviPuVadxVKonQ9bqLvI+xKgg5DNvYz3NOpPA=; b=QblhLVT5Rom0kP7IzqiSWHi+knBv6ZfLdeRKvdW8rVtIjcbiBkts7Q8HzOHk0XEzya4E l3C7Y2cX11kWqjh8x92u72OA9ZmYWQ1W+lwHOQQk5gG6/fkgp4UPWAXZZUzi0mbcZRXQT ATsMu4Dlqr66kXtIjUM63R6qLmXUBqoH6gKVOW/TNKVsLBepMSeAtoFl0MNSPfrfgoI1Y jSy3FDt7QHk2PSY16oh1P59r0UxNrhveGrElOIIO/e7uJ3bW7rlY/jsq6BTlA5VlYrCvX yW0NoSij0e+Hbk0noCHoVw2x7ltBz3XInFJ4aYNSfnrT28re5e5aVuqNBGEh4S0EwHg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b="glY/6qGa"; arc=fail smtp.remote-ip=198.175.65.20 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02BC3606A32C; Wed, 2 Dec 2026 14:15:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 02BC3606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=glY/6qGa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796220950; x=1827756950; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=W1Dd9GnviPuVadxVKonQ9bqLvI+xKgg5DNvYz3NOpPA=; b=glY/6qGa5xM99CQgz+cbph8Ei//qVIPvQch8queJXXSAzlvzOoXwW5ZR K0Fr115T/gKXrUuplEUJDy7CxXaKHUwbhW+1JmuO593jHTVgmW9S5A2ir U7cPNBsMDWx42cbm7wSjm0bJMbBDUd97LV0eKhZFIKADzMEhMFvmndQ01 jxzQVeYjEvMQdXSZRFgeIku+Fdmi4r65Hlov8wTNqk6Q8G8rw1LaFxwRw +mSR8i1C+KvF25e+osmcn6g2Za5OojRMQPz5fEM9MbfKuhVt9+TNLbwdN OyaFHFAVduqZfFR7MNPIoxnDP3HyvaifhEkZq4+XD4U567lEtB6mgBanY Q==; X-CSE-ConnectionGUID: tyJdlVjfRXaSwomM4+QIqg== X-CSE-MsgGUID: sb1R2fILT2qybYjjPWmNPw== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5187787" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5187787" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 06:15:49 -0800 X-CSE-ConnectionGUID: ZKItrVs9SpufouRrC2fUYA== X-CSE-MsgGUID: spf29wJyTbK+t3pWDt4ULA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13756925" Received: from fmsmsx903.amr.corp.intel.com ([10.18.126.92]) by fmviesa003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 06:15:48 -0800 Received: from FMSMSX903.amr.corp.intel.com (10.18.126.92) by fmsmsx903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 06:15:48 -0800 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Wed, 2 Dec 2026 06:15:48 -0800 Received: from CH1PR05CU001.outbound.protection.outlook.com (52.101.193.23) by edgegateway.intel.com (192.55.55.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 06:15:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GmLlyD66uT6BNKdzc6EuX86R9AohcRxYhbFTGqBv/OD4bvEEZmloxL+JUYpmsUdj2gO5jZQb/J/LnkT9C6QZjp2AsRKwMCx0PqcZnX8TrCit1vJSupPpZFgFqKzY1sz48tfdvzr+16UFP+v0eBFQ518QrIr0h+6YW+mwImOELfyRi1ede8mtFrelcAKHP6cRahu+szTmj4aZZBBgwisgrdD16ssHxBB7ibmF6cESAwMvI7byQQQ9A9ulrNAiYis+ei0sLGJvvGEZHfchnY7H/56xL5/7830/boVwiklwbdT1bejKBr+RD5/Vaa+Ez9jU1S7h6RgyeLCcRc90Hlihjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ZJffBpbBJdpeSpvT+TNqW2zw1T8gS6g4rRHiDpdC/k0=; b=lqpE1lP5SyPwhp06qbAnpbRBJ90Jg4jGyD9lfBSTIST9kMRB0nvqZy/NHR3Ky/Hdo8N/fGUtkZp+IgrFjaUi2hSOrbAX+oHGLTGJGmF6kzAKtA5jKl2GyxKc91SnycqYjlRnCSxGYqnaRjNkHP2LKpNPqXSidv8QXCL9omYDg/bwfmie1w6KRI88HKPOtnMYKH1eAMku5EnDDrxNwO4Gcjt0wwHvnSlZo6UHs0hhuLzaeUbmEwof+aqQj3KaeKi6uok8Rk5tAQF8jXpKMCOVMx2QKH/8508KUZC99pnRb0frSbgYF/We9syBuLwnsfx7g9Il3sqLCokPR/I8UaJQlQ== 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: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from LV2PR11MB868673.namprd11.prod.outlook.com (2603:10b6:408:422::13) by DSWPR11MB9713.namprd11.prod.outlook.com (2603:10b6:8:356::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Wed, 2 Dec 2026 14:15:45 +0000 Received: from LV2PR11MB868673.namprd11.prod.outlook.com ([fe80::5bfd:6afe:a9db:b7de]) by LV2PR11MB868673.namprd11.prod.outlook.com ([fe80::5bfd:6afe:a9db:b7de%4]) with mapi id 15.21.0688.009; Wed, 2 Dec 2026 14:15:45 +0000 Date: Wed, 2 Dec 2026 15:15:31 +0100 From: Maciej Fijalkowski To: =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= CC: Magnus Karlsson , Alexander Lobakin , Alexei Starovoitov , "Daniel Borkmann" , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Eduard Zingerman , "Kumar Kartikeya Dwivedi" , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , , , Simon Horman , Stanislav Fomichev , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Ihor Solodrai , Tony Nguyen , Przemek Kitszel , , =?iso-8859-1?Q?Cl=E9ment?= Lecigne Subject: Re: [PATCH net v2 0/4] xsk: Keep the shared info of zero-copy buffers in kernel memory Message-ID: References: <20261130123737.125432-1-bjorn@kernel.org> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261130123737.125432-1-bjorn@kernel.org> X-ClientProxiedBy: DU2P250CA0002.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::7) To LV2PR11MB868673.namprd11.prod.outlook.com (2603:10b6:408:422::13) X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR11MB868673:EE_|DSWPR11MB9713:EE_ X-MS-Office365-Filtering-Correlation-Id: ccdc575e-d063-4c6d-83da-08df507ec137 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|23010399003|11063799006|6133799003|261009223027099003|22082099003|18002099003|56012099006|10067099003|261102123227099003|261021123027099003|261022105027099003|261021121427099003|261028144727099003|261022075727099003|261026121527099003|261026140227099003; X-Microsoft-Antispam-Message-Info: NyiyKV5/r73mSrm7z1v719VANu6G1FQaQrK17bzMvyTGiSLPlYKziblEpe+0ZVsXAh3iwUOVFGI0/uvJ3W8JoCMEqqhXvE/UOESOpgm1nyU6p49+sqyqIHfPGZO+QP6BXaxE0Y4uXLipHxv8uOEI3TW3Y//R9t5vSDRDZqc8fw6m4NUWXbC+aMkOdfdZsS8e7Fo4nQItnxvT4j0k1Pf2ukP0/uRswbPVfrc8CLcXkIP69UgMFtfoOfO3KvBF1orBoFYhqBZmMNObyHsUw3DL0MIYy8otU7pRZBNLTAkkQTh9FgY3DikOUO8wDNi6sy2IANtNHJQJEtHkBB/FigBa0NlA/L9j3/rmEGqoz0/7wA3tz3cz1xYgIo4A4HYIetodQ6bK688NJdEYCCDN5e2gbQON5oWY3fXsvtHvANZHrut/LdAgpO7FlN57TZo+AsIJvgmCWhUUj7DUZkWmVdz+UnxaugKahkdeAWdjk4xbA510MlhwG3RgBrDZfcICVOu+0e2RreyFB/S7FbTS7BzOeYS7ILHWNnpTrTxiAtQIkXg0E4U5hw+3d5/0IWRtq1gnic10+8r6EZiEm3/mQop5qQud2eXXT6Fhkw/H1SQ8cmo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR11MB868673.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(23010399003)(11063799006)(6133799003)(261009223027099003)(22082099003)(18002099003)(56012099006)(10067099003)(261102123227099003)(261021123027099003)(261022105027099003)(261021121427099003)(261028144727099003)(261022075727099003)(261026121527099003)(261026140227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?zVuUWA/4g93gSHRbt5rWgBiQPTHzVqiEYtujp5b0i4ZOyGbneJpTuLczs2?= =?iso-8859-1?Q?4Whfc3jzmsR3RlmggE8Cmo0kS610awSNFvZVgT1jMXbHg8KJzfGBg5kzaI?= =?iso-8859-1?Q?nWjZlq+4GAPOYNFMaoYXua9v0Yve/xsI+vhaJYWFZ3VSs0W4EL5LjjpPal?= =?iso-8859-1?Q?1MC3Whui0MVJtBM+2QQkByR/ku6xU11vY7z4fkKMQha339QPlHQf5cFnMu?= =?iso-8859-1?Q?4S46xtle9PptGAHXzZvExpdCo08STdDZmOCwuavI1/0PLQDFvihZsHO7lO?= =?iso-8859-1?Q?hJWv59KWne6Nt352ifRuA0bFiKrtHtgY1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eZR/fA0XnJ1vnGcuNiO/KSF2x31nJHZve1VifVDwPGnBgNfA0QRm01dJqbv1Jjg== X-MS-Exchange-CrossTenant-Network-Message-Id: ccdc575e-d063-4c6d-83da-08df507ec137 X-MS-Exchange-CrossTenant-AuthSource: LV2PR11MB868673.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 14:15:44.9445 (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: zAZULwS/5vNW2mUn0S8xO1OzIyrqDoIKN1d0LQixvQuPPXml9fBoouS420QiDFV9jkb1AYqM6F8AZYBnd7B2leDzY79zXdbb0utYg07DMWo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DSWPR11MB9713 X-OriginatorOrg: intel.com On Mon, Nov 30, 2026 at 01:37:31PM +0100, Björn Töpel wrote: > A packet that AF_XDP receives in zero-copy mode over several buffers > keeps its shared info, the fragment list and its count, in the UMEM, > which userspace can write while the kernel uses it. A rewritten list > or count makes the kernel read and write out of bounds. > > Patch 4 moves the shared info into the buffer pool and lets the device > write up to the end of each chunk. Patch 1 makes libeth count XSk > XDP_TX buffers one by one, as it read the shared info at a later bulk > flush. Patches 2 and 3 fix skb builders that relied on the old > tailroom: the generic one sized the skb head from the frame size, and > i40e, igb, igc and ixgbe read past the data. The pool size doubles, 320 -> 640 bytes on x86_64 (1088 with MAX_SKB_FRAGS=45), but fq is ____cacheline_aligned_in_smp, so the data path members keep their layout. Nit: sinfo lands under "Members only used in the control path first", though ZC multi-buffer Rx writes it for every packet. > > Sashiko found the shared info issue in its review of the AF_XDP device > buffer layout series [1], and the issues fixed by patches 2 and 3 in > its review of v1. Clément reported the issue of patch 2 earlier [2]. > Patch 3 was reproduced on igb in QEMU; the others were not triggered > at runtime. > > I tested this on mlx5 hardware, and on igb, virtio-net and veth in > QEMU. None of them receives multi-buffer packets in zero copy or uses > the generic skb builder, so i40e, ice, idpf and gve are only > build-tested. Intel folks, could you run your multi-buffer zero-copy > tests on them? > > Also for Intel, found while auditing the drivers and not touched here: > ice no longer sizes its zero-copy RX buffers from the XSK pool. Commit > 3a4f419f7509 ("ice: drop page splitting and recycling") programmed a > fixed 3072 bytes, and 93f53db9f9dc ("ice: switch to Page Pool") > changed ice_setup_rx_ctx() to use ring->rx_buf_len, which only the > page pool path sets. An XSK ring gets the length of its last page pool > setup, 3456 bytes on 4K pages, or 0 if it never had one. With 2K > chunks the device can write past the chunk into the next one. I found > this by reading the code and did not test it. Thanks for the heads-up, I noticed it too when I ran v1. I'll send an ice fix. > > Changes in v2: > - Patch 1: fix the kernel-doc of struct libeth_sqe (Sashiko) > - New patch 2: size zero-copy skbs from the data, and copy the exact > length (Sashiko, Clément) > - New patch 3: copy the exact length in i40e, igb, igc and ixgbe > (Sashiko) > - Patch 4: set the flag on every buffer when the pool is created, and > again in xp_alloc() and xsk_buff_set_size(), as virtio_net clears > the flags of some buffers (Sashiko) Hmm, a bit of a bummer. Now that I think about it, could we piggyback on the rxq mem type being MEM_TYPE_XSK_BUFF_POOL instead? The core already relies on it in xdp_convert_buff_to_frame(), xdp_return_buff(), xsk_rcv() and bpf_xdp_adjust_tail(), so the flag juggling and rxq->ext_sinfo would go away. ice_xmit_xdp_ring() would first have to take the shared info from the frame, as the buffer it builds has no rxq. Or would this not carry over to your provider work? > - Patch 4: publish the shared info before the buffers point to the > queue (Sashiko) > - Patch 4: update the comment in bpf_xdp_adjust_tail() (Sashiko) > - Drop the selftest patch, it goes to net-next once net is merged > (Maciej) > - The libeth XDP_TX completion count that Sashiko found going the > wrong way is older and unrelated to the shared info; Separate fix > > v1: https://lore.kernel.org/netdev/20261127142131.3527737-1-bjorn@kernel.org/ > > [1] https://lore.kernel.org/netdev/179561567996.3135.9952128421877275714@kernel.org/ > [2] https://lore.kernel.org/bpf/20260629072300.1664622-1-clecigne@google.com/ > > Björn Töpel (4): > libeth: xsk: Count each XDP_TX buffer on its own > xdp: Size zero-copy skbs from the data, not the frame size > intel: Copy the exact length of XSk packets to skbs > xsk: Keep the shared info of zero-copy buffers in kernel memory > > drivers/net/ethernet/intel/i40e/i40e_xsk.c | 3 +- > drivers/net/ethernet/intel/igb/igb_xsk.c | 3 +- > drivers/net/ethernet/intel/igc/igc_main.c | 3 +- > drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 3 +- > include/net/libeth/tx.h | 8 ++-- > include/net/libeth/xdp.h | 9 ++++- > include/net/libeth/xsk.h | 6 ++- > include/net/xdp.h | 32 +++++++++++++--- > include/net/xdp_sock_drv.h | 26 +++---------- > include/net/xsk_buff_pool.h | 1 + > net/core/filter.c | 2 +- > net/core/xdp.c | 40 ++++++++++++++------ > net/xdp/xdp_umem.c | 3 +- > net/xdp/xsk_buff_pool.c | 20 ++++++---- > 14 files changed, 96 insertions(+), 63 deletions(-) > > > base-commit: e2fb9368a41662bc54624f9be87ea8989b109306 > -- > 2.56.1 >