]> git.proxmox.com Git - ovs.git/commitdiff
dpif: Use DPIF_FP_MODIFY for feature probes.
authorJoe Stringer <joestringer@nicira.com>
Wed, 29 Oct 2014 18:27:09 +0000 (11:27 -0700)
committerJoe Stringer <joestringer@nicira.com>
Thu, 11 Dec 2014 23:35:17 +0000 (12:35 +1300)
If ovs-vswitchd is killed at the right time, then a probe flow may be
left in the datapath. This commit adds the DPIF_FP_MODIFY flag to
feature probes so that re-creating the same probe flow will not cause an
error.

These flow_put flags were previously changed in commit a7d1bbdcfe49e8
("ofproto-dpif: Use DPIF_FP_CREATE but not DPIF_FP_MODIFY."), despite
the commit message addressing a different case.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/dpif.c

index a39050cbf40035a9b9e5511286e960237e21f240..4db3e433fb8225d0c2b43612d49360cf6ad661d5 100644 (file)
@@ -873,10 +873,13 @@ dpif_probe_feature(struct dpif *dpif, const char *name,
     bool enable_feature = false;
     int error;
 
-    error = dpif_flow_put(dpif, DPIF_FP_CREATE | DPIF_FP_PROBE,
+    /* Use DPIF_FP_MODIFY to cover the case where ovs-vswitchd is killed (and
+     * restarted) at just the right time such that feature probes from the
+     * previous run are still present in the datapath. */
+    error = dpif_flow_put(dpif, DPIF_FP_CREATE | DPIF_FP_MODIFY | DPIF_FP_PROBE,
                           ofpbuf_data(key), ofpbuf_size(key), NULL, 0, NULL, 0,
                           ufid, NULL);
-    if (error && error != EEXIST) {
+    if (error) {
         if (error != EINVAL) {
             VLOG_WARN("%s: %s flow probe failed (%s)",
                       dpif_name(dpif), name, ovs_strerror(error));