[dpdk-dev] [PATCH] doc: add sampling and mirroring in testpmd guide

Jiawei(Jonny) Wang jiaweiw at nvidia.com
Wed Mar 31 16:38:00 CEST 2021


Hi Ferruh,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit at intel.com>
> Sent: Wednesday, March 31, 2021 5:45 PM
> To: Jiawei(Jonny) Wang <jiaweiw at nvidia.com>; Slava Ovsiienko
> <viacheslavo at nvidia.com>; xiaoyun.li at intel.com; Ori Kam
> <orika at nvidia.com>
> Cc: dev at dpdk.org; Andrew Rybchenko <arybchenko at solarflare.com>; NBU-
> Contact-Thomas Monjalon <thomas at monjalon.net>
> Subject: Re: [PATCH] doc: add sampling and mirroring in testpmd guide
> 
> On 3/31/2021 7:38 AM, Jiawei(Jonny) Wang wrote:
> > Hi Ferruh,
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit at intel.com>
> >> Sent: Friday, March 26, 2021 1:11 AM
> >> To: Jiawei(Jonny) Wang <jiaweiw at nvidia.com>; Slava Ovsiienko
> >> <viacheslavo at nvidia.com>; xiaoyun.li at intel.com; Ori Kam
> >> <orika at nvidia.com>
> >> Cc: dev at dpdk.org; Andrew Rybchenko <arybchenko at solarflare.com>;
> NBU-
> >> Contact-Thomas Monjalon <thomas at monjalon.net>
> >> Subject: Re: [PATCH] doc: add sampling and mirroring in testpmd guide
> >>
> >> On 3/9/2021 1:18 PM, Jiawei Wang wrote:
> >>> Update documentation for sample action usage in testpmd and show the
> >>> command line example.
> >>>
> >>
> >> +1 to document this.
> >>
> >> Indeed for all testpmd flow update, it must be mandatory to update
> >> "Flow rules management" section for it, Ori what do you think?
> >>
> >>> Signed-off-by: Jiawei Wang <jiaweiw at nvidia.com>
> >>> Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
> >>
> >> <...>
> >>
> >>> +Sample Sampling/Mirroring rules
> >>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>> +
> >>> +Sample/Mirroring rules can be set by the following commands
> >>> +
> >>> +NIC-RX Sampling rule, the matched ingress packets are duplicated
> >>> +and sent to the queue 1, and each second packets are marked with
> >>> +0x1234 and sent to queue 0.
> >>> +
> >>
> >> Also each second packets duplicated to queue 1, isn't it, because of 'ratio
> 2'?
> >>
> >
> > Yes, 'ratio=2' means that 50% packet will be sampled.
> >
> 
> I thought 'sample' action also applies to the "queue index 1" but most
> probably it only applies to 'sample_actions', so original paragraph is correct,
> perhaps except the 'duplicated' detail, and my comment "each second
> packets duplicated to queue 1" is wrong.
> 

Here sample action is 'Queue index 0" and original action is 'Queue index 1",
sample action only impact on duplicated packets, so 50% duplicated to queue 0.

> Can you please confirm if below is correct:
> Assume 10 packets are received, from 1 to 10, after below rule queue status
> will be:
> Queue0: 2, 4, 6, 8, 10 [All marked with 0x1234, duplicated packets]
> Queue1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [Original packets]
> 
> 

My description is not correct here.
The Marked 0x1234 and  5 duplicated packet will be sent to queue 0;
But the duplicated packet order not strict 'each second packet'.
All of the 10 packet will be sent to Queue 1 without mark.

I will update as below:
"
NIC-RX Sampling rule, the matched ingress packets are sent to the queue 1,
and 50% packets are duplicated and marked with 0x1234 and sent to queue 0.
"

> >>> +::
> >>> +
> >>> + testpmd> set sample_actions 0 mark id  0x1234 / queue index 0 /
> >>> + testpmd> end flow create 0 ingress group 1 pattern eth / end
> >>> + testpmd> actions
> >>> +        sample ratio 2 index 0 / queue index 1 / end
> >>> +
> >>> +E-Switch Sampling rule, the matched ingress packets are duplicated
> >>> +and sent to port id 2, and each second packets are sent to eswitch
> >> manager.
> >>> +
> >>
> >> what is 'E-Switch', or "eswitch manager", isn't the mirror rule generic?
> >
> > Here E-Switch means 'transfer=1' in flow attribute,  I will remove it since
> the concept is for Mellanox HW.
> >

Thanks.


More information about the dev mailing list