DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
Cc: Ali Alnubani <alialnu@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>,
	Maayan Kashani <mkashani@nvidia.com>,
	Raslan Darawsheh <rasland@nvidia.com>,
	"bruce.richardson@intel.com" <bruce.richardson@intel.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>
Subject: Re: [PATCH v3] cmdline: increase input buffer size
Date: Wed, 15 May 2024 08:41:55 +0000	[thread overview]
Message-ID: <IA1PR12MB633276D5DEA1CF16385B8043A5EC2@IA1PR12MB6332.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20240503042715.344550-1-getelson@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 2500 bytes --]

Hello,

What is the status of that patch ?

Regards,
Gregory
________________________________
From: Gregory Etelson <getelson@nvidia.com>
Sent: Friday, May 3, 2024 07:27
To: Gregory Etelson <getelson@nvidia.com>
Cc: Ali Alnubani <alialnu@nvidia.com>; dev@dpdk.org <dev@dpdk.org>; Maayan Kashani <mkashani@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>; bruce.richardson@intel.com <bruce.richardson@intel.com>; stephen@networkplumber.org <stephen@networkplumber.org>; mb@smartsharesystems.com <mb@smartsharesystems.com>
Subject: [PATCH v3] cmdline: increase input buffer size

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 <getelson@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
---
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 <rte_os_shim.h>
 #ifdef RTE_EXEC_ENV_WINDOWS
 #include <rte_windows.h>
+#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 <termios.h>
 #endif

 #include <cmdline.h>

-#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


[-- Attachment #2: Type: text/html, Size: 4685 bytes --]

  reply	other threads:[~2024-05-15  8:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01  5:26 [PATCH] cmdline: configure " Gregory Etelson
2024-05-01  9:08 ` Bruce Richardson
2024-05-01 10:06   ` Etelson, Gregory
2024-05-01 14:42     ` Stephen Hemminger
2024-05-01 15:56       ` Etelson, Gregory
2024-05-01 16:30         ` Bruce Richardson
2024-05-01 17:18 ` [PATCH v2] cmdline: increase " Gregory Etelson
2024-05-01 18:26   ` Morten Brørup
2024-05-02  7:27     ` Bruce Richardson
2024-05-03  4:27 ` [PATCH v3] " Gregory Etelson
2024-05-15  8:41   ` Gregory Etelson [this message]
2024-06-19 19:58   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=IA1PR12MB633276D5DEA1CF16385B8043A5EC2@IA1PR12MB6332.namprd12.prod.outlook.com \
    --to=getelson@nvidia.com \
    --cc=alialnu@nvidia.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=mkashani@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).