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 58E8B41CF0 for ; Mon, 20 Feb 2023 20:18:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 520E6430E3; Mon, 20 Feb 2023 20:18:49 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2075.outbound.protection.outlook.com [40.107.101.75]) by mails.dpdk.org (Postfix) with ESMTP id 6741A40395; Mon, 20 Feb 2023 20:18:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jeykBszdfutBO7yr/xRQleTtB0Zjuny3KXpTLRQQaVq+i9nyqti3+4gE39K1Ell9HqV/F246uNzdOCl1jwkDng6IIRFWpJ2XvzSMKb6fl0xUpP39QrPXuMujWSyuZnaq/GAVzVv0dV8i2J9OEHoPAu8ngbx4nMCRKaQNEyNqt+H+9zMyeDkGYgBaLT1/znplYcE/1YpjSpWUIeTuJspppONs0ypaWeZp9yeFZFPv1Aj8prcy8aGT6/mNFP+aTUnqee2qd4NUTGp6ulV9VglmwHdxjmtmI64IYKKTQfCOVExZZnHo/HG1thSHBu/Xw8FKOfwVxPWCfC7jQpHyZP97xw== 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=WxqCQEYpXmOdWb9xmfWIm3/gIkhGhMtRK3GzDcEznf0=; b=NcDOqGJZeqF8zaKeTXVg6ghq9DdEDB7z4OxA15xvg38R3U8uqkPucDEXQcVrIE3ztfIZqCG1kxr4dw0cNVfcFdMAxyt/ItZFAmjIqZOdMz1it5iAFvNxz431IfPlb1r/KsNYxpHt1eR2M6y/NWifuj5+8vYdCgUT0s+QjbKku88XglZDWElyd4pdH4gm646P4031eplSdTOgwtqGkalp+sYD3SlnG8mhI+cXQW7CPbzOOHaMUez61ngUzrOch9iz+5UzbkAQ9SQN87sJzFSZp1Z4ROa6qF1gPRPyAZ/1Wg58HVDM1vw5Ms5VIJ7jLmBeSLI5igDJzci5EVQ7AM/DAQ== 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=WxqCQEYpXmOdWb9xmfWIm3/gIkhGhMtRK3GzDcEznf0=; b=FDeqago7uKuCVy6GOg6Pr9/stQ6KB3dI2EZYWdIx83RA0CpDGCeKfwyap3g3CXio+Xv8coObl/rKINySJq7Ay5zxj1niCsgnFFiVp0wyN268xq8XS+eUGw3a+CaouAYwo5ZiAhxUHPAMVYFe1gdq3WUojRN2sHGvQ7jfGhAzCb9tO7RIFjN8ILv2gg46Z9h+0VX+UFFA6VPCpLcuBZYfSfKKLPOUfRlctEVnbA+VapCvaI7+HEA6OwjKOF57hYRWPSYUrk8UoJ7mYhtv2nfq/NpBEGGR4gc+3wCKb5rUi+Sq/cVv4ASt1X4XMaBJQDS3haYRPtm+uS2sP+3MZzuLjw== Received: from MW4PR03CA0041.namprd03.prod.outlook.com (2603:10b6:303:8e::16) by MN0PR12MB6174.namprd12.prod.outlook.com (2603:10b6:208:3c5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.19; Mon, 20 Feb 2023 19:18:44 +0000 Received: from CO1NAM11FT116.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::a8) by MW4PR03CA0041.outlook.office365.com (2603:10b6:303:8e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Mon, 20 Feb 2023 19:18: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 CO1NAM11FT116.mail.protection.outlook.com (10.13.174.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.20 via Frontend Transport; Mon, 20 Feb 2023 19:18:43 +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.36; Mon, 20 Feb 2023 11:18:41 -0800 Received: from nvidia.com (10.126.230.37) 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.36; Mon, 20 Feb 2023 11:18:38 -0800 From: Gregory Etelson To: CC: , , , , Ori Kam , Aman Singh , Yuying Zhang , "Alexander Kozyrev" Subject: [PATCH] app/testpmd: fix template action mask parsing Date: Mon, 20 Feb 2023 21:18:24 +0200 Message-ID: <20230220191824.2393-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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: CO1NAM11FT116:EE_|MN0PR12MB6174:EE_ X-MS-Office365-Filtering-Correlation-Id: b4e14906-f778-4db2-1e11-08db13774872 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 77MZmZptMup+KtSdOP2KXgd8TSKOAkSdDohT7WAOjQueO/B1iFJO/lgqitz2Pjt3a0NsuFkte1UDq1OMjyZ3f0ROX3x7Oo3muT+naszhsKJ1MCaZ2/Pko5Y9naXbp9lXR74HJvf9akkRhH9U8qQ9LENt1+qzJPORAfgU/WEWquCDv3RAbT2QS8noA3uL5hVxtqSBDB4a3z5+dWSOvuxVI+NHnm1PhPYCwUcyR8MBM4qQpPLAwVfre24K7kAM+OfUjr8efgFL85ORHpRpQV9tC0XjjurjOgVL2Z0haItf7o73/Qz7ZAvt44oJzAHyKaNToT3xyDqmyH50HyMXnutzBcHdvYYwN487eC7guBFZCbSYs/hy5ipVEdbVPIPGybKHl8On8gQ3LAEKOOBIvcVAziV0h2ZLsz2OiVX6mZS18MQHt3swt4H1ovvqs2WknVKC0qakucN/fJ42DqurTPP+X1xXVxBdF5HS2S5YnobG8E9GnOxDYGHossi26eQB0S8x2u6suB8fukCApOuCN/VFUONRO3QyJFhM+xA8IJrmKX/S6auzq4L7tgiRUsr+ZonRPTDxX3Mqju7gyCl87BFde6sFxz/cy8Nx+1OaDAIx5gja9ajLdIvfC5H+rrV7XTPudW2Dsm8neMy1xiNZrRC8xo+YUeOx5dJy+YEIDcQuww25eXujkZ+EzMeZ2MbYaGuj9DNl4fpHIAjV+EuJ1geDZA== 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:(13230025)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(4326008)(70586007)(70206006)(8676002)(316002)(6916009)(7696005)(54906003)(8936002)(41300700001)(5660300002)(356005)(86362001)(36756003)(40460700003)(55016003)(478600001)(16526019)(186003)(107886003)(26005)(40480700001)(6286002)(1076003)(47076005)(6666004)(426003)(2616005)(336012)(2906002)(82310400005)(82740400003)(7636003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 19:18:43.8500 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4e14906-f778-4db2-1e11-08db13774872 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: CO1NAM11FT116.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6174 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 In the flow template API, non-masked action must set its configuration to NULL. If flow action defined a configuration structure, then testpmd *always* provided the action with configuration buffer. Testpmd also implicitly assigned 0 to all action configuration members that were not mentioned in a flow rule. As the result, testpmd configured non-masked flow action as masked with all parameters set to 0. The patch fixes testpmd parsing. If flow action token is followed by the actions separator character `/` in template masks section, testpmd will not assign action configuration buffer. Fixes: ecdc927b99f2 ("app/testpmd: add async flow create/destroy operations") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson --- app/test-pmd/cmdline_flow.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index f1991a5a9a..134b316c18 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -7490,6 +7490,14 @@ parse_vc(struct context *ctx, const struct token *token, out->args.vc.actions + out->args.vc.actions_n; data_size = priv->size; /* configuration */ + if (out->args.vc.masks) { + while (!isspace(*str)) + str++; /* skip current token */ + while (isspace(*str)) + str++; /* skip blanks */ + if (str[0] == '/') + data_size = 0; + } data = (void *)RTE_ALIGN_FLOOR((uintptr_t) (out->args.vc.data - data_size), sizeof(double)); -- 2.34.1