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 7E46442D95; Fri, 30 Jun 2023 15:30:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C42640EDB; Fri, 30 Jun 2023 15:30:47 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2066.outbound.protection.outlook.com [40.107.220.66]) by mails.dpdk.org (Postfix) with ESMTP id D3AC2406B6; Fri, 30 Jun 2023 15:30:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TK6XuVZowUrsajJiAEomegAK5dBbibcvfcd89ZDDeZVZ00gN911cfN4dd0b8HQdTw5CKdi7+mPMeMMRQ36P+UNcRrh34HIeqJaq76B9PakLuyMegR6hxhimJHfd+MHD9OqJJCbh1LR9KsOa/nf0GwlaLnIBGpTchbYoOrFo1ltDdc1zBWP6fVudAKQeZox/s1fXkrl3W8ZpWOloKzC40RxEOnY9kGMrP0Alh5rf+XFGDV0YY83O5wwq+TOTTMfNaG1yfG9Rooi1wIQl4eyknonwpJnbMUV9F8idjsjvHKUdp2/7YoetBjX99XVXhdzvvnogocwZVrEfIwhP7GyGTQw== 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=kX+TPJXpL08OgdbOtEH/A2pWJoE+0PkkjwabaVOrHo0=; b=PeaPOQUpbaHiNIZOknP6UUsqU55qKXgQ0ACNM5eR/cUOIxT17O2+NgLc7Z6xjQNd0r0WPOs9YqbJietlJr6zIBoD9pxrB+RE781Pfx5i+tNTG4cGBWIfhW92ROil+M/P7l41RH5l58ia6ui9/WCyiMSw3k4ZdutyVytxBow4k8qYekphv82R2tAE+Qp26rkuMrJLtDI+DMC9VjqO8K/H4emTqQ9FEjgVwgawCfECZHthlnnyqpxdL61qDjJ04+2VS0OXN7dgdv1NI8fEjk+RuCC2ndJ+YjbbkMCyrobDA6Eh/CeIewT9wmNXbbxVDs/2Sze/B4zSujkomyfG7o29gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com 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=kX+TPJXpL08OgdbOtEH/A2pWJoE+0PkkjwabaVOrHo0=; b=U0Bzr4lLyvlpwtgMZl03Gf+toZtDPwj+Va9j2MdR6bEPuYkUpxh/nIBtqM7xfjbcJGQOv7/AMD6Hn1cnxRKa0MU4h0jmib3l3TyqoxyDU/8Z9Jy0rBnntrXrjVlgmaSNjZwfhKidQuCOuk1HARt1o390ZAaqER4yuEdBsRz5qPD1L3qrpbOH0LJo9txLHMCo2zNemp5R1YAAJp/RETBbsmydfKT7knVrL6GiYu8xgtjwUGm0jr1o+cPVT3hSqvskV2xbG2D2EK6YAFUc4s7HVWMmjCzXDHKHhBn150EfPuyFXocIuHp/hdGSBhosY25/XwNPACZ8RmOiN+G30Os+sA== Received: from DS0PR17CA0002.namprd17.prod.outlook.com (2603:10b6:8:191::25) by MN0PR12MB5835.namprd12.prod.outlook.com (2603:10b6:208:37a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Fri, 30 Jun 2023 13:30:42 +0000 Received: from DM6NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:8:191:cafe::5e) by DS0PR17CA0002.outlook.office365.com (2603:10b6:8:191::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:30:42 +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 DM6NAM11FT038.mail.protection.outlook.com (10.13.173.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.49 via Frontend Transport; Fri, 30 Jun 2023 13:30:41 +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; Fri, 30 Jun 2023 06:30:23 -0700 Received: from nvidia.com (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; Fri, 30 Jun 2023 06:30:21 -0700 From: Bing Zhao To: , , CC: , , Subject: [PATCH] app/testpmd: fix the rule number parsing Date: Fri, 30 Jun 2023 16:30:02 +0300 Message-ID: <20230630133002.435747-1-bingz@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.35] 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: DM6NAM11FT038:EE_|MN0PR12MB5835:EE_ X-MS-Office365-Filtering-Correlation-Id: ae31e859-c1c4-4197-6f02-08db796e338d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JjBzcD/uX9zNPCmgXH+WWf2hF1ENO2AMH8CrzqM3Z7BUWnenY3XP1UMEtYeGPIv8b+YBWB1ZWAJ7dNogcSInnoXJE1NGIK9UUEVeQIfEfnD9CWIg1XMvB4xYwXllpDZSqnqr5n5Jj6TcAx++U83QoTv1VFSN9kvnGoPI2PLQD1CTYx+4cztiHhnTH32Bzo2OW7wO/P44rq1Lq5247g6E3m544Zxl+StwGUL7cnhTFTAKwXO2QKL3G5C0Q3ENPpzm4j+3VdY+mogKCJ4gdnF+PyTZkEKefxlhcHsAwtlY23HAX+kVo+y8eFaV1sqKfxMa1tGNwNfhoCv03SojqC9euEO9mJRJ7JO27AHS/wzkmB1bziOOXBQs37V2lrWzHJBC8oxVRWTY14ZWI4fkXPqjziAGvZTjqM8R4TCWRqN/gH0VKrb7btAihy/DsCyGMoSqROOXiaPSuq4PKPMBGNUvR7ABT5RdlhRWiu0QQjlFInSsDn9qW7QwejSQNXnzN79+wM2Ey1SxUJqiObFiaOvtIKplKdFxJ/pkn4DVmsT/zy/3Rp/as48odhYDT3o9jBnleth5qLo/rFvnkPMH9kbDd1BL+zwfcfY3AMC4yW61N/yNA/MuI2KbYR5vGrVa1+PaplV+wHK97Y3cmOUaObp6h1OvaTMZK3KJ0HpgSyE+sjDF43Rb9DL9GV5jGz9OX9aibLb4+RMcXtApT368PzvOoxbY2OutOGPEExuMfNP4+HlDpz3BlxPFJR5scqRP3JDd 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)(136003)(396003)(376002)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(26005)(2616005)(36756003)(426003)(336012)(4326008)(70586007)(2906002)(1076003)(70206006)(16526019)(186003)(6286002)(316002)(40460700003)(7696005)(55016003)(40480700001)(82310400005)(82740400003)(6666004)(5660300002)(47076005)(110136005)(86362001)(54906003)(8936002)(478600001)(41300700001)(7636003)(356005)(8676002)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2023 13:30:41.9608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae31e859-c1c4-4197-6f02-08db796e338d 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: DM6NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5835 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 When creating a template table, the object pointer of the command line "struct context" was set with an offset from the original out buffer if there is a template ID. If the "rules_number" is specified after the template IDs, it couldn't be set and passed to the API correctly. With this commit, the pointer is reset before pasring the "rules_number" field. Fixes: c4b38873346b ("app/testpmd: add flow table management") Cc: akozyrev@nvidia.com Cc: stable@dpdk.org Signed-off-by: Bing Zhao --- app/test-pmd/cmdline_flow.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 5771281125..bd626e2347 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -3369,6 +3369,7 @@ static const struct token token_list[] = { NEXT_ENTRY(COMMON_UNSIGNED)), .args = ARGS(ARGS_ENTRY(struct buffer, args.table.attr.nb_flows)), + .call = parse_table, }, [TABLE_PATTERN_TEMPLATE] = { .name = "pattern_template", @@ -10157,6 +10158,11 @@ parse_table(struct context *ctx, const struct token *token, return -1; out->args.table.attr.specialize = RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG; return len; + case TABLE_RULES_NUMBER: + ctx->objdata = 0; + ctx->object = out; + ctx->objmask = NULL; + return len; default: return -1; } -- 2.34.1