if (!atomic_dec_and_test(&fltr->refcnt))
return;
spin_lock_bh(&bp->ntp_fltr_lock);
+ if (!test_and_clear_bit(BNXT_FLTR_INSERTED, &fltr->base.state)) {
+ spin_unlock_bh(&bp->ntp_fltr_lock);
+ return;
+ }
hlist_del_rcu(&fltr->base.hash);
if (fltr->base.flags) {
clear_bit(fltr->base.sw_id, bp->ntp_fltr_bmap);
}
head = &bp->l2_fltr_hash_tbl[idx];
hlist_add_head_rcu(&fltr->base.hash, head);
+ set_bit(BNXT_FLTR_INSERTED, &fltr->base.state);
atomic_set(&fltr->refcnt, 1);
return 0;
}
new_fltr->base.type = BNXT_FLTR_TYPE_NTUPLE;
new_fltr->base.flags = BNXT_ACT_RING_DST;
hlist_add_head_rcu(&new_fltr->base.hash, head);
+ set_bit(BNXT_FLTR_INSERTED, &new_fltr->base.state);
bp->ntp_fltr_count++;
spin_unlock_bh(&bp->ntp_fltr_lock);
if (del) {
spin_lock_bh(&bp->ntp_fltr_lock);
+ if (!test_and_clear_bit(BNXT_FLTR_INSERTED, &fltr->base.state)) {
+ spin_unlock_bh(&bp->ntp_fltr_lock);
+ continue;
+ }
hlist_del_rcu(&fltr->base.hash);
bp->ntp_fltr_count--;
spin_unlock_bh(&bp->ntp_fltr_lock);