diff mbox series

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

Message ID 1613661889-59893-1-git-send-email-u9012063@gmail.com
State Accepted
Headers show
Series [ovs-dev,PATCHv2] Documentation: Fix DPDK qos example. | expand

Commit Message

William Tu Feb. 18, 2021, 3:24 p.m. UTC
Fix the example use case based on the decription.
EIR and CIR are measured in bytes/sec and considered 64-byte
IP packets size withtout 14-byte Ethernet header.
So fix the 1000pps example by: (64 - 14) * 1000 = 50,000
If the frame includes 4-byte FCS header, then it's
(64 - 14 - 4) * 1000 = 46,000

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

Comments

Eelco Chaudron Feb. 18, 2021, 4:52 p.m. UTC | #1
On 18 Feb 2021, at 16:24, William Tu wrote:

> Fix the example use case based on the decription.
> EIR and CIR are measured in bytes/sec and considered 64-byte
> IP packets size withtout 14-byte Ethernet header.
> So fix the 1000pps example by: (64 - 14) * 1000 = 50,000
> If the frame includes 4-byte FCS header, then it's
> (64 - 14 - 4) * 1000 = 46,000
>
> Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress policer")
> Signed-off-by: William Tu <u9012063@gmail.com>

Looks good, thanks for taking the time to fix this!

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Ilya Maximets March 1, 2021, 8:22 p.m. UTC | #2
On 2/18/21 5:52 PM, Eelco Chaudron wrote:
> 
> 
> On 18 Feb 2021, at 16:24, William Tu wrote:
> 
>> Fix the example use case based on the decription.
>> EIR and CIR are measured in bytes/sec and considered 64-byte
>> IP packets size withtout 14-byte Ethernet header.
>> So fix the 1000pps example by: (64 - 14) * 1000 = 50,000
>> If the frame includes 4-byte FCS header, then it's
>> (64 - 14 - 4) * 1000 = 46,000
>>
>> Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress policer")
>> Signed-off-by: William Tu <u9012063@gmail.com>
> 
> Looks good, thanks for taking the time to fix this!
> 
> Acked-by: Eelco Chaudron <echaudro@redhat.com>

Thanks!
Applied to master and backported down to 2.13.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst
index 103495415a9c..a98ec672fcf5 100644
--- a/Documentation/topics/dpdk/qos.rst
+++ b/Documentation/topics/dpdk/qos.rst
@@ -69,22 +69,24 @@  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
-Information Rate). High priority traffic is routed to queue 10, which marks
+1000pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess
+Information Rate). CIR and EIR are measured in bytes without Ethernet header.
+As a result, 1000pps means (64-byte - 14-byte) * 1000 = 50,000 in the
+configuration below. 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=50000 other-config:cbs=2048 \
+        other-config:eir=50000 other-config:ebs=2048  \
         queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \
          --id=@dpdk1Q10 create queue \
-          other-config:cir=41600000 other-config:cbs=2048 \
+          other-config:cir=100000 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=41600000 other-config:ebs=2048 \
+           other-config:eir=50000 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
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index a2ad84edefa9..4597a215d936 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -4660,7 +4660,8 @@  ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
         packets per second the CIR 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.
+        of the packet data for a 64 bytes IP packet without 14 bytes Ethernet
+        and 4 bytes FCS header.
       </column>
       <column name="other_config" key="cbs" type='{"type": "integer"}'>
         The Committed Burst Size (CBS) is measured in bytes and represents a
@@ -4681,7 +4682,8 @@  ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
         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.
+        of the packet data for a 64 bytes IP packet without 14 bytes Ethernet
+        and 4 bytes FCS header.
       </column>
       <column name="other_config" key="ebs" type='{"type": "integer"}'>
         The Excess Burst Size (EBS) is measured in bytes and represents a