Commit ed02112c authored by Edward Cree's avatar Edward Cree Committed by David S. Miller

sfc: make filter table probe caller responsible for adding VLANs

By making the caller of efx_mcdi_filter_table_probe() loop over the
 vlan_list calling efx_mcdi_filter_add_vlan(), instead of doing it in
 efx_mcdi_filter_table_probe(), the latter avoids looking in ef10-
 specific nic_data.
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbf2c669
...@@ -2447,6 +2447,7 @@ static int efx_ef10_filter_table_probe(struct efx_nic *efx) ...@@ -2447,6 +2447,7 @@ static int efx_ef10_filter_table_probe(struct efx_nic *efx)
{ {
struct efx_ef10_nic_data *nic_data = efx->nic_data; struct efx_ef10_nic_data *nic_data = efx->nic_data;
int rc = efx_ef10_probe_multicast_chaining(efx); int rc = efx_ef10_probe_multicast_chaining(efx);
struct efx_mcdi_filter_vlan *vlan;
if (rc) if (rc)
return rc; return rc;
...@@ -2455,7 +2456,16 @@ static int efx_ef10_filter_table_probe(struct efx_nic *efx) ...@@ -2455,7 +2456,16 @@ static int efx_ef10_filter_table_probe(struct efx_nic *efx)
if (rc) if (rc)
return rc; return rc;
list_for_each_entry(vlan, &nic_data->vlan_list, list) {
rc = efx_mcdi_filter_add_vlan(efx, vlan->vid);
if (rc)
goto fail_add_vlan;
}
return 0; return 0;
fail_add_vlan:
efx_mcdi_filter_table_remove(efx);
return rc;
} }
/* This creates an entry in the RX descriptor queue */ /* This creates an entry in the RX descriptor queue */
......
...@@ -1285,10 +1285,8 @@ efx_mcdi_filter_table_probe_matches(struct efx_nic *efx, ...@@ -1285,10 +1285,8 @@ efx_mcdi_filter_table_probe_matches(struct efx_nic *efx,
int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining)
{ {
struct efx_ef10_nic_data *nic_data = efx->nic_data;
struct net_device *net_dev = efx->net_dev; struct net_device *net_dev = efx->net_dev;
struct efx_mcdi_filter_table *table; struct efx_mcdi_filter_table *table;
struct efx_mcdi_filter_vlan *vlan;
int rc; int rc;
if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) if (!efx_rwsem_assert_write_locked(&efx->filter_sem))
...@@ -1337,17 +1335,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) ...@@ -1337,17 +1335,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining)
efx->filter_state = table; efx->filter_state = table;
list_for_each_entry(vlan, &nic_data->vlan_list, list) {
rc = efx_mcdi_filter_add_vlan(efx, vlan->vid);
if (rc)
goto fail_add_vlan;
}
return 0; return 0;
fail_add_vlan:
efx_mcdi_filter_cleanup_vlans(efx);
efx->filter_state = NULL;
fail: fail:
kfree(table); kfree(table);
return rc; return rc;
......
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