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 8FEB3A0093; Thu, 16 Jun 2022 10:08:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49CDD4281E; Thu, 16 Jun 2022 10:08:12 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id 5C8124114F; Thu, 16 Jun 2022 10:08:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RXkmo1iFKBqaXe84rYbMOPk5l8COrT1BucLSdfafuSV03FAZJHi+vJHxUormMSNCuX0JI6F2+mJVi4eAD/KUR3Mitdh7AOHwCxSHjw8v7neb+UzSSofD1TUNpWPy9+f8K4FFEWF9VrOmnvHAIyXbcBXmRKMaEb9FRSj9vFSX2Q6r9ova5OLvfJKLaRplPrc0MPRmDvFZZYRoPNywU1498m3oCOMawEs6cuMJ7TC8SsnIbfWxtQj6FKCm7AgcgWiXOjeu51iQapA3NiLINHIOqCUaCY+8WWZiZq+ymwnzrzvjAqEObbcoKELmGcX+N9elSOtvjtyi/rB5c7tstMKILg== 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=HCogfFn4F+l/QOtoqrO+C2gYZuoeMK8g+3x+1+FJ1ck=; b=hloHxRjJyX/s3EKU0QxagDjRs68hEy1V8ov7UTgn8hble0HLTMMAOQkUnEin6HHyEmnPW+XHxx1c7ikQoru+pglrJpV2L8nNp6B8q4jO2vMI5qYoO5pBuQP+tD6lYVM7ek5oIotJs6NvK9FeZ1ma0VNZxDsCtru9UnOGxJFRqHk+iJtgUtRJkOKKw6IveOhpyfuOBUuCDTmV91B//7BoDFDjIov8+elRj8mRxMOyVwlgiyfRmnv36JohhkCt+P8brNUpWdjqErmXlUVgqLYskMzLqt4VZ4UKwuqvBxWfqWfg+MR4YWxmK/UKyjYc7HVR5EV7Id6s84laNpbf5fHfGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=HCogfFn4F+l/QOtoqrO+C2gYZuoeMK8g+3x+1+FJ1ck=; b=Kn4gXZz2JpGDeGjZH3tH5JM5z7oBMymRaEDapDycvHPKHRUL9ZvF1j9JWoRYW+rWgZbMWby51sqxKX1KTZtE1hQ5lVKTfYotc0UOqi9spPxg4Uta17ggTuBzPhMnAnkolKuBi23cau+SdEYhXf6rGwYj/HaU5m1U/JnN2iSXHUC7Rj6CvLCFwAY9esMYunN5+ywU/EegQ0qdkYW1zhEafAwiDRoV7zDIhrgrTaYq7Jku+R+whZTt/A2gOMVLZHVOK8la/a2xK83ukFa4/WsM8ZpR/SM4uj94pbRlDbgxN6fHfjY5rqfUqGbtSSzu8iC9G/0lunaHSf7VIdxN0ChfBw== Received: from BN6PR19CA0115.namprd19.prod.outlook.com (2603:10b6:404:a0::29) by MN2PR12MB4405.namprd12.prod.outlook.com (2603:10b6:208:26d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Thu, 16 Jun 2022 08:08:09 +0000 Received: from BN8NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:404:a0:cafe::83) by BN6PR19CA0115.outlook.office365.com (2603:10b6:404:a0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.21 via Frontend Transport; Thu, 16 Jun 2022 08:08:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT029.mail.protection.outlook.com (10.13.177.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5332.12 via Frontend Transport; Thu, 16 Jun 2022 08:08:08 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 16 Jun 2022 08:08:06 +0000 Received: from nvidia.com (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.22; Thu, 16 Jun 2022 01:08:03 -0700 From: Gregory Etelson To: CC: , , , , Viacheslav Ovsiienko , Xiaoyun Li , Aman Singh , Yuying Zhang Subject: [PATCH] app/testpmd: fix flex parser destroy command Date: Thu, 16 Jun 2022 11:07:44 +0300 Message-ID: <20220616080744.5832-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.231.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-Office365-Filtering-Correlation-Id: b8bb25a6-5b8d-45f4-a591-08da4f6f5940 X-MS-TrafficTypeDiagnostic: MN2PR12MB4405:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VOADMNmtIQHn3Gh61+OHmB0PfNPomkp1VivJ2Tg1d+UJm+y5yiAwL/Fy7zI9XjM72hox9iI5Xg+7oWtdlSEju5rBCHGHmGAsDOM3wcUfBbFNXQiD9gOlbTDJug8j05ad8O977BcxD7osWtglGMLtKuy8aL+g/PPfWtxASF73qDAmLLJhggHuK4fShl8P491XTA6obPJqmDgfGRNg6MFs2VNVRE35ePFz5kBRvZTYj9sIiHq//p3VszVozucrYjmBYfYrDY+8oW47eVUIHBR8tCZvKYYRXXnoA829RKzBhKBkgPHOIHpl1ZAVewSGAfTaPRwRP0DjgwR13Qto9sZdW48rUD8dRQ7jQgghcM+eCWxjUuqXp7rdbw8v2CAnmffAkmIDRKyTfs8f/C9UZeKBy3ZnPh0UTf2KTcg2CJpjACvd3heA4MMtT1N5z9JC1iOzScAT8Fw1hk5B8zgeVhqUlUWsj8CvoLOEZeq+uSdLe6IwPwuWmC2D+otNDZxgss5YKvUsceaNZKX7jAAU8FXcQ92oj0r6MEQkPMLVRF1IWGQNbv6jDb8diB12/MqPJrrJFDaiECO7oj/ksxA/edFnD6mNfStSZX/p7o05+FhvMCbF7ZsaZHtR337nHwqzRdp7A9eTAlmkRTWEBGHhBYA8jge1zAQbIxcDloDd/kyh+jKxjp5YvO6+wgQwNvZjha8du+GnwhyhYROHQhQVngNcOA== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(40470700004)(46966006)(36840700001)(26005)(86362001)(356005)(6286002)(81166007)(47076005)(6666004)(426003)(7696005)(1076003)(336012)(40460700003)(2616005)(186003)(16526019)(83380400001)(36860700001)(54906003)(8936002)(5660300002)(2906002)(6916009)(4326008)(8676002)(70206006)(36756003)(82310400005)(70586007)(55016003)(508600001)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2022 08:08:08.2000 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8bb25a6-5b8d-45f4-a591-08da4f6f5940 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4405 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 patch separates flex item destruction function implementation. Setups with installed JSON development library can use any value in range [0, FLEX_MAX_PARSERS_NUM - 1] as input flex item ID. In setups without JSON development library flex item destruction function is resolved to empty stub. cc: stable@dpdk.org Fixes: 2d3d84013508 ("app/testpmd: fix flex item flush") Signed-off-by: Gregory Etelson Reviewed-by: Viacheslav Ovsiienko --- app/test-pmd/cmd_flex_item.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/cmd_flex_item.c b/app/test-pmd/cmd_flex_item.c index 78a89c0f8a..f2560dbf83 100644 --- a/app/test-pmd/cmd_flex_item.c +++ b/app/test-pmd/cmd_flex_item.c @@ -368,23 +368,12 @@ flex_item_create(portid_t port_id, uint16_t flex_id, const char *filename) free(fp); } -#else /* RTE_HAS_JANSSON */ -void flex_item_create(__rte_unused portid_t port_id, - __rte_unused uint16_t flex_id, - __rte_unused const char *filename) -{ - printf("cannot create flex item - no JSON library configured\n"); -} -#endif /* RTE_HAS_JANSSON */ - void flex_item_destroy(portid_t port_id, uint16_t flex_id) { int ret; struct rte_flow_error error; struct flex_item *fp = flex_parser_fetch(port_id, flex_id); - if (!flex_id) - return; if (fp == FLEX_PARSER_ERR) { printf("Bad parameters: port_id=%u flex_id=%u\n", port_id, flex_id); @@ -405,6 +394,22 @@ flex_item_destroy(portid_t port_id, uint16_t flex_id) } } +#else /* RTE_HAS_JANSSON */ +void flex_item_create(__rte_unused portid_t port_id, + __rte_unused uint16_t flex_id, + __rte_unused const char *filename) +{ + printf("cannot create flex item - no JSON library configured\n"); +} + +void +flex_item_destroy(__rte_unused portid_t port_id, __rte_unused uint16_t flex_id) +{ + +} + +#endif /* RTE_HAS_JANSSON */ + void port_flex_item_flush(portid_t port_id) { -- 2.34.1