- Logging to console and file will have UTC timestamp as a default for all
the daemons. An example of the default format is 2012-01-27T16:35:17Z.
ovs-appctl can be used to change the default format as before.
+ - ofproto-provider interface:
+ - "struct rule" has a new member "used" that ofproto implementations
+ should maintain by updating with ofproto_rule_update_used().
v1.5.0 - xx xxx xxxx
struct rule_dpif {
struct rule up;
- long long int used; /* Time last used; time created if not used. */
-
/* These statistics:
*
* - Do include packets and bytes from facets that have been deleted or
&& now > rule->up.modified + rule->up.hard_timeout * 1000) {
reason = OFPRR_HARD_TIMEOUT;
} else if (rule->up.idle_timeout && list_is_empty(&rule->facets)
- && now > rule->used + rule->up.idle_timeout * 1000) {
+ && now > rule->up.used + rule->up.idle_timeout * 1000) {
reason = OFPRR_IDLE_TIMEOUT;
} else {
return;
struct ofproto_dpif *ofproto = ofproto_dpif_cast(facet->rule->up.ofproto);
if (used > facet->used) {
facet->used = used;
- if (used > facet->rule->used) {
- facet->rule->used = used;
- }
+ ofproto_rule_update_used(&facet->rule->up, used);
netflow_flow_update_time(ofproto->netflow, &facet->nf_flow, used);
}
}
if (rule) {
rule->packet_count += push->packets;
rule->byte_count += push->bytes;
- rule->used = MAX(push->used, rule->used);
+ ofproto_rule_update_used(&rule->up, push->used);
}
}
return error;
}
- rule->used = rule->up.created;
rule->packet_count = 0;
rule->byte_count = 0;
size = packet->size;
if (execute_odp_actions(ofproto, flow, odp_actions->data,
odp_actions->size, packet)) {
- rule->used = time_msec();
+ ofproto_rule_update_used(&rule->up, time_msec());
rule->packet_count++;
rule->byte_count += size;
- flow_push_stats(rule, flow, 1, size, rule->used);
+ flow_push_stats(rule, flow, 1, size, rule->up.used);
}
ofpbuf_delete(odp_actions);
long long int created; /* Creation time. */
long long int modified; /* Time of last modification. */
- uint16_t idle_timeout; /* In seconds from time of last use. */
- uint16_t hard_timeout; /* In seconds from last modification. */
+ long long int used; /* Last use; time created if never used. */
+ uint16_t hard_timeout; /* In seconds from ->modified. */
+ uint16_t idle_timeout; /* In seconds from ->used. */
uint8_t table_id; /* Index in ofproto's 'tables' array. */
bool send_flow_removed; /* Send a flow removed message? */
return cls_rule ? CONTAINER_OF(cls_rule, struct rule, cr) : NULL;
}
+void ofproto_rule_update_used(struct rule *, long long int used);
void ofproto_rule_expire(struct rule *, uint8_t reason);
void ofproto_rule_destroy(struct rule *);
rule->cr = fm->cr;
rule->pending = NULL;
rule->flow_cookie = fm->cookie;
- rule->created = rule->modified = time_msec();
+ rule->created = rule->modified = rule->used = time_msec();
rule->idle_timeout = fm->idle_timeout;
rule->hard_timeout = fm->hard_timeout;
rule->table_id = table - ofproto->tables;
connmgr_send_flow_removed(rule->ofproto->connmgr, &fr);
}
+void
+ofproto_rule_update_used(struct rule *rule, long long int used)
+{
+ if (used > rule->used) {
+ rule->used = used;
+ }
+}
+
/* Sends an OpenFlow "flow removed" message with the given 'reason' (either
* OFPRR_HARD_TIMEOUT or OFPRR_IDLE_TIMEOUT), and then removes 'rule' from its
* ofproto.