sfc: ensure recovery after allocation failures
authorRobert Stonehouse <rstonehouse@solarflare.com>
Thu, 14 Feb 2019 17:27:43 +0000 (17:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Feb 2019 17:47:16 +0000 (12:47 -0500)
After failing to allocate a receive buffer the driver may fail to ever
request additional allocations. EF10 NICs require new receive buffers to
be pushed in batches of eight or more. The test for whether a slow fill
should be scheduled failed to take account of this. There is little
downside to *always* requesting a slow fill if we failed to allocate a
buffer, so the condition has been removed completely. The timer that
triggers the request for a refill has also been shortened.

Signed-off-by: Robert Stonehouse <rstonehouse@solarflare.com>
Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/rx.c

index 3643015a55cf201888f4247e509c4cae96fa0991..bc655ffc9e025f88760a3af9cc125fe7e4d9a067 100644 (file)
@@ -915,7 +915,7 @@ rollback:
 
 void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue)
 {
-       mod_timer(&rx_queue->slow_fill, jiffies + msecs_to_jiffies(100));
+       mod_timer(&rx_queue->slow_fill, jiffies + msecs_to_jiffies(10));
 }
 
 static bool efx_default_channel_want_txqs(struct efx_channel *channel)
index 396ff01298cdfd4d8ccc5566e36dba778a7f4e59..8702ab44d80b6e5153c31d43181b8fe692333dae 100644 (file)
@@ -360,8 +360,7 @@ void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue, bool atomic)
                rc = efx_init_rx_buffers(rx_queue, atomic);
                if (unlikely(rc)) {
                        /* Ensure that we don't leave the rx queue empty */
-                       if (rx_queue->added_count == rx_queue->removed_count)
-                               efx_schedule_slow_fill(rx_queue);
+                       efx_schedule_slow_fill(rx_queue);
                        goto out;
                }
        } while ((space -= batch_size) >= batch_size);