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 6CE1542E24; Tue, 18 Jul 2023 15:33:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D508042D52; Tue, 18 Jul 2023 15:32:49 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id A6D7542D51; Tue, 18 Jul 2023 15:32:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HF50+DcQVsIHDzGQOusT2pHFGE7nZWWtenZIF7MqdNmJLTCoqUaKUyNq4x2W0tiQeP9eK07e//gmiXUfl41Z9wmni2UW5FKE+sphyP/N1++leFElJ/MocuhHWyJTqUcmt2QvuaEMNjIatObyVJiOicrZicklBjhT4GrrzF0OkE6Zf3k1FysCHd/i+90vMI5VX8hRdNJ+dbEGymUyywlE4L9pwaTPAxwKPol3Gr8PDSdQW9ExZhYMgJo9KrD23fOvpeMZzl/b1UF8SVtmmVHoERivRwQb0kb5PqAfFPMjgMHnSpEdyMOX33fcF2mWrVyo6ATdTdVxdzhBf7KL60+ZSg== 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=1zlxxxo3rxPXDqCyGciBwH1JRaw13c+SUn3KbE6HM7A=; b=HZU5yhQOUMgSsbGUuwlLxFMpYweSNfVWAKfagXa694DH4oMif/igEPc7uejDmjtQkQ3lSzyz0kW6kEZFQzaedG3W9r+FK5pnwCNdPSAzdTYEykdcJDnqp9QoZAQaQNDeLL3Xl62iol2GixYUR0y38imnq405XbLPA/EKtKZmEmp5UgIi8HdOukvFMEwp/RfDLHCotrnAN0GaRJ5H8M5wLXFcSgU3Q64djLbflCCmnScCK0nTPyupcsyQWoB3iji/pGzegcv7gEYd6HV7624QvMDhKOCW/GiJg4gLXFdQZHg2wFAgcjJ1ZpUP1myzntLRlc3W8bCs/uO9lIhLL5176Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=1zlxxxo3rxPXDqCyGciBwH1JRaw13c+SUn3KbE6HM7A=; b=D445M7emUfZXmCJJ0RfBK6gvrCroYq+xurX6GfGfj+ozBpEE51a6O1R+nnhX4nGu2L5Q/gWrU43YS7OFqAcVhYUb0I7r2kFJoXWxolKv5Xm28481EqvSvBkkEhYCiXMpxjVgAsX5NKXjg23621m3kjjkIj7zQwjKgWAVNDgN5bdq5QfCCVUN7+R6i1lM6Jmx/xA3muIsXVl/Oepm7zwF6lxuh5uT9ZemxgnEU8qMrP8ydDBIW4VmMiFW5/UGfOJxc49UndjXl7fdjMOq3uEPvqULdPAOmJ8Xg2aRQ3Qhd908OoUqaSrw0YU88eQ8t5zgfSClCsiBGl9EpmsnDY01jA== Received: from BN9PR03CA0136.namprd03.prod.outlook.com (2603:10b6:408:fe::21) by DS0PR12MB7655.namprd12.prod.outlook.com (2603:10b6:8:11e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul 2023 13:32:47 +0000 Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fe:cafe::fa) by BN9PR03CA0136.outlook.office365.com (2603:10b6:408:fe::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 13:32:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT054.mail.protection.outlook.com (10.13.177.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33 via Frontend Transport; Tue, 18 Jul 2023 13:32:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 18 Jul 2023 06:32:35 -0700 Received: from pegasus01.mtr.labs.mlnx (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.37; Tue, 18 Jul 2023 06:32:33 -0700 From: Alexander Kozyrev To: CC: , , , , Subject: [PATCH v2 3/3] app/testpmd: fix meter mark handle update Date: Tue, 18 Jul 2023 16:32:14 +0300 Message-ID: <20230718133214.3895192-3-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20230718133214.3895192-1-akozyrev@nvidia.com> References: <20230711152044.3141138-1-akozyrev@nvidia.com> <20230718133214.3895192-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT054:EE_|DS0PR12MB7655:EE_ X-MS-Office365-Filtering-Correlation-Id: 52f60a27-1486-40c9-f216-08db87937987 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pMU9pOwyWwL3+P4gBI7uSOwamMItHBF77VIuz36NEzlMicEuS8hHXrcUEHnum5BV8uze0tgPSnKN+lPwj+fpk63clQdKhpSgggV/tqjrBkOXOz5GVGpTj+4mDnJrurvrrJ8i+xhVuXdcE6JaKL+I1W+kBrjrtyYLY7nfTY9Irq+UwD/hec+BWH5f2edrOGQx/2JUUbByVpRUAlSrXhC4rmJD33cCLGVdmEMNi9B7O+v2PrgswYpOBFxNWeQMLjHfMEr75LnpEu38zRXuUM5d2fveiuEW4+B7lqE8j33g3IQnQ2Tc8cC2M4BKy5srqWG7fWUxnejvshO4dQTu9KajANOQ+VR9njL0xf6AyuLP2ECr8DFFE8eLg5PoZ9o0vlFzcLYdlFZ1nqiifcoTshwzqtwWACmGAn6Pi+1Xc1lIlOyH+ayKrk2tZVQqBwb2nNT1RYyIHBpVUfqJ+cSvD271X6rW2azZNHtJjnor4VGrG+Qbo6Eo3k2wAw3aK2DvJWUCItO1aszw7uRwZcaWfRWJaNNYM60Ed1gwiDD1PWx2Qv9nQ3ZBICQG59kPdTpKYQI8RSISOj1MzDUWGB1XayOYBggKOiSkERu0Y+SwKNVL7HAWpBb21/J6lpbV6DGW+9bOf0CsXFPZblRc2ifGKUv9h43zoEeHt/d95QxTxigz0kaNoaYJCy2ks1V1Pr7Qjs9pc25SPeB4btvnrtXGN/zwwO9e+jk7+8BxhFd6ya58ocs= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(2906002)(478600001)(54906003)(6666004)(8676002)(36756003)(15650500001)(4326008)(6916009)(316002)(70586007)(70206006)(41300700001)(8936002)(426003)(82740400003)(83380400001)(336012)(47076005)(2616005)(356005)(16526019)(7636003)(40460700003)(86362001)(26005)(1076003)(186003)(40480700001)(36860700001)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:32:46.9920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52f60a27-1486-40c9-f216-08db87937987 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7655 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 The indirect action handle update for the METER_MERK action was implemented only for the async RTE Flow API. Allow updating the METER_MARK parameters via the old sync method. Fixes: 9c4a0c1859a3 ("ethdev: add meter color mark flow action") Signed-off-by: Alexander Kozyrev --- app/test-pmd/config.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index c4784b7f2c..11f3a22048 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1943,6 +1943,7 @@ port_action_handle_update(portid_t port_id, uint32_t id, struct rte_flow_error error; struct rte_flow_action_handle *action_handle; struct port_indirect_action *pia; + struct rte_flow_update_meter_mark mtr_update; const void *update; action_handle = port_action_handle_get_by_id(port_id, id); @@ -1956,6 +1957,17 @@ port_action_handle_update(portid_t port_id, uint32_t id, case RTE_FLOW_ACTION_TYPE_CONNTRACK: update = action->conf; break; + case RTE_FLOW_ACTION_TYPE_METER_MARK: + memcpy(&mtr_update.meter_mark, action->conf, + sizeof(struct rte_flow_action_meter_mark)); + if (mtr_update.meter_mark.profile) + mtr_update.profile_valid = 1; + if (mtr_update.meter_mark.policy) + mtr_update.policy_valid = 1; + mtr_update.color_mode_valid = 1; + mtr_update.state_valid = 1; + update = &mtr_update; + break; default: update = action; break; @@ -3162,8 +3174,10 @@ port_queue_action_handle_update(portid_t port_id, case RTE_FLOW_ACTION_TYPE_METER_MARK: rte_memcpy(&mtr_update.meter_mark, action->conf, sizeof(struct rte_flow_action_meter_mark)); - mtr_update.profile_valid = 1; - mtr_update.policy_valid = 1; + if (mtr_update.meter_mark.profile) + mtr_update.profile_valid = 1; + if (mtr_update.meter_mark.policy) + mtr_update.policy_valid = 1; mtr_update.color_mode_valid = 1; mtr_update.init_color_valid = 1; mtr_update.state_valid = 1; -- 2.18.2