On 5/12/2021 11:49 AM, Haifei Luo wrote: > Currently action RTE_FLOW_ACTION_TYPE_METER_COLOR is defined. > Add the CLI for this aciton: color type (types) > There are three types: green, yellow and red. > > Example for the new policy meter CLIs: > add port meter policy 0 1 g_actions color type green / end y_actions > color type yellow / end r_actions color type red / end > > In the above command, the action type is RTE_FLOW_ACTION_TYPE_METER_COLOR, > the meter policy action list: green -> green, yellow -> yellow, red -> red. > > V2: rebase the latest code. > V3: update the document. > V4: add sample in the document. > > Signed-off-by: Haifei Luo <haif...@nvidia.com> > Acked-by: Ori Kam <or...@nvidia.com> testpmd_funcs.rst:5033: WARNING: Block quote ends without a blank line; unexpected unindent.
<...> > @@ -5010,6 +5014,25 @@ rules like above for the peer port. > > testpmd> flow indirect_action 0 update 0 action conntrack_update dir / end > > +Sample meter with policy rules > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Meter with policy rules can be created by the following commands: > + > +Need to create policy first and actions are set for green/yellow/red colors. > +Create meter with policy id. Create flow with meter id. > + > +Example for policy with meter color action.The purpose is to color the packet > +to reflect the meter color result.The meter policy action list: Space is missing between sentences. > +green -> green, yellow -> yellow, red -> red. > + > +:: > +testpmd> add port meter profile srtcm_rfc2697 0 13 21504 2688 0 0 > +testpmd> add port meter policy 0 1 g_actions color type green / end > y_actions color type yellow / end > + r_actions color type red / end > +testpmd> create port meter 0 1 13 1 yes 0xffff 0 0 > +testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end actions > meter mtr_id 1 / end > + Gives build warning: testpmd_funcs.rst:5032: WARNING: Unexpected indentation. testpmd_funcs.rst:5033: WARNING: Block quote ends without a blank line; unexpected unindent. Will fix above issues while merging.