summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEelco Chaudron <echaudro@redhat.com>2020-01-14 11:12:47 -0500
committerIan Stokes <ian.stokes@intel.com>2020-01-15 19:17:55 +0000
commite61bdffc2a98ae6b3ec4c452cd5b61e165a6aaef (patch)
tree00058cafac458f051081f3d9208b699627764d1d /vswitchd
parent23c01b196ff77e15fd83e27fad638ac93eaacaff (diff)
downloadopenvswitch-e61bdffc2a98ae6b3ec4c452cd5b61e165a6aaef.tar.gz
netdev-dpdk: Add new DPDK RFC 4115 egress policer
This patch adds a new policer to the DPDK datapath based on RFC 4115's Two-Rate, Three-Color marker. It's a two-level hierarchical policer which first does a color-blind marking of the traffic at the queue level, followed by a color-aware marking at the port level. At the end traffic marked as Green or Yellow is forwarded, Red is dropped. For details on how traffic is marked, see RFC 4115. This egress policer can be used to limit traffic at different rated based on the queues the traffic is in. In addition, it can also be used 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 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 \ 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 -- \ --id=@dpdk1Q20 create queue \ other-config:cir=0 other-config:cbs=0 \ other-config:eir=41600000 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 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. Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/vswitch.xml34
1 files changed, 34 insertions, 0 deletions
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 0ec726c39..c43cb1aa4 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -4441,6 +4441,19 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
in performance will be noticed in terms of overall aggregate traffic
throughput.
</dd>
+ <dt><code>trtcm-policer</code></dt>
+ <dd>
+ A DPDK egress policer algorithm using RFC 4115's Two-Rate,
+ Three-Color marker. It's a two-level hierarchical policer
+ which first does a color-blind marking of the traffic at the queue
+ level, followed by a color-aware marking at the port level. At the
+ end traffic marked as Green or Yellow is forwarded, Red is dropped.
+ For details on how traffic is marked, see RFC 4115.
+
+ If the ``default queue'', 0, is not configured it's automatically
+ created with the same <code>other_config</code> values as the
+ physical port.
+ </dd>
</dl>
</column>
@@ -4508,6 +4521,27 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
bytes/tokens of the packet. If there are not enough tokens in the cbs
bucket the packet will be dropped.
</column>
+ <column name="other_config" key="eir" type='{"type": "integer"}'>
+ The Excess Information Rate (EIR) is measured in bytes of IP
+ packets per second, i.e. it includes the IP header, but not link
+ specific (e.g. Ethernet) headers. This represents the bytes per second
+ rate at which the token bucket will be updated. The eir value is
+ 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.
+ </column>
+ <column name="other_config" key="ebs" type='{"type": "integer"}'>
+ The Excess Burst Size (EBS) is measured in bytes and represents a
+ token bucket. At a minimum this value should be be set to the expected
+ largest size packet in the traffic stream. In practice larger values
+ may be used to increase the size of the token bucket. If a packet can
+ be transmitted then the ebs will be decremented by the number of
+ bytes/tokens of the packet. If there are not enough tokens in the cbs
+ bucket the packet might be dropped.
+ </column>
</group>
<group title="Configuration for linux-sfq">