ofproto->connmgr = connmgr_create(ofproto, datapath_name, datapath_name);
ofproto->state = S_OPENFLOW;
list_init(&ofproto->pending);
+ ofproto->n_pending = 0;
hmap_init(&ofproto->deletions);
error = ofproto->ofproto_class->construct(ofproto, &n_tables);
struct classifier *table;
assert(list_is_empty(&ofproto->pending));
+ assert(!ofproto->n_pending);
connmgr_destroy(ofproto->connmgr);
return error;
}
- if (list_size(&ofproto->pending) >= 50) {
+ if (ofproto->n_pending >= 50) {
+ assert(!list_is_empty(&ofproto->pending));
return OFPROTO_POSTPONE;
}
ofopgroup_destroy(group);
} else {
list_push_back(&group->ofproto->pending, &group->ofproto_node);
+ group->ofproto->n_pending++;
}
}
{
assert(list_is_empty(&group->ops));
if (!list_is_empty(&group->ofproto_node)) {
+ assert(group->ofproto->n_pending > 0);
+ group->ofproto->n_pending--;
list_remove(&group->ofproto_node);
}
if (!list_is_empty(&group->ofconn_node)) {