From patchwork Thu Oct 10 09:20:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13829858 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 648521A264C for ; Thu, 10 Oct 2024 09:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728552945; cv=fail; b=lbhX7qYGiOFLCcTG2UN1gbNIJvRoApO8+1n9oydGzsb7eBb4ZourvJFLAZEVsG2oNfCxt1eKWsskGDCpzw1EncP0qv/dq6RT7cV0InuYT9bDeL/LqDjZ1jyahSNY7+of1UpMZSnovmr5n5X2vN2M14iDC0AjDPo9pc/wOjPBNUA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728552945; c=relaxed/simple; bh=Xx/1/DAoEsILYc7CvMNPySxSzyCmgZksfKss0ndu/dw=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=k8M4n/0JARGpAEdUHVfO9Or9N5+Byt5J9xdAFY7DRayMizc6BB+YU4WWslBmE+STXXRFwvlBPPmtL4sNoRggnCcXtt/NWIiW2ljEYy3BkY7VXAKOfWWmzDx7bRgGL79x9lIbEz33s9Og07uoohJRjbQU9r45OYgwxyQxcLzWNxU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=cy/lSQL0; arc=fail smtp.client-ip=40.107.22.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="cy/lSQL0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xe8X10hTkNYPdqUHeraN8jvekTOeYNFHvQfZNkLzSCAbLQBropw37Zj2BJJYXCNRWRvzG3aEVWDJpC2yJhIQooYSTdVm7eB0k1l3UX8HdPqFntD8B82Yn67ayDRZt+YvK/NCIivN24OuikA+XrW45PC/bUIfJCNTuuFNZ9NjKAozKj6s0nTPUr7q7X/TvM8n+TuEy0z/Spe061nNMyHbN5908PPicMejDmaINsqaCQFRlqDDMyAq5MCE+yH7cuIm14T0Oan1/h37PPiq8r1VjGZG0hn+X7JImsrxrABNf2wRukX1iWghOdbDrrsqBPisnlJEnNVdoRWOES5ybjuT5Q== 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=bEgXAnKkTNCv0VXNvbfI9Qzye9kAedYAH8kASB8hW6I=; b=Kh+lm2zdRkNe7UCSzrSGlW0HddU/bN2F2t1lZtRYkaRC8U8XhOSiKs6IZmHUeIf9F3WAmhCg1dPNK8sV4jfDJ5BgYFsU8GPZuGnjz+iAF24pVTfZfLAc3vJzL15VqZwN7l8LoxmEiT20BQFKBpfdJulm7gF1v9+sTqIMs0EqfqGXiq+45JbDL5aXZTiglWenqmX01Rn1oAISIebZGTZFu5pC/AGZRajYjFPrdNAkg8LgXMDNo9GRdFooMfoXrWRRXhAPzC3QY4XTb0ANR38f+q36N2p5hjVkOsUjteFAx27X2Ss9zh7sKObCk3nrqYMjJZ2eJF7nJ33+/Eq7PidL4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bEgXAnKkTNCv0VXNvbfI9Qzye9kAedYAH8kASB8hW6I=; b=cy/lSQL04MvWDyF3EZrjhrIKlUicX6SwiEDpNUcFVpGWex5B3VtpQs1FYCZ3s9nGtuuq8h41Mg7aZp4gqGydqQ2gfMbR9OqZ1Xu4N2GnLzu/+GNM5E0KxTxoPlMbGf/UV+pdrHKnBT+TiY8lfrH4pnncWLutiaLms/hPbbAIc3s5hDAEqLM8YBi7ezSkZh5ImuR3jp+voePKUjFkx1TEV+tVee0kO80a2iHR2A0ajamWGRWkx/Lh6lpLeQzdhDUxdZpqlNkv9KBL+48E24R2inb71MaAcM8nMcPCqYZPgGShvSrxnKWlQAv87/cmb480ZCj6QegNrJwU44/OfQxfyQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by VI1PR04MB6847.eurprd04.prod.outlook.com (2603:10a6:803:134::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 09:35:36 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Thu, 10 Oct 2024 09:35:30 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, claudiu.manoil@nxp.com, vladimir.oltean@nxp.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org, imx@lists.linux.dev, rkannoth@marvell.com, maciej.fijalkowski@intel.com, sbhatta@marvell.com Subject: [PATCH v4 net 0/4] net: enetc: fix some issues of XDP Date: Thu, 10 Oct 2024 17:20:52 +0800 Message-Id: <20241010092056.298128-1-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR01CA0002.apcprd01.prod.exchangelabs.com (2603:1096:4:191::21) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|VI1PR04MB6847:EE_ X-MS-Office365-Filtering-Correlation-Id: c2210d8e-902a-49dd-7ff0-08dce90ee157 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|366016|7416014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: /ydshzWPxV5I2H5JSv7/n+UEuUG25xeocem+EPW9wJgFjeknIMBikF/L6BqXdcVcEvA6vSIdMJJ4FjEgJZFwYNj79Xl9nhrSSahdQtThB+tlEuBfHIjBrzQ9eES+GhyeAigtMh1tqN+CmDXLBXz4mfD0/ziRUDX37nQ0bB/GYgvrWSpMo2fUwar1S5tzaKBz7cZo5GO5m/imG9VP2CLHbo6uPLmjW1M+9lYxruZ1GTI3m4eT4ACUYlLE/+TkmllpWSl7BGKPnfiRRZQkeqF2HKnYQXxTHUh0AIKDHpONzza8l5stGFgsBsxgcvIKot2yKth0L0xymYxK2JNU0UFWy41R9LQDSMXo+BFsXVRYBMqTUIVssADutw9fDSBsmYkTSypKCzF+7EO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look.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(366016)(7416014)(376014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1vGPY/fJaM5uLQ3VNyA1/N53Pb5lYMn6/I3mMm3K0VRBeVkZPpc8RK/viVGyZX5K4+ydWq8F8VGP/9KU5D+FeMK7sXoz7hGn556bd3EwfJiiBiAgLwZeqFl3r8QQ1z92B/vSI4NUQ6CE60F7vWDK1dhpTuNYzj2vo0gJSZXXbq66JRf2Qn+Kns8Gcrt2qwb/GINBdHeGMfJ5RWWBgivIjkk6veMntgbOPfXXZXgNoCUsi7on/o8KRNP/hgnnbURdkrH6gh4nHqyLY3Xh3ne9NczPBp3dd+ba5RTN5FIVadUHSi/rHDLyw9fIvfcEt/+IIGmd8RxFWSPahYj6n8uGrcE75DFasS5Ct2YcLpQy029ZvKH6eHPz87EAnTHyrPfqlbxhhuKsd3wRwbqfkSQM7IXFuvMpXFRwbEvXzkRC2DFAkaL4LmR28ga3xZJOzNePq/2bXUp24C0kAOpUZ4EXf0NUnyQonLUyDU+ChVDCu0qTc3HsBx0JCmCKCCNKv0N52vLJpIU3PDN9ZHA93N9xBzAqYNT1iGbzDD9oebwN2fhz+y+tO1eP9LVjKzvagplhO31rR/G7o2NPO+NJGEEU5v2ZSFvKkk2wmZcOiTH5tBe80cAbhzPxJXaumBp8t7ZJTugrdUSmBkcjdNKV/r7w8QRSpIzqYhVqPcCvFhtJ4rYGMR1S8bEfC1jNjG2AnvHhwAd6BuzpKbD22/90OVfFDGLBB897XWmunO4EooN0guIM5dBTubosl9ShFbIaArfoIig1GBBHgb9Q2SZDh7RLZJaQtTsjHg538enLq4/CLT9ZHHvN1aVBR9DUYRXxC3uf0SsnOMGh9xonueS+jQdqNftotqhMrs0YKte0k+IOPxZw2JkiAbN9EcUkVUtYL4NHlyrGYugGLdoQQkUSwZeeyOowXq0E1VXRutemla3LHpd3UKj0KYeGjIWfDCtGlL8GvWPIsStLo+WErb6FRWcXt7a4Z8vxVmXtK3ke+AHDn8Aij7MZCqgxPxckSrIZ28HF1OWpsItIQN8s2d/n0FTMB0KtmlgyoaTIFVZ1mL7WCP339QIhQ8D8cr//udRaDtSzrSGBqChCqhtNRZCNRB8qvsOdKCJT/GHxFJSVU9MrkBEjtbB+qGAkxR4iwYAKJnO5aEnonOoppOZSw7K3YtCVqMTQv/uJApNPgpR27ARPfZ032i22kzwkq7PcEmR58cVB1rkKu2rklvmbG6artL4dbzpm5iLJjJpxBM/nBS1hleDyECc6B1eZPhPKEigcQQ9haahkkpXtXG6KzKhbKSbeXR8kvNqAGDy7Nm7Qzu+oNOFM/qBHijGpwNkZv8IYg2oiP0pgYwCpZEyXSpDXo+r8oR7p3Z9k+Fp9561fIKJCy7+anE8jDptYEjEuZ9MBn4ATsUBMw98oUnwFDQuWRJJPEpQOTxYxAgqHEM2HJGt7Sr0rlNO45zWABGt+QeJbQ2JIOgyIvTAVfQqVteYe8KIvW8KWuut1k6I5LvqIvE5nDts0GkGxpyoaPzPWJoc7W/Gxe8YyAhFPV/WcbpZu9WSQ2JKHIJqrptsX1gIZUP46SPJDUC1Kg6mI0r7/gilLpbq3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2210d8e-902a-49dd-7ff0-08dce90ee157 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 09:35:30.2376 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lAVewJA7F1vgkFNF9XG57b7g3gZtHH1lWoIU6P9f/UFvwrQkX9c3FamX6XXa2HviswL/g27RhvMXghUII2TMXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6847 We found some bugs when testing the XDP function of enetc driver, and these bugs are easy to reproduce. This is not only causes XDP to not work, but also the network cannot be restored after exiting the XDP program. So the patch set is mainly to fix these bugs. For details, please see the commit message of each patch. --- v1 link: https://lore.kernel.org/bpf/20240919084104.661180-1-wei.fang@nxp.com/T/ v2 link: https://lore.kernel.org/netdev/20241008224806.2onzkt3gbslw5jxb@skbuf/T/ v3 link: https://lore.kernel.org/imx/20241009090327.146461-1-wei.fang@nxp.com/T/ --- Wei Fang (4): net: enetc: remove xdp_drops statistic from enetc_xdp_drop() net: enetc: block concurrent XDP transmissions during ring reconfiguration net: enetc: disable Tx BD rings after they are empty net: enetc: disable NAPI after all rings are disabled drivers/net/ethernet/freescale/enetc/enetc.c | 56 +++++++++++++++----- drivers/net/ethernet/freescale/enetc/enetc.h | 1 + 2 files changed, 44 insertions(+), 13 deletions(-)