Skip to content

Commit

Permalink
ofproto-dpif-upcall: Do not call dpif_handlers_set() when there is no
Browse files Browse the repository at this point in the history
handler/revalidator configuration change.

dpif_handlers_set(), which dumps all vport from datapath, should not be
called constantly.

Found by inspection.

Signed-off-by: Alex Wang <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
yew011 committed May 9, 2014
1 parent bfe4277 commit 380fffe
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ofproto/ofproto-dpif-upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ void
udpif_set_threads(struct udpif *udpif, size_t n_handlers,
size_t n_revalidators)
{
int error;

ovs_assert(udpif);
ovs_assert(n_handlers && n_revalidators);

Expand All @@ -390,14 +388,16 @@ udpif_set_threads(struct udpif *udpif, size_t n_handlers,
udpif_stop_threads(udpif);
}

error = dpif_handlers_set(udpif->dpif, n_handlers);
if (error) {
VLOG_ERR("failed to configure handlers in dpif %s: %s",
dpif_name(udpif->dpif), ovs_strerror(error));
return;
}

if (!udpif->handlers && !udpif->revalidators) {
int error;

error = dpif_handlers_set(udpif->dpif, n_handlers);
if (error) {
VLOG_ERR("failed to configure handlers in dpif %s: %s",
dpif_name(udpif->dpif), ovs_strerror(error));
return;
}

udpif_start_threads(udpif, n_handlers, n_revalidators);
}
ovsrcu_quiesce_end();
Expand Down

0 comments on commit 380fffe

Please sign in to comment.