From patchwork Sun Sep 29 02:45:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13814802 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012070.outbound.protection.outlook.com [52.101.66.70]) (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 052E7224F0 for ; Sun, 29 Sep 2024 03:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727578837; cv=fail; b=eTdrJwsJQum91w+v835G9rkiF0VyzUQD9P6bPk1ij2GbE+rn5bgrxHln4Aq1iusi2PIjaZT2VsN31Rzl2Jv9TDE7YyfPlyRSvb0eVJuMK4pWxaX1obFj/nHYehpFJ4pWkFW0iiQzulL6OC5tSNTNojYEdvD3SU78wuEOOQHAZmo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727578837; c=relaxed/simple; bh=+MUEPLguGX8fYq84Znn4lytDLx/KISrgs7dC4x9cmR0=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=S2Xbe9SBrNmdgLI3JLiUvIHK9K62sVqYq4pVSwAS5SEYlc+emsl3gs3xaQenwReCxIvWvvxVAjpBFnnseruCcTlE9OkxrX7Vg0OfusCG1jKrPXnKR6IAQYOc+C1w0DRRD4mXX4U2sHaG9f0yrJ/j8Fq4B7eT3UXO/bupT6RpSlI= 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=ED8HuMqn; arc=fail smtp.client-ip=52.101.66.70 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="ED8HuMqn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vM008ffO6gvAenSALYDzWKEG8fQ1Wgq/a9EPCYLKi3pbTmEmkZB6InKXseFe2DBlFaGXUF7phog0kybmZcIv6w3RhyyRdvwlgp2eyr5SLsVbyRQNuZj6hMknRDkkOizz8/RZ6W+oY80ojLgfn5SWagiRLF3iIy0rUi9Z69rtK9XIgV8qgXu0NQJlYgcn7A9krMk6oZwp00cDiC9R8fGA5XHXpOUBf7iEKQzoNIDQImvk8820KeLRbm30NIgC8BRfb8+RbYYyOBht9Oc9Td1t95FKe4hqjVWxOcZoR4p+ME0s0WtLn0D4U7lfgdQXeElxkFNC2avvnApNGsRrj2/fDw== 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=+npkUDHZQItdA8r0Av4kBXt0Y+/u2JuKSBl2xXNWO7g=; b=v7137Kskz2TikD/+h6C39TwJ6lPnumV/+V9XPtJ2bk3y/bV2h3EWyzlGFf9rEX3g0E9tHx5E+pMSpCYKyhXrOxgAQZ/1//EEfa0Wakz0AXtsJ2/oVRFD24+qPDmpOsdnZ0FeR9b6BxUHA1SvmcZupIxNX6xJCZpqufl5um3QdFTgNoT1gQ9QzHAtXALYkPw+ZC82bzhO74/dU2+AAXo7n8zGQOdIzlYdAqEkQTnOHsPkqSplV5yToBJKqkLXgK6wRJ6YmxWhXqZGQLdDcx8vE3SlBE5MDB9pFG3o/tFLyYE7SnJapVQOBQ+qQz9z74G/uEJ3JkF5605wIadz8pbBjg== 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=+npkUDHZQItdA8r0Av4kBXt0Y+/u2JuKSBl2xXNWO7g=; b=ED8HuMqnmkDNC9yq/q71ZoVYEzbbqev9BwtQEcybdaI3AwjPpAm7wMlOR07vTkv9li7nFKGgs3qq12N4Pts3A8Z4gaW7ehTXF7KZSOm4FkqdD3QTlUDTUvG0FhGU3jusDL+7hoieXf2ZYSFcEUTtqRNnLRygZDzVCNj9Z/lWwyATHr0FUeXCK3cpx3VvAZ26UWNDi4Zydg019NHuoDV3IpBhnVntNHGJrkG8MjZeFqbHo94SNanFvh3k39h7IGgCvjR5hKfBRGdQw0yCZq3ThZwoPs6aR5HBh8G8EbASvaX7yZFa740k0BPWh1B8/K411E6rTCkBE13Ucn2Ttp0Ddw== 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 VI2PR04MB10690.eurprd04.prod.outlook.com (2603:10a6:800:279::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.25; Sun, 29 Sep 2024 03:00:32 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%6]) with mapi id 15.20.7918.024; Sun, 29 Sep 2024 03:00:32 +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 v2 net 0/3] net: enetc: fix some issues of XDP Date: Sun, 29 Sep 2024 10:45:03 +0800 Message-Id: <20240929024506.1527828-1-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2P153CA0025.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::12) 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_|VI2PR04MB10690:EE_ X-MS-Office365-Filtering-Correlation-Id: 01828681-7e92-4b08-b12b-08dce032e1e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: NcAT19ifSE494E9lTsGimMHOG1sYd69tNRqGCoJElIDsyCXUw5r+oWnV7EVMQilq86CTnuM+iR45TNZcRdfAaALhcB9lH3oYmj3iTJU8zl0b6LYRk1pZ43KYvERyYTNUpA2W3uVgAnfnz7VWOL+AGNoXdBmKKrTRfeGGZsQuJeX22fv7HTjhOTCHz7EcZ39OKoHbJFxTkZ5KpqSIzXKRKqYGayT9zvhibVyX0FWvHF+Uh7tVaXqbsGyB1yue815r9PDZcvBSsxUBxlhnK7poHv7o00glK8yLn4jZjGkzRameIlxaeS0fXYVEB6Wu1U23P0ncEtIvrRhHmtJOxjy9pVum1s+AODjo21UJrSpKfdlkMSjA2S+64wH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eof9cN+JDNsOfQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TQ3XyP1e/MUnsyKi3JRmDe7C6dDMRgWkewHlzKetBodtNqRB41QTtzwKKJ7Dxlb2N6clVH2AKw8EN/yG5ZxYUrGDH+JOo574G/R2Zqm1i2ebpcjFg6s6w82H5jwSTDrYUvUu+3/a0V92yv9RjTUXpaI7YMHBQLwp4AiDxAZcfXVX8Z4Ty/S2Z+av6zIBT8tdYc4y9PXlYODXNuRT5dZvu4DGoQdvLkOeM5ESFzGRoXtfwFcd9TmXu37TZXeLhuDV+r5sTMqhYHSP4sLtuxWACXlj01BBgU4uvONmvuRDyxnnghqUASvqSNNZ/h3Gq6U1bmr/l8QnEj0zw2AC6v4A9MLjMQ1vRjrvvw/X6NGRVI+brFfaU3oruqCKBDPF/HnwZasDe6B3e7fpDcDMkMTweaPsmyVK/EUJ+xO0Cjkq50jQ1+a1WXF3e9Mcx0Ufe5N7i4UdrMGYIdifTo+rY1yrX06QXYQt3lZhSpixaRoVIUT9OTND97RfTN1ou1B92T0cjeV/Juwxmn3uH/bfnxX7f+5DLfmni6Fu4yKFhHw0rTujP+rlkjodOD8X83vwdzpVZIhuipyj+n3K9bWgAYc2J/HHYlxptlOhWUZXT3xBgfqgf3Y/PNXwgsAsUIc0Q1hAzalV2cpRXMuePqaw5I1vD5WqNOV+Qt+mCvUzTxeA1wAQ1Bs+d4ld/sDJvmDlRpmSiF7mrU26w/EH5T7aQySaeVoHJIv0j9HxPPqBxSwsTMLjQGN8PsRIuCg/gtB+mpXrekSM2ViOzrIoX/mf2dnTuIVgcO65t+dADTSWHjCihVJvhReMcql4ADMYgW7+EnqjN3asCAc0lfkEfgSuTHE8PpvUWMswwXqOsb+mITarVafkzvI0/8xReNE6w/Rdg5zHW4AmE3hP6zg1jOM/7Wa5wUsU+NUcmt4cxGT8XmS9+1O2+eB7hLgoQD83wrHFVEhj3myqZFTZnBNKiqvwUxxldG18J4V8RL5Y4KkZB9rjdTcT4L5GCoJ10p0XYIivWsl679P7oDy9zicNeWJxtgAjW4TeFV1YW4JmLCMaB9We8IfFbw6K/jxZJbG2SffY6AIYVFPlZd5dsM8KbXsnWBSr1gjZ64nsyKBh8kY+rShe42FAP5z0gu4WUTNdOnk5PA9hRCV38wEehWpwHd9ZbxRU2DUldm9d3zR3ddg1eQv0/GcrCCKxEF7N4ZCPsMwTQ87/gc3OqC53rncmcS7sTnIa4YTejp+kuwll8WKYrGk1FIM6mCxgBW1anMijExoP6zPCnex2uoAmLvSr89kprh5528Dber2L7fsidrVQwgTqcZVp6TMuygoP+zx6JmQKaaxtJMapV9SwvKiFyoRJKp2750Rn4kj/gd0wMPlgSE+sP3D3q4c/8Jf2hkxLflx7QRL4lPKgzo9oquVq2W9rnuzYBfTsJ8CINr9htLEshiY2PkXMkyK0g5GuYeST7ZGKeOtWDWlObWfspjuEC5Yt0XtfSaJY8XAF371xI5HuxSnWXt/4JKernSrDuF8yReWKaxy9jCX+4gokcgoGiFaLgBt9xzQVGzfSfZ9cTyEajLkfwCV+A0M26O8oQa+Nvpo/7h7g X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01828681-7e92-4b08-b12b-08dce032e1e3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2024 03:00:32.6070 (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: XH6Pd0TwbpyK08S6CnZSzNEFUbJh4VdFeJG+oAm6vVt7ymUX2oTBsPuvY1Vox7Ood5RutVofKUtsOCkZ8FI1Lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10690 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/ --- Wei Fang (3): net: enetc: remove xdp_drops statistic from enetc_xdp_drop() net: enetc: fix the issues of XDP_REDIRECT feature net: enetc: disable IRQ after Rx and Tx BD rings are disabled drivers/net/ethernet/freescale/enetc/enetc.c | 50 +++++++++++++++----- drivers/net/ethernet/freescale/enetc/enetc.h | 1 + 2 files changed, 38 insertions(+), 13 deletions(-)