X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=c7872baf7a3baac5b57542c66e19db8d515cb5df;hb=a4b2e516ffd0aa466f2d0182c89a91ce5d23d9a4;hp=590b792a1bce25a3a9614275ead739d8f744fd4f;hpb=0b13821fe00d918e24c71419355a10b65081a71a;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 590b792a..c7872baf 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1396,9 +1396,15 @@ ofproto_get_ofproto_controller_info(const struct ofproto * ofproto, cinfo->pairs.values[cinfo->pairs.n++] = xstrdup(rconn_get_state(rconn)); - cinfo->pairs.keys[cinfo->pairs.n] = "time_in_state"; - cinfo->pairs.values[cinfo->pairs.n++] = - xasprintf("%u", rconn_get_state_elapsed(rconn)); + if (rconn_is_admitted(rconn)) { + cinfo->pairs.keys[cinfo->pairs.n] = "time_connected"; + cinfo->pairs.values[cinfo->pairs.n++] = + xasprintf("%ld", time_now() - rconn_get_last_connection(rconn)); + } else { + cinfo->pairs.keys[cinfo->pairs.n] = "time_disconnected"; + cinfo->pairs.values[cinfo->pairs.n++] = + xasprintf("%d", rconn_failure_duration(rconn)); + } } } @@ -2161,12 +2167,10 @@ facet_execute(struct ofproto *ofproto, struct facet *facet, assert(ofpbuf_headroom(packet) >= sizeof(struct ofp_packet_in)); flow_extract_stats(&facet->flow, packet, &stats); + stats.used = time_msec(); if (execute_odp_actions(ofproto, &facet->flow, facet->actions, facet->actions_len, packet)) { - facet->used = time_msec(); facet_update_stats(ofproto, facet, &stats); - netflow_flow_update_time(ofproto->netflow, - &facet->nf_flow, facet->used); } }