aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2018-03-27 12:44:21 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-27 13:33:20 -0400
commit31b842955211f427a099f78a6a63d18a6bbc8d55 (patch)
tree5b6b7def288526fdd9d407a14012190bba438f73
parentfc7a6c287ff395eb64745292b4d398e64152cfb6 (diff)
sfc: return a better error if filter insertion collides with MC reboot
If some other operation gets the MCDI lock ahead of us and performs an MC reboot, then our attempt to insert the filter will fail with EINVAL, because the destination VI (spec->dmaq_id, MC_CMD_FILTER_OP_IN_RX_QUEUE) does not exist. But the caller's request (which might e.g. be an ethtool ntuple request from userland) isn't invalid, it just got unlucky; so return EAGAIN. 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, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 9db1b9144e70..9a139c390037 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -4301,6 +4301,7 @@ static s32 efx_ef10_filter_insert(struct efx_nic *efx,
4301 bool replace_equal) 4301 bool replace_equal)
4302{ 4302{
4303 DECLARE_BITMAP(mc_rem_map, EFX_EF10_FILTER_SEARCH_LIMIT); 4303 DECLARE_BITMAP(mc_rem_map, EFX_EF10_FILTER_SEARCH_LIMIT);
4304 struct efx_ef10_nic_data *nic_data = efx->nic_data;
4304 struct efx_ef10_filter_table *table; 4305 struct efx_ef10_filter_table *table;
4305 struct efx_filter_spec *saved_spec; 4306 struct efx_filter_spec *saved_spec;
4306 struct efx_rss_context *ctx = NULL; 4307 struct efx_rss_context *ctx = NULL;
@@ -4427,6 +4428,12 @@ static s32 efx_ef10_filter_insert(struct efx_nic *efx,
4427 rc = efx_ef10_filter_push(efx, spec, &table->entry[ins_index].handle, 4428 rc = efx_ef10_filter_push(efx, spec, &table->entry[ins_index].handle,
4428 ctx, replacing); 4429 ctx, replacing);
4429 4430
4431 if (rc == -EINVAL && nic_data->must_realloc_vis)
4432 /* The MC rebooted under us, causing it to reject our filter
4433 * insertion as pointing to an invalid VI (spec->dmaq_id).
4434 */
4435 rc = -EAGAIN;
4436
4430 /* Finalise the software table entry */ 4437 /* Finalise the software table entry */
4431 if (rc == 0) { 4438 if (rc == 0) {
4432 if (replacing) { 4439 if (replacing) {