aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2017-06-29 11:50:06 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-29 15:59:38 -0400
commitd58299a478c416c0b48e4b31c6332fe7beb63000 (patch)
tree7e1c5c96244bdb703fae5368db5f9c146e05e427
parente44699d2c28067f69698ccb68dd3ddeacfebc434 (diff)
sfc: fix attempt to translate invalid filter ID
When filter insertion fails with no rollback, we were trying to convert EFX_EF10_FILTER_ID_INVALID to an id to store in 'ids' (which is either vlan->uc or vlan->mc). This would WARN_ON_ONCE and then record a bogus filter ID of 0x1fff, neither of which is a good thing. Fixes: 0ccb998bf46d ("sfc: fix filter_id misinterpretation in edge case") Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/sfc/ef10.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index a8089667fc5b..78f9e43420e0 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -5105,6 +5105,7 @@ static int efx_ef10_filter_insert_addr_list(struct efx_nic *efx,
5105 5105
5106 /* Insert/renew filters */ 5106 /* Insert/renew filters */
5107 for (i = 0; i < addr_count; i++) { 5107 for (i = 0; i < addr_count; i++) {
5108 EFX_WARN_ON_PARANOID(ids[i] != EFX_EF10_FILTER_ID_INVALID);
5108 efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, 0); 5109 efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, 0);
5109 efx_filter_set_eth_local(&spec, vlan->vid, addr_list[i].addr); 5110 efx_filter_set_eth_local(&spec, vlan->vid, addr_list[i].addr);
5110 rc = efx_ef10_filter_insert(efx, &spec, true); 5111 rc = efx_ef10_filter_insert(efx, &spec, true);
@@ -5122,11 +5123,11 @@ static int efx_ef10_filter_insert_addr_list(struct efx_nic *efx,
5122 } 5123 }
5123 return rc; 5124 return rc;
5124 } else { 5125 } else {
5125 /* mark as not inserted, and carry on */ 5126 /* keep invalid ID, and carry on */
5126 rc = EFX_EF10_FILTER_ID_INVALID;
5127 } 5127 }
5128 } else {
5129 ids[i] = efx_ef10_filter_get_unsafe_id(rc);
5128 } 5130 }
5129 ids[i] = efx_ef10_filter_get_unsafe_id(rc);
5130 } 5131 }
5131 5132
5132 if (multicast && rollback) { 5133 if (multicast && rollback) {