Skip to content

Commit

Permalink
ofproto-dpif-mirror: Always revalidate on mirror update.
Browse files Browse the repository at this point in the history
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: ec7ceae ("ofproto-dpif: Modularize mirror code.")
Reported-at: https://issues.redhat.com/browse/FDP-788
Tested-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
  • Loading branch information
mkp-rh authored and kevintraynor committed Sep 20, 2024
1 parent 1e56776 commit ec103da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
10 changes: 10 additions & 0 deletions ofproto/ofproto-dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -3667,6 +3667,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;
Expand Down

0 comments on commit ec103da

Please sign in to comment.