Previously updating mirror settings would not trigger a revalidation,
this could result in impactful changes to mirrors taking a long time to
take effect.
This change sets need_revalidate whenever a setting is successfully set
on a mirror.
Fixes: ec7ceaed4f3e ("ofproto-dpif: Modularize mirror code.")
Reported-at: https://issues.redhat.com/browse/FDP-788
Tested-by: Kevin Traynor <[email protected]>
Acked-by: Kevin Traynor <[email protected]>
Signed-off-by: Mike Pattrick <[email protected]>
---
ofproto/ofproto-dpif-mirror.c | 2 +-
ofproto/ofproto-dpif.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ofproto/ofproto-dpif-mirror.c b/ofproto/ofproto-dpif-mirror.c
index 343b75f0e..45024580a 100644
--- a/ofproto/ofproto-dpif-mirror.c
+++ b/ofproto/ofproto-dpif-mirror.c
@@ -265,7 +265,7 @@ mirror_set(struct mbridge *mbridge, void *aux, const char
*name,
{
hmapx_destroy(&srcs_map);
hmapx_destroy(&dsts_map);
- return 0;
+ return ECANCELED;
}
/* XXX: Not sure if these need to be thread safe. */
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index fe034f971..7e300c3f9 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3669,6 +3669,16 @@ mirror_set__(struct ofproto *ofproto_, void *aux,
s->n_dsts, s->src_vlans,
bundle_lookup(ofproto, s->out_bundle),
s->snaplen, s->out_vlan);
+
+ if (!error) {
+ ofproto->backer->need_revalidate = REV_RECONFIGURE;
+ } else if (error == ECANCELED) {
+ /* The user requested a change that is identical to the current state,
+ * the reconfiguration is canceled, but don't log an error message
+ * about that. */
+ error = 0;
+ }
+
free(srcs);
free(dsts);
return error;
--
2.43.5
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev