From patchwork Tue May 3 11:57:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12835670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E772C433F5 for ; Tue, 3 May 2022 11:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234972AbiECMB0 (ORCPT ); Tue, 3 May 2022 08:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231882AbiECMBZ (ORCPT ); Tue, 3 May 2022 08:01:25 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAD8626AF2 for ; Tue, 3 May 2022 04:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NmauY4C0k2NS4PNFtBrLsaNTx4303a2MOobjBc2xdEJMLx9EEOomkWOA4ojs0bkRxGBCm32xb7vee0lyHq30zXIBlmjoiPJvFnYAH34eHK3x9fjowwX+yXDhwI18/9SH0zyUFk4UwPcGQKTmpYM8D03ZdWD0DRpQzvjtw4nVBJYwkmyE56F8bk7H8cevf/k0CmVlqApf/Bz/XHLNLYJXDcwiBaXkBmqMZJ9DqjsfKmaK2FcqSNt3y0JTtRaysmh/lxjKwQOXzxJVaON1a8R03DR4xE4fI3LKdFlPKmwk6PJTQaS4ZszqnwathQr+5HKI2w93JfWGq8kEugJrmt/KjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=hcYs0QEmIQjtW31Ip8FmdLDJEG/PKxXN17IYk4CUaK0=; b=VrhJoiAI8SZDp4dLbvQOr2kYgbG3AFYMiIOy+PKkY5/CKne0ndLzyaBofLF/4o5ZOVdrE+3GDDVvzJTrmY1ijq5P0nwWcQLdVLEKEwcaVF+kZrXX46TImxJBnDuULrkpg6dBzCG7kOinwIlDasleh1O7d4syXi6RG8miGTwVugPduihqQkmXSOhijs2Ud3m7NYngi83o5ozZLGcrlCIAjb9RexJUsSYFYkVSkVZJdkuy/9Er0xbKFAsCPl++Kelz9agng+e5EONsPogfPpBi3+bv+0ebCLrThPv+bl2oJonCzA1pmYQDW6+hdve7IkDMAnvVTbZuGvcU8hM/VDIvIw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hcYs0QEmIQjtW31Ip8FmdLDJEG/PKxXN17IYk4CUaK0=; b=nv5cGQDBikwysRNioQo3EeXZHSB2/+wEwSjMhiL8BY1psC74FOavYVqoLtMrsBSnKx5GwtmFXgMpMJmEMO2nBkCqzE6j/qVBu+aLkkPxGerN+CLqsFacmdMzgt1Xn3w1nrGGFvbOWMrJmaBoDPWXc6wCp68yMm+E+uvJBEirskg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB5121.eurprd04.prod.outlook.com (2603:10a6:208:c1::16) by VI1PR04MB4813.eurprd04.prod.outlook.com (2603:10a6:803:51::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Tue, 3 May 2022 11:57:49 +0000 Received: from AM0PR04MB5121.eurprd04.prod.outlook.com ([fe80::d42:c23c:780e:78eb]) by AM0PR04MB5121.eurprd04.prod.outlook.com ([fe80::d42:c23c:780e:78eb%4]) with mapi id 15.20.5206.024; Tue, 3 May 2022 11:57:49 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Paolo Abeni , Eric Dumazet , Florian Fainelli , Vivien Didelot , Andrew Lunn , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Xiaoliang Yang , Colin Foster Subject: [PATCH net 0/6] Ocelot VCAP fixes Date: Tue, 3 May 2022 14:57:22 +0300 Message-Id: <20220503115728.834457-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: VI1P190CA0009.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::22) To AM0PR04MB5121.eurprd04.prod.outlook.com (2603:10a6:208:c1::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06a3c2d3-28cf-4653-9d7a-08da2cfc24a4 X-MS-TrafficTypeDiagnostic: VI1PR04MB4813:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dsXZf7d5XY4OO5Zy9b8GnlAzmnUJWGchT44y8McQ/8eaujdf/sZ6hVU0uoWgUDWWK40x2pGoxnwkQfT80TcM3xbfU0iue6b74ozeRipGQPgSvyoNm9ymVtu6T9x337YgNs35egPPO9eZdxxkRdDnsSJbKLAFHOJZ8c4+XLVXJfb9lQ74QqFfdc3b9fvVqZ2oVJ5M8miiNAo7PalBmGWKL4U9J2CZy7Oz7EhcuPuUnUMYmSbaeitjs2iGpcxAoaCR3oTM5o2zvLQUNLUfStC1NHy+oH90UIo5QkczWnmKkgch/b3/7qRFzUz64YQjtvXN/edc5hWsU701dJV5jsjfpSsjRONj7Oj1yLXJGpYNuBoBpL0kLLzr3D4yT58ECuAhfO1+HzqWiEeLl3/mV2TsFcj+QvnobBi1FlibuFub9Nk2BHzYi6Ia3+hoiXYo8FUmbHf0ckzld4hGTm5J83p+LRtBSf/3zX+FxbgzyQPYOyg9Sb+PqdMTPwPcjaWfffq9GORe1+OSpgrtqN5vJayP0B1z1CLlNQY1+Kjr4Btyz9qeJ6eIgI82xo36UyrVo2WGEMeWlgn8Z3xn2DY3173XnEoULDPzgoxKSDTEVnfcXHGqPevIQhBskKJrnRWtnmTvRXYl1Q9iawWew4lJSStwGZ6viwMZvE1okulMSn0hEkzEziW8xZqvzWzjB4zlHDKHS0XQyp+pEuPYmQn8sW3yjA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5121.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(44832011)(8936002)(2906002)(8676002)(66476007)(4326008)(1076003)(2616005)(186003)(508600001)(5660300002)(66556008)(7416002)(6506007)(6512007)(6666004)(36756003)(86362001)(52116002)(83380400001)(26005)(38350700002)(38100700002)(6916009)(54906003)(6486002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wf9hyIiqP9A7dFcFtbbwrBhgiuX8FN+4jq1dzLYM4BgbeiVhd2Yf/mT1QrULDDYm85UfglSM1HbT3LnjNozpgyCa5lQ9rXvOhuVxfTj7itbCHqMopy4qAN3CK4GjEWwgI8YRqeupPModrp22mqi8V84mH28WC7aMPIEeo2fJzykm/J3y9C733sNwe7OILW24+t2RR4frmfacpx867j8Cp/bSJe2wx/Pzy/juGin3m1lRmuPnskleT7JnehB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eldagWlpHeJYrYWOYBf5h2MBGCXxclgfVFQNsknhwhFD1i91od2gpodowuB+Gkxl/1y4A+1qGWOD3ZXJkPMPvWvCO9RNo/RZhlyCajHkULdE1SnmtJDW2BNYPzEhMcxHBag1L56cAbrKxAI5pkyAEJCsp/h6RBLDGf4oDPmaXJAcVC06s0yNnqnVt5ava4vbBE5ZjlEGlzZtHfNnzdbUXCR/nvEKHEXASrSoU7dQT2ei+4l1zqAbbhqHKOZLaDh9ZhDU/FncQjYJQCEwbHbDjmEEeub7kwRS9yKe5WHKlBoe5pfEQNmzc5Kz0VmVd0n+Up9Fd5TqdCGQRR9RTeIAQRKKyd6CU0yVczuRBzCGVK1lrnZfI1xboCncxpL/N0c+S4mZR8CYVp5ugLbXHStHxLMHUN/tv+/sNc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06a3c2d3-28cf-4653-9d7a-08da2cfc24a4 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5121.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2022 11:57:48.8869 (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: qHDu2bHDp4z4tisqxUEq0tVsxBr0QCjf8i0Sd9TSINeKl4DXdgo0QocTFuOZQC+ipChnngRyl/wRyHE0s4VctQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4813 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This series fixes issues found while running tools/testing/selftests/net/forwarding/tc_actions.sh on the ocelot switch: - NULL pointer dereference when failing to offload a filter - NULL pointer dereference after deleting a trap - filters still having effect after being deleted - dropped packets still being seen by software - statistics counters showing double the amount of hits - statistics counters showing inexistent hits - invalid configurations not rejected Vladimir Oltean (6): net: mscc: ocelot: don't use list_empty() on non-initialized list element net: mscc: ocelot: avoid use after free with deleted tc-trap rules net: mscc: ocelot: fix last VCAP IS1/IS2 filter persisting in hardware when deleted net: mscc: ocelot: fix VCAP IS2 filters matching on both lookups net: mscc: ocelot: restrict tc-trap actions to VCAP IS2 lookup 0 net: mscc: ocelot: avoid corrupting hardware counters when moving VCAP filters drivers/net/ethernet/mscc/ocelot_flower.c | 10 ++++++++-- drivers/net/ethernet/mscc/ocelot_vcap.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-)