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 27363A034F; Thu, 29 Jul 2021 18:05:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35A6241109; Thu, 29 Jul 2021 18:04:50 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by mails.dpdk.org (Postfix) with ESMTP id C6F01410F3 for ; Thu, 29 Jul 2021 18:04:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCQ57fNTqLncJ9j2N2jUfc2/iH5fd8OpTm+bc1dYRCZu0fYwfADPG556TEktlBI9+92au7FzIcIW+FI9E6HaZzqO5NA+3xNKb/EfmW67JdxHN+TGob4grgzY/ofeH6T0uRH2SUXa+JukntcZppNs6mTGCKKY0IW/xZAs1V7teptA5Uo5Kefng6VlmrlxKE1iC4sl0WUWnDYoEro1a5kZdueOWVIb3ga3CK+1gH8IvGMXTGUc66UsCaW+ByuMskCuNpGSLoax23uAhOGd+40xC+Zf2o2zzTSQgmpsmZj2L3zexBpYECUUmApRdQhu8No4mminUZ0WxVSpMx9dxDbxLw== 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-SenderADCheck; bh=09qmox/HL8l+WT4bO5NWbc/taJt0E6m0yNhb2oOd0w4=; b=aLWsATUdtxh9SjUUD5QEOQT6haIu4MkOrpqPYld9YIfSBycLPKjXkWaN9a8eMu9O5XHJGi47uKjhQn9TdA9aWPiP3wVodALMMBYNXGr0ng7TBJ+9PAdcCSwRJ0oMCLGAtYmhCqo8liJtEq4TsJhVP1FMLpQovjFPPeffH+hJHyIwoDDk2yYlvCYsKfxXozbmWroOt19khVNsc3yiWtq8sU7aOKs4AfEPvUhxWFY5FstGDP9hYo/jX2UXlprtriQX9LjVcjc7OUSeRmnccOxTDsJszpgGVSIO1zLjb4JHAsbIJ6X9kMwH/Uaw8nKDtqnSMou3mQySvrviV8mf0IbYag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=09qmox/HL8l+WT4bO5NWbc/taJt0E6m0yNhb2oOd0w4=; b=PvdVcY+YkDGDgNdEQldiFZhtJRnkFbvg0E+cLRxm5ESh9hVCi5rmPJPmpghR65LX1brwR6wBllbMlwqTIVTJVGhuIwRtfKQPSmEahxLcFCvFrcx/slTX1OmHYJFIYQ5iAyeZpPshOfnyQ+kP7vlZk+BSKKqzyROdYFu7W5pINMsBurrHsrL7p7hM6d9ParopquWpMUdJcfgWXKhmYIy3x4SPUSk2ipNzfvJyECTa/qKkB1H1cPzH8+euscoZ/+41mLUAK54dbHSYseH2rHvP/Ezrw2gdLrGlC7B/ypyE0Oz2/x5Jh6kYN4uhLVXPHtzXOcg732fj6o42vGINyFSJzA== Received: from BN9PR03CA0956.namprd03.prod.outlook.com (2603:10b6:408:108::31) by MN2PR12MB4405.namprd12.prod.outlook.com (2603:10b6:208:26d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Thu, 29 Jul 2021 16:04:46 +0000 Received: from BN8NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:408:108:cafe::9d) by BN9PR03CA0956.outlook.office365.com (2603:10b6:408:108::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.19 via Frontend Transport; Thu, 29 Jul 2021 16:04:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT050.mail.protection.outlook.com (10.13.177.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4373.18 via Frontend Transport; Thu, 29 Jul 2021 16:04:46 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Jul 2021 16:04:43 +0000 From: Bing Zhao To: , CC: , , , , Date: Thu, 29 Jul 2021 19:04:05 +0300 Message-ID: <20210729160405.161982-4-bingz@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210729160405.161982-1-bingz@nvidia.com> References: <20210729160405.161982-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 477abc66-9869-45f9-f21e-08d952aa95f5 X-MS-TrafficTypeDiagnostic: MN2PR12MB4405: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d/SjYpZc51QAn2WXhW0VbO/XNu9DRT/B32wlSD77Rhzly5RH3+TDTWfkUSQ4ulz5YIiuxp3fW1yo5pVfMRqCb+PopYiLYl8fjZ6x+KI1X1LloXKUDdYDEl3bUzT5JMHouSKc/cHCCMXr9AKnoY2hBXDhQFzHsu72hVNEOpFZ73KtMhj88Lfk56X7tZazUYE4GpY9LcAwOaFPGMdCWc3CKNQOvglhP24IJF09idCwZNzNtIds915NSGbX7V6YPzO4ewW8ecaIgIYz+veAIB28GwkMvEnKNSAd+ymvxOs9G+7EPdlXZGBAwRy7TQ4O/vwaHYJe/t1o0iOHx1inZLyhIbITBG3SbCija+nYhSTpgz1EXvoF+b/PyRe3vwV7bqXBvTjh5oVHnAuSSa7DNN4pBXH8vvFp6FGVfLG1H0CIq9eIFvXGJif6y/e3n+EBzhu+8WiH4JUE1zZcDmduJqZk+IQrIOwV17/j5JkidSyxe7gGcZcQxAdZbfmFeL4KR3wdKKu/6f3eABz8NDwCZhoM2IZv1PiVaToBcLtskgeGrklyltv8WKyleovx4gwNS5tHe45qhYP7BbNoMKqUCCDa3lVdavy91rofrfo1g2ce3AQtuYdDM879x5nbAlnaTdx9u1BUUcg2p8lQKlpZIJ5TdiVNlLHMyaL6NzngH2lHBGU0JX9qO5Ao2wPInCzEsLA7D+94+IBW1WZz/PbUx1cWRg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(376002)(396003)(39860400002)(346002)(36840700001)(46966006)(2616005)(16526019)(478600001)(26005)(55016002)(8676002)(8936002)(70206006)(356005)(7636003)(83380400001)(186003)(70586007)(6286002)(82740400003)(336012)(86362001)(6636002)(4326008)(2906002)(6666004)(36860700001)(316002)(5660300002)(7696005)(107886003)(54906003)(47076005)(426003)(36906005)(82310400003)(36756003)(1076003)(110136005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2021 16:04:46.1028 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 477abc66-9869-45f9-f21e-08d952aa95f5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4405 Subject: [dpdk-dev] [PATCH] net/mlx5: fix the meter hierarchy validation with yellow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In mlx5 PMD, the meter hierarchy only supports the green color. It means that a meter action can only be in the green action list. In the meanwhile, the yellow action list should be empty now. Any action for the yellow color policy will be considered invalid if the green color policy is a hierarchy. Also, the error message printing of meter hierarchy validation is fixed by removing an incorrect checking. Fixes: 4b7bf3ffb473 ("net/mlx5: support yellow in meter policy validation") Fixes: a3b7af90baba ("net/mlx5: validate meter action in policy") Cc: shunh@nvidia.com Signed-off-by: Bing Zhao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 837450722a..d5669e209d 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -17691,9 +17691,14 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev, return -rte_mtr_error_set(error, ENOTSUP, RTE_MTR_ERROR_TYPE_METER_POLICY, - NULL, flow_err.message ? - flow_err.message : - "Meter hierarchy only supports GREEN color."); + NULL, + "Meter hierarchy only supports GREEN color."); + if (*policy_mode != MLX5_MTR_POLICY_MODE_OG) + return -rte_mtr_error_set(error, + ENOTSUP, + RTE_MTR_ERROR_TYPE_METER_POLICY, + NULL, + "No yellow policy should be provided in meter hierarchy."); mtr = act->conf; ret = flow_dv_validate_policy_mtr_hierarchy(dev, mtr->mtr_id, -- 2.27.0