From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8394BA0032 for ; Sat, 17 Sep 2022 08:02:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E903042B6F; Sat, 17 Sep 2022 08:02:48 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by mails.dpdk.org (Postfix) with ESMTP id 8FBF542802; Sat, 17 Sep 2022 08:02:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XBWsFkH5DpwrW/3JXBwFG2P4b/3fZtcQxJc7G1lWhPjL52Qbi99aB9GpgTHtNN3x9VNG5qw8TqTKetvKjqCWtGJ+nkJUPNeNL30PdHOZ+kDkrRtcYJvJo9lCOOVIktxgq/HtO/S9xxKYT28o9p9FJ1Na2zCJXudyyT27gm3KIfrOAtbvDJrRn6cniTnBcOAsJVRY91H4u+Hn1vgWKgZ7Z4iMQdyYYnprEFRiv+fenUlb+K2wBGY/JFF9ICppf0ektYFIQIW0EQ7kX/sAI93LtLVPncyLUZzIw+mQ5g5Q6zAd3uWxedvhV8NvFFdyCaYHdVTd7RLud27reXhi1kFzLA== 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=J4odJPslNSskm2SPe5RYRSUERPParWRCvj6k3EfVUBA=; b=FEHfrBSuafqWPGdsnwiT6G7OtZZIQRvBETMnI8EDp5f7Oo0NzQFp5Kb1oQo5k87eTcsAmBzXCsQOf2NBF75Du1RFmLRxp6C8xtq3By00CgvKGTO8RXsb7DW+Nfkz090LyWUre45nDd9RErn8FYwWN0wWIftrdEX6NcKm3iqeuG8Os9LkRH0oo+gfN9xbMMoEfNxG82bl8xPZHGvTpafeoCGGZGEPQlGPUe0ZzqoQNngApC3RKck0dp6PD5sNp7Akl4NbcTGteTqr3r1Ef4q0d7zTNAhLVpUzrQtDEVglwWAJnmHQm/4HO7YzYWLc6Bj1rfUinZ7Z4tx2wF9h6udTdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org 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=J4odJPslNSskm2SPe5RYRSUERPParWRCvj6k3EfVUBA=; b=qd2BnpnFH2ps9Ttx1iZTN1r34aIERiksbpVRdHB0Vt0c0+0VxZKi+7BXv2xCxix8bx0D+mdtAGFtMJ45Y13AargeGemcpZzTxmbAhzrxSObcKEb5o26vfk8VltSuLOOT5nQsMDmgXAU4IUpeNe/A+c/EWvfwRKlJxaCC++uXAfzxfOYewhFQd0k1YEBDZuBg9oX3SMK988UnFvHo33+1ZbpKoVg5asRWdDV8PlQBXMbiKUAiMoNF+6XFUxlRYBueeaiYxnZ73J6OjXZ+AnG1AHc76GMMrxv7WP83RpjPEixykG8Rr7tNjxL8l5VHEDb6sPoDcQ6XaphODnmvPFwgdg== Received: from DS7PR03CA0095.namprd03.prod.outlook.com (2603:10b6:5:3b7::10) by MW4PR12MB5604.namprd12.prod.outlook.com (2603:10b6:303:18d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Sat, 17 Sep 2022 06:02:45 +0000 Received: from DM6NAM11FT085.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b7:cafe::cc) by DS7PR03CA0095.outlook.office365.com (2603:10b6:5:3b7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.16 via Frontend Transport; Sat, 17 Sep 2022 06:02:44 +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 DM6NAM11FT085.mail.protection.outlook.com (10.13.172.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Sat, 17 Sep 2022 06:02:44 +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.26; Fri, 16 Sep 2022 23:02:35 -0700 Received: from nvidia.com (10.126.231.35) 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.29; Fri, 16 Sep 2022 23:02:33 -0700 From: Shun Hao To: , , , "Sean Zhang" CC: , , Subject: [PATCH v1 3/3] net/mlx5: fix meter ID tag for meter hierarchy Date: Sat, 17 Sep 2022 09:02:10 +0300 Message-ID: <20220917060210.3332529-4-shunh@nvidia.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20220917060210.3332529-1-shunh@nvidia.com> References: <20220917060210.3332529-1-shunh@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT085:EE_|MW4PR12MB5604:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ff6d6bc-05cb-455c-32b2-08da98723d52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8hYBe+tcuQLnMUeuoIyNCTshi2dRldw42p6QeWGXnaEY+zbC3xNgcCl/izO/eNAZDeDn0zmVmdSH3AiIeoEHfivawWVNPkUlNZCiUvPpvOfOiYJlI5U4UADI/iTEmCUOcZxfhgfPf2ECnAJY56ko/FPHMez8Q9jLd4SJC5/Zym0jG0ohCJeHQuqzPjvAgCoYkP4FkIt2lwcOlhEJacDJoOKlrcE3/G948MtUs3RqI+IAAk2Hm4VmUKrZKjkmdKoRszr0aT88yXI9jjSvbaKz6Uf0CqOCR0Q3f4RfAD/jeJOQH7BsDf0LB5l6a7FyKvTfNTjnEwBpM+klIgOoOWJGFw/3usvl8cjM98+sNZdR1o2T/QFmlWDEG6j5K8/xubJn/DYr1LEZN0UDyCfhicD0GNKS8IxBiBfyk5AKCuxcy4xNfzeg6G577wC7AQsPW77Z6nt8hNwNmJjiEfm8BsFH8M9ic5C0svCl4aRuxeq2bPYkUCjxwaFqmrlQilH/ZpQ4RjY2La2O5qqomtNe5Osvq/CUeerKegIF0NogpMafRdMxB5Df0EYQlTMfLZIsZi7VvCiLl8lA6pGans1uYSOrXex9jajT+uohQxksJUWt9ptEeXNhxrG1xF/mVubSeU63D6IoEoTtHJueCUcsyPj7a0IkJm1AjEbznJZQuI1TTdIoyE4bXERdywMLALpc7Ol/qbxhILdKcnk6nPKs/Rv7mZwv93YT8rbSGkgqqAl0ZG2CNfcuOTx4PlMa7l8usxGvf6QmAMbV81N2MhWz1FprIQ== 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:(13230022)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(26005)(450100002)(82740400003)(54906003)(70206006)(7636003)(336012)(6666004)(82310400005)(186003)(6286002)(1076003)(8676002)(40480700001)(478600001)(55016003)(47076005)(7696005)(5660300002)(36756003)(4326008)(83380400001)(6636002)(8936002)(2906002)(40460700003)(36860700001)(110136005)(41300700001)(2616005)(16526019)(70586007)(356005)(86362001)(316002)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2022 06:02:44.7431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ff6d6bc-05cb-455c-32b2-08da98723d52 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: DM6NAM11FT085.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5604 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Currently, when flow usese meter hierarchy, a tag action is always applied to set the first meter's meter id, so as to update the first meter's drop count. But it's not considered if first meter doesn't have drop count. This patch fixes it, that in hierarchy, if the first meter doesn't have drop count, no need to add the meter id tag action. No change for non-hierarchy meter. Fixes: e8146c63 ("net/mlx5: support represented port item in flow rules") Cc: stable@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 2038c4a6c0..e4744b0a67 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -6438,14 +6438,12 @@ flow_create_split_meter(struct rte_eth_dev *dev, } /* * If it isn't default-policy Meter, and - * 1. There's no action in flow to change + * 1. Not meter hierarchy and there's no action in flow to change * packet (modify/encap/decap etc.), OR * 2. No drop count needed for this meter. - * 3. It's not meter hierarchy. * Then no need to use regC to save meter id anymore. */ - if (!fm->def_policy && !is_mtr_hierarchy && - (!has_modify || !fm->drop_cnt)) + if (!fm->def_policy && ((!has_modify && !is_mtr_hierarchy) || !fm->drop_cnt)) set_mtr_reg = false; /* Prefix actions: meter, decap, encap, tag, jump, end, cnt. */ #define METER_PREFIX_ACTION 7 -- 2.20.0