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 034BB43F58; Wed, 1 May 2024 07:27:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D808A402A8; Wed, 1 May 2024 07:27:32 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2084.outbound.protection.outlook.com [40.107.236.84]) by mails.dpdk.org (Postfix) with ESMTP id 5AC40402A7 for ; Wed, 1 May 2024 07:27:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=klW32WqvNHnl9aRjlNXnFyf8xhf5c4Zh8+KfC3f7vuicgYinBnZxHz6g5FoizKPKWYIzXvQ2T4XZhN7CrSnXFeEHZOXJxrh6JEiYHJc7BUq/cZM9M7N02BzRsH8osw5cb9DMwrDjckf0OgKFY6nlV9KmkleoNonfTOIThwkiE9bmqArDYzalkiW4W8fXEDddAm/zLJKVhtOa07ez8rFjy5AhQ0Fk/B2G5t5cDyOK3YuukuAUa819F9DUvkJNTlFfPSysvOsDJ4pRmA14YNd4EqHo2sZE2paFShS/wVYDr1PF0u9Qsx9JBk3iaBITUBDHSXudTC1Xo05l3SqmIQgp5w== 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=DqzS1kNikwVXgtesZgmRLGXPZIJjGePsHnTHVH87Ck0=; b=bUFMZmYh20vpNYORQj5ERRrDiykuX4XZ8VzC0frHKU8JLN5RR0g9UM7bWB7CeQj1v9nmcx9DUYh1y23pQnSzXXQKLGv6xGxw1O7Iqx+AKjcD05YpM9Fqn8G7mypTgAAbRajeRx0IwqS4PBYs5nmaqM+XYbgrgmuakum6Fd+XAd+tS3PXNCZNnTol0OiOnTWZWYwYJS1pcHEj9dL8f+W4o15H6AWTedoctpa0fyvUPJ40u4kQ6u7UXbCqmqdXC716NZKX+bgA47NPgVXH4i+VZdYgHoUOVaWGN7acng+6XELmjc+AAYKSMRYTRr94TQRboJQEQnOJ60nvt/jA4vIBzw== 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=DqzS1kNikwVXgtesZgmRLGXPZIJjGePsHnTHVH87Ck0=; b=YVkHLTN8zd4W/LrKk1Eer+AfjtQPMhQVw2Bz/GTSAKfPIqdt7GLv3+hD8WF0WLYyrVmZfRGNSfEhsXCBKMxNbcQRwAwLCN4gio6WZBtdzQSA0NnctUsXHK25WlvaBEEAil/Afk4HRs1Ye5cTeXQflFJ6QbwyIkRBeBOnnMe3ZjaEjvz/0Dc1Ar/K9SJRoW9NHHe8MuZoefhxUFVE5ggevHZyR3O/JkU/r16qCcdAYJS76OUkE5wJn+DmlCucpqKXgee6T+a9l0xRbn+voD1yR9B3oRK16lHX1W2QLFl+WTNAP9y89j6ctAJ6kTHGaJP1krxGEvMLzcaN214gnWDe4g== Received: from BN0PR02CA0011.namprd02.prod.outlook.com (2603:10b6:408:e4::16) by CY5PR12MB6621.namprd12.prod.outlook.com (2603:10b6:930:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Wed, 1 May 2024 05:27:29 +0000 Received: from BN1PEPF00004683.namprd03.prod.outlook.com (2603:10b6:408:e4:cafe::b3) by BN0PR02CA0011.outlook.office365.com (2603:10b6:408:e4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.36 via Frontend Transport; Wed, 1 May 2024 05:27:28 +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 BN1PEPF00004683.mail.protection.outlook.com (10.167.243.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.18 via Frontend Transport; Wed, 1 May 2024 05:27:28 +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; Tue, 30 Apr 2024 22:27:17 -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; Tue, 30 Apr 2024 22:27:15 -0700 From: Gregory Etelson To: CC: , =?UTF-8?q?=C2=A0?= , , Subject: [PATCH] cmdline: configure input buffer size Date: Wed, 1 May 2024 08:26:59 +0300 Message-ID: <20240501052659.231457-1-getelson@nvidia.com> X-Mailer: git-send-email 2.43.0 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: BN1PEPF00004683:EE_|CY5PR12MB6621:EE_ X-MS-Office365-Filtering-Correlation-Id: 18bef284-20b4-49dd-24c0-08dc699f647b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|82310400014|36860700004|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EUxPL6FlpIoooKkysH//PAxY3sAzcyhaavEN5B4LNttqstYXZAqVF3BO+oZr?= =?us-ascii?Q?wfd7lkpC0Qio5F5R2wci0Ypyj1vm2qB7M19N7ClWW3T41NZAiQaJtD/I3HmL?= =?us-ascii?Q?d8RmW1Mq5iODlF5numiu9mzZlR6gFmjFIGd6tk/q/txctzKk5sLMMUUftfXC?= =?us-ascii?Q?JuV44G0QavB91t3V/3YSrOiavK+Lm7UnMM7vk8jE3u0jquL6k4kjaOyzOx26?= =?us-ascii?Q?T11Xlf+4srlPvK66xX4emwDloQbX3e4NhDcQZMvJ9LVqlFVZLEPGRYCeNdSW?= =?us-ascii?Q?P6I6UlYqoG/gk38Q/6i3Ey1KNDR+Ai+YqauBnd7O8WlQ6KYZFMvDkPkyn3Uu?= =?us-ascii?Q?RJsrjTQFL33hMaaj/J1V5uFInzJN0YdRNtRxJOxhXqH0U0iNhpnwdRodZbm6?= =?us-ascii?Q?XK8633R+xCzNNGv0BBsMXkOxfwwxEV/ToeqnhRDxX5jyYeaVKTxxmq1egPPi?= =?us-ascii?Q?Fvhxw9Ze4+RYzN2s6d5Oo35+QUPOaXPSgR6uyCm40grpe+nqWOuzk4Rg871M?= =?us-ascii?Q?9Opn/RyWNE4mzerd7C07s2fNY8fLs31jDJ/l+gW1w1sIWGSSBi/h3hnewXrY?= =?us-ascii?Q?XpCLhdJJwYgZSNmxJ77kBseyxvF+dK6c7kWz+dhrVj1Sh/jg2c0F10VTrTdk?= =?us-ascii?Q?odT+jk1fQGsO2yD34b2YVlglLvknHpdxaJzvBON7lIj0KlW2RbfyVqBAMQmo?= =?us-ascii?Q?2T2tVoX5TCA2MVGgAExV1TxAOp4UKdoid4pzFF7GhiNeR/C3yNsnVsGa+drC?= =?us-ascii?Q?RZRQLRaJIwdfAsSaV82XFusP2VWhOIDjOcR+gT61ycm3wuA+a27H9ciW8JZS?= =?us-ascii?Q?U+56oawsgYlffeknPKjegxM3UU2wBWlRLb4Z19Et/L88a0Sbnzp2DyeIdmEi?= =?us-ascii?Q?3ae4NKXLLAh0OrQ6vpqTu//JWvNXTnH5ZXzVXKWeShcxzDsq1JWSHI0axLL5?= =?us-ascii?Q?YCym0K/d9dpyvdJQIj7Lx8UnNyXzM45w3fy+pehnwplBix2BtYuNHRUuPbzX?= =?us-ascii?Q?KfrqSC5B5eGuiUbqgAebhMR3SF0oRPVrJIGgKB7Hxr6a4pCjq6UXwUua5wiY?= =?us-ascii?Q?jkTeRcVxZAW0mi9Bk7x6tKX383WqwGVi2lZPTh1XLj/eSbMgHXFYcK+scbeD?= =?us-ascii?Q?wVHeoJ5dE1BMuOuhUIS1DihO5RU7863MNFHM2/2lvbv4iFT2P/0XlrrAz+tM?= =?us-ascii?Q?lH/7AkrO/eRKB5sPJLqwRSu6qbPCfgC0NKATlPiYUcplxOB2Zk4Jsbn0QjVU?= =?us-ascii?Q?/XcTcHEbI5vDYXq6qolVu19vRpfKt3/w1JGd3tOxdRoiOYjFUAubaoQdQ6cH?= =?us-ascii?Q?lZ9Jx9Jd5K0Onj88nH4JKHC3aIg2SM10t/ad3686CPu+UMRsjZt1U396bw7T?= =?us-ascii?Q?VjIl6Ch0wbaCOAzda363zx+cLPth?= 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)(1800799015)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2024 05:27:28.4245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18bef284-20b4-49dd-24c0-08dc699f647b 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: BN1PEPF00004683.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6621 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 introduces conditional `RDLINE_CUSTOM_BUF_SIZE` definition. Application can set custom cmdline size during DPDK configuration: `meson setup ... -Dc_args='-DRDLINE_CUSTOM_BUF_SIZE=4096' ...` Signed-off-by: Gregory Etelson --- lib/cmdline/cmdline_private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cmdline/cmdline_private.h b/lib/cmdline/cmdline_private.h index b64f363903..7908d963f9 100644 --- a/lib/cmdline/cmdline_private.h +++ b/lib/cmdline/cmdline_private.h @@ -17,7 +17,11 @@ #include +#ifndef RDLINE_CUSTOM_BUF_SIZE #define RDLINE_BUF_SIZE 512 +#else +#define RDLINE_BUF_SIZE RDLINE_CUSTOM_BUF_SIZE +#endif #define RDLINE_PROMPT_SIZE 32 #define RDLINE_VT100_BUF_SIZE 8 #define RDLINE_HISTORY_BUF_SIZE BUFSIZ -- 2.43.0