From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBFDCC43381 for ; Thu, 14 Feb 2019 17:27:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B44B321928 for ; Thu, 14 Feb 2019 17:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394986AbfBNR14 (ORCPT ); Thu, 14 Feb 2019 12:27:56 -0500 Received: from dispatch1-us1.ppe-hosted.com ([67.231.154.164]:43186 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394715AbfBNR1y (ORCPT ); Thu, 14 Feb 2019 12:27:54 -0500 X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id CB87B140079; Thu, 14 Feb 2019 17:27:52 +0000 (UTC) Received: from hgk-desktop.uk.solarflarecom.com (10.17.20.82) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 14 Feb 2019 17:27:47 +0000 From: Bert Kenward Subject: [PATCH net-next] sfc: ensure recovery after allocation failures CC: , netdev , Robert Stonehouse To: Dave Miller Message-ID: <6beed7df-01e6-a15e-0e19-d40bf0ff945c@solarflare.com> Date: Thu, 14 Feb 2019 17:27:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.17.20.82] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24428.003 X-TM-AS-Result: No-10.436900-8.000000-10 X-TMASE-MatchedRID: ZrBrMCNPw7tCrZI5WAPNnXV895e/Bd2Jwx0jRRxcQfPyxh8Vn5bGHiEP i3T0m113fsb4gWsAzqCNeTCCHycaNRs45Zj9hz9mU+OjsPhIWDgYR+gKWoGXztEsTITobgNEcHj giTON9jIXw0prgDEKYLBtJ7qJRjsnX1t4vOb2p6Lil2r2x2PwtVPgO2JKQydY0c4jGwXkyPmcz3 fbiWyz1DEn8LudAL+Txzag9/K1ZFFdleeOihB1yJ4CIKY/Hg3AtOt1ofVlaoLWRN8STJpl3PoLR 4+zsDTtgUicvJ4MChlaX8b7Ao/icV2WtZRwdkPqB19BisHNMDTqadRkruOGg6SPBBRGVW4o X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--10.436900-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24428.003 X-MDID: 1550165273-Nv3Mbelsq4pm Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Robert Stonehouse 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 Signed-off-by: Bert Kenward --- drivers/net/ethernet/sfc/efx.c | 2 +- drivers/net/ethernet/sfc/rx.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 3643015a55cf..bc655ffc9e02 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -915,7 +915,7 @@ efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) 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) diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 396ff01298cd..8702ab44d80b 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c @@ -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); -- 2.20.1