From patchwork Fri Dec 17 18:16:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12685491 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 AFF75C433EF for ; Fri, 17 Dec 2021 18:18:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240393AbhLQSSI (ORCPT ); Fri, 17 Dec 2021 13:18:08 -0500 Received: from mail-dm6nam10lp2105.outbound.protection.outlook.com ([104.47.58.105]:24917 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240403AbhLQSR6 (ORCPT ); Fri, 17 Dec 2021 13:17:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LV0/Jji18fFfodRPH29JueQJPtg8FX3vshvc6aqa1EoqMiDhDkYmlrcjiyul7WXYu+mn2DFwvHUIAud4S1mombHZWd/wmYt0lRph/K//umk/XuyVF8JWLGPtx1TUSms1SjqLoXYCDxHjJk17dV1ogsGhLNzktmW7WZyP69rkGAf29Q3gcRy4Z0SiHJuFtee456HOOqcpYCGb7eB7PqtOa8Lub06jZN00Ad0tJ7tSpeKsmezGkPXfszybFoy9lvSomYon69MVGw6GOmObU8D9qqUYUUhpH+RbhzXDq+qap7a5v3pWYKvFlg089ZC3PpXFBOsyp7T8ZdqzVK9VsKaZfQ== 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=BTA7FwwNKF/Y/7KDPQXYZQSBTdlW7E97VIIBj8WcX3A=; b=VkvO0S/cR3JstGPI7/hqKsTQS9Z0sv6Fk010OnPxMSdSamXA0PTdaz7VPtVqH8mLD2Qj1sHA5FMQYhv5I1z5Q1ac8uYGQBcmr9XFOpm2KjoJXlMgn6210DoPjwftnrvx5fHSQj9ZMfvc+M5mPuk6MmEKsgwKm6fWF/wK0c/KkATBJryX4YHkzVh+YD6w6mDinoV5n3sTcfNhiXXiu9g84itrP2jysEMU977ROjCJ2uHfBDj++NbxDIYIOL3D2Ht3HkRGwuq6T4d2MPNqMoBljMqsoBt7R75bS59bwbN6AF4uXKrlYBrZAmIB2tM68498Kpzd5xwB842FeQGuVzQTJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BTA7FwwNKF/Y/7KDPQXYZQSBTdlW7E97VIIBj8WcX3A=; b=rLbYfMS0CtFpXl3kmK+dUidgBx9f9F21be1plMF66Yx4GXU3L2JSxC6v+QnOgr5MNTwOMma7UOZaWPw1TDin3bfF9EoDy0iFEfr3oCFU3n6gEACDP8bCOry/T/kuZ15zXYRt3Tm+eIfUPAo0IUQzxpuDZY3YKNMG97Ser0g310A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH0PR13MB5589.namprd13.prod.outlook.com (2603:10b6:510:142::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.9; Fri, 17 Dec 2021 18:17:53 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::a01a:4940:c69a:e04c]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::a01a:4940:c69a:e04c%9]) with mapi id 15.20.4801.014; Fri, 17 Dec 2021 18:17:53 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: Alexandre Belloni , Andrew Lunn , Claudiu Manoil , Cong Wang , Florian Fainelli , Ido Schimmel , Jamal Hadi Salim , Jiri Pirko , Leon Romanovsky , Michael Chan , Oz Shlomo , Petr Machata , Roi Dayan , Saeed Mahameed , Vivien Didelot , Vlad Buslov , Vladimir Oltean , Baowen Zheng , Louis Peens , UNGLinuxDriver@microchip.com, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, oss-drivers@corigine.com, Simon Horman Subject: [PATCH v8 net-next 10/13] net: sched: save full flags for tc action Date: Fri, 17 Dec 2021 19:16:26 +0100 Message-Id: <20211217181629.28081-11-simon.horman@corigine.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211217181629.28081-1-simon.horman@corigine.com> References: <20211217181629.28081-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0PR06CA0097.eurprd06.prod.outlook.com (2603:10a6:208:fa::38) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b629554-dd8e-4b48-ec56-08d9c1898afc X-MS-TrafficTypeDiagnostic: PH0PR13MB5589:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AfORnDuOuhop/SmnQcK5YBtahv35d4Nopm8atCB8i129QyJM0/qeKEntH8QV4O03o40Hswlp54nPW9vmAMVDOHerMEKhUfhT6O080b5ZtPuP1e3tegz5P1eacja3FfzxIbZwT4HJVQRPtKT7rbBOdAdRq7iQQq1Q4YrYhd0cGUXL1HS1lU1D/pOiVxF8ZlSk4b/Ib4X9dw8AZVJahJwNAXZjToHGN9yVxUBvV/LymZzNaTpbCSfzyyRsXVanaffD0ztQqu8mqQZ4zy8b4nq7SlQ0hZQ5873azN2TBpkZ4eTDPCowk8PbG5wM7SNybE+P67frGDobuB755goHwyjcpw8p56A57LdX59WlqE2sIOR5MLAbYy4YwVBOpf1LAipqs8yBmUWy0BXILXbgUG5hGrlP3r4qK94mke75DoZlFgVFuKXYpo6HnqLRfQzAUr4gtQ5yzNCPiQaTwoeov0o9i+GQZ7zOfrqgO4WS7Cwn4TVcKamjGFZ3lrtA7S7HHW4I/+N0ZKb9SWSTxzF9pBdokA2PoOfTQdVDWnWEVGmFi9GiAV0g/adH+hxsE87O/95Z1RtkObbbNwlucU7ekz1kOJaULsG//cdtGoyvCQT0qEgSC8v5bw9lMhUWwXDbuJVyqfzloVpNn2eBkoZ8rMKZ7g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(376002)(346002)(366004)(39840400004)(396003)(136003)(508600001)(107886003)(52116002)(6666004)(6512007)(86362001)(2616005)(6486002)(186003)(83380400001)(1076003)(8676002)(316002)(6506007)(2906002)(54906003)(66946007)(44832011)(110136005)(7416002)(4326008)(8936002)(66476007)(66556008)(5660300002)(36756003)(38100700002)(20210929001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SDSbRJpO1QYDaoOzV1D7Umqg9Pahf1oBQwn71V2CKQdBM79u3hmCESqUdRjbzh2c0QqXS81OmFbZDlSs+b1TCFKyAjeohYZxgeSp39neDBq/C3z7AiQn9/wB5IhkfQuEEhWP9PqrqVmOWY+6iRoHHjTUuEnRtwW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+zfAOoBZM6Z6ztNnbEn0EpegiHJUSdw7B4qU+aYP5exlD5epZ+urhaIx0bVizU2i7F9RRwflcLHG3MdBIwW2V7PaUImUy6POKajY4VFD1RM6CuW64phfOCecFa9/W2uYH/MPrSwwRrgRYGFYp/BTKpYGXntAiAbgFXUkZIdHBqvlje7WCLC6qoZcYucBVnDikm7T5bXp5oIpQZTmLTMdfLTzVaAs0UU4umXaAEvrrHeOXZkz855nWql1fgIILSGByHbQlr7bYgZfQNKjVYqWlOsqjsHJ5PjkoBmhAZtKNaSGGxNYAuzLL4ndljvU4oGuSOgUy2y9FY1N9tODqnXeW7QuuJR76zbEQtuzQyVHGGk+jmydnavbz/3iK7St8VYV5e/1aTUCPOFo31dDCjcjs3Q60+0SRoYhWBmOxm21Ifxp61p74jSfkqjR8Tg5a04RM81vWSTqOgtccZ6xeLLlVAAmKpiC3ahachK8frt4nFLAaKoiYIRNDKLDzyJlhrNNfrHfNlnJg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b629554-dd8e-4b48-ec56-08d9c1898afc X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2021 18:17:53.7790 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MBfedWsZ/FxfN9nQaVUxZTnelhV+fuk8GjI6gUcRon+N9QQY7kw6WFfXWkcXTCQ2CnaYKzItrD84apY4ZCGhbqLuuju9bBeB5RBw9o/tgjc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5589 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Baowen Zheng Save full action flags and return user flags when return flags to user space. Save full action flags to distinguish if the action is created independent from classifier. We made this change mainly for further patch to reoffload tc actions. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim --- net/sched/act_api.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index f9186f283488..b32680ad75d3 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -669,7 +669,7 @@ int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, p->tcfa_tm.install = jiffies; p->tcfa_tm.lastuse = jiffies; p->tcfa_tm.firstuse = 0; - p->tcfa_flags = flags & TCA_ACT_FLAGS_USER_MASK; + p->tcfa_flags = flags; if (est) { err = gen_new_estimator(&p->tcfa_bstats, p->cpu_bstats, &p->tcfa_rate_est, @@ -996,6 +996,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) int err = -EINVAL; unsigned char *b = skb_tail_pointer(skb); struct nlattr *nest; + u32 flags; if (tcf_action_dump_terse(skb, a, false)) goto nla_put_failure; @@ -1010,9 +1011,10 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) a->used_hw_stats, TCA_ACT_HW_STATS_ANY)) goto nla_put_failure; - if (a->tcfa_flags && + flags = a->tcfa_flags & TCA_ACT_FLAGS_USER_MASK; + if (flags && nla_put_bitfield32(skb, TCA_ACT_FLAGS, - a->tcfa_flags, a->tcfa_flags)) + flags, flags)) goto nla_put_failure; if (nla_put_u32(skb, TCA_ACT_IN_HW_COUNT, a->in_hw_count))