summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorHan Zhou <hzhou@ovn.org>2023-01-16 19:01:29 -0800
committerIlya Maximets <i.maximets@ovn.org>2023-01-27 16:09:10 +0100
commite5b3cb9995445cd83ab1d2811bfd79ca03dd46d4 (patch)
tree1fe5906650bca821ee7dd35da826c154eeb31ede /ofproto
parentebaee446240133f5ec5064553535dfe392f60999 (diff)
downloadopenvswitch-e5b3cb9995445cd83ab1d2811bfd79ca03dd46d4.tar.gz
revalidator: Allow min-revalidator-pps to be 0.
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. Signed-off-by: Han Zhou <hzhou@ovn.org> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-upcall.c4
-rw-r--r--ofproto/ofproto.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index ad9635496..442141ccd 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -2099,6 +2099,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 17f636ed9..e4a1bee76 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -724,7 +724,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