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 40F2543EC1; Fri, 3 May 2024 06:28:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1BF71402D1; Fri, 3 May 2024 06:28:02 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2055.outbound.protection.outlook.com [40.107.236.55]) by mails.dpdk.org (Postfix) with ESMTP id 2B799402CF for ; Fri, 3 May 2024 06:28:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzpBOVAh6fh5+pOLch2Z2E3P6SQ0WUY3U9psnSi74OTtLuXZZzPdYFBsxLuIyZwwcxBB6a0VkFEbfpKoqP64vA5ENXTKVmMW9SaXfK0IeOiJPnxhWJxZI9/EgmqHEiZuzushjQMp0l9hH/zKaLYzI4hBWfYdIVhNVMNHl8SwA/9C3c+WlYbqhlYa4oYBy40q51/FArEjyK3Xd4CR4UJG1a3uH1payPyxcjbxDo50h+x2H2p33AnRZhfqRE25vHbO4MG815HLzRtB2KSYcspuRUzBu9/iesxocoFYwBupMfFseILAmJTYprJM1vaFQYO+VK/BwmtdCgj6pLhUxhEPOg== 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=1hxCpX/D35UU1jp95TXHko1sCs5aIKCrYuqxukTkHHA=; b=esmfUOlyozbMm99x4vidE+H0woWjBpNaSz98VcVOELGNyCQQGsirQOnZZCYZQnsGtKdLAk+Slm7zgEDxEXPxSJERk7Fdj/TJ7wE24BsbkvUlJj7p6Lz8xYNMIgw8qBKLtdrKMjA9U5dljCRMg9I7nRbb3qGBurpgDmvdpk94OZVE04uS/9CAV+l37WgJcyWP0THbiBZhQHvsOi6HajV/QIUOB0oqoXDjKnDwTfTAyg4Tx7RsIC394/q9jWpkhEvCSDiT288NypPEOfFNmx4zVwtq65cIsFDLfwoDGsf8ilBDcFxSf78KS4R2PVPCs/m2S/GYdi7rFP9NBZukaXJFuQ== 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 (0) 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=1hxCpX/D35UU1jp95TXHko1sCs5aIKCrYuqxukTkHHA=; b=l4HyTqS4YANQmPuzgUyET/8Ig4WKWvkUQ9r3PEpYbmtuGgG2IcU1G3U4Oi2fubb+GFl493QEfGWND4lzcxFtwbGwSRcW0gWVJrRHnWUFtyct4Cg+2JYnfwYUf0gzVvOU+4GWpC4J+NbTAYV+P+swf7wAt15VaoYNeYgRZcKWpjbX/BUaLJ1qVcmE/W0H0wh90D8W7TkzagmPYopBpKNl0gp2FqW2efI1rbkG2I0Rm7qn0ow4mfwFhU23D1etSnSRfJXDlZlfY35Vqrk+z5Ohbhxm0j8GuSFB7oKLQoLROKQVKGJLkd/xkHpmbMWHEO1jG+2+TTr2voO6sgemcTahcw== Received: from MN2PR15CA0060.namprd15.prod.outlook.com (2603:10b6:208:237::29) by SN7PR12MB6983.namprd12.prod.outlook.com (2603:10b6:806:261::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29; Fri, 3 May 2024 04:27:56 +0000 Received: from BN3PEPF0000B370.namprd21.prod.outlook.com (2603:10b6:208:237:cafe::99) by MN2PR15CA0060.outlook.office365.com (2603:10b6:208:237::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35 via Frontend Transport; Fri, 3 May 2024 04:27:56 +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 BN3PEPF0000B370.mail.protection.outlook.com (10.167.243.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.0 via Frontend Transport; Fri, 3 May 2024 04:27:55 +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.1544.4; Thu, 2 May 2024 21:27:32 -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.1544.4; Thu, 2 May 2024 21:27:29 -0700 From: Gregory Etelson To: CC: , , , , , , Subject: [PATCH v3] cmdline: increase input buffer size Date: Fri, 3 May 2024 07:27:14 +0300 Message-ID: <20240503042715.344550-1-getelson@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240501052659.231457-1-getelson@nvidia.com> References: <20240501052659.231457-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B370:EE_|SN7PR12MB6983:EE_ X-MS-Office365-Filtering-Correlation-Id: 98f647f9-0f55-469e-a6ab-08dc6b2967c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YkRZVWlqRjY5aWdLU2ZtYXFMRjY2NDNHK2JBYVpvQTRLM3ZwbnYxMS9vRmRH?= =?utf-8?B?WUxYMjRQck9FUWpMbDVkYmNuR3BBZjJZQzJHM0ZWN1pYSVFZdDUwaGQ4SzJG?= =?utf-8?B?MUdPWTdYVUlieWpkVktSMm9OZS9BWVp3TWVGc05sWngrdUs0VndRQWF0aGFn?= =?utf-8?B?MUNBVHFJRklQZlBzK2MwSUlrNXFjV0ZpY29ReS9Mb3k2ZDV2MkxiRTJsOWRX?= =?utf-8?B?U1plVEVVUEhyUVd3MHd1THdUUlRhMDg0SEpEanE0d2VHTk1GNy96Q2FEeEFy?= =?utf-8?B?UUFNb2YzOTBuR2IxS2RNZ1FoU3lpY25mdXdBbWkxekd2WWxwOXVUWUp3RG5a?= =?utf-8?B?THNMSHI4S2lIakVnRGw5cE9jckI2ZTZmWit1ZEphd3k5RnRXYTN3ZmJ1dWhJ?= =?utf-8?B?dGsreE9FcldtMG5kWVpmUHlNOUZiMXFYY3pWMjkyQ0RsVnF1N0J0RUZNWlJi?= =?utf-8?B?WUk0aVlLeDlyUG5lY1pDUlVIY1MveHo5Q09veTNRRjd4eXFnQ2RWVVFZM0Y0?= =?utf-8?B?aTFmYko2MTZNWlNFeExMcG5taVFCT3d3WmdHeS9wQUlVc1hOVExNTkEwR0Ft?= =?utf-8?B?UmpDbUVvb1ZBL0xpeFZWUFZac2diNW5jWXU0Zl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0RGUXhnU3lJSkdPb3RKdjJnUVhWamhTS085U1RIR1I4SVp3UUpq?= =?utf-8?B?TnkzdkpQdDYzVVgwR0hqTitQWVJLMTg1cHlmdjJRQnFjMUhicVpxODF5c21T?= =?utf-8?B?c2wvSE5CckpGM2tQbVcxRDdhSTVjRlE2N3VMKysxTXlmVytsc2lWQzRkNUds?= =?utf-8?B?bVlmNEQ3eHhZc2t0K2pUQ2hNUjFrQ3ZkU1pTQkNYVFJVZlNvd2JRZXF4dUVi?= =?utf-8?B?UVVOMnRkUDdPUWZEdGtBKzI2S1pwQTBDZndTb3lhN0ZOOXVmblNZNkVHOUF4?= =?utf-8?B?VWExUXh6QW9nMHROWWxxZ2ZIZzRzUjlXODlXZE1wZXlHRjJxdGFVSmNkK1Zr?= =?utf-8?Q?O7r4yzSYnutbT?= 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:(13230031)(376005)(36860700004)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2024 04:27:55.6377 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98f647f9-0f55-469e-a6ab-08dc6b2967c2 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: BN3PEPF0000B370.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6983 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 DPDK defines cmdline input buffer size to 512 characters. That buffer size can be too small for long application input. For example, the following flow template API testpmd command is 444 bytes long: ``` flow queue 0 create 0 template_table 1000 \ pattern_template 0 actions_template 0 postpone no \ pattern eth / ipv4 / udp / end \ actions modify_field op set dst_type tag dst_level 0 dst_offset 0 \ src_type value src_value 0x31 width 32 / \ modify_field op set dst_type ipv4_src src_type value \ src_value 10101010 width 32 / modify_field op add dst_type \ ipv4_ttl dst_level 0 dst_offset 0 src_type value \ src_value ff width 8 / count / jump group 100 / end ``` The patch increases cmdline input buffer size to the LINE_MAX value, which typically is 2048 bytes. Signed-off-by: Gregory Etelson Acked-by: Bruce Richardson Reviewed-by: Morten Brørup --- v2: set RDLINE_BUF_SIZE to LINE_MAX change the patch subject. v3: fix Windows compilation error. --- lib/cmdline/cmdline_private.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/cmdline/cmdline_private.h b/lib/cmdline/cmdline_private.h index b64f363903..f00b025ecb 100644 --- a/lib/cmdline/cmdline_private.h +++ b/lib/cmdline/cmdline_private.h @@ -11,13 +11,20 @@ #include #ifdef RTE_EXEC_ENV_WINDOWS #include +#ifndef LINE_MAX +/** + * The LINE_MAX value is derived from POSIX. + * Windows environment may not have POSIX definitions. + */ +#define LINE_MAX 2048 +#endif #else #include #endif #include -#define RDLINE_BUF_SIZE 512 +#define RDLINE_BUF_SIZE LINE_MAX #define RDLINE_PROMPT_SIZE 32 #define RDLINE_VT100_BUF_SIZE 8 #define RDLINE_HISTORY_BUF_SIZE BUFSIZ -- 2.43.0