[ovs-dev] [PATCH v2] Make 100 percents packets sampled when sampling rate is 1.

Justin Pettit jpettit at nicira.com
Wed Aug 5 17:01:26 UTC 2015


> On Aug 5, 2015, at 3:11 AM, Wenyu Zhang <wenyuz at vmware.com> wrote:
> 
> 
>> On Aug 4, 2015, at 12:17 PM, Ben Pfaff <blp at nicira.com> wrote:
>> 
>> On Tue, Aug 04, 2015 at 04:05:58AM +0000, Wenyu Zhang wrote:
>>> In ipfix and sflow, the sampling rate can be set as 1, which means
>>> 100%.  And in order to make 100% packets sampled, I work out a patch
>>> in datapath, which is for review on net-next.  And the same change
>>> seems need to be added into lib/odp-execute.c too. Do you mean that it
>>> is not necessary here?
>> 
>> I mean that we should modify the IPFIX and sFlow sampling code so that
>> in the 0% and 100% sample rates cases it doesn't generate a sample
>> action; there isn't any value in it.
>> 
>> This situation is a little different from the kernel situation, since we
>> know exactly what actions can be fed to the userspace datapath in
>> odp-execute.c, since the actions that it executes are generated by
>> another part of the same source tree.  The kernel datapath, however,
>> should be equally capable of handling actions from sources other than
>> the Open vSwitch userspace.
> 
> It is  OK that sample action shouldn’t be generated when the sampling rate is 0%.
> But I wonder why we shouldn’t generate sample action when the sampling rate is 100%. It should happen in kernel datapth.
> Or you means that the 100% sampling rate case won’t happen in the userspace datapath?

Ben's on vacation, so I'll just have to guess what he meant.  I suspect his thinking was that you'd just call the actions that would be called through "sample" directly.  Since the run 100% of the time, there's no need to call them through the sample action.

--Justin





More information about the dev mailing list