DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Qi Zhang <qi.z.zhang@intel.com>
Cc: aman.deep.singh@intel.com, yuying.zhang@intel.com, dev@dpdk.org,
	cristian.dumitrescu@intel.com, orika@nvidia.com,
	ferruh.yigit@amd.com
Subject: Re: [PATCH v2] app/testpmd: enable cli for programmable action
Date: Wed, 4 Oct 2023 21:32:01 -0700	[thread overview]
Message-ID: <20231004213201.20c1de85@hermes.local> (raw)
In-Reply-To: <20231005114238.243388-1-qi.z.zhang@intel.com>

On Thu,  5 Oct 2023 07:42:38 -0400
Qi Zhang <qi.z.zhang@intel.com> wrote:

> +	char name[ACTION_PROG_NAME_SIZE_MAX];
> +	struct rte_flow_action_prog_argument args[ACTION_PROG_ARG_NUM_MAX];
> +	char arg_names[ACTION_PROG_ARG_NUM_MAX][ACTION_PROG_NAME_SIZE_MAX];
> +	uint8_t value[ACTION_PROG_ARG_NUM_MAX][ACTION_PROG_ARG_VALUE_SIZE_MAX];
> +};
> +

IMHO if you have this many array elements the data structure makes more sense as.

	struct flow_arg {
		char name[ACTION_PROG_NAME_SIZE_MAX];
		struct {
			struct rte_flow_prog_argument prog;
			char names[ACTION_PROG_NAME_SIZE_MAX];
			uint8_t value[ACTION_PROG_ARG_VALUE_SIZE_MAX];
		} args[ACTION_PROG_ARG_NUM_MAX];
	};

Or better yet get rid of PROG_ARG_NUM_MAX and use a flex array.
Somebody will want more than 8 args.

  reply	other threads:[~2023-10-05  4:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 10:02 [PATCH 1/2] " Qi Zhang
2023-10-05 11:42 ` [PATCH v2] " Qi Zhang
2023-10-05  4:32   ` Stephen Hemminger [this message]
2023-10-06  2:37     ` Zhang, Qi Z
2023-10-06 11:07 ` [PATCH v3] " Qi Zhang
2023-10-06 12:35   ` Dumitrescu, Cristian
2023-10-07  1:50     ` Zhang, Qi Z
2023-10-07 10:47 ` [PATCH v4] " Qi Zhang
2023-10-08  0:06   ` Dumitrescu, Cristian
2023-10-10 10:49   ` Ferruh Yigit
2023-10-11  2:24     ` Zhang, Qi Z
2023-10-11 10:20       ` Ferruh Yigit
2023-10-11 13:19         ` Zhang, Qi Z
2023-10-12  0:04           ` Zhang, Qi Z
2023-10-12  1:32             ` Stephen Hemminger
2023-10-27 11:06               ` Zhang, Qi Z
2023-10-11 11:58 ` [PATCH v5] " Qi Zhang
2023-10-11 12:03 ` [PATCH v6] " Qi Zhang
2024-02-08  1:10   ` Ferruh Yigit
2024-04-18 15:39     ` Ferruh Yigit
2024-10-07 18:12       ` Stephen Hemminger

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=20231004213201.20c1de85@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=orika@nvidia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=yuying.zhang@intel.com \
    /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).