From: Ben Pfaff Date: Fri, 30 Jan 2015 21:36:34 +0000 (-0800) Subject: ofproto-dpif: Revalidate when sFlow probability changes. X-Git-Tag: v2.3.2~41 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=b24701f5f4889e650787bbcd3a063b0026caf210 ofproto-dpif: Revalidate when sFlow probability changes. 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 華 Signed-off-by: Ben Pfaff Acked-by: Jarno Rajahalme --- diff --git a/AUTHORS b/AUTHORS index 54da3471d..1d29a7e57 100644 --- a/AUTHORS +++ b/AUTHORS @@ -214,6 +214,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 diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index c18ed32e6..5dd767236 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1764,6 +1764,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; @@ -1771,9 +1772,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);