[dpdk-dev] [PATCH V2 5/5] app/testpmd: cli for traffic metering and policing
Adrien Mazarguil
adrien.mazarguil at 6wind.com
Fri Oct 6 15:58:10 CEST 2017
On Thu, Oct 05, 2017 at 02:09:34PM +0100, Cristian Dumitrescu wrote:
> Add CLI commands to exercise the ethdev Traffic Metering and Policing
> (MTR) API.
>
> Signed-off-by: Jasvinder Singh <jasvinder.singh at intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
I can't comment most of these changes, however for the part related to the
flow command:
<snip>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index a17a004..f210ce5 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -194,6 +194,8 @@ enum index {
> ACTION_VF,
> ACTION_VF_ORIGINAL,
> ACTION_VF_ID,
> + ACTION_METER,
> + ACTION_METER_ID,
> };
>
> /** Size of pattern[] field in struct rte_flow_item_raw. */
> @@ -601,6 +603,7 @@ static const enum index next_action[] = {
> ACTION_RSS,
> ACTION_PF,
> ACTION_VF,
> + ACTION_METER,
> ZERO,
> };
>
> @@ -635,6 +638,12 @@ static const enum index action_vf[] = {
> ZERO,
> };
>
> +static const enum index action_meter[] = {
> + ACTION_METER_ID,
> + ACTION_NEXT,
> + ZERO,
> +};
> +
> static int parse_init(struct context *, const struct token *,
> const char *, unsigned int,
> void *, unsigned int);
> @@ -1566,6 +1575,21 @@ static const struct token token_list[] = {
> .args = ARGS(ARGS_ENTRY(struct rte_flow_action_vf, id)),
> .call = parse_vc_conf,
> },
> + [ACTION_METER] = {
> + .name = "meter",
> + .help = "meter the directed packets at given id",
> + .priv = PRIV_ACTION(METER,
> + sizeof(struct rte_flow_action_meter)),
> + .next = NEXT(action_meter),
> + .call = parse_vc,
> + },
> + [ACTION_METER_ID] = {
> + .name = "mtr_id",
> + .help = "meter id to use",
> + .next = NEXT(action_meter, NEXT_ENTRY(UNSIGNED)),
> + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_meter, mtr_id)),
> + .call = parse_vc_conf,
> + },
> };
<snip>
Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
One remaining minor comment:
> diff --git a/app/test-pmd/cmdline_mtr.h b/app/test-pmd/cmdline_mtr.h
<snip>
> +#endif /* _CMDLINE_MTR_H_ */
> \ No newline at end of file
Make sure to add this missing new line for the next iteration.
--
Adrien Mazarguil
6WIND
More information about the dev
mailing list