}
/* Extracts the flow stats for a packet. The 'flow' and 'packet'
- * arguments must have been initialized through a call to flow_extract(). */
+ * arguments must have been initialized through a call to flow_extract().
+ * 'used' is stored into stats->used. */
void
dpif_flow_stats_extract(const struct flow *flow, const struct ofpbuf *packet,
- struct dpif_flow_stats *stats)
+ long long int used, struct dpif_flow_stats *stats)
{
stats->tcp_flags = packet_get_tcp_flags(packet, flow);
stats->n_bytes = packet->size;
stats->n_packets = 1;
- stats->used = time_msec();
+ stats->used = used;
}
/* Appends a human-readable representation of 'stats' to 's'. */
struct flow_miss_op *ops, size_t *n_ops)
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(rule->up.ofproto);
+ long long int now = time_msec();
struct action_xlate_ctx ctx;
struct ofpbuf *packet;
ofpbuf_use_stub(&odp_actions, op->stub, sizeof op->stub);
- dpif_flow_stats_extract(&miss->flow, packet, &stats);
+ dpif_flow_stats_extract(&miss->flow, packet, now, &stats);
rule_credit_stats(rule, &stats);
action_xlate_ctx_init(&ctx, ofproto, &miss->flow, miss->initial_tci,
subfacet_make_actions(subfacet, packet, &odp_actions);
}
- dpif_flow_stats_extract(&facet->flow, packet, &stats);
+ dpif_flow_stats_extract(&facet->flow, packet, time_msec(), &stats);
subfacet_update_stats(subfacet, &stats);
if (subfacet->actions_len) {
uint64_t odp_actions_stub[1024 / 8];
struct ofpbuf odp_actions;
- dpif_flow_stats_extract(flow, packet, &stats);
+ dpif_flow_stats_extract(flow, packet, time_msec(), &stats);
rule_credit_stats(rule, &stats);
ofpbuf_use_stub(&odp_actions, odp_actions_stub, sizeof odp_actions_stub);
ofpbuf_use_stack(&key, &keybuf, sizeof keybuf);
odp_flow_key_from_flow(&key, flow);
- dpif_flow_stats_extract(flow, packet, &stats);
+ dpif_flow_stats_extract(flow, packet, time_msec(), &stats);
action_xlate_ctx_init(&ctx, ofproto, flow, flow->vlan_tci, NULL,
packet_get_tcp_flags(packet, flow), packet);