From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=198.175.65.9 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796377768; b=mau93Y+uKDVt99ca9Bf5xubqc4lxLxIUqEUxO6rL4hiWYEd2tjME6KnlhiQ5cQLHJmTt udLPdSfGfH6FIB/9G+S/4jV1RYqsMCIKdDv43xap2SDo/GBUPQT/T1NOLwwCqKuunXq40 SZysiECP876mJXOiCXNphuXEKOYQEh97d5Jx15wdq2isiFaPRrHeq0cevUvMehjbvPOJE JJpsbYXfgwanww73IT8PcT3oxSkX6imvhgBE1MS8XRJoI7SMg03YVZK33Qh6v7GBmotQY PPbRvHN6+sVl4DnobbWo/cusPXyxWZ0oAOnFrybq1BO1G+kMLEUEVxch5WlItdtDLNg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796377768; 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: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=sNtfipWv3DlC4oxpcJtv75WysmtLhCofTpIaxIL67ik=; b=Yu9AKRiwv5IYQzbamzPXyMga7QDhqqoRaigIYp6NJLBGNLJ3WpJWsw0h+34llKgBc2LF C/r5Ec/uDCQgLkoWWYyqH2DKlpEQF6vpVFyOgJRdDW1NnKHwrlLoX3UpUkeWPrRrh6Ru1 L8f7G7Fxvr45CND3JG1usNrqB+0+oJ9RNn+5nu4Wr0pcTEVfcuWPd+zha5VdtEwocj2H5 HW1kF9qDg6hnZavQebvj8un+TGPJniRg/f8F+HYu/ptaWx3HJo4/JpnnFey05eXJihh9b RgTFoJdloGkAHNM3dZ64s33b3t5RymJ4lECBXZI4nHAELlMniiJOu5ldAXGf4ToMSSQ== 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=GMcvb4tr; arc=pass header.oldest-pass=0 smtp.remote-ip=198.175.65.9 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 1271D606A32F; Fri, 4 Dec 2026 09:49:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1271D606A32F 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=GMcvb4tr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796377769; x=1827913769; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=sNtfipWv3DlC4oxpcJtv75WysmtLhCofTpIaxIL67ik=; b=GMcvb4trLZLav+5Gcb2U5sBFv4zQZhT5orTpkYHKexGLd1h84X2upmTZ a7FRr+paraj3VOxUtVwLtUvzvwh8UNUZI8/x9qjloSnX92C6TYe78o2n2 7SAtADHizT6QAABdNKkCjmT0l5W/Y42bimzyg320d5wkkQFLQbHPS1oQy OHUpq9pdryULuuWL5LWvF9AiiclBorGyFQRkfz2C3GZ8PA6q0aS7FUimn WP30U0aBGh0ksFMD8mWb9XHfw1+McntMVWG/1gZif8Vez5T5ycmytAPFJ 0ik1pToLojRTcaX2MHNwRiOCawIQ9vQpthYSvDEHu3117Z6aTUQ80Za5B A==; X-CSE-ConnectionGUID: Rb5avS4HQyGrc8xqYwHmeg== X-CSE-MsgGUID: gmP/nqepRMWwY7A2ffv1EA== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5270956" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5270956" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 01:49:28 -0800 X-CSE-ConnectionGUID: tctT05RTRvS1Iu3pDihFgA== X-CSE-MsgGUID: XAIsVs65Se6VybxNmW/GFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13947970" Received: from fmsmsx902.amr.corp.intel.com ([10.18.126.91]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 01:49:28 -0800 Received: from FMSMSX901.amr.corp.intel.com (10.18.126.90) by fmsmsx902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Fri, 4 Dec 2026 01:49:26 -0800 Received: from fmsedg902.ED.cps.intel.com (10.1.192.144) by FMSMSX901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Fri, 4 Dec 2026 01:49:26 -0800 Received: from CH5PR02CU005.outbound.protection.outlook.com (40.107.200.65) by edgegateway.intel.com (192.55.55.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Fri, 4 Dec 2026 01:49:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qF9fmivdlYLGXRLK7WTV1SXFYJKjhVroAz7PciRjy8GIbh/n1UgBrVI2iLt1/Bpj/G2WWpp0Bkp/bRlDn2G0hzaW97/iWYc4wlTH5HH2otYqYjsu1VsJbSttgYWhNM0dxa+F87QrV7L+wLMTyGJ/PVmYNeuxMtziERhpMgdk7D0BELQ3YF8vua5/KRS6Y16K0ftOTPtXHjdK3Fa3ExNT9OOiNPuN6jwLTovUCvSY0Pq8uGx8S+AHSN7qnKgZxmL70Udva6zqZyafwnwHZwCent6pXy7nyhgkBY4FPqL5Sm/8JJU+6FEunuNZSBb1QJy90qjsT2RQfCNgoxm+d1Dy/Q== 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=sNtfipWv3DlC4oxpcJtv75WysmtLhCofTpIaxIL67ik=; b=rdoy8+qDBkq8ogrxkco0rbo46TjW7SJillL2XOge3AndaNHn4FszxfaBtob943Gm1zmkW3b86llJhjImJhdFZ76dBBorO/gmM4VvexoQwNp8kYBy6MtSQzS5xzLhlJo+cLAkjCT3C0CbAmSj/4pa+ySdzCF9oK1ivIR1Y4JWv9aAfJ3yNETzPBcb9R+LxKv+nqx5258V0tbc4onxfENelnuKB1S5Jy1LnhJRXQgCvIn9fX+iig2EChlmqI/hSK6U1uf0iqcfjAT7jkxDt40xLglMOEgm/E8gl7/k0pRCxr5RP2tP89S8uPqk9MEcADUhAEjyNmv3ldUlf9h6XP66EA== 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 LV8PR11MB8723.namprd11.prod.outlook.com (2603:10b6:408:1f8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.13; Fri, 4 Dec 2026 09:49:24 +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.011; Fri, 4 Dec 2026 09:49:24 +0000 Date: Fri, 4 Dec 2026 10:49:10 +0100 From: Maciej Fijalkowski To: CC: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , "Alexei Starovoitov" , Daniel Borkmann , "Jesper Dangaard Brouer" , John Fastabend , Stanislav Fomichev , , , , Subject: Re: [PATCH net v2] i40e: stop XSK queue pairs in VSI shutdown order Message-ID: References: <20261203-b4-i40e-xsk-queue-order-v2-1-e14b712d5fc2@boondocker.io> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203-b4-i40e-xsk-queue-order-v2-1-e14b712d5fc2@boondocker.io> X-ClientProxiedBy: TL2P290CA0029.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::19) 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_|LV8PR11MB8723:EE_ X-MS-Office365-Filtering-Correlation-Id: 763d17c1-9483-4bff-76bd-08df51ebe0c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|7416014|22082099003|10067099003|56012099006|260925021311599003|260925022911599003|260925021911599003|261022105027099003|261026121527099003|261026140227099003|261022075727099003|261028144727099003|261021121427099003|261021123027099003|261102123227099003|261009223027099003|18002099003|11063799006|6133799003; X-Microsoft-Antispam-Message-Info: wsuBMRHfgi2PQp8kd758op3I1WyHz/8MVlyBu5mYWVdWWjZ6J333wb5p/n246VOTP5Mq5AaQrRXEfXQrpq9w33ria1GVSCABC4Y3GV8tH1Bdt0iq/ST1OKqdBmdPNYz3MveXEz45iZZ+v3qnLUvRQFWEycHtNAAxJ7PgdJNDhvNWGXz83vDZIMW888lfN61TRMiqEZ/EzmgU+KxZNGJHmI3HuEpKp4ebevx3ie+7CpxT7cK4PWIGm/+s94d6N48ryvsqVcjCuNWY5Fq8jkfkBNKiX+tQhX5UiaSz4kH3FyVeAfSqOPsAo94/yhLBmVXumMM6zJNKGkAjiGe6FwybyM7cmgC6umsut2g5wLlmxaAlahHC8SrVGWZaaB/SszGlrqE92+CEkPOhFEtET0yHzLAX7m1rYvU/8yWqE+3vgnySN9WkpB1l0k/RFoPZQaNni673VMWI8iFLQEPxu3w0qU3WQPQan1k9NoGoF8t2iC/cQPDg9GVp6zv2ezL54SR+GKns2aJJTQgQt5HIGsfnAUzs9nut93DJ0jUzdLptU0GCu5xu2oE+cqzWnvwQpBqxpQkdLFqyGMFUEQjpWIcg8jLLWDjRPN472u6WrnEDJDOC5WsMJmw2bJwl56oUnRGt 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)(366016)(1800799024)(23010399003)(376014)(7416014)(22082099003)(10067099003)(56012099006)(260925021311599003)(260925022911599003)(260925021911599003)(261022105027099003)(261026121527099003)(261026140227099003)(261022075727099003)(261028144727099003)(261021121427099003)(261021123027099003)(261102123227099003)(261009223027099003)(18002099003)(11063799006)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3zRZojFKDBy2NL9i0LDfYyPSIEiZk+G2rTWILacFS/cBJOWWga77OHf2IU4t?= =?us-ascii?Q?Zn2zaAZEiBzCnfayYwHetk65nESnQ++QlmD5I2+o8VB3qRK2qvPKTc6eAhRZ?= =?us-ascii?Q?Zgc7DsTkeujsci11eCpmxIuCOVv74O/Pz1WlHZf+9UlffuvlCQIiL9ZPezKF?= =?us-ascii?Q?xvxiqbxsgLV8HhiredR7tr7Hh1lID4jXH72v55TIDKZ2CUh828W7VeatwOb3?= =?us-ascii?Q?WBotXBZ0eueYP4WM4Y2BqnFcpc3YybV9V578XfffFTt+zRJ+SF/9lwZyzhSA?= =?us-ascii?Q?mzK5c4UIaeiRh+sTmI/8jif9jisPqn1kqgB6/Gpdgl7Xkbu3glIqNeOQVnE/?= =?us-ascii?Q?bczbXNzMYi0B7kyhnENxCYEqcQtvz3ZB6ThqBrMywivZ7drtL7JsEBovERyj?= =?us-ascii?Q?TN0FWfo6AQZD1Wi+AN/fuonJD4+XpNbec6TeZ+Fd4t0YaCSpi+/yfYT7KI5K?= =?us-ascii?Q?ACn8tS2GZxAcGOpJqy0HMlJqBXcDtXn12w4GehskS1iF3PKnx6QPGeZdplPM?= =?us-ascii?Q?TAtF7fvSws7zypzPotQ5oXguYHk0hbOaRx/2SC4IRYsp8Aanucz8zd/YL3aG?= =?us-ascii?Q?wgL1XhClFBlrayWXIXOWnkvSbpx2nskLNtU59atL+jtoAp5EfKm5jtgTHX2L?= =?us-ascii?Q?x0l4JfPhrog01n+3gzIj8JGNoRAI6zwEtgQInenMo0CiKGYzTxnWiryS0lWJ?= =?us-ascii?Q?nRgcgxyv7a48S9IErrKzcooi2cG/nTp8iUGPMNJ49KJtrJzBHUYSIxObVPTM?= =?us-ascii?Q?6w2ID1keDTt7pNrjjKv/C3aXY+sAyXHykdNjcbFY8eIcsdBWoBqfK5c23Ffv?= =?us-ascii?Q?xZLm77k5cbSglsZBLHCj9NoG6vSxYnrm21CUOC02VMIc1jCy3XdQX3htBtqz?= =?us-ascii?Q?GSIrJI2aFynyI6f8VNLpvfzL+5N2wgQHcrY7x2Nkkv8/a81C5XoU1lyrQeh8?= =?us-ascii?Q?ZruYbaZxjrtLFl7SQDPBKLIYqRExXN7qt+NG0JK97siEs/0+Cc8nIfXMRdzE?= =?us-ascii?Q?mCNqbhV+wc8L5Z+DleZ0NsV25KJhUcTJGISK8T0gy4MMIj5/0JZppnR/58kl?= =?us-ascii?Q?iP935vKl85+lIKFV+0CBZR0KfnTiD6JWyQxP1tw4McW902YtOwfy1SsOGvEw?= =?us-ascii?Q?O3TWSzz88Jdv1WehA0zEERQ6NT3zBGeV0gE2kSQtJ9D5SJlffpB49I9WAMte?= =?us-ascii?Q?gYurqeRTQbyGUhrpUYRMV6bEN5N1T/bYZxqcFV4gI4B/FhGztqIKutYXShgG?= =?us-ascii?Q?8C7oJKsEbMPHQ/q6o1D+yLB+0xCyQqCte3ZIThSwY011pGrpRhCfaBJj/8nt?= =?us-ascii?Q?5KyQFkMGBkQoQH5yqGpSIxS7iLZt8j0eJ+1x0vXusjI7dj5ebBLdcwcWUVEw?= =?us-ascii?Q?6J4TkKhIdJpFjGQm4c6uyTXQF6xHrwTo2o8YBo+csO7maeoAI7o0yR6Dwot2?= =?us-ascii?Q?+jfL6athhuFKUPWi1G8SBlMwwD+Wf1Nbm/Ur8P3RFYx+4X1I7IO73msAMJsK?= =?us-ascii?Q?cEuX7+EK5tEJwYimXFwcOKHV4qKXTfTQv6udmqUHwyCTdp9Q7KgGRfwuRm1Y?= =?us-ascii?Q?eYVMLPGneDOysC13Waf/oiUmVimZJFmNAgY/BK/PyW+GAk/eRtmbLf8cSFp+?= =?us-ascii?Q?SG1aAqKv2uAQsNsRQTDhDgsXMaZU2JTxtaQIsybfbAizlpxwWtUTvVnqYoTI?= =?us-ascii?Q?u/vroKjfOnGQ6bnvybtVJwKp73HVQkST4vaX+zle8PUQ7uJIMHnwt6FXkBy+?= =?us-ascii?Q?BNhPMICduUO8Ma11sXT61R0/3WPWIeA=3D?= X-Exchange-RoutingPolicyChecked: JQ1lX27Xz3AQwOclwGN9MJcEp83uA972u5XDIEIwc0aQMVEOuw+esdEIlYo1p3C3sy5L15nJJEHPPfvOIj4UGRWXaf1BZ/LBgmm7ZJQexfpif6m+cMyBHdSGjHuSrkXZxbgCRsbiRYh15QwcpJCHjO1MdFZruN/LCAZ2fvKNpzn7pPmocy5rwVQrPJ6vxrl/zVMQaR4PGBoFAgSeMdEt2qMkARTeoytnkv1vBX4lCPNSDA8rDMVbiQ+okZ7t2cgmeVsMez+YxtSxYqKFnD3QhjGTwiFifEiRWrMk3KiDGpLSXNN1D0RzHGuMONjkmc8mOgU2DoynGRkYxc0zW+ngcQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 763d17c1-9483-4bff-76bd-08df51ebe0c7 X-MS-Exchange-CrossTenant-AuthSource: LV2PR11MB868673.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2026 09:49:24.1335 (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: FgMY+z+B17+WuCxHOMvRSmqd/K9jMKin8v9cBp7K7TQRgVI2GQqJfXMHMR9uVjjMpdlEfDtyXCSIDlM5rLmUen9kxzyOtFtCrAyqZne0Y6k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR11MB8723 X-OriginatorOrg: intel.com On Thu, Dec 03, 2026 at 03:53:13PM -0700, Matt Thompson via B4 Relay wrote: > From: Matt Thompson > > An AF_XDP zero-copy pool transition on an active X710 can time out > disabling the regular Tx ring. With 12 combined queues and simultaneous > 2048-frame bursts on queues 0 and 11, the original driver reported > "VSI seid 390 Tx ring 11 disable timeout" and networking stopped > responding. > > The queue-pair path disables Tx before Rx. The whole-VSI shutdown path > first announces the Tx disable to firmware, disables Rx, waits for the > Rx disable erratum, and then disables both regular and XDP Tx queues. > Use that sequence for a single queue pair as well. Bring Rx up before > Tx on enable, matching the whole-VSI start path. > > The Tx queue disable request is asynchronous. The X710 leaves QENA_STAT > set until a disable marker has traversed the Tx pipe, including when > the descriptor ring is empty. The original ten 10-20 us sleeps can > report failure while QENA_REQ is clear and QENA_STAT is still set; in > the test the status then cleared within milliseconds. Poll the status > with an elapsed-time deadline before cleaning the rings and releasing > the AF_XDP pool. The deadline covers the observed multi-millisecond > transitions without using a fixed retry count. > > With this change, 1,000 AF_XDP setup/teardown cycles at 12 queues > completed 2,048 Tx descriptors per cycle on each of queues 0 and 11. > Another 310 cycles closed the sockets with 2,048 Tx descriptors per > queue still uncompleted. Neither test produced a disable timeout or > AF_XDP teardown warning. > > Fixes: 123cecd427b6 ("i40e: added queue pair disable/enable functions") > Cc: stable@vger.kernel.org > Signed-off-by: Matt Thompson Awesome, thanks: Reviewed-by: Maciej Fijalkowski > --- > Changes in v2: > - Share the per-queue disable wait with the full-VSI path, as requested by Maciej Fijalkowski. > - Order the new local declarations in reverse Christmas tree style. > - Wait for Tx QENA_STAT with a time-based deadline so the hardware disable marker can drain before AF_XDP buffers are released. > - Retain the v1 queue shutdown and startup ordering changes. > - Link to v1: https://patch.msgid.link/20261202-b4-i40e-xsk-queue-order-v1-1-737cfb5a0146@boondocker.io > > To: Tony Nguyen > To: Przemek Kitszel > To: Andrew Lunn > To: "David S. Miller" > To: Eric Dumazet > To: Jakub Kicinski > To: Paolo Abeni > To: Alexei Starovoitov > To: Daniel Borkmann > To: Jesper Dangaard Brouer > To: John Fastabend > To: Stanislav Fomichev > Cc: intel-wired-lan@lists.osuosl.org > Cc: netdev@vger.kernel.org > Cc: bpf@vger.kernel.org > --- > drivers/net/ethernet/intel/i40e/i40e_main.c | 148 ++++++++++++++-------------- > 1 file changed, 72 insertions(+), 76 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c > index abbc71e81..555eac07e 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_main.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -4660,6 +4661,8 @@ static void i40e_netpoll(struct net_device *netdev) > #endif > > #define I40E_QTX_ENA_WAIT_COUNT 50 > +#define I40E_TXQ_ENABLE_TIMEOUT_US 1000 > +#define I40E_TXQ_DISABLE_TIMEOUT_US 20000 > > /** > * i40e_pf_txq_wait - Wait for a PF's Tx queue to be enabled or disabled > @@ -4674,20 +4677,16 @@ static void i40e_netpoll(struct net_device *netdev) > **/ > static int i40e_pf_txq_wait(struct i40e_pf *pf, int pf_q, bool enable) > { > - int i; > u32 tx_reg; > > - for (i = 0; i < I40E_QUEUE_WAIT_RETRY_LIMIT; i++) { > - tx_reg = rd32(&pf->hw, I40E_QTX_ENA(pf_q)); > - if (enable == !!(tx_reg & I40E_QTX_ENA_QENA_STAT_MASK)) > - break; > - > - usleep_range(10, 20); > - } > - if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT) > - return -ETIMEDOUT; > - > - return 0; > + /* QENA_STAT stays set until the disable marker leaves the Tx pipe. > + * The pipe can take milliseconds to drain even when the ring is empty. > + */ > + return read_poll_timeout(rd32, tx_reg, > + enable == !!(tx_reg & I40E_QTX_ENA_QENA_STAT_MASK), > + 200, enable ? I40E_TXQ_ENABLE_TIMEOUT_US : > + I40E_TXQ_DISABLE_TIMEOUT_US, false, &pf->hw, > + I40E_QTX_ENA(pf_q)); > } > > /** > @@ -5293,6 +5292,39 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf) > i40e_unquiesce_vsi(vsi); > } > > +static int i40e_queue_pair_wait_queues_disabled(struct i40e_vsi *vsi, int pf_q) > +{ > + struct i40e_pf *pf = vsi->back; > + int ret; > + > + ret = i40e_pf_txq_wait(pf, pf_q, false); > + if (ret) { > + dev_info(&pf->pdev->dev, > + "VSI seid %d Tx ring %d disable timeout\n", > + vsi->seid, pf_q); > + return ret; > + } > + > + if (i40e_enabled_xdp_vsi(vsi)) { > + int xdp_q = pf_q + vsi->alloc_queue_pairs; > + > + ret = i40e_pf_txq_wait(pf, xdp_q, false); > + if (ret) { > + dev_info(&pf->pdev->dev, > + "VSI seid %d XDP Tx ring %d disable timeout\n", > + vsi->seid, xdp_q); > + return ret; > + } > + } > + > + ret = i40e_pf_rxq_wait(pf, pf_q, false); > + if (ret) > + dev_info(&pf->pdev->dev, > + "VSI seid %d Rx ring %d disable timeout\n", > + vsi->seid, pf_q); > + return ret; > +} > + > /** > * i40e_vsi_wait_queues_disabled - Wait for VSI's queues to be disabled > * @vsi: the VSI being configured > @@ -5301,41 +5333,13 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf) > **/ > int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi) > { > - struct i40e_pf *pf = vsi->back; > int i, pf_q, ret; > > pf_q = vsi->base_queue; > for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) { > - /* Check and wait for the Tx queue */ > - ret = i40e_pf_txq_wait(pf, pf_q, false); > - if (ret) { > - dev_info(&pf->pdev->dev, > - "VSI seid %d Tx ring %d disable timeout\n", > - vsi->seid, pf_q); > - return ret; > - } > - > - if (!i40e_enabled_xdp_vsi(vsi)) > - goto wait_rx; > - > - /* Check and wait for the XDP Tx queue */ > - ret = i40e_pf_txq_wait(pf, pf_q + vsi->alloc_queue_pairs, > - false); > - if (ret) { > - dev_info(&pf->pdev->dev, > - "VSI seid %d XDP Tx ring %d disable timeout\n", > - vsi->seid, pf_q); > - return ret; > - } > -wait_rx: > - /* Check and wait for the Rx queue */ > - ret = i40e_pf_rxq_wait(pf, pf_q, false); > - if (ret) { > - dev_info(&pf->pdev->dev, > - "VSI seid %d Rx ring %d disable timeout\n", > - vsi->seid, pf_q); > + ret = i40e_queue_pair_wait_queues_disabled(vsi, pf_q); > + if (ret) > return ret; > - } > } > > return 0; > @@ -13408,46 +13412,38 @@ static int i40e_queue_pair_toggle_rings(struct i40e_vsi *vsi, int queue_pair, > bool enable) > { > struct i40e_pf *pf = vsi->back; > - int pf_q, ret = 0; > + int xdp_q, pf_q, ret; > + bool has_xdp; > > + has_xdp = i40e_enabled_xdp_vsi(vsi); > pf_q = vsi->base_queue + queue_pair; > - ret = i40e_control_wait_tx_q(vsi->seid, pf, pf_q, > - false /*is xdp*/, enable); > - if (ret) { > - dev_info(&pf->pdev->dev, > - "VSI seid %d Tx ring %d %sable timeout\n", > - vsi->seid, pf_q, (enable ? "en" : "dis")); > - return ret; > - } > + xdp_q = pf_q + vsi->alloc_queue_pairs; > > - i40e_control_rx_q(pf, pf_q, enable); > - ret = i40e_pf_rxq_wait(pf, pf_q, enable); > - if (ret) { > - dev_info(&pf->pdev->dev, > - "VSI seid %d Rx ring %d %sable timeout\n", > - vsi->seid, pf_q, (enable ? "en" : "dis")); > - return ret; > - } > - > - /* Due to HW errata, on Rx disable only, the register can > - * indicate done before it really is. Needs 50ms to be sure > - */ > - if (!enable) > - mdelay(50); > - > - if (!i40e_enabled_xdp_vsi(vsi)) > - return ret; > + if (!enable) { > + /* Use the same firmware transition as i40e_vsi_stop_rings(). > + * Both TX queues must be announced before RX is stopped. > + */ > + i40e_pre_tx_queue_cfg(&pf->hw, pf_q, false); > + if (has_xdp) > + i40e_pre_tx_queue_cfg(&pf->hw, xdp_q, false); > + i40e_control_rx_q(pf, pf_q, false); > + msleep(I40E_DISABLE_TX_GAP_MSEC); > + wr32(&pf->hw, I40E_QTX_ENA(pf_q), 0); > + if (has_xdp) > + wr32(&pf->hw, I40E_QTX_ENA(xdp_q), 0); > > - ret = i40e_control_wait_tx_q(vsi->seid, pf, > - pf_q + vsi->alloc_queue_pairs, > - true /*is xdp*/, enable); > - if (ret) { > - dev_info(&pf->pdev->dev, > - "VSI seid %d XDP Tx ring %d %sable timeout\n", > - vsi->seid, pf_q, (enable ? "en" : "dis")); > + return i40e_queue_pair_wait_queues_disabled(vsi, pf_q); > } > > - return ret; > + /* The whole-VSI enable path brings RX up before TX. */ > + i40e_control_rx_q(pf, pf_q, true); > + ret = i40e_pf_rxq_wait(pf, pf_q, true); > + if (ret) > + return ret; > + ret = i40e_control_wait_tx_q(vsi->seid, pf, pf_q, false, true); > + if (ret || !has_xdp) > + return ret; > + return i40e_control_wait_tx_q(vsi->seid, pf, xdp_q, true, true); > } > > /** > > --- > base-commit: c1c39137dcc3134010566ff29a81c93124efa539 > change-id: 20261202-b4-i40e-xsk-queue-order-0103023207a2 > > Best regards, > -- > Matt Thompson > > >