X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif.c;h=186f165c1745558883b4e8fed88874433e4cec04;hb=fb0d597fb64308c60001e3afc9b31eb295dedb6b;hp=315f11f9dd72c078f078d79deedb1a41a165d759;hpb=5f55c39b21e69025045437ffbd3bb98fe6ce2e89;p=openvswitch diff --git a/lib/dpif.c b/lib/dpif.c index 315f11f9..186f165c 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -58,7 +58,7 @@ static struct shash dpif_classes = SHASH_INITIALIZER(&dpif_classes); static struct vlog_rate_limit dpmsg_rl = VLOG_RATE_LIMIT_INIT(600, 600); /* Not really much point in logging many dpif errors. */ -static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(9999, 5); +static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(60, 5); static void log_operation(const struct dpif *, const char *operation, int error); @@ -724,6 +724,11 @@ dpif_flow_get(const struct dpif *dpif, struct odp_flow *flow) if (!error) { error = flow->stats.error; } + if (error) { + /* Make the results predictable on error. */ + memset(&flow->stats, 0, sizeof flow->stats); + flow->n_actions = 0; + } if (should_log_flow_message(error)) { log_flow_operation(dpif, "flow_get", error, flow); }