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 7B146A0C43; Mon, 11 Oct 2021 04:41:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D8D2410DB; Mon, 11 Oct 2021 04:41:19 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2070.outbound.protection.outlook.com [40.107.237.70]) by mails.dpdk.org (Postfix) with ESMTP id 4A832410DA; Mon, 11 Oct 2021 04:41:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HneecdMuwracqGcSgvYyO4as8jda9MhIvg2azdREBTnabNGXuJbpbu//95vOmLZIL/jqTjOr6gd9aGtRj8kbk4jki0DnpIYm8cclwlJx1o1C7ffZCOks7G+jaoE4R9ZkYSd1ocR6KB80uqj8YWL+7GMyw4FQrQwuI2NSw8iOxXjHLgvl4wzemM5SO8VLZEiU0uSB8G7PqZCBW8hBX45w25BxcYgPCYrxv5uz6gTlrG2/xl4NmJHqYcKUv0AroizI/DPFx+S6AmktlYofUi4DtHdCxrcVPFN9JZpdirAbp5nP98J09A4rPGW0X/JOi0wZJHpL7Vv6iar8QE5pw+c0bQ== 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=MZkUiNQ4zREkrvsjl2l6x0b9NsU0DjwER364853VWyE=; b=i7h7eIAiNjjFWva8nadCFHX+xt9bpu46MRjvSmGc3SaupyGJT13vVUA6kc9qmtdJ/t/UQ2oWiyHC4nI0/+ciGgIuOmxyA19kWm9f0+FDhANFu/KRNUH8yqbCH9waJEZY+phr1xSIps20K3myj3eCI/Q8T9lKwz5S+gEZpR4dBXAFq1Ge/FkWZZOvw5ImZa1ZPX+AqCZWNxDNRuYSG5QAv3bb0ERVbj9AG6gcRefW4WxPUO7bEzWX+0hoh+D0oGxCfQy2fmbgcBicoLxfcjRkTHNtdjrd/ed4KJ3CcW+y0izrg7lNbKDEHxRNvQ5GspgL2lx8yi/IGbjRuoUP7838TQ== 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=MZkUiNQ4zREkrvsjl2l6x0b9NsU0DjwER364853VWyE=; b=osfRLQvRj3YpSnkei2pOFFhMpV58lYdNY6eTCEmwPVjl/ZAyawJ3juWrQmWEFuQ6BGq0m2wQN0XigiIGBW1UJo019S2ADTtsaCTp9H4qAfCCWhkCvM2GYVPqx2fI7NoGAZhVq6P4MnitzdFdtt3EWj7520yk2FagLYJwX29+js88kN++0B59M0OSdWX6J/CrJ9/1SD9y8SMAgLBD/DBG8DaC+j8Ipr5miOUakCdMVo7K7hCPfBMggVThwiLrPFNvoAW6wEG7S9tfpraTMg+oC7wDJa096qlTC+FoadN4uBAa/XbtUPXxm3P0ucjEfrx4ufIjdEd7JGWCnGINZ9BH/A== Received: from DS7PR07CA0021.namprd07.prod.outlook.com (2603:10b6:5:3af::23) by BN6PR12MB1298.namprd12.prod.outlook.com (2603:10b6:404:17::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Mon, 11 Oct 2021 02:41:12 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::ac) by DS7PR07CA0021.outlook.office365.com (2603:10b6:5:3af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 02:41:12 +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 DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 02:41:11 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 11 Oct 2021 02:41:09 +0000 From: Li Zhang To: , , , CC: , , , Date: Mon, 11 Oct 2021 05:40:48 +0300 Message-ID: <20211011024048.28165-1-lizh@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] 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: 79df2d51-614f-4871-2ac6-08d98c609667 X-MS-TrafficTypeDiagnostic: BN6PR12MB1298: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hUpbDOkK4Zt8Zj0VWQkVtv24ZQUbFSACvyqOXrhDGeuWlnLHr8GG3UhFphgiq1dVnvZSWq0l3ggP2XPGWIxSRHBLA1tBFCRmU9s+pNf6zsFZEbyyfNtJXiwBXUyYESZVkkyiIj8xL3V+pZv6UgzajTBenR3eJDLGHt0TOMufwc/3UBQdKGutP6N6e83gxx7XjWwq1xPlBlktgP/FtaLr7PVYM8F8JfPoiC78Z8GtXjibyUkj/bKIbj2TBgZbE/GG2J1pm6RG4i0is/whU9FDqXNPjLrt3wemnLQ82dc/OnCjshnquL7gXaVte26cd2HD8L/1612EYkc3Q/oGvXlQ+Sn9rDoPr6viv8ijsTthfFm6Mkxxt8sp8m4SQrTQGfWdN7WwF7wNrMyw5jJjBoThTbtaMsp4VB+AvbXOYYsj3b/QCoMOCBte00b+J/zzVIZv+5jGrEPoGZc8kZ8QFl+Jq25iX0we8fA0qlh6uTkvBR163JYxzEsyH9tLye5SupHAlHy0Du6CaEuEE2LhrMXt4KXD3owy30B9lc9mXSSlun6DhQ4e2M21UNnAkJqaZdaSTqdxI9bXXY115K6Qg0nmWKPCPe/AXIWzCa3DO8Kr4eU96SrQNDpMFCEIiJQlPS5z9wH+1ZUiSa6bIgYdNE4MN5aRYV4R+RH74lofIqMHm2Q+ppjtn9FS9o/cts2eAWHQGtpo2p1TaSTTuW0ktyrAbw== 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)(36840700001)(46966006)(7696005)(47076005)(336012)(426003)(6666004)(508600001)(5660300002)(26005)(4326008)(2616005)(1076003)(7636003)(356005)(36756003)(6286002)(6636002)(36860700001)(8936002)(110136005)(54906003)(83380400001)(70206006)(16526019)(186003)(86362001)(55016002)(70586007)(2906002)(316002)(82310400003)(36906005)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 02:41:11.6579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79df2d51-614f-4871-2ac6-08d98c609667 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: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1298 Subject: [dpdk-dev] [PATCH] net/mlx5: fix domains selection for meter policy 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" Fate actions are different per domain. When all the domains, ingress, egress and FDB (transfer), can support all the policy actions, i.e. [SET_TAG], the policy prepares resources for all the domains and failure happens if one of the domains misses its fate action in the policy action list. Remove the domains missing their fate action from the meter policy preparation. Now, the policy will prepare a domain only when the domain supports all the actions and when one of the domain fate actions is on the list. Fixes: afb4aa4f ("net/mlx5: support meter policy operations") Cc: stable@dpdk.org Signed-off-by: Li Zhang Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_dv.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index c6370cd1d6..ea737e3e35 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -17856,18 +17856,23 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev, "Doesn't support optional action"); } } - if (action_flags[i] & MLX5_FLOW_ACTION_PORT_ID) + if (action_flags[i] & MLX5_FLOW_ACTION_PORT_ID) { domain_color[i] = MLX5_MTR_DOMAIN_TRANSFER_BIT; - else if ((action_flags[i] & + } else if ((action_flags[i] & (MLX5_FLOW_ACTION_RSS | MLX5_FLOW_ACTION_QUEUE)) || - (action_flags[i] & MLX5_FLOW_ACTION_MARK)) + (action_flags[i] & MLX5_FLOW_ACTION_MARK)) { /* * Only support MLX5_XMETA_MODE_LEGACY * so MARK action is only in ingress domain. */ domain_color[i] = MLX5_MTR_DOMAIN_INGRESS_BIT; - else + } else { domain_color[i] = def_domain; + if (action_flags[i] && + !(action_flags[i] & MLX5_FLOW_FATE_ESWITCH_ACTIONS)) + domain_color[i] &= + ~MLX5_MTR_DOMAIN_TRANSFER_BIT; + } if (action_flags[i] & MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY) domain_color[i] &= hierarchy_domain; -- 2.27.0