Re: [ovs-dev] [dpdk-latest PATCH v3 2/2] netdev-dpdk: Add new DPDK RFC 4115 egress policer
On 7 Jan 2020, at 19:33, Stokes, Ian wrote: On 10/1/2019 3:10 PM, Eelco Chaudron wrote: 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=4160 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=4160 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 Thank for the patch Eelco, Overall loks good and follows the established QoS methodology. I'm still testing this code in more detail but wanted to clarify a few points below in the meantime. Comments inline. We discussed this at the OVS conference but this causes compilation to failure in OVS DPDK due to some of the trtcm API being experimental in DPDK, so we'd either need to avoid that warning or else remove the experimental tag for the API in 19.11.1 and hold off merging this patch until then. Thanks for the review, will prepare a new version of this patch and sent it out later after some more testing. See comments inline below… --- Documentation/topics/dpdk/qos.rst | 36 lib/netdev-dpdk.c | 321 + vswitchd/vswitch.xml | 30 +++ 3 files changed, 386 insertions(+), 1 deletion(-) diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst index c0aec5d..b06b1c2 100644 --- a/Documentation/topics/dpdk/qos.rst +++ b/Documentation/topics/dpdk/qos.rst @@ -49,6 +49,42 @@ To clear the QoS configuration from the port and ovsdb, run:: $ ovs-vsctl destroy QoS vhost-user0 -- clear Port vhost-user0 qos Below looks good, robust explanation, possibly worth separating the single policer and Two rte policer using the 2nd heading style as we now have 2 types of QoS. What do you think? Ack, will add headers in next version +In addition to the egress-policer OVS-DPDK also has support for a RFC +4115's Two-Rate, Three-Color marker meter. 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=4160 other-config:cbs=2048 \ + other-config:eir=0 other-config:ebs=0 -- \ + --id=@dpdk1Q20 create queue \ + other-config:cir=0 other-config:cbs=0 \ +
Re: [ovs-dev] [dpdk-latest PATCH v3 2/2] netdev-dpdk: Add new DPDK RFC 4115 egress policer
On 10/1/2019 3:10 PM, Eelco Chaudron wrote: 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=4160 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=4160 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 Thank for the patch Eelco, Overall loks good and follows the established QoS methodology. I'm still testing this code in more detail but wanted to clarify a few points below in the meantime. Comments inline. We discussed this at the OVS conference but this causes compilation to failure in OVS DPDK due to some of the trtcm API being experimental in DPDK, so we'd either need to avoid that warning or else remove the experimental tag for the API in 19.11.1 and hold off merging this patch until then. --- Documentation/topics/dpdk/qos.rst | 36 lib/netdev-dpdk.c | 321 + vswitchd/vswitch.xml | 30 +++ 3 files changed, 386 insertions(+), 1 deletion(-) diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst index c0aec5d..b06b1c2 100644 --- a/Documentation/topics/dpdk/qos.rst +++ b/Documentation/topics/dpdk/qos.rst @@ -49,6 +49,42 @@ To clear the QoS configuration from the port and ovsdb, run:: $ ovs-vsctl destroy QoS vhost-user0 -- clear Port vhost-user0 qos Below looks good, robust explanation, possibly worth separating the single policer and Two rte policer using the 2nd heading style as we now have 2 types of QoS. What do you think? +In addition to the egress-policer OVS-DPDK also has support for a RFC +4115's Two-Rate, Three-Color marker meter. 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=4160 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=4160 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
[ovs-dev] [dpdk-latest PATCH v3 2/2] 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=4160 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=4160 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 --- Documentation/topics/dpdk/qos.rst | 36 lib/netdev-dpdk.c | 321 + vswitchd/vswitch.xml | 30 +++ 3 files changed, 386 insertions(+), 1 deletion(-) diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst index c0aec5d..b06b1c2 100644 --- a/Documentation/topics/dpdk/qos.rst +++ b/Documentation/topics/dpdk/qos.rst @@ -49,6 +49,42 @@ To clear the QoS configuration from the port and ovsdb, run:: $ ovs-vsctl destroy QoS vhost-user0 -- clear Port vhost-user0 qos +In addition to the egress-policer OVS-DPDK also has support for a RFC +4115's Two-Rate, Three-Color marker meter. 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=4160 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=4160 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. + Refer to ``vswitch.xml`` for more details on egress policer. Rate Limiting (Ingress Policing) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 072ce96..87f098f 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -309,13 +309,14 @@ struct dpdk_qos_ops { /* dpdk_qos_ops for each type of user space QoS implementation */ static const struct dpdk_qos_ops egress_policer_ops; - +static const struct dpdk_qos_ops trtcm_policer_ops; /* * Array of dpdk_qos_ops, contains pointer to all supported QoS * operations. */ static const struct dpdk_qos_ops *const qos_confs[] = { _policer_ops, +_policer_ops, NULL }; @@ -4334,6