Commit 3707428d authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: move filter sync_needed bit set

Move the setting of the filter-sync-needed bit to the error
case in the filter add routine to be sure we're checking the
live filter status rather than a copy of the pre-sync status.

Fixes: 969f8439 ("ionic: sync the filters in the work task")
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 17c37d74
...@@ -1292,8 +1292,10 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) ...@@ -1292,8 +1292,10 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr)
if (err && err != -EEXIST) { if (err && err != -EEXIST) {
/* set the state back to NEW so we can try again later */ /* set the state back to NEW so we can try again later */
f = ionic_rx_filter_by_addr(lif, addr); f = ionic_rx_filter_by_addr(lif, addr);
if (f && f->state == IONIC_FILTER_STATE_SYNCED) if (f && f->state == IONIC_FILTER_STATE_SYNCED) {
f->state = IONIC_FILTER_STATE_NEW; f->state = IONIC_FILTER_STATE_NEW;
set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
}
spin_unlock_bh(&lif->rx_filters.lock); spin_unlock_bh(&lif->rx_filters.lock);
......
...@@ -349,9 +349,6 @@ void ionic_rx_filter_sync(struct ionic_lif *lif) ...@@ -349,9 +349,6 @@ void ionic_rx_filter_sync(struct ionic_lif *lif)
list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) { list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) {
(void)ionic_lif_addr_add(lif, sync_item->f.cmd.mac.addr); (void)ionic_lif_addr_add(lif, sync_item->f.cmd.mac.addr);
if (sync_item->f.state != IONIC_FILTER_STATE_SYNCED)
set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
list_del(&sync_item->list); list_del(&sync_item->list);
devm_kfree(dev, sync_item); devm_kfree(dev, sync_item);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment