DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: skori@marvell.com
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Rakesh Kudurumalla <rkudurumalla@marvell.com>,
	dev@dpdk.org
Subject: Re: [PATCH v8 01/12] app/graph: add application framework to read CLI
Date: Mon, 16 Oct 2023 14:30:45 +0530	[thread overview]
Message-ID: <CALBAE1Ofdsx8j+qL0iF83vwpEz+VeniPjVpWhSCiWEqf1CV-Aw@mail.gmail.com> (raw)
In-Reply-To: <20230929095814.692890-2-skori@marvell.com>

On Fri, Sep 29, 2023 at 3:28 PM <skori@marvell.com> wrote:
>
> From: Sunil Kumar Kori <skori@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@marvell.com>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

> +cli_script_process(const char *file_name, size_t msg_in_len_max, size_t msg_out_len_max, void *obj)
> +{
> +       char *msg_in = NULL, *msg_out = NULL;
> +       FILE *f = NULL;
> +
> +       /* Check input arguments */
> +       if ((file_name == NULL) || (strlen(file_name) == 0) || (msg_in_len_max == 0) ||
> +           (msg_out_len_max == 0))
> +               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)) {

Use goto to avod dupliciting this section.

> +               free(msg_out);
> +               free(msg_in);
> +               return -ENOMEM;
> +       }
> +
> +       /* Open input file */
> +       f = fopen(file_name, "r");
> +       if (f == NULL) {
> +               free(msg_out);
> +               free(msg_in);
> +               return -EIO;
> +       }
> +
> +       /* Read file */
> +       while (fgets(msg_in, msg_in_len_max, f) != NULL) {
> +               msg_out[0] = 0;
> +
> +               cli_process(msg_in, msg_out, msg_out_len_max, obj);
> +
> +               if (strlen(msg_out))
> +                       printf("%s", msg_out);
> +       }
> +
> +       /* Close file */
> +       fclose(f);

See above:

> +       free(msg_out);
> +       free(msg_in);
> +       return 0;
> +}
>
new file mode 100644
> index 0000000000..08d0a48cd9
> --- /dev/null
> +++ b/app/graph/meson.build
> @@ -0,0 +1,15 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2023 Marvell.
> +
> +# override default name to drop the hyphen
> +name = 'graph'
> +build = cc.has_header('sys/epoll.h')

Is this required?

> +if not build
> +    subdir_done()
> +endif
> +
> +deps += ['bus_pci', 'graph', 'eal', 'lpm', 'ethdev', 'node', 'cmdline']

Check bus_pci really required?

> +sources = files(
> +        'cli.c',
> +        'main.c',
> +)
> diff --git a/app/graph/module_api.h b/app/graph/module_api.h
> new file mode 100644
> index 0000000000..372aeae7e3
> --- /dev/null
> +++ b/app/graph/module_api.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2023 Marvell.
> + */
> +
> +#ifndef APP_GRAPH_MODULE_API_H
> +#define APP_GRAPH_MODULE_API_H
> +
> +#include <stdint.h>
> +#include <stdbool.h>

Have a new line here.

> +#include "cli.h"
> +/*
> + * Externs
> + */
> new file mode 100644
> index 0000000000..271a85896d
> --- /dev/null
> +++ b/doc/guides/tools/graph.rst
> @@ -0,0 +1,82 @@
> +..  SPDX-License-Identifier: BSD-3-Clause
> +    Copyright(c) 2023 Marvell.
> +
> +dpdk-graph Application
> +======================
> +
> +The ``dpdk-graph`` tool is a Data Plane Development Kit (DPDK)
> +application that allows exercising various graph use cases.
> +This application has a generic framework to add new graph based use cases to
> +verify functionality. Each use case is defined as a ``<usecase>.cli`` file.
> +Based on the input file, application creates a graph to cater the use case.

Could you add some detailed text to describe the fact that, due to
modular nature
this app framework can be used by other graph based application OR SO.

> +
> +Supported Use cases
> +-------------------
> + *

This * can be removed in this patch. Add it when l3fwd adds it.


> +
> +Running the Application
> +-----------------------
> +
> +The application has a number of command line options which can be provided in
> +following syntax
> +
> +.. code-block:: console
> +
> +   dpdk-graph [EAL Options] -- [application options]
> +
> +EAL Options
> +~~~~~~~~~~~
> +
> +Following are the EAL command-line options that can be used in conjunction
> +with the ``dpdk-graph`` application.
> +See the DPDK Getting Started Guides for more information on these options.
> +
> +*   ``-c <COREMASK>`` or ``-l <CORELIST>``
> +
> +        Set the hexadecimal bit mask of the cores to run on. The CORELIST is a
> +        list of cores to be used.
> +
> +Application Options
> +~~~~~~~~~~~~~~~~~~~
> +
> +Following are the application command-line options:
> +
> +* ``-s``
> +
> +        Script name with absolute path which specifies the use case. It is
> +        a mandatory parameter which will be used to create desired graph
> +        for a given use case.
> +
> +* ``--help``
> +
> +       Dumps application usage
> +
> +Supported CLI commands
> +----------------------
> +
> +This section provides details on commands which can be used in ``<usecase>.cli``
> +file to express the requested use case configuration.
> +
> +.. list-table:: Exposed CLIs
> +   :widths: 40 40 10 10
> +   :header-rows: 1
> +   :class: longtable
> +
> +   * - Command
> +     - Description
> +     - Dynamic
> +     - Optional
> +   * - Dummy command
> +     - Dummy command description
> +     - No
> +     - No

Is it possible to make it as more vertical placement ? More horizontal
placement is not PDF friendly.

  reply	other threads:[~2023-10-16  9:01 UTC|newest]

Thread overview: 182+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  6:02 [PATCH 0/4] app: introduce testgraph application Vamsi Attunuru
2023-04-21  6:02 ` [PATCH 1/4] node: add pkt punt to kernel node Vamsi Attunuru
2023-05-29 17:29   ` Jerin Jacob
2023-05-31 12:36     ` [EXT] " Vamsi Krishna Attunuru
2023-04-21  6:02 ` [PATCH 2/4] node: add a node to receive pkts from kernel Vamsi Attunuru
2023-05-29 17:39   ` Jerin Jacob
2023-06-01  2:40     ` [EXT] " Vamsi Krishna Attunuru
2023-04-21  6:02 ` [PATCH 3/4] node: remove hardcoded node next details Vamsi Attunuru
2023-04-21  6:02 ` [PATCH 4/4] app: add testgraph application Vamsi Attunuru
2023-05-09  6:09   ` Jerin Jacob
2023-04-25 13:15 ` [PATCH v2 0/4] app: introduce " Vamsi Attunuru
2023-04-25 13:15   ` [PATCH v2 1/4] node: add pkt punt to kernel node Vamsi Attunuru
2023-05-30  8:16     ` Nithin Dabilpuram
2023-05-31 12:35       ` [EXT] " Vamsi Krishna Attunuru
2023-04-25 13:15   ` [PATCH v2 2/4] node: add a node to receive pkts from kernel Vamsi Attunuru
2023-04-25 13:15   ` [PATCH v2 3/4] node: remove hardcoded node next details Vamsi Attunuru
2023-04-25 13:15   ` [PATCH v2 4/4] app: add testgraph application Vamsi Attunuru
2023-05-09  2:34     ` [EXT] " Sunil Kumar Kori
2023-05-09  3:39       ` Vamsi Krishna Attunuru
2023-05-09  8:53         ` Sunil Kumar Kori
2023-05-09 12:24           ` Vamsi Krishna Attunuru
2023-05-12 11:08     ` Yan, Zhirun
2023-05-22  7:07       ` Vamsi Krishna Attunuru
2023-05-30  7:34         ` Jerin Jacob
2023-06-01  2:44           ` [EXT] " Vamsi Krishna Attunuru
2023-07-20 15:52             ` Rakesh Kudurumalla
2023-07-21  6:48               ` Jerin Jacob
2023-07-21  7:01                 ` Sunil Kumar Kori
2023-07-21  7:39                   ` Rakesh Kudurumalla
2023-09-08 11:00                     ` Sunil Kumar Kori
2023-09-08 10:49     ` [PATCH v3 1/1] app/graph: add example for different usecases skori
2023-09-09  1:18       ` [EXT] " Nithin Kumar Dabilpuram
2023-09-19 16:04       ` [PATCH v4 01/14] app/graph: add application framework to read CLI skori
2023-09-19 16:04         ` [PATCH v4 02/14] app/graph: add telnet connectivity framework skori
2023-09-20  4:34           ` Jerin Jacob
2023-09-20  8:14             ` Bruce Richardson
2023-09-19 16:04         ` [PATCH v4 03/14] app/graph: add parser utility APIs skori
2023-09-19 16:04         ` [PATCH v4 04/14] app/graph: add mempool command line interfaces skori
2023-09-19 16:04         ` [PATCH v4 05/14] app/graph: add ethdev " skori
2023-09-19 16:04         ` [PATCH v4 06/14] app/graph: add ipv4_lookup " skori
2023-09-19 16:04         ` [PATCH v4 07/14] app/graph: add ipv6_lookup " skori
2023-09-19 16:04         ` [PATCH v4 08/14] app/graph: add neigh " skori
2023-09-19 16:04         ` [PATCH v4 09/14] app/graph: add ethdev_rx " skori
2023-09-19 16:04         ` [PATCH v4 10/14] app/graph: add graph " skori
2023-09-19 16:04         ` [PATCH v4 11/14] app/graph: add CLI option to enable graph stats skori
2023-09-19 16:04         ` [PATCH v4 12/14] app/graph: add l3fwd usecase skori
2023-09-19 16:04         ` [PATCH v4 13/14] doc: add graph application user guide skori
2023-09-20  4:28           ` Jerin Jacob
2023-09-19 16:04         ` [PATCH v4 14/14] maintainers: add maintainers for graph app skori
2023-09-20  4:40         ` [PATCH v4 01/14] app/graph: add application framework to read CLI Jerin Jacob
2023-09-21 10:08         ` [PATCH v5 00/12] add CLI based graph application skori
2023-09-21 10:08           ` [PATCH v5 01/12] app/graph: add application framework to read CLI skori
2023-09-21 10:08           ` [PATCH v5 02/12] app/graph: add telnet connectivity framework skori
2023-09-21 10:08           ` [PATCH v5 03/12] app/graph: add parser utility APIs skori
2023-09-21 10:08           ` [PATCH v5 04/12] app/graph: add mempool command line interfaces skori
2023-09-21 10:08           ` [PATCH v5 05/12] app/graph: add ethdev " skori
2023-09-21 10:08           ` [PATCH v5 06/12] app/graph: add ipv4_lookup " skori
2023-09-21 10:08           ` [PATCH v5 07/12] app/graph: add ipv6_lookup " skori
2023-09-21 10:08           ` [PATCH v5 08/12] app/graph: add neigh " skori
2023-09-21 10:08           ` [PATCH v5 09/12] app/graph: add ethdev_rx " skori
2023-09-21 10:08           ` [PATCH v5 10/12] app/graph: add graph " skori
2023-09-21 10:08           ` [PATCH v5 11/12] app/graph: add CLI option to enable graph stats skori
2023-09-21 10:08           ` [PATCH v5 12/12] app/graph: add l3fwd usecase skori
2023-09-26 10:57             ` [PATCH v6 00/12] add CLI based graph application skori
2023-09-26 10:57               ` [PATCH v6 01/12] app/graph: add application framework to read CLI skori
2023-09-26 10:57               ` [PATCH v6 02/12] app/graph: add telnet connectivity framework skori
2023-09-26 10:57               ` [PATCH v6 03/12] app/graph: add parser utility APIs skori
2023-09-26 10:57               ` [PATCH v6 04/12] app/graph: add mempool command line interfaces skori
2023-09-26 10:57               ` [PATCH v6 05/12] app/graph: add ethdev " skori
2023-09-26 10:57               ` [PATCH v6 06/12] app/graph: add ipv4_lookup " skori
2023-09-26 10:57               ` [PATCH v6 07/12] app/graph: add ipv6_lookup " skori
2023-09-26 10:57               ` [PATCH v6 08/12] app/graph: add neigh " skori
2023-09-26 10:57               ` [PATCH v6 09/12] app/graph: add ethdev_rx " skori
2023-09-26 10:57               ` [PATCH v6 10/12] app/graph: add graph " skori
2023-09-26 10:57               ` [PATCH v6 11/12] app/graph: add CLI option to enable graph stats skori
2023-09-26 10:57               ` [PATCH v6 12/12] app/graph: add l3fwd use case skori
2023-09-27 11:54                 ` [PATCH v7 00/12] add CLI based graph application skori
2023-09-27 11:54                   ` [PATCH v7 01/12] app/graph: add application framework to read CLI skori
2023-09-27 11:54                   ` [PATCH v7 02/12] app/graph: add telnet connectivity framework skori
2023-09-27 11:54                   ` [PATCH v7 03/12] app/graph: add parser utility APIs skori
2023-09-27 11:54                   ` [PATCH v7 04/12] app/graph: add mempool command line interfaces skori
2023-09-27 11:54                   ` [PATCH v7 05/12] app/graph: add ethdev " skori
2023-09-27 11:54                   ` [PATCH v7 06/12] app/graph: add ipv4_lookup " skori
2023-09-27 11:54                   ` [PATCH v7 07/12] app/graph: add ipv6_lookup " skori
2023-09-27 11:54                   ` [PATCH v7 08/12] app/graph: add neigh " skori
2023-09-27 11:54                   ` [PATCH v7 09/12] app/graph: add ethdev_rx " skori
2023-09-27 11:54                   ` [PATCH v7 10/12] app/graph: add graph " skori
2023-09-27 11:54                   ` [PATCH v7 11/12] app/graph: add CLI option to enable graph stats skori
2023-09-27 11:54                   ` [PATCH v7 12/12] app/graph: add l3fwd use case skori
2023-09-29  9:58                     ` [PATCH v8 00/12] add CLI based graph application skori
2023-09-29  9:58                       ` [PATCH v8 01/12] app/graph: add application framework to read CLI skori
2023-10-16  9:00                         ` Jerin Jacob [this message]
2023-10-17  6:19                           ` [EXT] " Sunil Kumar Kori
2023-10-18  6:33                         ` [PATCH v9 00/12] add CLI based graph application skori
2023-10-18  6:33                           ` [PATCH v9 01/12] app/graph: support application CLI framework skori
2023-10-18  6:33                           ` [PATCH v9 02/12] app/graph: support telnet connectivity framework skori
2023-10-18  6:33                           ` [PATCH v9 03/12] app/graph: support parser utility APIs skori
2023-10-18  6:33                           ` [PATCH v9 04/12] app/graph: support mempool command line interfaces skori
2023-10-18  6:33                           ` [PATCH v9 05/12] app/graph: support ethdev " skori
2023-10-18  6:33                           ` [PATCH v9 06/12] app/graph: support IPv4 lookup " skori
2023-10-18  6:33                           ` [PATCH v9 07/12] app/graph: support IPv6 " skori
2023-10-18  6:33                           ` [PATCH v9 08/12] app/graph: support neigh " skori
2023-10-18  6:33                           ` [PATCH v9 09/12] app/graph: support ethdev Rx " skori
2023-10-18  6:33                           ` [PATCH v9 10/12] app/graph: support graph " skori
2023-10-18  6:33                           ` [PATCH v9 11/12] app/graph: support CLI option to enable graph stats skori
2023-10-18  6:33                           ` [PATCH v9 12/12] app/graph: support l3fwd use case skori
2023-10-18 10:38                             ` Jerin Jacob
2023-10-19 10:49                             ` [PATCH v10 00/12] add CLI based graph application skori
2023-10-19 10:49                               ` [PATCH v10 01/12] app/graph: support application CLI framework skori
2023-10-19 10:49                               ` [PATCH v10 02/12] app/graph: support telnet connectivity framework skori
2023-10-19 10:49                               ` [PATCH v10 03/12] app/graph: support parser utility APIs skori
2023-10-19 10:49                               ` [PATCH v10 04/12] app/graph: support mempool command line interfaces skori
2023-10-19 10:49                               ` [PATCH v10 05/12] app/graph: support ethdev " skori
2023-10-19 10:49                               ` [PATCH v10 06/12] app/graph: support IPv4 lookup " skori
2023-10-19 10:49                               ` [PATCH v10 07/12] app/graph: support IPv6 " skori
2023-10-19 10:49                               ` [PATCH v10 08/12] app/graph: support neigh " skori
2023-10-19 10:49                               ` [PATCH v10 09/12] app/graph: support ethdev Rx " skori
2023-10-19 10:49                               ` [PATCH v10 10/12] app/graph: support graph " skori
2023-10-19 10:49                               ` [PATCH v10 11/12] app/graph: support CLI option to enable graph stats skori
2023-10-19 10:50                               ` [PATCH v10 12/12] app/graph: support l3fwd use case skori
2023-10-19 12:28                                 ` [EXT] " Jerin Jacob Kollanukkaran
2023-10-23  7:06                                   ` Nithin Dabilpuram
2023-10-19 17:29                                 ` [PATCH v11 00/12] add CLI based graph application skori
2023-10-19 17:30                                   ` [PATCH v11 01/12] app/graph: support application CLI framework skori
2023-10-23  7:03                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 02/12] app/graph: support telnet connectivity framework skori
2023-10-23  7:03                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 03/12] app/graph: support parser utility APIs skori
2023-10-23  7:03                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 04/12] app/graph: support mempool command line interfaces skori
2023-10-23  7:04                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 05/12] app/graph: support ethdev " skori
2023-10-23  7:04                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 06/12] app/graph: support IPv4 lookup " skori
2023-10-23  7:04                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 07/12] app/graph: support IPv6 " skori
2023-10-23  7:04                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 08/12] app/graph: support neigh " skori
2023-10-23  7:05                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 09/12] app/graph: support ethdev Rx " skori
2023-10-23  7:05                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 10/12] app/graph: support graph " skori
2023-10-23  7:06                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 11/12] app/graph: support CLI option to enable graph stats skori
2023-10-23  7:06                                     ` Nithin Dabilpuram
2023-10-19 17:30                                   ` [PATCH v11 12/12] app/graph: support l3fwd use case skori
2023-10-23 13:03                                   ` [PATCH v11 00/12] add CLI based graph application Sunil Kumar Kori
2023-11-03 16:44                                   ` Thomas Monjalon
2023-09-29  9:58                       ` [PATCH v8 02/12] app/graph: add telnet connectivity framework skori
2023-10-16  9:04                         ` Jerin Jacob
2023-10-17  6:21                           ` [EXT] " Sunil Kumar Kori
2023-09-29  9:58                       ` [PATCH v8 03/12] app/graph: add parser utility APIs skori
2023-10-16  9:05                         ` Jerin Jacob
2023-09-29  9:58                       ` [PATCH v8 04/12] app/graph: add mempool command line interfaces skori
2023-10-16  9:09                         ` Jerin Jacob
2023-10-17  6:22                           ` [EXT] " Sunil Kumar Kori
2023-09-29  9:58                       ` [PATCH v8 05/12] app/graph: add ethdev " skori
2023-10-16 13:20                         ` Jerin Jacob
2023-10-16 14:10                           ` Bruce Richardson
2023-10-17  6:26                             ` [EXT] " Sunil Kumar Kori
2023-09-29  9:58                       ` [PATCH v8 06/12] app/graph: add ipv4_lookup " skori
2023-10-16 15:47                         ` Jerin Jacob
2023-10-17  6:30                           ` [EXT] " Sunil Kumar Kori
2023-09-29  9:58                       ` [PATCH v8 07/12] app/graph: add ipv6_lookup " skori
2023-09-29  9:58                       ` [PATCH v8 08/12] app/graph: add neigh " skori
2023-09-29  9:58                       ` [PATCH v8 09/12] app/graph: add ethdev_rx " skori
2023-09-29  9:58                       ` [PATCH v8 10/12] app/graph: add graph " skori
2023-09-29  9:58                       ` [PATCH v8 11/12] app/graph: add CLI option to enable graph stats skori
2023-10-16 15:55                         ` Jerin Jacob
2023-09-29  9:58                       ` [PATCH v8 12/12] app/graph: add l3fwd use case skori
2023-10-16 16:01                       ` [PATCH v8 00/12] add CLI based graph application Jerin Jacob
2023-10-16 16:27                         ` Stephen Hemminger
2023-06-02 16:22   ` [PATCH v3 0/3] node: Introduce kernel_rx & kernel_tx nodes Vamsi Attunuru
2023-06-02 16:22     ` [PATCH v3 1/3] node/kernel_tx: support packet transmit to kernel Vamsi Attunuru
2023-06-05 12:47       ` Nithin Dabilpuram
2023-06-12 19:32         ` Thomas Monjalon
2023-06-02 16:22     ` [PATCH v3 2/3] node/kernel_rx: support receiving packets from kernel Vamsi Attunuru
2023-06-05 12:50       ` Nithin Dabilpuram
2023-06-02 16:22     ` [PATCH v3 3/3] node/ethdev_rx: remove hardcoded node next details Vamsi Attunuru
2023-06-05 12:51       ` Nithin Dabilpuram
2023-06-12 16:12     ` [PATCH v3 0/3] node: Introduce kernel_rx & kernel_tx nodes Vamsi Krishna Attunuru
2023-06-12 19:31     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBAE1Ofdsx8j+qL0iF83vwpEz+VeniPjVpWhSCiWEqf1CV-Aw@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=rkudurumalla@marvell.com \
    --cc=skori@marvell.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).