From patchwork Wed Oct 9 09:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13827947 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2084.outbound.protection.outlook.com [40.107.105.84]) (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 189BF18E030 for ; Wed, 9 Oct 2024 09:18:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728465504; cv=fail; b=Qni0cOWnDPDJnD9ZygFEgpKaoJUtsNR52R+BpT332lNIErVX42Y6V30i4KJikGxCNxkDUdVIjEEa9v8WX/xrdd7S8io6MeSGNcYqYIIJ+KgW2WQVkjwI0t4Qc53TDklreEj3aNge7CUwoHQ5DQgodjtyRFPZsApfxMxAYrhZIQQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728465504; c=relaxed/simple; bh=yG6zMOIrUy1VozJLeovt3JsnwrjkIXFUHGzqiCfjNjk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XHkWgEFq1GLrMFn/w88WqNKPn2yFJdP58CgtgO0fPyXGa+SZbR4lzSMr7GFqPTexRZI+06RztFDvDhJ3dcQ+W/8is162RDtB+lixRx0fbOj3NROrO1Dd5IkNkftpEPNxYCwe9AnetvpH30pKZnglUi8vkSXgAaSeUq/LVjhbYCU= 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=GLOKp76s; arc=fail smtp.client-ip=40.107.105.84 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="GLOKp76s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WR2L4dbtalr7QjazYMEEEcrFIGQx7GhOTeGanyNrR4YXmpxLU4T1Gvw95w0c/gj9PN1quuqvLPLKGbXhYeOPPfbUFx0Z5Zwrq3pR8/nzvjdy3GoQOrG5lVvFxPpuS8YF7Ks/sJ5I4f02BgAJE/BMkPs6VcBHqBMtANBmBNNFTYUqwbQdtI9CjfYcro3ZyItUi0hw4gr/DSlG7YSwH3KvS/T4ch+8G+jh6ItkkgLe2W+W7kP62Ig6FVEp5ZoKgORLFf7fc7Hwm8ZvH2Q/xjOBj6m7/OS4/1TsyhwTWeH8VHRlH+m/YKWBp6NfSe+nj8XIM3EtzApUayNU01opSHHxtA== 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=J+UT3Aj9pXKHz1zIEj/01SoRaXU6yDqUrDa5Plb0JcE=; b=lYU9LlsMjpKfaHsE0X4jPUh9jVx82bvjmAa4BaTqcg4SpvJql8SZ8dtyZXuRK7Xav/f2EwUWL7u4UwUN0Iy4Pj4kme9HuH53FuT3xM7NCHREaYSPoOhLy0s05cT0eFdyxwBXiQoRnzMagcMiCkzgwLbSR1RtFT3fA5nuDUpjGF60Cd8qcO9nSeFtn6usNBEhSUg+dLetaLDTQ24xlsQs85j1lZpOfadu3IP3I8QhAll+X0OVNuBuBTloF9CTMF46m598w0iBAMfJLAJWYC4w61Dv8gyIiJKrR9ZVeHGLnd7yG6CmRnIKSebhCVrPr5UMqRxyWLy9OB2mv9jqtzA3aA== 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=J+UT3Aj9pXKHz1zIEj/01SoRaXU6yDqUrDa5Plb0JcE=; b=GLOKp76sxnIWjxF2fkiEpJG+8BBlAtjQZMsZWk5WN2M5IzbtjYOBSL1lqjR7mB3qIGFoV+7hdnSDCJ78h0Nh3AXZLfeq35oM/Bor26ITULEbW4KJklTJ4VAnfKwmlwxDWp+ViL7VqeZ00SitrpBA4nOkr6Xd2O1/0rGD25FN5RifbWoCL7f3efCysFZC+HaJ897dvvwhpk11yAMp0kRfGuhCBQRsVH7TYQsn79h79ck2jrgmTtnIYBOojGS5mNIDCPs+OjzEgi4FAWv1WB/ulKGEtCBpv/gB58wdLt/TdrZl+og22DJKzvCznFuJK48jBGgrSK74yq36Q9ED4GrKhA== 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 PA4PR04MB9318.eurprd04.prod.outlook.com (2603:10a6:102:2a5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Wed, 9 Oct 2024 09:18:20 +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; Wed, 9 Oct 2024 09:18:20 +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 v3 net 1/3] net: enetc: remove xdp_drops statistic from enetc_xdp_drop() Date: Wed, 9 Oct 2024 17:03:25 +0800 Message-Id: <20241009090327.146461-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009090327.146461-1-wei.fang@nxp.com> References: <20241009090327.146461-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR03CA0102.apcprd03.prod.outlook.com (2603:1096:4:7c::30) 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_|PA4PR04MB9318:EE_ X-MS-Office365-Filtering-Correlation-Id: f886636d-260a-4271-2fa3-08dce8435111 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 2e3c0uH8LfXBj9qZwFS6h4VOWIupoeIwqmPJ8QkJI1M3kyx1hdsW5hZzmT4xV0+dE8fwAli+6XQJrqG0YPVjIFhS8shdxOHlS6F2bs6dQY/GoqQGeKIpdlK/TFRLWJUer81sg9HGLc6pczpQB1/gQPna7YiqZ/j1CqAkm2DTIo3D5P69OrtArw/vqO9tHKk++3nVIVPT7lCCuRAeJtqIIZDvKwv4ZBGoYYTHmo7sqNa3pJb3Ebrg9ITeFbRYn5i9R5gFgzaetDZgFfB2dv50Kg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81Cwjdn76sp+pWc6g== 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)(52116014)(7416014)(376014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 92SmKzujttIfEJlINMclSc3voUZZNJsRxEBx8vY47Qu5YXCtKYrFGC1Ul2MtxrTSkI8JbY86H9IQSirNcIhaWFFb9WIUorz+/Yu22udCJRrM1SooIsYHWSMVeiNKQKNZMGtX2WBUE2KXBxpTtjTVR4rhkxT5y67HCZNR132nmsxZfs8HjpJ3fmUCEEqEBNSt2BGuQS1lACnPxcKmphRGjQPmjeW2nIZaCtPp2xUeQM85X65egagBLecS/2FdAP9e4JW9cyxN79fqHUxEkiReSkyMhkIbdcX7a9qZh/bw1453ooqxcgUd0DriP6PaSCUli6o+fBgiwSWp3ofAty/egIFrkq78mbUiXo3nKWL+7I8PQv/zSyw2x/qQUVL/1jVreoiUqJLSkiQBNSwuBUch1N+Wh704WsTxm0mzTgFPiEtUZ0q4oryutWMTGo226qTFzJx+PboXoEJEPo7Gs6mLD/O8u2jSa4goeR5hGtAj0kvihqAXDWnxAlnJE0qiLkRUNeRrHgA94fGzQguW9TcnhUC3PbpTfClcZAj4cls9ZAgsixUZCS0v3GrfpmslFcUYEScB+nIp/juX+KEG3Nqo8ywM/JUfBorbuYuKC1JbVp/PCIiPpXoJB3jmFOLSuVt/nR4rYx8Kptx1BkhoeWs691bxQTAcl//mJKLOP1iTyAFYoQGrsUDQynhzMBX+4pRJHz0YHYEgY6rlwsyxALKdbqaB7/rH4fuLz0l0trIEGSyv/amUve94yXAnY2BblIaIeOyVVdRQLrn89nzRJpHNA8+sSMNvuwARJZ8mw5pFW62+MHIS7HtdYJmnKc1VeU4KxFYyA4SZi/TpHduEEmdrr+Pn7JkeLvXIyM5AlcHEvufRPOxdmUz9IpD2wZXUk6zXIcUip5ib0h3T023NI/aD97YSNgbj3yn1v03dx0YA+OB+miHCMl2tcaVFDvKyiHnCJ3k5WTfvuqawmMu/ijhjITt22/wFjmtmIwp1gweTzCbBUAuJotAefgFuLb5PEJWOWVqa9NRwYmf577CeYJ2yBsSgP4+GadvCewbe6eAFhwXCzgdvFLXe/IXLynCcymwWfslooMAngFdVxtMOnkq2v4hV8Cyq3sTVAR+L/x+OIjuOvDc1LVfL7vzBgFE7+NlAGCRiC1NR60HWayvUYvfUrE7Rb2FNZe/TkmvXCO7OLvXLhvcjBc9+6RCLqlycvXstEMXlJ29ryX0zG2wmmo6SN/BoXNeI/YD0MYrgK3aPPnBBcUxZ5fGDlTOO+g2tix6I5Li6p9UJeAMMVPPxT5cFqMlFVoa7v9W0+tpesj59qus9NhWR4b0iohyGl0itchTnryjqjH8k/ufgNpMuL3/r4YRtllN5qy7giz8g390YUlmjJi8b53Jy+ERnMKZNKAEHXFHV4PHtV9o7i5U6AFXaAjZID3ZWg1mMaYmOLIDS2sJBOzIqxA5ReYRdMqc79kVctcPMFgz9Ue255ovDWjE08P4rJFTbndJo2n8vsWQyrf26a+8v4KLrnqv8XF0n6o1Y93kyQkgRCGcCX1B2OuM0CYZcoFCUYr+AqZopJHXES+4sbTGBYvyAPJn7K2VOATUe X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f886636d-260a-4271-2fa3-08dce8435111 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 09:18:20.2093 (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: 0doioPXCuSTgiKwACvYwuV62tPEboi53B2wWcwqgW20FNb/LvRH08yYuUPAXULkpF4cuviGWexJTzIHSRlGI6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9318 The xdp_drops statistic indicates the number of XDP frames dropped in the Rx direction. However, enetc_xdp_drop() is also used in XDP_TX and XDP_REDIRECT actions. If frame loss occurs in these two actions, the frames loss count should not be included in xdp_drops, because there are already xdp_tx_drops and xdp_redirect_failures to count the frame loss of these two actions, so it's better to remove xdp_drops statistic from enetc_xdp_drop() and increase xdp_drops in XDP_DROP action. Fixes: 7ed2bc80074e ("net: enetc: add support for XDP_TX") Cc: stable@vger.kernel.org Signed-off-by: Wei Fang Reviewed-by: Maciej Fijalkowski Reviewed-by: Vladimir Oltean --- v2: no changes v3: no changes --- drivers/net/ethernet/freescale/enetc/enetc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 032d8eadd003..56e59721ec7d 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -1521,7 +1521,6 @@ static void enetc_xdp_drop(struct enetc_bdr *rx_ring, int rx_ring_first, &rx_ring->rx_swbd[rx_ring_first]); enetc_bdr_idx_inc(rx_ring, &rx_ring_first); } - rx_ring->stats.xdp_drops++; } static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, @@ -1586,6 +1585,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring, fallthrough; case XDP_DROP: enetc_xdp_drop(rx_ring, orig_i, i); + rx_ring->stats.xdp_drops++; break; case XDP_PASS: rxbd = orig_rxbd;