[PATCH v4 01/14] app/graph: add application framework to read CLI

Jerin Jacob jerinjacobk at gmail.com
Wed Sep 20 06:40:52 CEST 2023


On Tue, Sep 19, 2023 at 9:35 PM <skori at marvell.com> wrote:
>
> From: Sunil Kumar Kori <skori at marvell.com>
>
> It adds base framework to read a given .cli file as a command line
> parameter "-s".
>
> Example:
>  # ./dpdk-graph -c 0xff -- -s ./app/graph/examples/dummy.cli
>
> Each .cli file will contain commands to configure different module like
> mempool, ethdev, lookup tables, graph etc. Command parsing is backed by
> commandline library.
>
> Each module needs to expose its supported commands & corresponding
> callback functions to commandline library to get them parsed.
>
> Signed-off-by: Sunil Kumar Kori <skori at marvell.com>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla at marvell.com>
> ---
> v3..v4:
>  - Addressed Nithin's review comments

List the review comments for next versions or minimum, share the
patchwork URL for review comments.


> +               return -EINVAL;
> +
> +       msg_in = malloc(msg_in_len_max + 1);
> +       msg_out = malloc(msg_out_len_max + 1);
> +       if ((msg_in == NULL) || (msg_out == NULL)) {
> +               free(msg_out);
> +               free(msg_in);
> +               return -ENOMEM;

Please switch to goto exit; scheme.

> +       }
> +
> +       /* Open input file */
> +       f = fopen(file_name, "r");
> +       if (f == NULL) {
> +               free(msg_out);
> +               free(msg_in);
> +               return -EIO;

Same as here.

> +       }


More information about the dev mailing list