[v3] cmdline: increase maximum line length

Message ID 1582210386-27331-1-git-send-email-wisamm@mellanox.com (mailing list archive)
State New, archived
Delegated to: Thomas Monjalon
Headers
Series [v3] cmdline: increase maximum line length |

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, 2:53 p.m. UTC
  This increase due to the usage of cmdline in dpdk applications
as config commands such as testpmd do for rte_flow rules creation.

The current size of buffer is not enough to fill
many cases of rte_flow commands validation/creation.

rte_flow now can have outer items, inner items, modify
actions, meta data actions, duplicate action, fate action and
more in one single rte flow, thus 512 char will not be enough
to validate such rte flow rules.

Such change shouldn't affect the memory since the cmdline
reading again using the same buffer.

Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>

---
changes in v3
* Fix commit title
	Previous title was not that clear of what the change is
* Add more clarification for what we need such increase
* Explain why it won't cause any memory issue
---
---
 lib/librte_cmdline/cmdline_rdline.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand Feb. 22, 2020, 3:28 p.m. UTC | #1
This patch is flagged as an ABI breakage:
https://travis-ci.com/ovsrobot/dpdk/jobs/289313318#L2273


On Thu, Feb 20, 2020 at 3:53 PM Wisam Jaddo <wisamm@mellanox.com> wrote:
>
> This increase due to the usage of cmdline in dpdk applications
> as config commands such as testpmd do for rte_flow rules creation.
>
> The current size of buffer is not enough to fill
> many cases of rte_flow commands validation/creation.
>
> rte_flow now can have outer items, inner items, modify
> actions, meta data actions, duplicate action, fate action and
> more in one single rte flow, thus 512 char will not be enough
> to validate such rte flow rules.
>
> Such change shouldn't affect the memory since the cmdline
> reading again using the same buffer.

I don't get your point here.


> Cc: stable@dpdk.org

This is not a fix.
  
Olivier Matz July 31, 2020, 12:55 p.m. UTC | #2
Hi,

Ressurecting this old thread.

On Sat, Feb 22, 2020 at 04:28:15PM +0100, David Marchand wrote:
> This patch is flagged as an ABI breakage:
> https://travis-ci.com/ovsrobot/dpdk/jobs/289313318#L2273
> 

In case we want this fix for 20.11, should we do a deprecation notice
in 20.08?


Olivier


> 
> On Thu, Feb 20, 2020 at 3:53 PM Wisam Jaddo <wisamm@mellanox.com> wrote:
> >
> > This increase due to the usage of cmdline in dpdk applications
> > as config commands such as testpmd do for rte_flow rules creation.
> >
> > The current size of buffer is not enough to fill
> > many cases of rte_flow commands validation/creation.
> >
> > rte_flow now can have outer items, inner items, modify
> > actions, meta data actions, duplicate action, fate action and
> > more in one single rte flow, thus 512 char will not be enough
> > to validate such rte flow rules.
> >
> > Such change shouldn't affect the memory since the cmdline
> > reading again using the same buffer.
> 
> I don't get your point here.
> 
> 
> > Cc: stable@dpdk.org
> 
> This is not a fix.
> 
> 
> -- 
> David Marchand
>
  
David Marchand July 31, 2020, 1 p.m. UTC | #3
On Fri, Jul 31, 2020 at 2:55 PM Olivier Matz <olivier.matz@6wind.com> wrote:
> Ressurecting this old thread.
>
> On Sat, Feb 22, 2020 at 04:28:15PM +0100, David Marchand wrote:
> > This patch is flagged as an ABI breakage:
> > https://travis-ci.com/ovsrobot/dpdk/jobs/289313318#L2273
> >
>
> In case we want this fix for 20.11, should we do a deprecation notice
> in 20.08?

If there is something to change, that would be removing this max size
rather than extend it.
Let's not go the "XX bytes ought to be enough for anybody" way.
  
Stephen Hemminger July 31, 2020, 3:46 p.m. UTC | #4
On Fri, 31 Jul 2020 14:55:16 +0200
Olivier Matz <olivier.matz@6wind.com> wrote:

> Hi,
> 
> Ressurecting this old thread.
> 
> On Sat, Feb 22, 2020 at 04:28:15PM +0100, David Marchand wrote:
> > This patch is flagged as an ABI breakage:
> > https://travis-ci.com/ovsrobot/dpdk/jobs/289313318#L2273
> >   
> 
> In case we want this fix for 20.11, should we do a deprecation notice
> in 20.08?
> 
> 
> Olivier
> 
> 
> > 
> > On Thu, Feb 20, 2020 at 3:53 PM Wisam Jaddo <wisamm@mellanox.com> wrote:  
> > >
> > > This increase due to the usage of cmdline in dpdk applications
> > > as config commands such as testpmd do for rte_flow rules creation.
> > >
> > > The current size of buffer is not enough to fill
> > > many cases of rte_flow commands validation/creation.
> > >
> > > rte_flow now can have outer items, inner items, modify
> > > actions, meta data actions, duplicate action, fate action and
> > > more in one single rte flow, thus 512 char will not be enough
> > > to validate such rte flow rules.
> > >
> > > Such change shouldn't affect the memory since the cmdline
> > > reading again using the same buffer.  
> > 
> > I don't get your point here.

The cmdline is a awkward user API. Thomas wanted to replace it but
it seems to have gotten nowhere.

Agree that having something dynamic would be best, Something
based of getline() or editline (readline).
  

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