DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] cmdline: configure input buffer size
@ 2024-05-01  5:26 Gregory Etelson
  2024-05-01  9:08 ` Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Gregory Etelson @ 2024-05-01  5:26 UTC (permalink / raw)
  To: dev; +Cc: getelson,  , rasland, alialnu

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 <getelson@nvidia.com>
---
 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 <cmdline.h>
 
+#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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-06-19 19:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-01  5:26 [PATCH] cmdline: configure input buffer size 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
2024-06-19 19:58   ` David Marchand

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).