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 6257A42E47; Tue, 11 Jul 2023 17:21:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D5E142D1A; Tue, 11 Jul 2023 17:21:23 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2046.outbound.protection.outlook.com [40.107.223.46]) by mails.dpdk.org (Postfix) with ESMTP id E324E42D13; Tue, 11 Jul 2023 17:21:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UpjINN+2EUayPjJPC/nNLhAwQDpwbdFzkAVGUiaGuBvafWr6FQBlvtzByCRHFoNo3YZMhHbot+Eu8RaRQNAvc9nBU9Ej/sGGYtKbBlW6uD8rH1jJUOEBrbOIrNAO6VgejS5Kr5DgyfCwqus35NesL9kpHsX3dnlH1+m5XPXan7Xh9BcWcDP3Qo6Vo40AZP26dt+ArXli3E9S3XSztN1cLn3sStBhjM9tj2Ehl2epYFEXuX+3G9zSlPDQH6SXTmYE0DiY7aJkpjmTCyhA6NXVBmCVZ74hXh2aQBlNbLAspWys8zIE9DdHQtFte309FGS/NxupeMs/BFfgDmKoOml8pA== 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=jbNlLe9QIdNhpVkhkpkxxVjSo7r8lVBFyWY2NnQJw6c=; b=R+IMKK9n8N2L95g2bEF7mzaRsHLpxekx/Ck0BOLL0lyr65Z9YwJX72ZfI88shEMZG/8M1wrk2U6grG2RY3W0HdW1qIRg3vxHEDBF1EXCFP/yahhGc66riwUi7HPFf1GheKqEQ/Y5z/TXhwcWRCim2yzYbI1u1Fzui6P5UMo1CXjLLpjzlSchDN3Cav4XRMSLXT17/bVwbxmcnh+vwBg3Lq9UpI/LiB+8gJB1KmXWgXk0W95Agdhol9LXjLvo3QW07CwJQqvr2BGEp7ZuoN91Nwgc//rgdERwqQWgtgPBCaL5d7wV2lnAXEadaQ+q8OsfihyUBGzPy4f9woGUmHAEsQ== 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=jbNlLe9QIdNhpVkhkpkxxVjSo7r8lVBFyWY2NnQJw6c=; b=QQoEqQqc+yg7zl3XN28znEoo/lv8ZhymvJGxHigDxqTqPbdxDJwU1ZYXMenxGGxigwYbLRe6uNB9Z7asWhl2oZlWPiijPwGyfV3+mj1i5ofQgn/BPJYBUTMoahDYLiur5tKSfHsCont+EIpnabsxT4bPolCQr4mLladnA7GI34+12k3C49o2J1CdPZY8gPijserQXpkRLePSMTVBPjIlFbN/3PxMKktjQCIwyGRdVVA5Bdb+8EKeOWr44tRj4adeeBbAbhKcYOxM93LyIFat0gvn5CtEQfWXwW/mFrKGJ7jeFZ4iqMEEPfW34x+C76xLLhMYIuCY0TSfVOwEyy69Qw== Received: from BN9PR03CA0111.namprd03.prod.outlook.com (2603:10b6:408:fd::26) by IA0PR12MB8376.namprd12.prod.outlook.com (2603:10b6:208:40b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Tue, 11 Jul 2023 15:21:17 +0000 Received: from BN8NAM11FT090.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fd:cafe::f5) by BN9PR03CA0111.outlook.office365.com (2603:10b6:408:fd::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 15:21:17 +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 BN8NAM11FT090.mail.protection.outlook.com (10.13.177.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20 via Frontend Transport; Tue, 11 Jul 2023 15:21:17 +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, 11 Jul 2023 08:21:05 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.230.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, 11 Jul 2023 08:21:03 -0700 From: Alexander Kozyrev To: CC: , , , Subject: [PATCH 3/3] app/testpmd: fix meter mark handle update Date: Tue, 11 Jul 2023 18:20:44 +0300 Message-ID: <20230711152044.3141138-3-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20230711152044.3141138-1-akozyrev@nvidia.com> References: <20230711152044.3141138-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.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: BN8NAM11FT090:EE_|IA0PR12MB8376:EE_ X-MS-Office365-Filtering-Correlation-Id: 270b839e-7911-4ab1-6a1e-08db82227947 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hxIrtPuaqCPko/6znDtTUh59StY5Y/UHxoZ7OhtZdQKhLCmdgbTMEWFSEFWjzM6fRtyNjUQN9vMmnAGeG5GL4IbAA+FfimCqRkuFoAfoZ18NVJpwcfu0vVMJ/qmdvD/7DHMtLGkd+5kNIySsOmkbmspfGsPtd1SnM8HWJkKn3jSv/AE8HbjaFgMNZ3QAeeYIGrD8OZA5eaM6gd/Z5Z/FsV4LwlacEwHytgYuUUv19PnedOFpsYbYIz7zDM7+WJHr1X+6WO4XpMPW4dlB5vpwD0D/w/L1ld7iOKyWlPEZkOI3UGY6a2LfheSCCZG+x1HGMtLHI3zJVFdyAQDCnSMzXoS+MNFGT7iXsArTd3BkPaDFMlyCE+D7yre/sqFj4Ce66zAAsXoOhjBCpZmfdX0HNypUQw83B2GbPscbzIiBrJKfYKdGkXASDMmF8AdzsxK6wmtRPkWNHRJnKT16osrLJaB8myHX3hiAu8Ajr9XJMYD7IzoQQ7Uo7LJjynUgaitFvQN5J1vpuNwW7SuMCyt2ruwIbGh+M6s3DeLEFoiRnbrSvnOYxyCzYdFMhcBTIFb9dnT0Do3brKG6NMV83r915F0Nf3MBgslsViul39heXpaoa++aTAK/XxMmuX+D7UnUHcpGsf4EjLlbh5UhGG/0vlzhhkmoAVnDQnKKAF7OQDheOLObfJLVykOXBKhcBclVPKGAAwQVCDGljcrBQUm2t9Q5VIY7oV8okya7wWgnKx4= 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)(346002)(376002)(39860400002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(426003)(336012)(82310400005)(316002)(6666004)(15650500001)(54906003)(4326008)(40480700001)(450100002)(478600001)(2906002)(36756003)(40460700003)(356005)(7636003)(70586007)(70206006)(6916009)(82740400003)(2616005)(83380400001)(16526019)(186003)(36860700001)(5660300002)(8676002)(8936002)(47076005)(107886003)(1076003)(41300700001)(86362001)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 15:21:17.6404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 270b839e-7911-4ab1-6a1e-08db82227947 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: BN8NAM11FT090.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8376 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..58ac1576b7 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: + rte_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