]> git.proxmox.com Git - ovs.git/commitdiff
ofproto-dpif: Revalidate when sFlow probability changes.
authorBen Pfaff <blp@nicira.com>
Fri, 30 Jan 2015 21:36:34 +0000 (13:36 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 3 Feb 2015 19:20:01 +0000 (11:20 -0800)
Until now, when the sFlow selection probability changed, OVS failed to
immediately revalidate the flow table, delaying the new probability taking
effect.  This commit fixes the problem.

Reported-by: K 華 <k940545@hotmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
AUTHORS
ofproto/ofproto-dpif.c

diff --git a/AUTHORS b/AUTHORS
index 978b2ac7fc65c396977c3d19d140ffb66affe539..1903423c11ef58634b682c08b3f99c650340497b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -261,6 +261,7 @@ Joan Cirer              joan@ev0.net
 John Darrington         john@darrington.wattle.id.au
 John Galgay             john@galgay.net
 John Hurley             john.hurley@netronome.com
+K 華                    k940545@hotmail.com
 Kevin Mancuso           kevin.mancuso@rackspace.com
 Kiran Shanbhog          kiran@vmware.com
 Kirill Kabardin
index 1b4ad12e2e31329bb977801d53bfd64d30e23924..b909fd9e021fc7b75ac07e6843bb68f2c6f79d7a 100644 (file)
@@ -1894,6 +1894,7 @@ set_sflow(struct ofproto *ofproto_,
     struct dpif_sflow *ds = ofproto->sflow;
 
     if (sflow_options) {
+        uint32_t old_probability = ds ? dpif_sflow_get_probability(ds) : 0;
         if (!ds) {
             struct ofport_dpif *ofport;
 
@@ -1901,9 +1902,11 @@ set_sflow(struct ofproto *ofproto_,
             HMAP_FOR_EACH (ofport, up.hmap_node, &ofproto->up.ports) {
                 dpif_sflow_add_port(ds, &ofport->up, ofport->odp_port);
             }
-            ofproto->backer->need_revalidate = REV_RECONFIGURE;
         }
         dpif_sflow_set_options(ds, sflow_options);
+        if (dpif_sflow_get_probability(ds) != old_probability) {
+            ofproto->backer->need_revalidate = REV_RECONFIGURE;
+        }
     } else {
         if (ds) {
             dpif_sflow_unref(ds);