[ovs-dev] [PATCH 3/3] dpif: Use DPIF_FP_MODIFY for feature probes.
Joe Stringer
joestringer at nicira.com
Wed Dec 3 22:24:48 UTC 2014
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 at nicira.com>
Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
lib/dpif.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/dpif.c b/lib/dpif.c
index a39050c..4db3e43 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -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));
--
1.7.10.4
More information about the dev
mailing list