From patchwork Mon Jun 19 17:49:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1796773 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=hpLrmJvZ; 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 4QlHNm2jkcz20Wk for ; Tue, 20 Jun 2023 03:50:32 +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 1qBJ1B-0007rw-0m; Mon, 19 Jun 2023 17:50:21 +0000 Received: from mail-bn1nam02on2068.outbound.protection.outlook.com ([40.107.212.68] helo=NAM02-BN1-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 1qBJ16-0007md-Pc for kernel-team@lists.ubuntu.com; Mon, 19 Jun 2023 17:50:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I5sH5A0CpQ9B/PGicv71njj5xOErxibMdQ02mqgq8IMd4efzU31ItzGgJosWy54sJ48kkE6jA59Nqvan3b8xfXWVRq7IouN0wXI9VTj8P4JPDmSny9RVsRv3GDut10Pc7/H1icC9tfjbNH6goJlnzGlLrTJGffwbi/bzTYilXCXDaVCt6UBPFqBLPW/N14Qka5Us+zrraCBTOPTvrpiR76WjBl9lI/RO7ZMy9Yes+yhkb/XiEYoDJG3ce/OaMFZC3/VUrPm6TnjDmb4lrUOmaHtlEgk3AIbJQOAso6sxc6YuPn1uG4lPcBQ9yAor6JVL6hUY51CVNw14IpBWb0QGow== 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=J3u4TtVYHmKtL9NkCPYEMPusy4p1SnZZcy9j6YfhA98=; b=EiP3FLv0nQLr7ORp9IR2/mQeSK5AApoJK+1y+n3vPkAu2ZH/v24fpWCGztD2OevbN2MPEL4odNbh9IhaLi/r8FVBppG+8vs7RQOTzetuOvI5eZwNbDGlCXQ9VUXT8iT7s6KKqKoAy8DulT2bgvW9YqTyeldgUsakBHqmLy4/eu0dd5b8CIYMIpujn97WmoTAJOIqoC0XsPfUUFKP8FHjHIK2sj4zoppva0D6OINR06rpGy1bC0b+6g5ivfmouUykLoDvw7kWTWn9jjpqg1+NQl2zIgnTHRgx7Fct4Yi3itkLzxLD5jf9lm5vCixurQOno60eS67SQebmKh1YWztUag== 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=J3u4TtVYHmKtL9NkCPYEMPusy4p1SnZZcy9j6YfhA98=; b=hpLrmJvZn6Nwq1csjkxu5AAtxDgTP0qZCDOQDeodIRcQ21+w59h9uVdNhihYa17Pszwmc1FbFy6Nn9EewztLEgKlmAbp8Jm6wTJaB4f80vppQUK+HPRVRNf/7lonhKUp7t7XkjiBu4jnItivs/3Qfex77FqDWAeow6qvsmHSReKSh9BnOG2hgHcWTwDQO0xMJ5OfWQeLlaA1lws0aXQ5vcW4e2fWPP7SEINP2pfGWfzeVuJqT2lofoWTdfQPfI9bZuXp34aHQHE0cEVn+tQgHWOzfa1h/qHw5fsKd6SkHvjcGi0axlsgpQXuZWFl1IjpVZNyftGCmVnNB5D54tTxHg== Received: from MW4PR04CA0209.namprd04.prod.outlook.com (2603:10b6:303:86::34) by SA3PR12MB8024.namprd12.prod.outlook.com (2603:10b6:806:312::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Mon, 19 Jun 2023 17:50:13 +0000 Received: from CO1NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::b6) by MW4PR04CA0209.outlook.office365.com (2603:10b6:303:86::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37 via Frontend Transport; Mon, 19 Jun 2023 17:50:12 +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 CO1NAM11FT025.mail.protection.outlook.com (10.13.175.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37 via Frontend Transport; Mon, 19 Jun 2023 17:50:13 +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; Mon, 19 Jun 2023 10:50:04 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) 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; Mon, 19 Jun 2023 10:50:04 -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; Mon, 19 Jun 2023 10:50:03 -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 35JHnnvK030853; Mon, 19 Jun 2023 20:50:00 +0300 From: William Tu To: Subject: [SRU][J:linux-bluefield][PATCH v4 05/10] net/sched: flower: Support hardware miss to tc action Date: Mon, 19 Jun 2023 20:49:36 +0300 Message-ID: <20230619174942.1195846-6-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619174942.1195846-1-witu@nvidia.com> References: <20230619174942.1195846-1-witu@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT025:EE_|SA3PR12MB8024:EE_ X-MS-Office365-Filtering-Correlation-Id: a40bb21a-a768-4b00-e0ff-08db70eda24c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tp7L+Me7yEcf/8UCLtRChcI/+V+4KSNMUg6gmbCHMd1SIN2tffmpR3ZaW7laItjtU3gPWhxTfX2AIj5gOEzDgPIrpp4YWeBOQOCTJ2DixUqkxkm03UkMGd8l1korxeD+V34IWS8py1m5grGkQZI8d6fkS/sM1nDg03AakOFX1PKgUBo2QoFTeU6aItXxhap2l2QNeU/WwUu2v1dCeqqsPH57784RK78Woylpc4unpAl+tigbTs3hkkfv+GYmdUsXU6B7OSfUJvR12rwEs4xXJQXi+PGWKy0N27APacHTDhTYB/gpeBlFc7bRDj//w9xpMy6K2PSAseWGq5V7uhTiGLPc+jjPsOekHPhO/e30u6xT/TAXZQlzqSbiCBjCduuFEQ2lhYr/hptsUDT1Kf7qRlbmm6brv/omsPZbKVYHgnWYLh6pJekGxHDGaf6+NXuKYFT5SBCQWTRxxmXNALpgxUujbDGBCMFPFAGmT6RqylGOaj8IAc8tfsDxQ5Sx+5xivwOlJu1I1vTrg8kiKK/fsJ7w2lBH5s16g25kt6it24JzjoZAeTxI08GgguizZCBBz0CIL9ou8RkR9Eg1Wzbjkj059tF//htMlIeAKI5pZq5BKMmv02OQn1C9hlV0sME8U+9tbv2MWyw3u2wIeIeY6K3R1YrfmicApibHYkhh56MW2hOl9kg/j4tThd66K+yzC4AeNQe11FQdCgJ7DshRjclZk/RzOBx8gd1dr06Xdt/CAyT8dGp5AS5JVngv77e3S5EPqhzv5RonOch/obQmnxz94Myklf92POxZGxFIJrs= 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)(376002)(39860400002)(136003)(346002)(451199021)(40470700004)(36840700001)(46966006)(356005)(336012)(107886003)(2616005)(86362001)(83380400001)(7636003)(47076005)(36860700001)(2906002)(5660300002)(82740400003)(40460700003)(4326008)(54906003)(82310400005)(186003)(70586007)(8676002)(70206006)(8936002)(966005)(26005)(478600001)(36756003)(41300700001)(6916009)(40480700001)(1076003)(6666004)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2023 17:50:13.4470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a40bb21a-a768-4b00-e0ff-08db70eda24c 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: CO1NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8024 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" From: Paul Blakey BugLink: https://bugs.launchpad.net/bugs/2012571 To support hardware miss to tc action in actions on the flower classifier, implement the required getting of filter actions, and setup filter exts (actions) miss by giving it the filter's handle and actions. Signed-off-by: Paul Blakey Reviewed-by: Jiri Pirko Reviewed-by: Simon Horman Reviewed-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski (cherry picked from commit 606c7c43d08c4daf954ec8d58ae6dd39292fb457) Signed-off-by: Paul Blakey Signed-off-by: William Tu --- net/sched/cls_flower.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 83a55b00e800..29628ef80aef 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -535,6 +535,15 @@ 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) @@ -2070,7 +2079,8 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, } fnew->handle = handle; - err = tcf_exts_init(&fnew->exts, net, TCA_FLOWER_ACT, 0); + err = tcf_exts_init_ex(&fnew->exts, net, TCA_FLOWER_ACT, 0, tp, handle, + !tc_skip_hw(fnew->flags)); if (err < 0) goto errout_idr; @@ -3239,6 +3249,7 @@ 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, };