buildtools/dpdk-cmdline-gen: fix code gen for IP addresses

Message ID 20231205113104.473203-1-bruce.richardson@intel.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series buildtools/dpdk-cmdline-gen: fix code gen for IP addresses |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Bruce Richardson Dec. 5, 2023, 11:31 a.m. UTC
  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>
---
 buildtools/dpdk-cmdline-gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sunil Kumar Kori Dec. 6, 2023, 6:18 a.m. UTC | #1
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, December 5, 2023 5:01 PM
> To: dev@dpdk.org
> Cc: Bruce Richardson <bruce.richardson@intel.com>; stable@dpdk.org;
> Sunil Kumar Kori <skori@marvell.com>
> Subject: [EXT] [PATCH] buildtools/dpdk-cmdline-gen: fix code gen for IP
> addresses
> 
> External Email
> 
> ----------------------------------------------------------------------
> 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>
> ---
>  buildtools/dpdk-cmdline-gen.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/buildtools/dpdk-cmdline-gen.py b/buildtools/dpdk-cmdline-
> gen.py index 49b03bee4a..bf1253d949 100755
> --- a/buildtools/dpdk-cmdline-gen.py
> +++ b/buildtools/dpdk-cmdline-gen.py
> @@ -71,7 +71,7 @@ def process_command(lineno, tokens, comment):
>          elif t_type in ["IP", "IP_ADDR", "IPADDR"]:
>              result_struct.append(f"\tcmdline_ipaddr_t {t_name};")
>              initializers.append(
> -                f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
> +                f"static cmdline_parse_token_ipaddr_t
> cmd_{name}_{t_name}_tok =\n"
>                  f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result,
> {t_name});"
>              )
>          elif t_type.startswith("(") and t_type.endswith(")"):
> --
Acked-by: Sunil Kumar Kori <skori@marvell.com>

> 2.40.1
  
David Marchand Dec. 12, 2023, 10:25 a.m. UTC | #2
On Tue, Dec 5, 2023 at 12:31 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> 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>

Applied, thanks Bruce and Sunil.
  

Patch

diff --git a/buildtools/dpdk-cmdline-gen.py b/buildtools/dpdk-cmdline-gen.py
index 49b03bee4a..bf1253d949 100755
--- a/buildtools/dpdk-cmdline-gen.py
+++ b/buildtools/dpdk-cmdline-gen.py
@@ -71,7 +71,7 @@  def process_command(lineno, tokens, comment):
         elif t_type in ["IP", "IP_ADDR", "IPADDR"]:
             result_struct.append(f"\tcmdline_ipaddr_t {t_name};")
             initializers.append(
-                f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
+                f"static cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
                 f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result, {t_name});"
             )
         elif t_type.startswith("(") and t_type.endswith(")"):