Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2458643imd; Fri, 2 Nov 2018 11:45:34 -0700 (PDT) X-Google-Smtp-Source: AJdET5feucSwd568jHvQ3MFtofPuJ7J4NvuNTQy1nlYH1kwUX2IXccDSc342xB2ocnim2izIUmw7 X-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr12759499plg.310.1541184334732; Fri, 02 Nov 2018 11:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184334; cv=none; d=google.com; s=arc-20160816; b=sZTcCZU/h7XddEMY0IoRZWFpUhpRyB9RnUfJgvRFl1+r6X2DjA598VWXvnyxSdB1cp 9J6f+po3KXWcdUiHk2dqzokAHQXpYu6TOOd7x5BQ4jZxaETcRXHUNE3YNBz+AXMD8zhC dbjYvwcDAh/a3bActMYicdrcFUrhp2i4w/zD/UWmnjf0z5Az2QOub5P+NVvXQGsAcUpr udllNtS7r0/fR2sBeEv1IrNGkfUSAVA/K8SMlUI7VK6Ob8l/s0g5c9sDzxSgYSOOxggx sqiDVWEmEG0onF60i/i8r9egKgLCll4CHN9ke3kygI1M9gKIce79c+OpgO/H7ujQ8IAn aCpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RWXPJM0ozg7F0rfM2+wJuoIm58RRXFOy64fiLDgKc/E=; b=R32F3JIVkp+XhKW316ZkbAzHDxzFY8M3edh7Q6rlGZInZ5SPhsjiY+OTwQLNxUqNjW b9vI1miT+CvOLugJDKXLsgcOKKIaog6Zs6eBvy/a9NwTjGaeHlCW+g62FNscUdtZYaZ1 gkZRuAFKvAzQQdALk6WNBUwlVesYEge4DG51IrjNjovitAHgnpRvHuqMfAKi4VsWn22m GpGoeoKrih2Xw9eI1Rfkz+Muy8wQg2m4PsK41IDvpHn35Tqsk60yULJpL6P7C6SpgfhS xEFK296S8gPloKAtYm12Ob93KPtOV41c7nxzTFbaYUzLWvFjqZDJiAbGdl9Yi79BXZpe Kpag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w85TkHvx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si35108310pgj.417.2018.11.02.11.45.20; Fri, 02 Nov 2018 11:45:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w85TkHvx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729750AbeKCDwZ (ORCPT + 99 others); Fri, 2 Nov 2018 23:52:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:47736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbeKCDwZ (ORCPT ); Fri, 2 Nov 2018 23:52:25 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD40120847; Fri, 2 Nov 2018 18:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184252; bh=OILLLUehxy56+HzHGnMuEfNKM9SLg+zJJvlhY7BjHLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w85TkHvxejcJYLhvI7N7B5tqfeavRVrVpXfRgStRIgKlNDGGtHEFYXJXeFGZx6mwM NjLLFFg1Q/qfpOssGi+JvlWVC/r16b4XzjQjHnjiepMh5QUnErd+jsBWOw3QhbruuW 0PBS+t7/iC/ap3vVcpU9uozP1N7RLRCb60oaPL5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , "David S. Miller" Subject: [PATCH 4.18 115/150] r8169: fix NAPI handling under high load Date: Fri, 2 Nov 2018 19:34:37 +0100 Message-Id: <20181102182911.135331069@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiner Kallweit [ Upstream commit 6b839b6cf9eada30b086effb51e5d6076bafc761 ] rtl_rx() and rtl_tx() are called only if the respective bits are set in the interrupt status register. Under high load NAPI may not be able to process all data (work_done == budget) and it will schedule subsequent calls to the poll callback. rtl_ack_events() however resets the bits in the interrupt status register, therefore subsequent calls to rtl8169_poll() won't call rtl_rx() and rtl_tx() - chip interrupts are still disabled. Fix this by calling rtl_rx() and rtl_tx() independent of the bits set in the interrupt status register. Both functions will detect if there's nothing to do for them. Fixes: da78dbff2e05 ("r8169: remove work from irq handler.") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -7044,17 +7044,15 @@ static int rtl8169_poll(struct napi_stru struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi); struct net_device *dev = tp->dev; u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow; - int work_done= 0; + int work_done; u16 status; status = rtl_get_events(tp); rtl_ack_events(tp, status & ~tp->event_slow); - if (status & RTL_EVENT_NAPI_RX) - work_done = rtl_rx(dev, tp, (u32) budget); + work_done = rtl_rx(dev, tp, (u32) budget); - if (status & RTL_EVENT_NAPI_TX) - rtl_tx(dev, tp); + rtl_tx(dev, tp); if (status & tp->event_slow) { enable_mask &= ~tp->event_slow;