lib/cmdline_rdline: increase command line buf size

Message ID 1582204709-7992-1-git-send-email-wisamm@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series lib/cmdline_rdline: increase command line buf size |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot warning Travis build: failed

Commit Message

Wisam Jaddo Feb. 20, 2020, 1:18 p.m. UTC
  The current size of buffer is not enough to fit all allowed items/actions,
thus it will block a lot of testing.

Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
---
 lib/librte_cmdline/cmdline_rdline.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Feb. 20, 2020, 1:42 p.m. UTC | #1
Hi,

About the title, I suggest:
cmdline: increase maximum line length

20/02/2020 14:18, Wisam Jaddo:
> The current size of buffer is not enough to fit all allowed items/actions,
> thus it will block a lot of testing.
> 
> Cc: stable@dpdk.org

+Cc maintainers of cmdline and testpmd

> Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
[...]
> -#define RDLINE_BUF_SIZE 512
> +#define RDLINE_BUF_SIZE 2048

I feel 2k is reasonable.
What is the consequence on memory usage?

How critical is this change?
Which kind of command is so long?
  
Wisam Jaddo Feb. 20, 2020, 2:06 p.m. UTC | #2
Hi,

Sure I'll handle the title with the right prefix.

- consequence on memory usage?
I don't think it will affect much,
Since we are reading from the same buffer all the time,
Read -> reset -> read again -> ...etc

- How critical is this change?
For now it's not that critical, but for testing perspective I think it's critical,
And it's a must to have so we can check un touched scenarios.
Example:
one rule can have outer items, inner items, actions ={ header rewrite, meta actions, duplicate actions, fate action, ..etc} 
thus to test such combination we need to parse more in the cmdline

- Which kind of command is so long?
RTE_FLOW Example:
flow create 2 ingress priority 0 group 4 transfer pattern eth / ipv4 tos spec 0x0 ttl spec 0x0 proto spec 0x6 src spec 4.4.4.11 dst spec 4.4.4.10 tos mask 0x0 ttl mask 0x0 proto mask 0x0 src mask 255.255.255.255 dst mask 255.255.255.255 / tcp src spec 5001 dst spec 38392 flags spec 0x0 src mask 65535 dst mask 65535 flags mask 0x5 / tag index is 0 data spec 0x00000200 data mask 0x0000ff00 / end actions count / set_tag index 0 data 0x00000200 mask 0x0000ff00 / set_tag index 0 data 0x0000002a mask 0x000000ff / set_meta data 0x00000001 mask 0x0000ffff / jump group 7 / end

BRs,
Wisam Jaddo

-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net> 
Sent: Thursday, February 20, 2020 3:43 PM
To: Wisam Monther <wisamm@mellanox.com>
Cc: dev@dpdk.org; Raslan Darawsheh <rasland@mellanox.com>; stable@dpdk.org; olivier.matz@6wind.com; bernard.iremonger@intel.com
Subject: Re: [dpdk-stable] [PATCH] lib/cmdline_rdline: increase command line buf size

Hi,

About the title, I suggest:
cmdline: increase maximum line length

20/02/2020 14:18, Wisam Jaddo:
> The current size of buffer is not enough to fit all allowed 
> items/actions, thus it will block a lot of testing.
> 
> Cc: stable@dpdk.org

+Cc maintainers of cmdline and testpmd

> Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
[...]
> -#define RDLINE_BUF_SIZE 512
> +#define RDLINE_BUF_SIZE 2048

I feel 2k is reasonable.
What is the consequence on memory usage?

How critical is this change?
Which kind of command is so long?
  

Patch

diff --git a/lib/librte_cmdline/cmdline_rdline.h b/lib/librte_cmdline/cmdline_rdline.h
index d217029..8193e1d 100644
--- a/lib/librte_cmdline/cmdline_rdline.h
+++ b/lib/librte_cmdline/cmdline_rdline.h
@@ -39,7 +39,7 @@  extern "C" {
 #endif
 
 /* configuration */
-#define RDLINE_BUF_SIZE 512
+#define RDLINE_BUF_SIZE 2048
 #define RDLINE_PROMPT_SIZE  32
 #define RDLINE_VT100_BUF_SIZE  8
 #define RDLINE_HISTORY_BUF_SIZE BUFSIZ