summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
15aaf59)
Previously this parameter was useful for Clang locking annotations
but it isn't actually a locking requirement anymore, so remove
the parameter.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
cls_cursor_init(&cursor, &table->cls, NULL);
ovs_rwlock_unlock(&table->cls.rwlock);
CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) {
cls_cursor_init(&cursor, &table->cls, NULL);
ovs_rwlock_unlock(&table->cls.rwlock);
CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, up.cr, &cursor) {
- ofproto_rule_delete(&ofproto->up, &table->cls, &rule->up);
+ ofproto_rule_delete(&ofproto->up, &rule->up);
void ofproto_rule_expire(struct rule *rule, uint8_t reason)
OVS_REQUIRES(ofproto_mutex);
void ofproto_rule_expire(struct rule *rule, uint8_t reason)
OVS_REQUIRES(ofproto_mutex);
-void ofproto_rule_delete(struct ofproto *, struct classifier *cls,
- struct rule *)
+void ofproto_rule_delete(struct ofproto *, struct rule *)
OVS_EXCLUDED(ofproto_mutex);
void ofproto_rule_reduce_timeouts(struct rule *rule, uint16_t idle_timeout,
uint16_t hard_timeout)
OVS_EXCLUDED(ofproto_mutex);
void ofproto_rule_reduce_timeouts(struct rule *rule, uint16_t idle_timeout,
uint16_t hard_timeout)
size_t n_fields);
static void oftable_remove_rule(struct rule *rule) OVS_REQUIRES(ofproto_mutex);
size_t n_fields);
static void oftable_remove_rule(struct rule *rule) OVS_REQUIRES(ofproto_mutex);
-static void oftable_remove_rule__(struct ofproto *ofproto,
- struct classifier *cls, struct rule *rule)
+static void oftable_remove_rule__(struct ofproto *, struct rule *)
OVS_REQUIRES(ofproto_mutex);
static void oftable_insert_rule(struct rule *);
OVS_REQUIRES(ofproto_mutex);
static void oftable_insert_rule(struct rule *);
-ofproto_rule_delete__(struct ofproto *ofproto, struct classifier *cls,
- struct rule *rule)
+ofproto_rule_delete__(struct ofproto *ofproto, struct rule *rule)
OVS_REQUIRES(ofproto_mutex)
{
struct ofopgroup *group;
ovs_assert(!rule->pending);
OVS_REQUIRES(ofproto_mutex)
{
struct ofopgroup *group;
ovs_assert(!rule->pending);
- ovs_assert(cls == &ofproto->tables[rule->table_id].cls);
group = ofopgroup_create_unattached(ofproto);
delete_flow__(rule, group, OFPRR_DELETE);
group = ofopgroup_create_unattached(ofproto);
delete_flow__(rule, group, OFPRR_DELETE);
* ofproto implementation.
*
* This function implements steps 4.4 and 4.5 in the section titled "Rule Life
* ofproto implementation.
*
* This function implements steps 4.4 and 4.5 in the section titled "Rule Life
- * Cycle" in ofproto-provider.h.
-
- * The 'cls' argument is redundant (it is &ofproto->tables[rule->table_id].cls)
- * but it allows Clang to do better checking. */
+ * Cycle" in ofproto-provider.h. */
-ofproto_rule_delete(struct ofproto *ofproto, struct classifier *cls,
- struct rule *rule)
+ofproto_rule_delete(struct ofproto *ofproto, struct rule *rule)
OVS_EXCLUDED(ofproto_mutex)
{
struct ofopgroup *group;
ovs_mutex_lock(&ofproto_mutex);
ovs_assert(!rule->pending);
OVS_EXCLUDED(ofproto_mutex)
{
struct ofopgroup *group;
ovs_mutex_lock(&ofproto_mutex);
ovs_assert(!rule->pending);
- ovs_assert(cls == &ofproto->tables[rule->table_id].cls);
group = ofopgroup_create_unattached(ofproto);
ofoperation_create(group, rule, OFOPERATION_DELETE, OFPRR_DELETE);
group = ofopgroup_create_unattached(ofproto);
ofoperation_create(group, rule, OFOPERATION_DELETE, OFPRR_DELETE);
- oftable_remove_rule__(ofproto, cls, rule);
+ oftable_remove_rule__(ofproto, rule);
ofproto->ofproto_class->rule_delete(rule);
ofopgroup_submit(group);
ofproto->ofproto_class->rule_delete(rule);
ofopgroup_submit(group);
ovs_rwlock_unlock(&table->cls.rwlock);
CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, cr, &cursor) {
if (!rule->pending) {
ovs_rwlock_unlock(&table->cls.rwlock);
CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, cr, &cursor) {
if (!rule->pending) {
- ofproto_rule_delete__(ofproto, &table->cls, rule);
+ ofproto_rule_delete__(ofproto, rule);
OVS_REQUIRES(ofproto_mutex)
{
struct ofproto *ofproto = rule->ofproto;
OVS_REQUIRES(ofproto_mutex)
{
struct ofproto *ofproto = rule->ofproto;
- struct classifier *cls = &ofproto->tables[rule->table_id].cls;
ovs_assert(reason == OFPRR_HARD_TIMEOUT || reason == OFPRR_IDLE_TIMEOUT
|| reason == OFPRR_DELETE || reason == OFPRR_GROUP_DELETE);
ofproto_rule_send_removed(rule, reason);
ovs_assert(reason == OFPRR_HARD_TIMEOUT || reason == OFPRR_IDLE_TIMEOUT
|| reason == OFPRR_DELETE || reason == OFPRR_GROUP_DELETE);
ofproto_rule_send_removed(rule, reason);
- ofproto_rule_delete__(ofproto, cls, rule);
+ ofproto_rule_delete__(ofproto, rule);
}
/* Reduces '*timeout' to no more than 'max'. A value of zero in either case
}
/* Reduces '*timeout' to no more than 'max'. A value of zero in either case
/* Removes 'rule' from the oftable that contains it. */
static void
/* Removes 'rule' from the oftable that contains it. */
static void
-oftable_remove_rule__(struct ofproto *ofproto, struct classifier *cls,
- struct rule *rule)
+oftable_remove_rule__(struct ofproto *ofproto, struct rule *rule)
OVS_REQUIRES(ofproto_mutex)
{
OVS_REQUIRES(ofproto_mutex)
{
+ struct classifier *cls = &ofproto->tables[rule->table_id].cls;
+
ovs_rwlock_wrlock(&cls->rwlock);
classifier_remove(cls, CONST_CAST(struct cls_rule *, &rule->cr));
ovs_rwlock_unlock(&cls->rwlock);
ovs_rwlock_wrlock(&cls->rwlock);
classifier_remove(cls, CONST_CAST(struct cls_rule *, &rule->cr));
ovs_rwlock_unlock(&cls->rwlock);
oftable_remove_rule(struct rule *rule)
OVS_REQUIRES(ofproto_mutex)
{
oftable_remove_rule(struct rule *rule)
OVS_REQUIRES(ofproto_mutex)
{
- struct ofproto *ofproto = rule->ofproto;
- struct oftable *table = &ofproto->tables[rule->table_id];
-
- oftable_remove_rule__(ofproto, &table->cls, rule);
+ oftable_remove_rule__(rule->ofproto, rule);
}
/* Inserts 'rule' into its oftable, which must not already contain any rule for
}
/* Inserts 'rule' into its oftable, which must not already contain any rule for