From patchwork Fri Dec 17 14:21:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12684791 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 9AD27C433EF for ; Fri, 17 Dec 2021 14:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234591AbhLQOWu (ORCPT ); Fri, 17 Dec 2021 09:22:50 -0500 Received: from mail-dm6nam12lp2172.outbound.protection.outlook.com ([104.47.59.172]:37698 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237375AbhLQOWt (ORCPT ); Fri, 17 Dec 2021 09:22:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FRGVF3HAxMM5Y5gLjFZRqO6IPfZ82zImKfuLSiLQuzJ/yTZ4AO2FSSxK8486bOVecaLSJK4EFMX0K+bIdf5epz42tt4IVAklmtl3KXGU7HVi1YcEG00AaVMWoZyfcLmu0WoonLZhkfpI5J5bA1LRIDWmNnId3mjbmN4BBkrWAMiBcrmPZx2FkjxtH6o6uuivKA8WCspqEkVaekF3GebS+1FXl75dupGY3RQgn+7+lg3VnzEri/NqeBy7rFIuTKoln0INiPgQsobsYI2b103yQhhPcRxNAOHrJ00Exzv+Vpzi5MBgcPFOkQl36HaSINXAsQXdfXz164hqwmBZx8Novg== 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=uwnbpnGQsujWzVpx0G3VIKNtNa/iDjgKdHVE5iByKUg=; b=F/vmF3ciSSdz/RTPKGw+mA7+9cBLy8h9XMhJfh3a/KKPOWnQ8+aq3tZ+1YgMhdyZY/WZkIn/piUv6TwIp3ZtSMOelmV6AnKfbCEBsLAXpocNeJwkln7lTNRVK4nIv1sKuq5aFIXi6P0nLCHFidgSKOODeVVOxktg8ajgMqla3CMXCB0fjRM7v16iPuh9VYld6fIbBfFbVl3F7HT5sVpOMp0phe2CT0Ol0MjaqIn0uD8qRqlAvpwaiamYTmmF76SEDb6mVhgGzrYOWG98uvtczQwiQq2slMm/6dapzcmG12hqYR/yiWTBHqmt6P6y94nYOv1Hs5qsZq3QEgdl5bRZWw== 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=uwnbpnGQsujWzVpx0G3VIKNtNa/iDjgKdHVE5iByKUg=; b=Ca7RExL0cTWwnqEr4WJ5UtBblPdO95Di5OaDnuuJFlEhmllGLJ8p+klhkY3UxjCcG7jfqxHDdf0Oq/+73cT398CroahJXM5rvwOotOepsTWu+cotX0bVLA/2pPiLx9B1wHdc0yblDE6L3fRq3nk0aPHncHFhA6fVToSp/xSYHU8= 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 PH7PR13MB5595.namprd13.prod.outlook.com (2603:10b6:510:139::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.8; Fri, 17 Dec 2021 14:22:48 +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 14:22:48 +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 v7 net-next 09/12] net: sched: save full flags for tc action Date: Fri, 17 Dec 2021 15:21:47 +0100 Message-Id: <20211217142150.17838-10-simon.horman@corigine.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211217142150.17838-1-simon.horman@corigine.com> References: <20211217142150.17838-1-simon.horman@corigine.com> X-ClientProxiedBy: AM3PR07CA0079.eurprd07.prod.outlook.com (2603:10a6:207:6::13) 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: 2f5c639e-914d-4f00-22f1-08d9c168b353 X-MS-TrafficTypeDiagnostic: PH7PR13MB5595: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: wKBYgCc0yBuYVu9hqJjd1IpwOs0t0eG5sAQd5FaNtIM2MZshqnSTGvD9sIABegoa60lxec4ncj/wdYi7GGUzPXqYciTr7/eDerj34YkIEcT0v95OaNogrWOS3bins7n/h7dfoHdlseXaRkwSskROVKM1n1b+Jnnue6hdRe1xQNXVwDwYKcbBFGMGFHY5TLZroFiDCVd0SYS9m5l7kFifI7bxuVyizO6HaXQowOdvEg1zjgZnl64e35nCGsroXP2EukO+ao/PF4wXf/zU2TKmrz1Thrmau/xZ+GnsM/8intE8EHpPGfXy3P8m+Mz3aFgkexD1pxy7eaBHEGC+sBYZEGV3+DYcvdl+5oeIx6qjeS4JzUzKjVbc6pPbFj32/T3F9Ck23eAAxBLBxKVw1eo5nHa81IrybA4losylxKX5X2p7ek/RUpQ2MM/WQUYT1IwyrGK23wZsrRwcwiXTOcu3qhXHWqJWS/OD4FLQRA+QAOHKcj/6kfUhMqpyr67dpnEPvKW6MxGTU7OcyPvN6EsqIA9XMcPxxH5Jl7cfiVJYZhcDB6ad6wA6JX7OQCf7F1omevHn7CRvtmuno9oBX3nqp5+R77BjpHGKqUjNX44LoajbthUdt7lTR2oaX+KYF0p0xpCY49NFTiFH1ZCpkkOHme7n4ekmeHPMN6BfvxyQsl9ybFcd0p7ZxLbXrN1rUNFy 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)(396003)(366004)(39840400004)(346002)(376002)(136003)(110136005)(8936002)(54906003)(8676002)(316002)(66946007)(66476007)(7416002)(2906002)(66556008)(4326008)(86362001)(38100700002)(107886003)(83380400001)(508600001)(1076003)(6486002)(36756003)(6506007)(2616005)(52116002)(5660300002)(44832011)(186003)(6512007)(20210929001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pFI6HdNln5kvgkB75CEEAWhvWUiePZRJNLF9+TNr4+NNWEr0sfvjCOc0SgwGA19/xlIWPkB/1H9BziAFrmbsDlNWDPZ2JVtuLFNOXXxeixvng1cvgh4g/Pj60bsyj7zZ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DQjQtw3obSVtsdo9aDp6I9HO07rkrBu8HdAJXrk+UWxQ7ZO7yyivK07Dvrj8jfslgXneLSQUMvjeLzqzFmJNd09Mp96obmtw/qJKtjHDSiSIxjzT6PyJNBesNDaJZ2cU6Vq4fI77ekeek+i3CApucQARd006LGLOzZBs+7TogbI6m3tvMfk+31OVjrqFf0RAuR04Pf/iHuhX6K4aue9CRMd69bgFBZsELIa9i3a4utAJBTa/QaRz8Bf7lKBcmzuB5ufPoban7wgeIa79ihFSkVWJHsRwteJRyuQBVyqmgvkkI3r2SLdml6REIryR/eyp54Ll2ShHV+s8AIr9wpNODKvwaztfh4rve5JvaqCjnExH+M3wg+oQJ9FJzTKOGZ+0YyQ0bmrsfoa9Xy/EOqjRu0CGpEOhFvATvHsmu/xRqFKslU+T/OQ0pphCfoNv/PtcrPGcPLzuXThz6VF+BuilfayxaGk1VBNRrd6weho8hS19UpgTX9oTQnxLrdTSCJXHu6s4yfO/0HB+dr98HvioSRUmlIvr0Ug== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f5c639e-914d-4f00-22f1-08d9c168b353 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2021 14:22:48.0757 (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: dj8+Tzw8q7BduE4iXxtducAvSw/irg4WiIhKPq/34ONP6ANGjMdqCE9HUTep0bPTz4oMXGssveux88yzgBr0RDQgXKPj5q84EwKzjradWAo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5595 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 ac6c2c396d4f..75f34e6fdea0 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))