History log of /dpdk/buildtools/dpdk-cmdline-gen.py (Results 1 – 7 of 7)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v24.07-rc2, v24.07-rc1, v24.03, v24.03-rc4, v24.03-rc3, v24.03-rc2, v24.03-rc1
# 620b2696 05-Dec-2023 Bruce Richardson <bruce.richardson@intel.com>

buildtools/cmdline: support optional parameters

Sometimes a user may want to have a command which takes an optional
parameter. For commands with an optional constant string, this is no
issue, as it

buildtools/cmdline: support optional parameters

Sometimes a user may want to have a command which takes an optional
parameter. For commands with an optional constant string, this is no
issue, as it can be configured as two separate commands, e.g.

start
start tx_first.

However, if we want to have a variable parameter on the command, we hit
issues, because variable tokens do not form part of the generated
command names used for function and result-struct naming. To avoid
duplicate name issues, we add a special syntax to allow the user to
indicate that a particular variable parameter should be included in the
name. Any leading variable names starting with a "__" will be included
in command naming.

This then allows us to have:

start
start tx_first
start tx_first <UINT16>__n

without hitting any naming conflicts.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>

show more ...


# fb8a2784 05-Dec-2023 Bruce Richardson <bruce.richardson@intel.com>

buildtools/cmdline: add IPv4 and IPv6 address types

Add support for generating cmdline lib code to just match IPv4 addresses
or IPv6 addresses, rather than IP addresses in general.

Signed-off-by: B

buildtools/cmdline: add IPv4 and IPv6 address types

Add support for generating cmdline lib code to just match IPv4 addresses
or IPv6 addresses, rather than IP addresses in general.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>

show more ...


# 7cd7850a 05-Dec-2023 Bruce Richardson <bruce.richardson@intel.com>

buildtools/cmdline: fix IP address initializer

The IP address type should be generic for both IPv4 and IPv6 and so use
the cmdline lib's TOKEN_IPADDR_INITIALIZER rather than
TOKEN_IPV4_INITIALIZER.

buildtools/cmdline: fix IP address initializer

The IP address type should be generic for both IPv4 and IPv6 and so use
the cmdline lib's TOKEN_IPADDR_INITIALIZER rather than
TOKEN_IPV4_INITIALIZER.

Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>

show more ...


# a78b8f11 05-Dec-2023 Bruce Richardson <bruce.richardson@intel.com>

buildtools/cmdline: fix generated code for IP addresses

The C code generated for the tokens for matching IP addresses in
commandlines was missing the "static" prefix present in the output for
the ot

buildtools/cmdline: fix generated code for IP addresses

The C code generated for the tokens for matching IP addresses in
commandlines was missing the "static" prefix present in the output for
the other data-types.

Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")
Cc: stable@dpdk.org

Reported-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>

show more ...


Revision tags: v23.11, v23.11-rc4
# 6c4a69cf 16-Nov-2023 Robin Jarry <rjarry@redhat.com>

buildtools/cmdline: fix generator for empty command

Fix the following error when a command list file contains empty lines:

Traceback (most recent call last):
File "buildtools/dpdk-cmdline-gen.py"

buildtools/cmdline: fix generator for empty command

Fix the following error when a command list file contains empty lines:

Traceback (most recent call last):
File "buildtools/dpdk-cmdline-gen.py", line 202, in <module>
main()
File "buildtools/dpdk-cmdline-gen.py", line 184, in main
process_commands(args.infile, sys.stdout, None, args.context_name)
File "buildtools/dpdk-cmdline-gen.py", line 141, in process_commands
cmd_inst, h_out, c_out = process_command(lineno, tokens.strip().spl…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
File "buildtools/dpdk-cmdline-gen.py", line 36, in process_command
if tokens[0].startswith("<"):
~~~~~~^^^
IndexError: list index out of range

Use shlex.split() to properly split each line arguments into tokens and
strip comments.

If there are no tokens, ignore the line.

Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

show more ...


Revision tags: v23.11-rc3, v23.11-rc2
# 1cd1716b 27-Oct-2023 Bruce Richardson <bruce.richardson@intel.com>

buildtools/cmdline: support option strings

Add support to the commandline generator for option strings, where there
are only a limited number of acceptable values to be passed as a
parameter.

Signe

buildtools/cmdline: support option strings

Add support to the commandline generator for option strings, where there
are only a limited number of acceptable values to be passed as a
parameter.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


# 37666691 27-Oct-2023 Bruce Richardson <bruce.richardson@intel.com>

buildtools: add a tool to generate cmdline boilerplate

Provide a "dpdk-cmdline-gen.py" script for application developers to
quickly generate the boilerplate code necessary for using the cmdline
libr

buildtools: add a tool to generate cmdline boilerplate

Provide a "dpdk-cmdline-gen.py" script for application developers to
quickly generate the boilerplate code necessary for using the cmdline
library.

Example of use:
The script takes an input file with a list of commands the user wants in
the app, where the parameter variables are tagged with the type.
For example:

$ cat commands.list
list
add <UINT16>x <UINT16>y
echo <STRING>message
add socket <STRING>path
quit

When run through the script as "./dpdk-cmdline-gen.py commands.list",
the output will be the contents of a header file with all the
boilerplate necessary for a commandline instance with those commands.

If the flag --stubs is passed, an output header filename must also be
passed, in which case both a header file with the definitions and a C
file with function stubs in it is written to disk. The separation is so
that the header file can be rewritten at any future point to add more
commands, while the C file can be kept as-is and extended by the user
with any additional functions needed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...