From patchwork Sat Apr 22 01:47:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1772206 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=d38g9NMs; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q3DmY5sb8z23tr for ; Sat, 22 Apr 2023 11:47:41 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pq2Lf-0002BK-Fb; Sat, 22 Apr 2023 01:47:35 +0000 Received: from mail-co1nam11on2057.outbound.protection.outlook.com ([40.107.220.57] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pq2Lb-00028Y-1x for kernel-team@lists.ubuntu.com; Sat, 22 Apr 2023 01:47:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h6mu7WSDKmWIrodVtO6R8WsGtLNS9oGjSdR0MBAq/NQUp9db14fU5EinrWJY2bVNnjoP6kmKMNy3vSwyqlth3+Q85O8tFxX5YUUJZJKfLk9ak2tSx7KPY0kStUs1RUP1rGMOi1i2+0SpYv9Tg+ix0rtNytDx9+nIplMRPHYDlw0dErcCAp/SW778XovUxV7G8x1y2ImS7l/5u9ck6y1PpNH2fedz0uISw6W9z68AGAeu+ENGcn/RKb4tH0XXwhxKW/+npfw1u3qQuxFkoIpcp4sWHiaaC+NYJFznkzr41yEDMH3VVqBkKDwYXCe/2wb0pytnEV4yvNa6r1VMyCkOtA== 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=NaqVoYWDVi8d7qKal00iQiOE1T3gmVm6EvPydEi7Jaw=; b=O+jdOz5635m8Gw1oOC/lOr9XbJqMftDXCIOs54Plj/i+62wBAcOohjRFYvSvtGQQQNTZzA5buXddz7r+YJCCedilTkvn8Lwbst0lUthTuNsPMYCSXvbE/+hCjWHbOG/6l9TL29Jw7cWXp3vy/0L9syEFj/G8zKqC8deHb4vWdFoXHxXRLfmbqvhH3J/h3BWlHRJvG+rt190/0q1BLqzC9OCB12T7kl5KzhEAEhMQYb078bAP/73Nb7v1rZ93Og75J6jAIAK6leqaC0Mf4Phyik6epe5RJl9IeajqK1umPEyFLWWkXvfJbw35n2F6d5yQocockOwk6nC4PCjTplPrlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NaqVoYWDVi8d7qKal00iQiOE1T3gmVm6EvPydEi7Jaw=; b=d38g9NMscLXWoFvyy6+zdG+Yse3nZnUqOyBsXUHvL/xlhM6Yj4+BHdEbQ6Sz94Lx+Zx/VVVA6c3lkCKK+uhb29m25+0dcLDbB3n5VmFTL97F9B4HBcUXu87fpJwUrz3hBk9KZ7KiOqgDqtHeCFG4Fhn9DzkwxG3ibLlEpXvrbxClmfGsGtqgxABdyAP9KX7rTpIz5N86YNB7HMsmqxQwH7neBMf0mXiiXND76/bIi8pobNv/nNa7gepQZDP7qrQopyAWlNoYqE72ky8Zc9QJs6QC9uNltrbHpuPyRN2ytnu6N9GxxDE0xPuL8eblONitLaN+SUSb8wnWdgWw9HT3EQ== Received: from MN2PR20CA0064.namprd20.prod.outlook.com (2603:10b6:208:235::33) by SN7PR12MB7324.namprd12.prod.outlook.com (2603:10b6:806:29b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sat, 22 Apr 2023 01:47:28 +0000 Received: from BL02EPF0000C402.namprd05.prod.outlook.com (2603:10b6:208:235:cafe::ef) by MN2PR20CA0064.outlook.office365.com (2603:10b6:208:235::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Sat, 22 Apr 2023 01:47:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL02EPF0000C402.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.15 via Frontend Transport; Sat, 22 Apr 2023 01:47:27 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 18:47:13 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 18:47:13 -0700 Received: from mtl123.mtl.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 18:47:12 -0700 Received: from sw-mtx-002.mtx.labs.mlnx (sw-mtx-002.mtx.labs.mlnx [10.9.151.106]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 33M1l76S008750; Sat, 22 Apr 2023 04:47:09 +0300 From: William Tu To: Subject: [SRU][F:linux-bluefield][PATCH v1 1/5] Revert "net/sched: flower: fix fl_change() error recovery path" Date: Sat, 22 Apr 2023 04:47:02 +0300 Message-ID: <20230422014706.594733-2-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230422014706.594733-1-witu@nvidia.com> References: <20230422014706.594733-1-witu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000C402:EE_|SN7PR12MB7324:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d9676ef-a2a4-4e01-c401-08db42d38736 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PiHYT5E72a86ZlchJ7YJXboPMdbxIbCvILCw6B1SfpQdFsjJc1rgkUVOnCGVa7fpmB7lxOA/3K8aWnD8t+yFXzoNNx+Jnrd079oWIkHbt/keCLNaOyo1M/x1U6ryghgzUngL3RYG1Qm/TDX1HB+2JS8zLD5kFsU6pHVo8gUvs/UxDSQ43QaHL8nhLymg2nygGG9Wsfg9Tae1rCUBgieVnxSlJigWFRMzS/OIbk6+RlZPDr+LbkXQOcg0sCMKrT7faHJJKDUQFtCykgIDPuZpiee5BkCeUB4kRv6+e8vEQqbwtLV4VSYzGSW6zuTDJHhe3+BzSDmtbE3CzuJh+aL1Gg4W/eJmr47FdT+CTuqJb4LdKa1HxvkfvVuaYUuX8SDlh3Box7JR8Arq4/GoyV4usTVP2ZM97QU4xaBK1kI6rziiGbvK+S/SRlTjf3UJS7dWWIVqzlGzHJNCiSp0+Mu4dDyukcIO04UVdPXme6v+SE+Iv93vTAGQqeFY+Q1Ex9cngdyvz6QR+WyIInahnSa8iZ9vQTpasHktKMB0B+vs3b8U8REf84gSxNTm4IJW99AxE+Q7ovEa+WmZ98bI4l6q3x52j1Le/WmhE+YEagBTLCNN7cj6JzYAzFQb03drgOnV1ccodiBVaIpsvLhHZukeTISUP2/15K8YPsgcjbNeBlpCMtAfKrisdOyicpmbs/0lOwfV98G1e0qrncRV2wLHlrYU9qH7+E/six5FeGL9sKjxh3DwpS4fMFv+EisDKumj X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(376002)(346002)(136003)(396003)(451199021)(46966006)(40470700004)(36840700001)(5660300002)(70206006)(70586007)(6916009)(2906002)(4744005)(8936002)(316002)(4326008)(8676002)(41300700001)(54906003)(83380400001)(478600001)(40460700003)(6666004)(26005)(356005)(186003)(7636003)(107886003)(40480700001)(36860700001)(36756003)(2616005)(1076003)(47076005)(82310400005)(336012)(82740400003)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2023 01:47:27.5228 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d9676ef-a2a4-4e01-c401-08db42d38736 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000C402.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7324 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dann.frazier@canonical.com, paulb@nvidia.com, vlad@nvidia.com, yifeid@nvidia.com, bodong@nvidia.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This reverts commit 635ef758926c0acdb84cb96cd3b36554b3e7558d. --- net/sched/cls_flower.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index c347861dfcc1..2431456a58cd 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -1841,9 +1841,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, fnew->flags = nla_get_u32(tb[TCA_FLOWER_FLAGS]); if (!tc_flags_valid(fnew->flags)) { - kfree(fnew); err = -EINVAL; - goto errout_tb; + goto errout; } } @@ -1868,10 +1867,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, } spin_unlock(&tp->lock); - if (err) { - kfree(fnew); - goto errout_tb; - } + if (err) + goto errout; } fnew->handle = handle; @@ -1980,6 +1977,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, fl_mask_put(head, fnew->mask); errout_idr: idr_remove(&head->handle_idr, fnew->handle); +errout: __fl_put(fnew); errout_tb: kfree(tb); From patchwork Sat Apr 22 01:47:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1772204 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=CozowRf8; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q3DmY3jWGz23s0 for ; Sat, 22 Apr 2023 11:47:40 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pq2LZ-00028H-Rn; Sat, 22 Apr 2023 01:47:29 +0000 Received: from mail-dm6nam10on2089.outbound.protection.outlook.com ([40.107.93.89] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pq2LW-00027u-QK for kernel-team@lists.ubuntu.com; Sat, 22 Apr 2023 01:47:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbzAgSOcTll9NUidBAckoukC23sQzzt/0OBBK722hCH4bMPowYBZG2CP/s8efah/jIfi9iHxpVefqz87uaa4k0jMrkSu0UA0Ac8m5VOLYSFsuVVEhU0k9nuGAG6HyHa745LBxKdvfndWbwdZaIZYF1MefAsdzLKB2DtSKVdDPHeLlORbDUtjPIKQiW1OKEeE57CvSJ3BiNnJjDi7E69LMhJgTDurg7WBZsDBTajsGyGds1tguBlhXN4KHpt2XK5CKaWacLlhqb2QMLwHAoAnbF/c10XGmik4YU0yrqZsUIJtfjqan0SwQGXYAgYv8rgYFB4ebP8eDgh9zFED/L30ow== 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=Zl7gUu8PLKbftdqO9cs1xf+9YpD8UVVu8EJ0f/dkC7c=; b=dvF2EN2ZuzGWHzaxKuGTQZ7vZnsPz7Xfmz1Ribwspm/EIRmoRWxUJf0LyDxG1h8sFi03E/M/yXnjgztcZoJCc/vsQOPFxBI8/daq41Or0RNcmJrSgyDdaiqOMhgidvvaxfNnn7UdRwK/vMXEu3fCT7W95ujxh7V6sRUeFRaxKH6B94mJiBpulc3eQ+8J+kJLIJGK5NXouQwgK8ktxfOwOJONbYJ/tSn0ReJScEJHE9MRB1ibSUOVJfaAAIBoOx6RrL5m90rqzc4PMEix+wJeKO+DiEWyzOkrmrZQscEgNK4V+jE/PPpeYhx2hHlEDiH8WhHtIde8Pr152szDSFE6bA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zl7gUu8PLKbftdqO9cs1xf+9YpD8UVVu8EJ0f/dkC7c=; b=CozowRf8lP9kHalsLWmvXFr0OFgprOJ8jUdtrGMMcStfurhDPUrV+ULPvL37+BAK5t+EbjE6Ou4Bjr0Dl548LBnbiIeaaD2HAR4ToqFXEmGcFXWJqqHrti7AWr3LTCCegT/j3Li1ds/XUFlCJlLYgSm3d4VG9pzJ3HEM1j+D5ijjabw0yV0qRt4Nb0p/016TB/ETQQQ5L8MYwyY90CsSnODhsXteJuHczGC614/6yM2YMPj5cw+WruN0y2XlA+PVwjA/weJH+aBs+sFdKpxofNMeWT3BP4QL5pYG6pXOy/+GONYhfVri5R8QEPDS3nQQNdtFswuTrl3yowCOpBU58A== Received: from DS0PR17CA0011.namprd17.prod.outlook.com (2603:10b6:8:191::13) by DM4PR12MB5070.namprd12.prod.outlook.com (2603:10b6:5:389::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sat, 22 Apr 2023 01:47:24 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:8:191:cafe::13) by DS0PR17CA0011.outlook.office365.com (2603:10b6:8:191::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.25 via Frontend Transport; Sat, 22 Apr 2023 01:47:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.16 via Frontend Transport; Sat, 22 Apr 2023 01:47:24 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 18:47:15 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 18:47:14 -0700 Received: from mtl123.mtl.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 18:47:14 -0700 Received: from sw-mtx-002.mtx.labs.mlnx (sw-mtx-002.mtx.labs.mlnx [10.9.151.106]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 33M1l76T008750; Sat, 22 Apr 2023 04:47:11 +0300 From: William Tu To: Subject: [SRU][F:linux-bluefield][PATCH v1 2/5] Revert "net/sched: flower: Support hardware miss to tc action" Date: Sat, 22 Apr 2023 04:47:03 +0300 Message-ID: <20230422014706.594733-3-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230422014706.594733-1-witu@nvidia.com> References: <20230422014706.594733-1-witu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT024:EE_|DM4PR12MB5070:EE_ X-MS-Office365-Filtering-Correlation-Id: 197092c2-7620-4a07-b888-08db42d38527 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WO0WrN0ifGR81zCFmxNu0Qq9nkvl6Rj3Ese1nXB2y2CoRO4799ocSh2d24pdTuaUCBwz0bUoaoYYrhKA38MgYwr+0qijcrNRd08wQEu5fXXLdTxhFlI3WUCUHbZABF9zskJ9kRQ2Nyk5+2lCg2D2c38sjnnB3NVo2J3G/TAnAhgMgg004WLX0v4oxAEWL6k28cdeFPE2Uyj9PHNTzaSM2Rg8serzHhq/DBVQHz7wWyXaXVM7RTehmkn0jAoCvvxqfnGriaMVbHLF5DQr/gbjtgNzBCBnFKdxFkFbVE1n0Hv4bnaZAQ46rqexaWDBVSvOaEldt2tOLyOZMXD0PIDGUxSrao4u/c4AUH8Pe1qzx73KlZWK69/hjx9+oXxWwARYVgM3znBVNdlqRghy0qeIj8+mH1EPnyFGFOQeJn9NwVY6L75E6T9jIO/VK2Imyvniiyz7rtgj4M8tNVdIu1nMC5GgHBL8giRHGrJFVTIWQfjd5PerYhoFqDy6Abs2IY4U18yDtnE8RAIlpFYT8x5noY/tjCrDFN9T7FR+DNZUTBVHHvwU/MNoBdR+ZYoHuxFBFOcJHKzV34YsvNZWoZirjSrvp0EElH93b/Nk1SOWU7ZBEOE6aUiWYRlWll0IK0LxgnKCJKjYvxOhD+J8PNKp4DdQc6sdMmfE7ixYvR68RD91hDMbIvPVPZCojyjwiuv7PKSjC6OdB7r4UtEOyL7bQrlYHvdjJN7FpfaV0TgD2rkTTFLzvYdGQlZBL+ANb3eo7s8lb5ZYEOHFsmeacfispDLfVO7CMWKGLQd4YcmOmH4= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(40470700004)(46966006)(36840700001)(26005)(186003)(1076003)(107886003)(41300700001)(6666004)(336012)(47076005)(83380400001)(36860700001)(2616005)(70206006)(478600001)(40460700003)(34020700004)(70586007)(6916009)(4326008)(82310400005)(356005)(40480700001)(82740400003)(7636003)(5660300002)(54906003)(8936002)(8676002)(2906002)(86362001)(36756003)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2023 01:47:24.1156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 197092c2-7620-4a07-b888-08db42d38527 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5070 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dann.frazier@canonical.com, paulb@nvidia.com, vlad@nvidia.com, yifeid@nvidia.com, bodong@nvidia.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This reverts commit 85ec3adff4d54fefe9982025d591880b6bcfda83. --- net/sched/cls_flower.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 2431456a58cd..3ef5206cbcbb 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -532,15 +532,6 @@ static struct cls_fl_filter *__fl_get(struct cls_fl_head *head, u32 handle) return f; } -static struct tcf_exts *fl_get_exts(const struct tcf_proto *tp, u32 handle) -{ - struct cls_fl_head *head = rcu_dereference_bh(tp->root); - struct cls_fl_filter *f; - - f = idr_find(&head->handle_idr, handle); - return f ? &f->exts : NULL; -} - static int __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f, bool *last, bool rtnl_held, struct netlink_ext_ack *extack) @@ -1872,8 +1863,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, } fnew->handle = handle; - err = tcf_exts_init_ex(&fnew->exts, net, TCA_FLOWER_ACT, 0, tp, handle, - !tc_skip_hw(fnew->flags)); + err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0); if (err < 0) goto errout_idr; @@ -2899,7 +2889,6 @@ static struct tcf_proto_ops cls_fl_ops __read_mostly = { .tmplt_create = fl_tmplt_create, .tmplt_destroy = fl_tmplt_destroy, .tmplt_dump = fl_tmplt_dump, - .get_exts = fl_get_exts, .owner = THIS_MODULE, .flags = TCF_PROTO_OPS_DOIT_UNLOCKED, }; From patchwork Sat Apr 22 01:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1772205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=hUfIOI3d; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q3DmY6TZlz23ts for ; Sat, 22 Apr 2023 11:47:41 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pq2Lf-0002Aw-7Q; Sat, 22 Apr 2023 01:47:35 +0000 Received: from mail-dm6nam12on2084.outbound.protection.outlook.com ([40.107.243.84] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pq2Lb-00028u-FE for kernel-team@lists.ubuntu.com; Sat, 22 Apr 2023 01:47:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZ6Nv0CCF1/67U3yFC9mOS0uqFXtEtxmsxk1TcNGqC2aLDjZ5Q5871KhlCiWsfXueoUXO6bkmxy53wSYbqgoHCScJdPeVfExoqFv3eDOH26geE5wpcyqQQwcfHorKhtu+JoeQEBiqkoPtvde3QRxyCGjJJDofO3K2eZfe1rKd172A6dkh/8bKxUUenzFxj7HHPaQOuxLpCouw52S8WCfXpysXkirglj1GFKnezQNl/HI6QujMJOrcssgVfLA8ki67uUEtWf/JV+yjc8zevJMGNEtlOzyt8Y7tT5Gd5dv2m5bRSVeDByS+Q9yr5pX++QFuKka+HGpdJoqwgpqsByvtw== 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=k4alRp6LTVBaOnbhuFSLKNFtsJw5C3UcbRl0NvVQ/Cc=; b=KUvIxw4LM/FCPPTfplU8yqzBjSJqXVvDnoaawaT85U/9LtPEaTNQo+VuBkygkNDc3EYF6iqn8oK5Og0fO2eMezteHdADKiZKi0hVLQM/XswxD2wGr5XsLqwBr1jQ9NBz4KipqOhZmV4p/aGgO0ElLa7MOxjpGeGbI0e+lnzQo7BAfkDrkRJDpx0qfShkws6odlqGogkUzv+N+ocJ20wt2alADLIRV/fMF/H5B8J76ogRHhaqwMfBiOfIzm/01PbVzki8EpdVd3MXjNGtySp2IFigL7O0akYXZIQpJI3q2ZZhzbT7070OKnHvEMCm0aszz7ZpZnrrH8/QXVUImo03qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k4alRp6LTVBaOnbhuFSLKNFtsJw5C3UcbRl0NvVQ/Cc=; b=hUfIOI3duF3nzgr3K/l1bFbfO49aypKkt3KZlHxPPiNAMch+DeA1ucbJ0dABQZoE4XVmkxHRuJE6DbrorCCsAzPtZ22Ne2jMpRJiPX8uY7ZjqsIsRkCYxlxcFdi4NtOCfXCSPK+j6ersEn+U0Tva4tf/GipQnt6RukxH1YvvaxWlXVfR1vD5x5J+Fnh4LoZC8YJMOrr8DIPACMNshtpW9lwBGNYX0pa9ac7va1Y6HKCH/vt5ULUb9g+AgzzYWxWGL6ZjbjpwxYCPYUC4E8BWKej6PFcIO1MuqFS631FhbAXITsJVzLOFdJPW2lJm1eFSR7iClXuwXlXQVdWsF4ON8g== Received: from DM6PR02CA0112.namprd02.prod.outlook.com (2603:10b6:5:1b4::14) by CY8PR12MB7121.namprd12.prod.outlook.com (2603:10b6:930:62::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sat, 22 Apr 2023 01:47:27 +0000 Received: from DM6NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b4:cafe::37) by DM6PR02CA0112.outlook.office365.com (2603:10b6:5:1b4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.25 via Frontend Transport; Sat, 22 Apr 2023 01:47:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT071.mail.protection.outlook.com (10.13.173.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Sat, 22 Apr 2023 01:47:27 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 18:47:17 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 18:47:17 -0700 Received: from mtl123.mtl.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 18:47:16 -0700 Received: from sw-mtx-002.mtx.labs.mlnx (sw-mtx-002.mtx.labs.mlnx [10.9.151.106]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 33M1l76U008750; Sat, 22 Apr 2023 04:47:13 +0300 From: William Tu To: Subject: [SRU][F:linux-bluefield][PATCH v1 3/5] Revert "net/sched: flower: Move filter handle initialization earlier" Date: Sat, 22 Apr 2023 04:47:04 +0300 Message-ID: <20230422014706.594733-4-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230422014706.594733-1-witu@nvidia.com> References: <20230422014706.594733-1-witu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT071:EE_|CY8PR12MB7121:EE_ X-MS-Office365-Filtering-Correlation-Id: 81bb975c-f0fc-40b1-b548-08db42d386e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kGpPf2F6heM44tRyHaRHtKIsgPYAT7jYH+gGX/+4qxIGvo/9kiZIY+ZlJgOxJ6AENlHyK5IJH1SN6GM0QjN4d7VsCpBrjB/7+A4HTct1WXNV9edJxW5ZDmUufgrJQp+ZEAseQ951OeE5ZtrQVGF30uzxVtbhx6LhM/wndFKfvEzgkKe6s1gd2EEnOrn/Woqh9bOrvkP6VVBjZUB4FSn/HoMqKQP9b8Xv5n7pUXl/ndaskzBl5sCboMcrfZaZjMSCWIQt8Ky/c0oDrgyBUzNvOpUMQQN57+TJP4aj6Qgvl7bZ9dhOLX5Uo4QAEweq7FZ3uwmSpsOP1vgCfxMN2o3HshxL2Oha8Xd/GY/LzCEuWbVfd9LxlHBlVbK+B+U/as+ocWWHn6UVk3d2EcNdyJID131Emmp7wk6cAhqsqyCi04e7GaKe9cUm1BQHiEvUf9N6klb2rExL9O1CqzPXnSQ6NQGZcI+6dKPhrZLNytpgkkQdTztLQJl7MHuRoP8zXNFtoomhJaoPYGX99kJ/VqrJfclXBOzVOB6Hd4UKMYYgp3io1jZmihedUlFDg66dl2EKaJfDlFTuJWlO02rAwoAKpuzXVRQLHex6tlRykfKO+TAXH6CTu4OfMIUUkYQoZUsmO8sat6y9sjYzJXEGpcEdVXSNfxOPE8rEI2bvu5f0Lf2mlyGm0j9BsMp08mU/bfdUw6wXM556jSP9RtQkq0H/jpvXolIzDRyq7hpEoYf/QN/q0CSvJQQCirNadbNyQR8xu7S+u3QJA4SPc4QftX31pDoLsO4FKdwhU+TbzYACmpM= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(186003)(26005)(1076003)(6666004)(107886003)(40480700001)(5660300002)(41300700001)(47076005)(2616005)(336012)(70586007)(70206006)(6916009)(4326008)(8676002)(8936002)(54906003)(478600001)(82740400003)(2906002)(316002)(86362001)(36756003)(83380400001)(40460700003)(36860700001)(7636003)(34020700004)(356005)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2023 01:47:27.0122 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81bb975c-f0fc-40b1-b548-08db42d386e1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7121 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dann.frazier@canonical.com, paulb@nvidia.com, vlad@nvidia.com, yifeid@nvidia.com, bodong@nvidia.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This reverts commit 0e6ec758d0354671ddd40e4f254e96bcf159aad2. --- net/sched/cls_flower.c | 62 ++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 3ef5206cbcbb..f47ae62b7215 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -1828,6 +1828,10 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, INIT_LIST_HEAD(&fnew->hw_list); refcount_set(&fnew->refcnt, 1); + err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0); + if (err < 0) + goto errout; + if (tb[TCA_FLOWER_FLAGS]) { fnew->flags = nla_get_u32(tb[TCA_FLOWER_FLAGS]); @@ -1837,44 +1841,14 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, } } - if (!fold) { - spin_lock(&tp->lock); - if (!handle) { - handle = 1; - err = idr_alloc_u32(&head->handle_idr, fnew, &handle, - INT_MAX, GFP_ATOMIC); - } else { - err = idr_alloc_u32(&head->handle_idr, fnew, &handle, - handle, GFP_ATOMIC); - - /* Filter with specified handle was concurrently - * inserted after initial check in cls_api. This is not - * necessarily an error if NLM_F_EXCL is not set in - * message flags. Returning EAGAIN will cause cls_api to - * try to update concurrently inserted rule. - */ - if (err == -ENOSPC) - err = -EAGAIN; - } - spin_unlock(&tp->lock); - - if (err) - goto errout; - } - fnew->handle = handle; - - err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0); - if (err < 0) - goto errout_idr; - err = fl_set_parms(net, tp, fnew, mask, base, tb, tca[TCA_RATE], ovr, tp->chain->tmplt_priv, rtnl_held, extack); if (err) - goto errout_idr; + goto errout; err = fl_check_assign_mask(head, fnew, fold, mask); if (err) - goto errout_idr; + goto errout; err = fl_ht_insert_unique(fnew, fold, &in_ht); if (err) @@ -1940,9 +1914,29 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, refcount_dec(&fold->refcnt); __fl_put(fold); } else { - idr_replace(&head->handle_idr, fnew, fnew->handle); + if (handle) { + /* user specifies a handle and it doesn't exist */ + err = idr_alloc_u32(&head->handle_idr, fnew, &handle, + handle, GFP_ATOMIC); + + /* Filter with specified handle was concurrently + * inserted after initial check in cls_api. This is not + * necessarily an error if NLM_F_EXCL is not set in + * message flags. Returning EAGAIN will cause cls_api to + * try to update concurrently inserted rule. + */ + if (err == -ENOSPC) + err = -EAGAIN; + } else { + handle = 1; + err = idr_alloc_u32(&head->handle_idr, fnew, &handle, + INT_MAX, GFP_ATOMIC); + } + if (err) + goto errout_hw; refcount_inc(&fnew->refcnt); + fnew->handle = handle; list_add_tail_rcu(&fnew->list, &fnew->mask->filters); spin_unlock(&tp->lock); } @@ -1965,8 +1959,6 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, fnew->mask->filter_ht_params); errout_mask: fl_mask_put(head, fnew->mask); -errout_idr: - idr_remove(&head->handle_idr, fnew->handle); errout: __fl_put(fnew); errout_tb: From patchwork Sat Apr 22 01:47:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1772209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=fF39WlPM; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q3Dml3YPTz23s0 for ; Sat, 22 Apr 2023 11:47:51 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pq2Lp-0002N8-8p; Sat, 22 Apr 2023 01:47:45 +0000 Received: from mail-dm3nam02on2074.outbound.protection.outlook.com ([40.107.95.74] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pq2Lj-0002Fl-8W for kernel-team@lists.ubuntu.com; Sat, 22 Apr 2023 01:47:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hcC/5/xRGDSzNoTFaDVjy8oaXvu38bj4UzSpF9ezSYSUTy6T7YqJZheIh4N3ORsEorkEc4pkzxgYV+wQQMLmfaNaQEAB5Ymmx+QGCXAi6aPCWM1u3uq3xPusSCgQURQbMuhP5QDw2SkMWMn9/fKwXsaNtFWsLixqW9FtghFKWofks+ZQgGD5MAtIu+EDFU9xKHZyNPgqZht4S8amJ/jlvjVn6eZph8YiGyz9dhOzmXHTG3Qbd5pshcRXmm+hykdjNXzAwGWpp6MiWFbrwPOon8c0H9wt9zB9Yur53BNwETp5iH0KJ06CSDejpF/NXHnDJPe8w27IZyodhee/4jmTKA== 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=3uC93Mli80kfO7WkIF/kHVLk3+0DC7f/P/3JDxZS2oo=; b=BCMQqNasRuqbrjGgLNVhUGPcBRPzBoaS/WyXob3WXJsHW0j6NanCjix+QLhNKHZj6KEYqro+MHG+41+Ao5eMUFxh9IQHSsSo5ZIZvVjNdIuJYyw52+pHOXkiilhhvRb+gszYor4FFX9lD5u9f1LgGjfzwsfHg1/p2aOtdIShO2jnbQZ4wKuIyKJrfolwPI3LMGGjXapus8305hfHHamm3Zj3xFue98JrBD1qoRsNsULjiikIgIzkmsreDQS+TUmKt8nkn/8Mrn7ZWB0X8oBVFedwhdmad00vn3zohRBmtRRoiTgCCn7tiR8ozKZfiIYnIo9F+DE+IR5y7m4Hy0+j5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3uC93Mli80kfO7WkIF/kHVLk3+0DC7f/P/3JDxZS2oo=; b=fF39WlPM9Ri0K8E1EVf18cPOGjgOPHfp2FoZ8t2vg+Osrac/YJWd1qy/rDLSW2q/A3Mwl1fJ/TUrkI4StR2m/tEV5Zsj87X5egYkiWSsrdGtQN8wNk7xwIOG2teEQbYiCJYgSibeFh2EBhaInVKO5gXWbBXWDpXuG1/F1LHr+eetli+7SjMhL8u2u/B/9zrdeBe7QSYnqEyK2aaKR4OGfZ12DGdVgfht4LT5FpmDrAzCU3HPhCPQf09wxvYQn5PfRzl6ubB03EzRBoaeChg6yxJACjI82CDvauPLcZDlfvmqWXCsTlrU8UjbrAHTE3G8PXKs4es1ZYrwYrWjnAk9zA== Received: from MW4PR04CA0037.namprd04.prod.outlook.com (2603:10b6:303:6a::12) by SA0PR12MB7076.namprd12.prod.outlook.com (2603:10b6:806:2d5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sat, 22 Apr 2023 01:47:36 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6a:cafe::fc) by MW4PR04CA0037.outlook.office365.com (2603:10b6:303:6a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.27 via Frontend Transport; Sat, 22 Apr 2023 01:47:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.26 via Frontend Transport; Sat, 22 Apr 2023 01:47:35 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 18:47:18 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 18:47:18 -0700 Received: from mtl123.mtl.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 18:47:18 -0700 Received: from sw-mtx-002.mtx.labs.mlnx (sw-mtx-002.mtx.labs.mlnx [10.9.151.106]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 33M1l76V008750; Sat, 22 Apr 2023 04:47:15 +0300 From: William Tu To: Subject: [SRU][F:linux-bluefield][PATCH v1 4/5] Revert "net/sched: cls_api: Support hardware miss to tc action" Date: Sat, 22 Apr 2023 04:47:05 +0300 Message-ID: <20230422014706.594733-5-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230422014706.594733-1-witu@nvidia.com> References: <20230422014706.594733-1-witu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT053:EE_|SA0PR12MB7076:EE_ X-MS-Office365-Filtering-Correlation-Id: af3e5186-7e4c-433a-071d-08db42d38c19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LksR5yTOH99VV4Bsiz5OhlhMOu5HPR612DZO9lf4tNQ5VkXYBkelUMyYvU/tuBWvtnzL8aiNxhYqwBOLpDKhwKXo6+HYiq0pbOol6QuHra/eOUKvsQ7GtM6SFDDhEj2Mt8bn5UjAK2HwkkIfVkmNhcyBVkI3zWr+UGA1YZVd7fYMNc3rHHufJDPHSa6wxUSl71Z6ArfhTpEfqdUNjx14aJ4pf1Pxn1xR6L2EOZ5SAFNXEkpFm+cGXZH8B+x+kG16qJFY2YnmVB2bwVsanTN4oNE7EaGCOTOZM0o5QQ8jEOCpVOQaqywosxPIWjpUfseLy4dLNSMd4fmPDqd+iGglQQRIHPN6+1s8M7NE76Usdlo8Fg/7/H5Cf8tV0LQIOY1XeFnqXyY2Y5vHLQN1nN1RyUWNmXgaxCSmgIgjNL0sXA9wcYYZ4cCfotA2jOR2uXeVqaHYwEoiXBQhyBrsOobrn+uDocc0/oYvkYpvO6XNVnnHvS7m+8XR0SIRp6W3ZPIqwimv6K3Q7N/TQI6NJOQdIpRtDKeg/0zGndWGfA+qgbGOwXMmFgZ65Jlj0IwqnoQF9wFd6u+UGP61I1JX4kSGrn01ykxjSoCvT+BOg/PHAQquQcmp3TM3HbawF2pQ9vi/7i7CLf13Akv1CIyb2qkRU6wQN5YHjbxpDKU+kOXKYprsR1OiHAO1X1ZzyvOuy2R5n+fyysJYAj8a4svNEQOatPMBiDn/k3RS5a2YKrPt8h7kywpWzxqCMQ6XoWLYppo8rpo9T9MZiSGZjRUjG3jgr3NaO6wP5FYen5mwqXrkpXI= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(46966006)(36840700001)(40470700004)(82310400005)(40480700001)(36756003)(40460700003)(478600001)(54906003)(6666004)(34020700004)(41300700001)(8936002)(356005)(7636003)(8676002)(316002)(70586007)(4326008)(82740400003)(70206006)(6916009)(2616005)(36860700001)(47076005)(83380400001)(336012)(186003)(107886003)(26005)(1076003)(86362001)(30864003)(2906002)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2023 01:47:35.8259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af3e5186-7e4c-433a-071d-08db42d38c19 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7076 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dann.frazier@canonical.com, paulb@nvidia.com, vlad@nvidia.com, yifeid@nvidia.com, bodong@nvidia.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This reverts commit 636a658578ec6c6ae5019e678894840690146c70. --- include/linux/skbuff.h | 6 +- include/net/flow_offload.h | 1 - include/net/pkt_cls.h | 30 ++---- include/net/sch_generic.h | 2 - net/openvswitch/flow.c | 3 +- net/sched/cls_api.c | 216 ++----------------------------------- 6 files changed, 22 insertions(+), 236 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 3f71951b4206..e246a3f2df35 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -282,16 +282,12 @@ struct nf_bridge_info { * and read by ovs to recirc_id. */ struct tc_skb_ext { - union { - u64 act_miss_cookie; - __u32 chain; - }; + __u32 chain; __u16 mru; __u16 zone; u8 post_ct:1; u8 post_ct_snat:1; u8 post_ct_dnat:1; - u8 act_miss:1; /* Set if act_miss_cookie is used */ }; #endif diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 305de642e70f..d9e2e5d905ee 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -167,7 +167,6 @@ typedef void (*action_destr)(void *priv); struct flow_action_entry { enum flow_action_id id; void *act; - u64 miss_cookie; action_destr destructor; void *destructor_priv; union { diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 80ae50a248db..18e9373caad8 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -53,8 +53,6 @@ int tcf_block_get_ext(struct tcf_block **p_block, struct Qdisc *q, void tcf_block_put(struct tcf_block *block); void tcf_block_put_ext(struct tcf_block *block, struct Qdisc *q, struct tcf_block_ext_info *ei); -int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, - int police, struct tcf_proto *tp, u32 handle, bool used_action_miss); static inline bool tcf_block_shared(struct tcf_block *block) { @@ -199,7 +197,6 @@ struct tcf_exts { int nr_actions; struct tc_action **actions; struct net *net; - struct tcf_exts_miss_cookie_node *miss_cookie_node; #endif /* Map to export classifier specific extension TLV types to the * generic extensions API. Unsupported extensions must be set to 0. @@ -211,11 +208,18 @@ struct tcf_exts { static inline int tcf_exts_init(struct tcf_exts *exts, struct net *net, int action, int police) { -#ifdef CONFIG_NET_CLS - return tcf_exts_init_ex(exts, net, action, police, NULL, 0, false); -#else - return -EOPNOTSUPP; +#ifdef CONFIG_NET_CLS_ACT + exts->type = 0; + exts->nr_actions = 0; + exts->net = net; + exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *), + GFP_KERNEL); + if (!exts->actions) + return -ENOMEM; #endif + exts->action = action; + exts->police = police; + return 0; } /* Return false if the netns is being destroyed in cleanup_net(). Callers @@ -303,18 +307,6 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts, return TC_ACT_OK; } -static inline int -tcf_exts_exec_ex(struct sk_buff *skb, struct tcf_exts *exts, int act_index, - struct tcf_result *res) -{ -#ifdef CONFIG_NET_CLS_ACT - return tcf_action_exec(skb, exts->actions + act_index, - exts->nr_actions - act_index, res); -#else - return TC_ACT_OK; -#endif -} - int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, struct nlattr *rate_tlv, struct tcf_exts *exts, bool ovr, bool rtnl_held, diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 6551f0d828b6..ab534fade088 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -358,8 +358,6 @@ struct tcf_proto_ops { struct nlattr **tca, struct netlink_ext_ack *extack); void (*tmplt_destroy)(void *tmplt_priv); - struct tcf_exts * (*get_exts)(const struct tcf_proto *tp, - u32 handle); /* rtnetlink specific */ int (*dump)(struct net*, struct tcf_proto*, void *, diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 8fa3ce23ce71..c8b03cbef897 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -884,8 +884,7 @@ int ovs_flow_key_extract(const struct ip_tunnel_info *tun_info, #if IS_ENABLED(CONFIG_NET_TC_SKB_EXT) if (static_branch_unlikely(&tc_recirc_sharing_support)) { tc_ext = skb_ext_find(skb, TC_SKB_EXT); - key->recirc_id = tc_ext && !tc_ext->act_miss ? - tc_ext->chain : 0; + key->recirc_id = tc_ext ? tc_ext->chain : 0; OVS_CB(skb)->mru = tc_ext ? tc_ext->mru : 0; post_ct = tc_ext ? tc_ext->post_ct : false; post_ct_snat = post_ct ? tc_ext->post_ct_snat : false; diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 2be1c228e6cd..384a4d815849 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -50,109 +49,6 @@ static LIST_HEAD(tcf_proto_base); /* Protects list of registered TC modules. It is pure SMP lock. */ static DEFINE_RWLOCK(cls_mod_lock); -static struct xarray tcf_exts_miss_cookies_xa; -struct tcf_exts_miss_cookie_node { - const struct tcf_chain *chain; - const struct tcf_proto *tp; - const struct tcf_exts *exts; - u32 chain_index; - u32 tp_prio; - u32 handle; - u32 miss_cookie_base; - struct rcu_head rcu; -}; - -/* Each tc action entry cookie will be comprised of 32bit miss_cookie_base + - * action index in the exts tc actions array. - */ -union tcf_exts_miss_cookie { - struct { - u32 miss_cookie_base; - u32 act_index; - }; - u64 miss_cookie; -}; - -#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT) -static int -tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, - u32 handle) -{ - struct tcf_exts_miss_cookie_node *n; - static u32 next; - int err; - - if (WARN_ON(!handle || !tp->ops->get_exts)) - return -EINVAL; - - n = kzalloc(sizeof(*n), GFP_KERNEL); - if (!n) - return -ENOMEM; - - n->chain_index = tp->chain->index; - n->chain = tp->chain; - n->tp_prio = tp->prio; - n->tp = tp; - n->exts = exts; - n->handle = handle; - - err = xa_alloc_cyclic(&tcf_exts_miss_cookies_xa, &n->miss_cookie_base, - n, xa_limit_32b, &next, GFP_KERNEL); - if (err) - goto err_xa_alloc; - - exts->miss_cookie_node = n; - return 0; - -err_xa_alloc: - kfree(n); - return err; -} - -static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts) -{ - struct tcf_exts_miss_cookie_node *n; - - if (!exts->miss_cookie_node) - return; - - n = exts->miss_cookie_node; - xa_erase(&tcf_exts_miss_cookies_xa, n->miss_cookie_base); - kfree_rcu(n, rcu); -} - -static struct tcf_exts_miss_cookie_node * -tcf_exts_miss_cookie_lookup(u64 miss_cookie, int *act_index) -{ - union tcf_exts_miss_cookie mc = { .miss_cookie = miss_cookie, }; - - *act_index = mc.act_index; - return xa_load(&tcf_exts_miss_cookies_xa, mc.miss_cookie_base); -} -#else /* IS_ENABLED(CONFIG_NET_TC_SKB_EXT) */ -static int -tcf_exts_miss_cookie_base_alloc(struct tcf_exts *exts, struct tcf_proto *tp, - u32 handle) -{ - return 0; -} - -static void tcf_exts_miss_cookie_base_destroy(struct tcf_exts *exts) -{ -} -#endif /* IS_ENABLED(CONFIG_NET_TC_SKB_EXT) */ - -static u64 tcf_exts_miss_cookie_get(u32 miss_cookie_base, int act_index) -{ - union tcf_exts_miss_cookie mc = { .act_index = act_index, }; - - if (!miss_cookie_base) - return 0; - - mc.miss_cookie_base = miss_cookie_base; - return mc.miss_cookie; -} - static u32 destroy_obj_hashfn(const struct tcf_proto *tp) { return jhash_3words(tp->chain->index, tp->prio, @@ -1683,8 +1579,6 @@ static inline int __tcf_classify(struct sk_buff *skb, const struct tcf_proto *orig_tp, struct tcf_result *res, bool compat_mode, - struct tcf_exts_miss_cookie_node *n, - int act_index, u32 *last_executed_chain) { #ifdef CONFIG_NET_CLS_ACT @@ -1696,36 +1590,13 @@ static inline int __tcf_classify(struct sk_buff *skb, #endif for (; tp; tp = rcu_dereference_bh(tp->next)) { __be16 protocol = skb_protocol(skb, false); - int err = 0; + int err; - if (n) { - struct tcf_exts *exts; - - if (n->tp_prio != tp->prio) - continue; - - /* We re-lookup the tp and chain based on index instead - * of having hard refs and locks to them, so do a sanity - * check if any of tp,chain,exts was replaced by the - * time we got here with a cookie from hardware. - */ - if (unlikely(n->tp != tp || n->tp->chain != n->chain || - !tp->ops->get_exts)) - return TC_ACT_SHOT; - - exts = tp->ops->get_exts(tp, n->handle); - if (unlikely(!exts || n->exts != exts)) - return TC_ACT_SHOT; - - n = NULL; - err = tcf_exts_exec_ex(skb, exts, act_index, res); - } else { - if (tp->protocol != protocol && - tp->protocol != htons(ETH_P_ALL)) - continue; + if (tp->protocol != protocol && + tp->protocol != htons(ETH_P_ALL)) + continue; - err = tp->classify(skb, tp, res); - } + err = tp->classify(skb, tp, res); #ifdef CONFIG_NET_CLS_ACT if (unlikely(err == TC_ACT_RECLASSIFY && !compat_mode)) { first_tp = orig_tp; @@ -1741,9 +1612,6 @@ static inline int __tcf_classify(struct sk_buff *skb, return err; } - if (unlikely(n)) - return TC_ACT_SHOT; - return TC_ACT_UNSPEC; /* signal: continue lookup */ #ifdef CONFIG_NET_CLS_ACT reset: @@ -1768,35 +1636,21 @@ int tcf_classify(struct sk_buff *skb, #if !IS_ENABLED(CONFIG_NET_TC_SKB_EXT) u32 last_executed_chain = 0; - return __tcf_classify(skb, tp, tp, res, compat_mode, NULL, 0, + return __tcf_classify(skb, tp, tp, res, compat_mode, &last_executed_chain); #else u32 last_executed_chain = tp ? tp->chain->index : 0; - struct tcf_exts_miss_cookie_node *n = NULL; const struct tcf_proto *orig_tp = tp; struct tc_skb_ext *ext; - int act_index = 0; int ret; if (block) { ext = skb_ext_find(skb, TC_SKB_EXT); - if (ext && (ext->chain || ext->act_miss)) { + if (ext && ext->chain) { struct tcf_chain *fchain; - u32 chain; - if (ext->act_miss) { - n = tcf_exts_miss_cookie_lookup(ext->act_miss_cookie, - &act_index); - if (!n) - return TC_ACT_SHOT; - - chain = n->chain_index; - } else { - chain = ext->chain; - } - - fchain = tcf_chain_lookup_rcu(block, chain); + fchain = tcf_chain_lookup_rcu(block, ext->chain); if (!fchain) return TC_ACT_SHOT; @@ -1808,7 +1662,7 @@ int tcf_classify(struct sk_buff *skb, } } - ret = __tcf_classify(skb, tp, orig_tp, res, compat_mode, n, act_index, + ret = __tcf_classify(skb, tp, orig_tp, res, compat_mode, &last_executed_chain); /* If we missed on some chain */ @@ -3208,48 +3062,9 @@ static int tc_dump_chain(struct sk_buff *skb, struct netlink_callback *cb) return skb->len; } -int tcf_exts_init_ex(struct tcf_exts *exts, struct net *net, int action, - int police, struct tcf_proto *tp, u32 handle, - bool use_action_miss) -{ - int err = 0; - -#ifdef CONFIG_NET_CLS_ACT - exts->type = 0; - exts->nr_actions = 0; - /* Note: we do not own yet a reference on net. - * This reference might be taken later from tcf_exts_get_net(). - */ - exts->net = net; - exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *), - GFP_KERNEL); - if (!exts->actions) - return -ENOMEM; -#endif - - exts->action = action; - exts->police = police; - - if (!use_action_miss) - return 0; - - err = tcf_exts_miss_cookie_base_alloc(exts, tp, handle); - if (err) - goto err_miss_alloc; - - return 0; - -err_miss_alloc: - tcf_exts_destroy(exts); - return err; -} -EXPORT_SYMBOL(tcf_exts_init_ex); - void tcf_exts_destroy(struct tcf_exts *exts) { #ifdef CONFIG_NET_CLS_ACT - tcf_exts_miss_cookie_base_destroy(exts); - if (exts->actions) { tcf_action_destroy(exts->actions, TCA_ACT_UNBIND); kfree(exts->actions); @@ -3690,15 +3505,11 @@ int tc_setup_flow_action(struct flow_action *flow_action, const struct tcf_exts *exts, bool rtnl_held) { struct tc_action *act; - u32 miss_cookie_base; int i, j, k, err = 0; if (!exts) return 0; - miss_cookie_base = exts->miss_cookie_node ? - exts->miss_cookie_node->miss_cookie_base : 0; - if (!rtnl_held) rtnl_lock(); @@ -3709,10 +3520,6 @@ int tc_setup_flow_action(struct flow_action *flow_action, entry = &flow_action->entries[j]; entry->act = act; spin_lock_bh(&act->tcfa_lock); - - if (!is_tcf_pedit(act)) - entry->miss_cookie = tcf_exts_miss_cookie_get(miss_cookie_base, i); - if (is_tcf_gact_ok(act)) { entry->id = FLOW_ACTION_ACCEPT; } else if (is_tcf_gact_shot(act)) { @@ -3779,10 +3586,6 @@ int tc_setup_flow_action(struct flow_action *flow_action, entry->mangle.mask = tcf_pedit_mask(act, k); entry->mangle.val = tcf_pedit_val(act, k); entry->mangle.offset = tcf_pedit_offset(act, k); - - entry->miss_cookie = - tcf_exts_miss_cookie_get(miss_cookie_base, i); - entry = &flow_action->entries[++j]; } } else if (is_tcf_csum(act)) { @@ -3924,7 +3727,6 @@ static int __init tc_filter_init(void) goto err_register_pernet_subsys; flow_indr_add_block_cb(&block_ing_entry); - xa_init_flags(&tcf_exts_miss_cookies_xa, XA_FLAGS_ALLOC1); rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_new_tfilter, NULL, RTNL_FLAG_DOIT_UNLOCKED); From patchwork Sat Apr 22 01:47:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1772208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=P5yBZ+vX; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q3Dmf2bZBz23s0 for ; Sat, 22 Apr 2023 11:47:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pq2Lj-0002Gz-Pv; Sat, 22 Apr 2023 01:47:39 +0000 Received: from mail-bn7nam10on2049.outbound.protection.outlook.com ([40.107.92.49] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pq2Lh-0002Dw-Tl for kernel-team@lists.ubuntu.com; Sat, 22 Apr 2023 01:47:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/DLImzylmPzMyUTnxx8yxPPWhZKoIBEN2DIxTsLjHkLvbRppFYa4BPU48zY9n8mOSUZ64eOPMvOfXBUvQXmq7BFOJn3OjEZH0WGtdyZsYVV5qeHrpA3f69ZHd8eGbXB2TsYWCiMSzepLFwbFPp3lph7dK+VM+GVCXX6apfqD+3UsSwBSiPOsShNxPHjlfBWqFBPkzdSYb5gra6Cek4XshVBbkMFx1HFCZRHvQ3wWIeNETLhbaDk88eWs2/8YxNnelOGbFhmY+n8H1h2syGTPq2UrshjM9L3tz3ZTOtVXdfBwu4ua3q8VXWy5txz0gO8375JDtWEHrnTP3C8ltOg+Q== 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=mylrxo4vzda4L+Pk0dnIsd5pt1mCm51S3rZyEMDH0g4=; b=NuyEQQE+xsqud5ejQwpEm2dv3Mvxbkxxlw0rSB6U6uImpC39JLQ0ExtOykdG8Tn2wY8eVA3s7FKk7DdqicKq/zek5/jNZ5XtljR9HazxckWGVb8YsWK1RJLlSss2SKaL0UrqB1UyA+aHjMmR0aMzJocBPaIii8fq1L5rx1uqWXg/w5Ceiaqs+8joZx9L9Xn7izfCU7gpIZvSsVEYt1l4vWNvGauUS3sUNFkUXlDruT4O2iZ6di5PIiRWb5zHmm5jLaeSJsqYH7292Dbkdwo/XGnB+101Epsg4tuNXioJttD5y3Uz11/LNGoTYp7On/ndmK61lo2UlWVIncnvYs5CAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mylrxo4vzda4L+Pk0dnIsd5pt1mCm51S3rZyEMDH0g4=; b=P5yBZ+vXrXqNjNEwPnZOM/gtp+QPtUM2Tg6EzrjRFz9k69NsyyBZFRoSkg9epropFgDTP+BkpgzklM79WeTiTvKCm9mBYoNvnFvOTeHUf0GE7kI9iHbB8+CuTYigGJKdQZ4hZgwKkXdgQgNEEovJ21Andy5+yXUNTII0ezFPhrGcv/KpQZQydc4Zy5KxfWz3kFhMe5GcdE62gjSAfxNwWU11QTkagFnzfMF+08w6kzzI6JToBnOfD86Z9KmUGzW5Qt8B2lZew7GL10JffLTd9KOVJanS0P9F8rlWPxgUsHIlys3cOrpscU0PkkpUeQM0hQ+wK22jG9kFuIw37j0Nzw== Received: from DM6PR03CA0084.namprd03.prod.outlook.com (2603:10b6:5:333::17) by IA0PR12MB7601.namprd12.prod.outlook.com (2603:10b6:208:43b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Sat, 22 Apr 2023 01:47:34 +0000 Received: from DM6NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::e0) by DM6PR03CA0084.outlook.office365.com (2603:10b6:5:333::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.25 via Frontend Transport; Sat, 22 Apr 2023 01:47:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT081.mail.protection.outlook.com (10.13.172.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.26 via Frontend Transport; Sat, 22 Apr 2023 01:47:34 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 21 Apr 2023 18:47:21 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 21 Apr 2023 18:47:20 -0700 Received: from mtl123.mtl.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Fri, 21 Apr 2023 18:47:20 -0700 Received: from sw-mtx-002.mtx.labs.mlnx (sw-mtx-002.mtx.labs.mlnx [10.9.151.106]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 33M1l76W008750; Sat, 22 Apr 2023 04:47:16 +0300 From: William Tu To: Subject: [SRU][F:linux-bluefield][PATCH v1 5/5] Revert "UBUNTU: SAUCE: net/sched: Provide act to offload action" Date: Sat, 22 Apr 2023 04:47:06 +0300 Message-ID: <20230422014706.594733-6-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230422014706.594733-1-witu@nvidia.com> References: <20230422014706.594733-1-witu@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT081:EE_|IA0PR12MB7601:EE_ X-MS-Office365-Filtering-Correlation-Id: 27a01857-2ad9-4d03-04e4-08db42d38b15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2S9OW1bm+51Lu49OdItZVQyJmRq44IS8DFGExhItreo0J4OTfSmgGuiWNmYWCpaaYSpdf2OwA6RvYl/ucPiTKIFK+q2PIH6TffuXyNS2ji4efPpleSCw6TWe6qOCg8wgHBuvawHVGk8KXNrCoSjH3PyjVwUAWnzy9Vg/aM5V2uazsk4q9y9KJskoRUcwzVAVeusIB4DVQlcRYl1vzbq0+V2S70S2WHLgoJyUlvKOh538l0smGD2uoYQPPTfQ/8A7spk3lWYuFj4yMtOuqK8t3qMjHenbP6jT0OxsjAWMxNWgy4OZdXbaNCZU0c5Zp+wusUSgHTixye9nxmu/2LqnFqoK/tWyUlR7nUH6KDippUflRNS2Pqm5v2K4TCgXwUTZheqkKovsyGp33djhrYAw0QaU6QCwpM2NalMhTCyrwt7A13IzrifNjLB8Wjs5D95pPeCCoHk20C28fa1eXXY79ymvc255LAeVA2gvjuFcPXJcBrC2gk7kV/2CVOdr7/LE1Bfs3i60RRbQiRvu603l4EapZYfehnNfcomydz3xRdDEOIv8JvuKP6VWzAd8rbVD2pTO2BzTSYIXJeLUNKvcC4Y7E60aMCQ/PAEfDhd3BBlF1ujgTarO14LQNp/gUnFWGGTqcMJoCq8t4r7AWChIkCsYYNWViFfg6VUQsTudLFcBqaaXccfE0Q9B5fTnWk7j9qBW4KvtWw3xKFDwA+4YHFT4nyBvrZNDbFoixhenkre2YtT/5Ispy2+OODE2gbcrVP2W7wC5F9Nbc2NR2EB1cQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(376002)(396003)(39860400002)(346002)(451199021)(40470700004)(46966006)(36840700001)(82740400003)(356005)(4744005)(2906002)(7636003)(40460700003)(86362001)(82310400005)(40480700001)(478600001)(54906003)(34020700004)(316002)(70586007)(2616005)(41300700001)(70206006)(4326008)(6916009)(107886003)(26005)(8676002)(1076003)(36860700001)(36756003)(186003)(6666004)(47076005)(336012)(8936002)(83380400001)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2023 01:47:34.0594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27a01857-2ad9-4d03-04e4-08db42d38b15 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7601 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dann.frazier@canonical.com, paulb@nvidia.com, vlad@nvidia.com, yifeid@nvidia.com, bodong@nvidia.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This reverts commit 73cbac8f27c9a13a417f05733786e5c1f11e5d7c. --- include/net/flow_offload.h | 1 - net/sched/cls_api.c | 1 - 2 files changed, 2 deletions(-) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index d9e2e5d905ee..e9686f7e5cdf 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -166,7 +166,6 @@ typedef void (*action_destr)(void *priv); struct flow_action_entry { enum flow_action_id id; - void *act; action_destr destructor; void *destructor_priv; union { diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 384a4d815849..5d933c9e9cc0 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -3518,7 +3518,6 @@ int tc_setup_flow_action(struct flow_action *flow_action, struct flow_action_entry *entry; entry = &flow_action->entries[j]; - entry->act = act; spin_lock_bh(&act->tcfa_lock); if (is_tcf_gact_ok(act)) { entry->id = FLOW_ACTION_ACCEPT;