diff mbox series

[ovs-dev] Documentation: Fix DPDK qos example.

Message ID 1613533180-11511-1-git-send-email-u9012063@gmail.com
State Changes Requested
Headers show
Series [ovs-dev] Documentation: Fix DPDK qos example. | expand

Commit Message

William Tu Feb. 17, 2021, 3:39 a.m. UTC
RFC4115 says "The CIR and EIR are both measured in bits/s."
Fix the example use case based on the decription.
64-Byte packet * 8 * 1000 pps = 512000

Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress policer")
Signed-off-by: William Tu <u9012063@gmail.com>
---
 Documentation/topics/dpdk/qos.rst | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Eelco Chaudron Feb. 17, 2021, 8:23 a.m. UTC | #1
On 17 Feb 2021, at 4:39, William Tu wrote:

> RFC4115 says "The CIR and EIR are both measured in bits/s."
> Fix the example use case based on the decription.
> 64-Byte packet * 8 * 1000 pps = 512000

Did you run some tests to verify the changes you made?

> Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress 
> policer")
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
>  Documentation/topics/dpdk/qos.rst | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/topics/dpdk/qos.rst 
> b/Documentation/topics/dpdk/qos.rst
> index 103495415a9c..e9a51ab3a3f0 100644
> --- a/Documentation/topics/dpdk/qos.rst
> +++ b/Documentation/topics/dpdk/qos.rst
> @@ -69,22 +69,22 @@ to prioritize certain traffic over others at a 
> port level.
>
>  For example, the following configuration will limit the traffic rate 
> at a
>  port level to a maximum of 2000 packets a second (64 bytes IPv4 
> packets).
> -100pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
> +1000pps as CIR (Committed Information Rate) and 1000pps as EIR 
> (Excess
>  Information Rate). High priority traffic is routed to queue 10, which 
> marks
>  all traffic as CIR, i.e. Green. All low priority traffic, queue 20, 
> is
>  marked as EIR, i.e. Yellow::
>
>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>          --id=@myqos create qos type=trtcm-policer \
> -        other-config:cir=52000 other-config:cbs=2048 \
> -        other-config:eir=52000 other-config:ebs=2048  \
> +        other-config:cir=512000 other-config:cbs=2048 \
> +        other-config:eir=512000 other-config:ebs=2048  \
>          queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
>           --id=@dpdk1Q10 create queue \
> -          other-config:cir=41600000 other-config:cbs=2048 \
> -          other-config:eir=0 other-config:ebs=0 -- \
> +          other-config:cir=512000 other-config:cbs=2048 \
> +          other-config:eir=512000 other-config:ebs=0 -- \

The eir should stay zero here

>           --id=@dpdk1Q20 create queue \
>             other-config:cir=0 other-config:cbs=0 \
> -           other-config:eir=41600000 other-config:ebs=2048 \
> +           other-config:eir=512000 other-config:ebs=2048 \
>
>  This configuration accomplishes that the high priority traffic has a
>  guaranteed bandwidth egressing the ports at CIR (1000pps), but it can 
> also

I’ll re-run some of my tests if you have not done so with the new 
config. Hopefully next week or the week after.

//Eelco
Eelco Chaudron Feb. 17, 2021, 4:21 p.m. UTC | #2
On 17 Feb 2021, at 9:23, Eelco Chaudron wrote:

> On 17 Feb 2021, at 4:39, William Tu wrote:
>
>> RFC4115 says "The CIR and EIR are both measured in bits/s."
>> Fix the example use case based on the decription.
>> 64-Byte packet * 8 * 1000 pps = 512000
>
> Did you run some tests to verify the changes you made?
>
>> Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress 
>> policer")
>> Signed-off-by: William Tu <u9012063@gmail.com>
>> ---
>>  Documentation/topics/dpdk/qos.rst | 12 ++++++------
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/topics/dpdk/qos.rst 
>> b/Documentation/topics/dpdk/qos.rst
>> index 103495415a9c..e9a51ab3a3f0 100644
>> --- a/Documentation/topics/dpdk/qos.rst
>> +++ b/Documentation/topics/dpdk/qos.rst
>> @@ -69,22 +69,22 @@ to prioritize certain traffic over others at a 
>> port level.
>>
>>  For example, the following configuration will limit the traffic rate 
>> at a
>>  port level to a maximum of 2000 packets a second (64 bytes IPv4 
>> packets).
>> -100pps as CIR (Committed Information Rate) and 1000pps as EIR 
>> (Excess
>> +1000pps as CIR (Committed Information Rate) and 1000pps as EIR 
>> (Excess

Ack this should be 1000

>>  Information Rate). High priority traffic is routed to queue 10, 
>> which marks
>>  all traffic as CIR, i.e. Green. All low priority traffic, queue 20, 
>> is
>>  marked as EIR, i.e. Yellow::
>>
>>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>>          --id=@myqos create qos type=trtcm-policer \
>> -        other-config:cir=52000 other-config:cbs=2048 \
>> -        other-config:eir=52000 other-config:ebs=2048  \

52000 is fine as our documentation states cir, eir are in bytes per 
second, minus the ethernet header.
So (64-12) * 1000 = 52000

>> +        other-config:cir=512000 other-config:cbs=2048 \
>> +        other-config:eir=512000 other-config:ebs=2048  \
>>          queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
>>           --id=@dpdk1Q10 create queue \
>> -          other-config:cir=41600000 other-config:cbs=2048 \

This one should change to cir 2*52000 = 104000 also.

>> -          other-config:eir=0 other-config:ebs=0 -- \

This should change unaltered.

>> +          other-config:cir=512000 other-config:cbs=2048 \
>> +          other-config:eir=512000 other-config:ebs=0 -- \
>
> The eir should stay zero here
>
>>           --id=@dpdk1Q20 create queue \
>>             other-config:cir=0 other-config:cbs=0 \
>> -           other-config:eir=41600000 other-config:ebs=2048 \
>> +           other-config:eir=512000 other-config:ebs=2048 \

This should be 52000 also the trailing backslash can be removed.
>>
>>  This configuration accomplishes that the high priority traffic has a
>>  guaranteed bandwidth egressing the ports at CIR (1000pps), but it 
>> can also
>
> I’ll re-run some of my tests if you have not done so with the new 
> config. Hopefully next week or the week after.

I found some time to re-test this, and with the new values it works as 
expected.
To be clear this is the correct set:

$ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
     --id=@myqos create qos type=trtcm-policer \
     other-config:cir=52000 other-config:cbs=2048 \
     other-config:eir=52000 other-config:ebs=2048  \
     queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
      --id=@dpdk1Q10 create queue \
       other-config:cir=104000 other-config:cbs=2048 \
       other-config:eir=0 other-config:ebs=0 -- \
      --id=@dpdk1Q20 create queue \
        other-config:cir=0 other-config:cbs=0 \
        other-config:eir=52000 other-config:ebs=2048
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
William Tu Feb. 17, 2021, 5:17 p.m. UTC | #3
On Wed, Feb 17, 2021 at 8:21 AM Eelco Chaudron <echaudro@redhat.com> wrote:
>
>
>
> On 17 Feb 2021, at 9:23, Eelco Chaudron wrote:
>
> > On 17 Feb 2021, at 4:39, William Tu wrote:
> >
> >> RFC4115 says "The CIR and EIR are both measured in bits/s."
> >> Fix the example use case based on the decription.
> >> 64-Byte packet * 8 * 1000 pps = 512000
> >
> > Did you run some tests to verify the changes you made?
> >
> >> Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress
> >> policer")
> >> Signed-off-by: William Tu <u9012063@gmail.com>
> >> ---
> >>  Documentation/topics/dpdk/qos.rst | 12 ++++++------
> >>  1 file changed, 6 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/Documentation/topics/dpdk/qos.rst
> >> b/Documentation/topics/dpdk/qos.rst
> >> index 103495415a9c..e9a51ab3a3f0 100644
> >> --- a/Documentation/topics/dpdk/qos.rst
> >> +++ b/Documentation/topics/dpdk/qos.rst
> >> @@ -69,22 +69,22 @@ to prioritize certain traffic over others at a
> >> port level.
> >>
> >>  For example, the following configuration will limit the traffic rate
> >> at a
> >>  port level to a maximum of 2000 packets a second (64 bytes IPv4
> >> packets).
> >> -100pps as CIR (Committed Information Rate) and 1000pps as EIR
> >> (Excess
> >> +1000pps as CIR (Committed Information Rate) and 1000pps as EIR
> >> (Excess
>
> Ack this should be 1000
>
> >>  Information Rate). High priority traffic is routed to queue 10,
> >> which marks
> >>  all traffic as CIR, i.e. Green. All low priority traffic, queue 20,
> >> is
> >>  marked as EIR, i.e. Yellow::
> >>
> >>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
> >>          --id=@myqos create qos type=trtcm-policer \
> >> -        other-config:cir=52000 other-config:cbs=2048 \
> >> -        other-config:eir=52000 other-config:ebs=2048  \
>
> 52000 is fine as our documentation states cir, eir are in bytes per
> second, minus the ethernet header.
> So (64-12) * 1000 = 52000
>
> >> +        other-config:cir=512000 other-config:cbs=2048 \
> >> +        other-config:eir=512000 other-config:ebs=2048  \
> >>          queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
> >>           --id=@dpdk1Q10 create queue \
> >> -          other-config:cir=41600000 other-config:cbs=2048 \
>
> This one should change to cir 2*52000 = 104000 also.
>
> >> -          other-config:eir=0 other-config:ebs=0 -- \
>
> This should change unaltered.
>
> >> +          other-config:cir=512000 other-config:cbs=2048 \
> >> +          other-config:eir=512000 other-config:ebs=0 -- \
> >
> > The eir should stay zero here
> >
> >>           --id=@dpdk1Q20 create queue \
> >>             other-config:cir=0 other-config:cbs=0 \
> >> -           other-config:eir=41600000 other-config:ebs=2048 \
> >> +           other-config:eir=512000 other-config:ebs=2048 \
>
> This should be 52000 also the trailing backslash can be removed.
> >>
> >>  This configuration accomplishes that the high priority traffic has a
> >>  guaranteed bandwidth egressing the ports at CIR (1000pps), but it
> >> can also
> >
> > I’ll re-run some of my tests if you have not done so with the new
> > config. Hopefully next week or the week after.
>
> I found some time to re-test this, and with the new values it works as
> expected.
> To be clear this is the correct set:
>
> $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>      --id=@myqos create qos type=trtcm-policer \
>      other-config:cir=52000 other-config:cbs=2048 \
>      other-config:eir=52000 other-config:ebs=2048  \
>      queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
>       --id=@dpdk1Q10 create queue \
>        other-config:cir=104000 other-config:cbs=2048 \
>        other-config:eir=0 other-config:ebs=0 -- \
>       --id=@dpdk1Q20 create queue \
>         other-config:cir=0 other-config:cbs=0 \
>         other-config:eir=52000 other-config:ebs=2048

Hi Eelco,
Thanks!
One question, I thought for queue10, instead of "cir=104000", we should do
      --id=@dpdk1Q10 create queue \
       other-config:cir=52000 other-config:cbs=2048 \
       other-config:eir=52000 other-config:ebs=2048 -- \
because later on in the description, we said "
 This configuration accomplishes that the high priority traffic has a
  guaranteed bandwidth egressing the ports at CIR (1000pps), but it can also
  use the EIR, so a total of 2000pps at max. These additional 1000pps is
 shared with the low priority traffic. The low priority traffic can use at
 maximum 1000pps.
"
William
Eelco Chaudron Feb. 17, 2021, 5:28 p.m. UTC | #4
On 17 Feb 2021, at 18:17, William Tu wrote:

> On Wed, Feb 17, 2021 at 8:21 AM Eelco Chaudron <echaudro@redhat.com> 
> wrote:
>>
>>
>>
>> On 17 Feb 2021, at 9:23, Eelco Chaudron wrote:
>>
>>> On 17 Feb 2021, at 4:39, William Tu wrote:
>>>
>>>> RFC4115 says "The CIR and EIR are both measured in bits/s."
>>>> Fix the example use case based on the decription.
>>>> 64-Byte packet * 8 * 1000 pps = 512000
>>>
>>> Did you run some tests to verify the changes you made?
>>>
>>>> Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress
>>>> policer")
>>>> Signed-off-by: William Tu <u9012063@gmail.com>
>>>> ---
>>>>  Documentation/topics/dpdk/qos.rst | 12 ++++++------
>>>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/Documentation/topics/dpdk/qos.rst
>>>> b/Documentation/topics/dpdk/qos.rst
>>>> index 103495415a9c..e9a51ab3a3f0 100644
>>>> --- a/Documentation/topics/dpdk/qos.rst
>>>> +++ b/Documentation/topics/dpdk/qos.rst
>>>> @@ -69,22 +69,22 @@ to prioritize certain traffic over others at a
>>>> port level.
>>>>
>>>>  For example, the following configuration will limit the traffic 
>>>> rate
>>>> at a
>>>>  port level to a maximum of 2000 packets a second (64 bytes IPv4
>>>> packets).
>>>> -100pps as CIR (Committed Information Rate) and 1000pps as EIR
>>>> (Excess
>>>> +1000pps as CIR (Committed Information Rate) and 1000pps as EIR
>>>> (Excess
>>
>> Ack this should be 1000
>>
>>>>  Information Rate). High priority traffic is routed to queue 10,
>>>> which marks
>>>>  all traffic as CIR, i.e. Green. All low priority traffic, queue 
>>>> 20,
>>>> is
>>>>  marked as EIR, i.e. Yellow::
>>>>
>>>>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>>>>          --id=@myqos create qos type=trtcm-policer \
>>>> -        other-config:cir=52000 other-config:cbs=2048 \
>>>> -        other-config:eir=52000 other-config:ebs=2048  \
>>
>> 52000 is fine as our documentation states cir, eir are in bytes per
>> second, minus the ethernet header.
>> So (64-12) * 1000 = 52000
>>
>>>> +        other-config:cir=512000 other-config:cbs=2048 \
>>>> +        other-config:eir=512000 other-config:ebs=2048  \
>>>>          queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
>>>>           --id=@dpdk1Q10 create queue \
>>>> -          other-config:cir=41600000 other-config:cbs=2048 \
>>
>> This one should change to cir 2*52000 = 104000 also.
>>
>>>> -          other-config:eir=0 other-config:ebs=0 -- \
>>
>> This should change unaltered.
>>
>>>> +          other-config:cir=512000 other-config:cbs=2048 \
>>>> +          other-config:eir=512000 other-config:ebs=0 -- \
>>>
>>> The eir should stay zero here
>>>
>>>>           --id=@dpdk1Q20 create queue \
>>>>             other-config:cir=0 other-config:cbs=0 \
>>>> -           other-config:eir=41600000 other-config:ebs=2048 \
>>>> +           other-config:eir=512000 other-config:ebs=2048 \
>>
>> This should be 52000 also the trailing backslash can be removed.
>>>>
>>>>  This configuration accomplishes that the high priority traffic has 
>>>> a
>>>>  guaranteed bandwidth egressing the ports at CIR (1000pps), but it
>>>> can also
>>>
>>> I’ll re-run some of my tests if you have not done so with the new
>>> config. Hopefully next week or the week after.
>>
>> I found some time to re-test this, and with the new values it works 
>> as
>> expected.
>> To be clear this is the correct set:
>>
>> $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>>      --id=@myqos create qos type=trtcm-policer \
>>      other-config:cir=52000 other-config:cbs=2048 \
>>      other-config:eir=52000 other-config:ebs=2048  \
>>      queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
>>       --id=@dpdk1Q10 create queue \
>>        other-config:cir=104000 other-config:cbs=2048 \
>>        other-config:eir=0 other-config:ebs=0 -- \
>>       --id=@dpdk1Q20 create queue \
>>         other-config:cir=0 other-config:cbs=0 \
>>         other-config:eir=52000 other-config:ebs=2048
>
> Hi Eelco,
> Thanks!
> One question, I thought for queue10, instead of "cir=104000", we 
> should do
>       --id=@dpdk1Q10 create queue \
>        other-config:cir=52000 other-config:cbs=2048 \
>        other-config:eir=52000 other-config:ebs=2048 -- \
> because later on in the description, we said "
>  This configuration accomplishes that the high priority traffic has a
>   guaranteed bandwidth egressing the ports at CIR (1000pps), but it 
> can also
>   use the EIR, so a total of 2000pps at max. These additional 1000pps 
> is
>  shared with the low priority traffic. The low priority traffic can 
> use at
>  maximum 1000pps.
> "

My configuration is fine, the queue 10 classifier will mark all traffic 
as green, then when it comes to the port classifier, it will first let 
the port level CIR, and if none is left it will eat the EIR.

If you configure it your way, in theory, you could drop an EIR marked 
packet at the queue level when there is room in CIR but not in the EIR 
at port level.

Basically, if you look at the RFC the queue level classifier is done as 
color blind, followed by the port processing which is done colorful.

> William
William Tu Feb. 17, 2021, 5:41 p.m. UTC | #5
>
> >>  Information Rate). High priority traffic is routed to queue 10,
> >> which marks
> >>  all traffic as CIR, i.e. Green. All low priority traffic, queue 20,
> >> is
> >>  marked as EIR, i.e. Yellow::
> >>
> >>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
> >>          --id=@myqos create qos type=trtcm-policer \
> >> -        other-config:cir=52000 other-config:cbs=2048 \
> >> -        other-config:eir=52000 other-config:ebs=2048  \
>
> 52000 is fine as our documentation states cir, eir are in bytes per
> second, minus the ethernet header.
> So (64-12) * 1000 = 52000

How come it's not minus 14-byte ethernet header?

the rest looks good to me. Thanks!
William
Eelco Chaudron Feb. 18, 2021, 9:23 a.m. UTC | #6
On 17 Feb 2021, at 18:41, William Tu wrote:

>>
>>>>  Information Rate). High priority traffic is routed to queue 10,
>>>> which marks
>>>>  all traffic as CIR, i.e. Green. All low priority traffic, queue 20,
>>>> is
>>>>  marked as EIR, i.e. Yellow::
>>>>
>>>>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>>>>          --id=@myqos create qos type=trtcm-policer \
>>>> -        other-config:cir=52000 other-config:cbs=2048 \
>>>> -        other-config:eir=52000 other-config:ebs=2048  \
>>
>> 52000 is fine as our documentation states cir, eir are in bytes per
>> second, minus the ethernet header.
>> So (64-12) * 1000 = 52000
>
> How come it's not minus 14-byte ethernet header?

You are right, it should be 14, miscounted the rte_ether_hdr structure size :(
William Tu Feb. 18, 2021, 2:40 p.m. UTC | #7
On Thu, Feb 18, 2021 at 1:23 AM Eelco Chaudron <echaudro@redhat.com> wrote:
>
>
>
> On 17 Feb 2021, at 18:41, William Tu wrote:
>
> >>
> >>>>  Information Rate). High priority traffic is routed to queue 10,
> >>>> which marks
> >>>>  all traffic as CIR, i.e. Green. All low priority traffic, queue 20,
> >>>> is
> >>>>  marked as EIR, i.e. Yellow::
> >>>>
> >>>>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
> >>>>          --id=@myqos create qos type=trtcm-policer \
> >>>> -        other-config:cir=52000 other-config:cbs=2048 \
> >>>> -        other-config:eir=52000 other-config:ebs=2048  \
> >>
> >> 52000 is fine as our documentation states cir, eir are in bytes per
> >> second, minus the ethernet header.
> >> So (64-12) * 1000 = 52000
> >
> > How come it's not minus 14-byte ethernet header?
>
> You are right, it should be 14, miscounted the rte_ether_hdr structure size :(
>
Thank you!
at vswitchd/vswitch.xml, it uses "46", should I change it to "64- 14 = 50"?
        calculated by (pps x packet data size).  For example assuming a user
        wishes to limit a stream consisting of 64 byte packets to 1 million
        packets per second the EIR would be set to to to 46000000. This value
        can be broken into '1,000,000 x 46'. Where 1,000,000 is the policing
        rate for the number of packets per second and 46 represents the size
        of the packet data for a 64 byte ip packet.
William
Eelco Chaudron Feb. 18, 2021, 2:55 p.m. UTC | #8
On 18 Feb 2021, at 15:40, William Tu wrote:

> On Thu, Feb 18, 2021 at 1:23 AM Eelco Chaudron <echaudro@redhat.com> 
> wrote:
>>
>>
>>
>> On 17 Feb 2021, at 18:41, William Tu wrote:
>>
>>>>
>>>>>>  Information Rate). High priority traffic is routed to queue 10,
>>>>>> which marks
>>>>>>  all traffic as CIR, i.e. Green. All low priority traffic, queue 
>>>>>> 20,
>>>>>> is
>>>>>>  marked as EIR, i.e. Yellow::
>>>>>>
>>>>>>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
>>>>>>          --id=@myqos create qos type=trtcm-policer \
>>>>>> -        other-config:cir=52000 other-config:cbs=2048 \
>>>>>> -        other-config:eir=52000 other-config:ebs=2048  \
>>>>
>>>> 52000 is fine as our documentation states cir, eir are in bytes per
>>>> second, minus the ethernet header.
>>>> So (64-12) * 1000 = 52000
>>>
>>> How come it's not minus 14-byte ethernet header?
>>
>> You are right, it should be 14, miscounted the rte_ether_hdr 
>> structure size :(
>>
> Thank you!
> at vswitchd/vswitch.xml, it uses "46", should I change it to "64- 14 = 
> 50"?
>         calculated by (pps x packet data size).  For example assuming 
> a user
>         wishes to limit a stream consisting of 64 byte packets to 1 
> million
>         packets per second the EIR would be set to to to 46000000. 
> This value
>         can be broken into '1,000,000 x 46'. Where 1,000,000 is the 
> policing
>         rate for the number of packets per second and 46 represents 
> the size
>         of the packet data for a 64 byte ip packet.
> William

Guess they take of the FCS also, so the packets they sent are 14 bytes 
ethernet, + 46 bytes IP + 4 FCS.

In my tests I sent 64 byte packets, i.e. 14 bytes ethernet + 50 bytes 
IP.

Maybe we should clarify this in the text some how?
William Tu Feb. 18, 2021, 3:10 p.m. UTC | #9
On Thu, Feb 18, 2021 at 6:55 AM Eelco Chaudron <echaudro@redhat.com> wrote:
>
>
>
> On 18 Feb 2021, at 15:40, William Tu wrote:
>
> > On Thu, Feb 18, 2021 at 1:23 AM Eelco Chaudron <echaudro@redhat.com>
> > wrote:
> >>
> >>
> >>
> >> On 17 Feb 2021, at 18:41, William Tu wrote:
> >>
> >>>>
> >>>>>>  Information Rate). High priority traffic is routed to queue 10,
> >>>>>> which marks
> >>>>>>  all traffic as CIR, i.e. Green. All low priority traffic, queue
> >>>>>> 20,
> >>>>>> is
> >>>>>>  marked as EIR, i.e. Yellow::
> >>>>>>
> >>>>>>      $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
> >>>>>>          --id=@myqos create qos type=trtcm-policer \
> >>>>>> -        other-config:cir=52000 other-config:cbs=2048 \
> >>>>>> -        other-config:eir=52000 other-config:ebs=2048  \
> >>>>
> >>>> 52000 is fine as our documentation states cir, eir are in bytes per
> >>>> second, minus the ethernet header.
> >>>> So (64-12) * 1000 = 52000
> >>>
> >>> How come it's not minus 14-byte ethernet header?
> >>
> >> You are right, it should be 14, miscounted the rte_ether_hdr
> >> structure size :(
> >>
> > Thank you!
> > at vswitchd/vswitch.xml, it uses "46", should I change it to "64- 14 =
> > 50"?
> >         calculated by (pps x packet data size).  For example assuming
> > a user
> >         wishes to limit a stream consisting of 64 byte packets to 1
> > million
> >         packets per second the EIR would be set to to to 46000000.
> > This value
> >         can be broken into '1,000,000 x 46'. Where 1,000,000 is the
> > policing
> >         rate for the number of packets per second and 46 represents
> > the size
> >         of the packet data for a 64 byte ip packet.
> > William
>
> Guess they take of the FCS also, so the packets they sent are 14 bytes
> ethernet, + 46 bytes IP + 4 FCS.

I see, thanks!

>
> In my tests I sent 64 byte packets, i.e. 14 bytes ethernet + 50 bytes
> IP.
>
> Maybe we should clarify this in the text some how?
>
Sure, I will do it.
William
diff mbox series

Patch

diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst
index 103495415a9c..e9a51ab3a3f0 100644
--- a/Documentation/topics/dpdk/qos.rst
+++ b/Documentation/topics/dpdk/qos.rst
@@ -69,22 +69,22 @@  to prioritize certain traffic over others at a port level.
 
 For example, the following configuration will limit the traffic rate at a
 port level to a maximum of 2000 packets a second (64 bytes IPv4 packets).
-100pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
+1000pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
 Information Rate). High priority traffic is routed to queue 10, which marks
 all traffic as CIR, i.e. Green. All low priority traffic, queue 20, is
 marked as EIR, i.e. Yellow::
 
     $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \
         --id=@myqos create qos type=trtcm-policer \
-        other-config:cir=52000 other-config:cbs=2048 \
-        other-config:eir=52000 other-config:ebs=2048  \
+        other-config:cir=512000 other-config:cbs=2048 \
+        other-config:eir=512000 other-config:ebs=2048  \
         queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
          --id=@dpdk1Q10 create queue \
-          other-config:cir=41600000 other-config:cbs=2048 \
-          other-config:eir=0 other-config:ebs=0 -- \
+          other-config:cir=512000 other-config:cbs=2048 \
+          other-config:eir=512000 other-config:ebs=0 -- \
          --id=@dpdk1Q20 create queue \
            other-config:cir=0 other-config:cbs=0 \
-           other-config:eir=41600000 other-config:ebs=2048 \
+           other-config:eir=512000 other-config:ebs=2048 \
 
 This configuration accomplishes that the high priority traffic has a
 guaranteed bandwidth egressing the ports at CIR (1000pps), but it can also