[PATCH v2] app/testpmd: enable cli for programmable action
Zhang, Qi Z
qi.z.zhang at intel.com
Fri Oct 6 04:37:24 CEST 2023
> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Thursday, October 5, 2023 12:32 PM
> To: Zhang, Qi Z <qi.z.zhang at intel.com>
> Cc: Singh, Aman Deep <aman.deep.singh at intel.com>; Zhang, Yuying
> <yuying.zhang at intel.com>; dev at dpdk.org; Dumitrescu, Cristian
> <cristian.dumitrescu at intel.com>; orika at nvidia.com; ferruh.yigit at 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 at 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.
More information about the dev
mailing list