Hi Han.
On 8/9/22 03:40, Han Zhou wrote:
Today the minimum value for this setting is 1. This patch allows it to
be 0, meaning not checking pps at all, and always do revalidation.
This is particularly useful for environments where some of the
applications with long-lived connections may have very low traffic for
certain period but have high rate of burst periodically. It is desirable
to keep the datapath flows instead of periodically deleting them to
avoid burst of packet miss to userspace.
When setting to 0, there may be more datapath flows to be revalidated,
resulting in higher CPU cost of revalidator threads. This is the
downside but in certain cases this is still more desirable than packet
misses to user space.
I am trying to quantify this CPU cost. Do you have any numbers so we understand
the effects of disabling pps-based evictions?
Signed-off-by: Han Zhou <[email protected]>
---
ofproto/ofproto-dpif-upcall.c | 4 ++++
ofproto/ofproto.c | 2 +-
vswitchd/vswitch.xml | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 57f94df54..23b52ef40 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -2079,6 +2079,10 @@ should_revalidate(const struct udpif *udpif, uint64_t
packets,
{
long long int metric, now, duration;
+ if (!ofproto_min_revalidate_pps) {
+ return true;
+ }
+
if (!used) {
/* Always revalidate the first time a flow is dumped. */
return true;
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 3a527683c..259fad4b5 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -723,7 +723,7 @@ ofproto_set_max_revalidator(unsigned max_revalidator)
void
ofproto_set_min_revalidate_pps(unsigned min_revalidate_pps)
{
- ofproto_min_revalidate_pps = min_revalidate_pps ? min_revalidate_pps : 1;
+ ofproto_min_revalidate_pps = min_revalidate_pps;
}
/* If forward_bpdu is true, the NORMAL action will forward frames with
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 4a9284f6b..2222c1296 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -212,7 +212,7 @@
</column>
<column name="other_config" key="min-revalidate-pps"
- type='{"type": "integer", "minInteger": 1}'>
+ type='{"type": "integer", "minInteger": 0}'>
<p>
Set minimum pps that flow must have in order to be revalidated when
revalidation duration exceeds half of max-revalidator config
variable.
--
Adrián Moreno
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev