summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5798ed6)
Multiple code paths can evict flows, but before this commit only one of
those code paths used OFPRR_EVICTION as the reason code.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
static enum ofperr add_flow(struct ofproto *, struct ofconn *,
const struct ofputil_flow_mod *,
const struct ofp_header *);
static enum ofperr add_flow(struct ofproto *, struct ofconn *,
const struct ofputil_flow_mod *,
const struct ofp_header *);
-static void delete_flow__(struct rule *, struct ofopgroup *);
+static void delete_flow__(struct rule *, struct ofopgroup *,
+ enum ofp_flow_removed_reason);
static bool handle_openflow(struct ofconn *, const struct ofpbuf *);
static enum ofperr handle_flow_mod__(struct ofproto *, struct ofconn *,
const struct ofputil_flow_mod *,
static bool handle_openflow(struct ofconn *, const struct ofpbuf *);
static enum ofperr handle_flow_mod__(struct ofproto *, struct ofconn *,
const struct ofputil_flow_mod *,
op->group->n_running--;
ofoperation_destroy(rule->pending);
} else if (evict) {
op->group->n_running--;
ofoperation_destroy(rule->pending);
} else if (evict) {
- delete_flow__(evict, group);
+ delete_flow__(evict, group, OFPRR_EVICTION);
}
ofopgroup_submit(group);
}
}
ofopgroup_submit(group);
}
/* OFPFC_DELETE implementation. */
static void
/* OFPFC_DELETE implementation. */
static void
-delete_flow__(struct rule *rule, struct ofopgroup *group)
+delete_flow__(struct rule *rule, struct ofopgroup *group,
+ enum ofp_flow_removed_reason reason)
{
struct ofproto *ofproto = rule->ofproto;
{
struct ofproto *ofproto = rule->ofproto;
- ofproto_rule_send_removed(rule, OFPRR_DELETE);
+ ofproto_rule_send_removed(rule, reason);
- ofoperation_create(group, rule, OFOPERATION_DELETE, OFPRR_DELETE);
+ ofoperation_create(group, rule, OFOPERATION_DELETE, reason);
oftable_remove_rule(rule);
ofproto->ofproto_class->rule_destruct(rule);
}
oftable_remove_rule(rule);
ofproto->ofproto_class->rule_destruct(rule);
}
* Returns 0 on success, otherwise an OpenFlow error code. */
static enum ofperr
delete_flows__(struct ofproto *ofproto, struct ofconn *ofconn,
* Returns 0 on success, otherwise an OpenFlow error code. */
static enum ofperr
delete_flows__(struct ofproto *ofproto, struct ofconn *ofconn,
- const struct ofp_header *request, struct list *rules)
+ const struct ofp_header *request, struct list *rules,
+ enum ofp_flow_removed_reason reason)
{
struct rule *rule, *next;
struct ofopgroup *group;
group = ofopgroup_create(ofproto, ofconn, request, UINT32_MAX);
LIST_FOR_EACH_SAFE (rule, next, ofproto_node, rules) {
{
struct rule *rule, *next;
struct ofopgroup *group;
group = ofopgroup_create(ofproto, ofconn, request, UINT32_MAX);
LIST_FOR_EACH_SAFE (rule, next, ofproto_node, rules) {
- delete_flow__(rule, group);
+ delete_flow__(rule, group, reason);
}
ofopgroup_submit(group);
}
ofopgroup_submit(group);
fm->out_port, &rules);
return (error ? error
: !list_is_empty(&rules) ? delete_flows__(ofproto, ofconn, request,
fm->out_port, &rules);
return (error ? error
: !list_is_empty(&rules) ? delete_flows__(ofproto, ofconn, request,
fm->out_port, &rules);
return (error ? error
: list_is_singleton(&rules) ? delete_flows__(ofproto, ofconn,
fm->out_port, &rules);
return (error ? error
: list_is_singleton(&rules) ? delete_flows__(ofproto, ofconn,
+ request, &rules,
+ OFPRR_DELETE)