From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "Singh, Aman Deep" <aman.deep.singh@intel.com>,
"Zhang, Yuying" <yuying.zhang@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
"orika@nvidia.com" <orika@nvidia.com>,
"ferruh.yigit@amd.com" <ferruh.yigit@amd.com>
Subject: RE: [PATCH v2] app/testpmd: enable cli for programmable action
Date: Fri, 6 Oct 2023 02:37:24 +0000 [thread overview]
Message-ID: <DM4PR11MB599450381164AC40A65BCFB0D7C9A@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20231004213201.20c1de85@hermes.local>
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, October 5, 2023 12:32 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: Singh, Aman Deep <aman.deep.singh@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; dev@dpdk.org; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; orika@nvidia.com; ferruh.yigit@amd.com
> Subject: Re: [PATCH v2] app/testpmd: enable cli for programmable action
>
> 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];
> };
>
The memory of rte_flow_action_prog_argument need to be continues due to the definition of rte_flow_action_prog.
But follow your idea, it still can be refined as below to get a better view.
struct action_prog_data {
struct rte_flow_action_prog conf;
struct {
char name[ACTION_PROG_NAME_SIZE_MAX];
struct rte_flow_action_prog_argument args[ACTION_PROG_ARG_NUM_MAX];
struct {
char names[ACTION_PROG_NAME_SIZE_MAX];
uint8_t value[ACTION_PROG_ARG_VALUE_SIZE_MAX];
} arg_data[ACTION_PROG_ARG_NUM_MAX];
} data;
};
> Or better yet get rid of PROG_ARG_NUM_MAX and use a flex array.
My understanding is to make the array flex will introduce additional complexity, currently fixed size data structure is required to be allocated for parser buffer for all action commands
Also to support variant size at runtime, we may introduce another testpmd parameter which seems a little bit overused to me.
> Somebody will want more than 8 args.
Sure, I can made it bigger.
next prev parent reply other threads:[~2023-10-06 2:37 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
2023-10-06 2:37 ` Zhang, Qi Z [this message]
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=DM4PR11MB599450381164AC40A65BCFB0D7C9A@DM4PR11MB5994.namprd11.prod.outlook.com \
--to=qi.z.zhang@intel.com \
--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=stephen@networkplumber.org \
--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).