Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp53179imu; Thu, 8 Nov 2018 14:38:55 -0800 (PST) X-Google-Smtp-Source: AJdET5fNA/op8wQvEKuQmGnegSyWXoXi6hAfoJtgxR2E2LqKY2yHPqqpJblhCl2QXjy2Qh7EJgL+ X-Received: by 2002:a62:3406:: with SMTP id b6-v6mr6466852pfa.50.1541716735016; Thu, 08 Nov 2018 14:38:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716734; cv=none; d=google.com; s=arc-20160816; b=FfmiCDH2soU52hEUSe5oZfoDCRezJMRdF+3yne3ciVJ5RDtAvld4MUBkBhiBUACpod bNxnEUa8BFX1YMdDSfEX4Ms2MulHBDmgh7kAQfkwuU1x4koSpvXucv8FKr1yMpLIM8mG byz6DMxliezffrDmAXwGLfu9Ohner7yIQYF7/JKGKpRtvGtT5cvxuN1LP7j1tiQn23ik Hwi39vq8/+LeruftStnuRAdHKMM6v+fndFEt+kzdvOTwbKZdZFKVB+w8TdLqxysAzXip hTfPLrw6RyUYs7yf6ESJqrWCap6Y/MqzVpkqU4HbGBFsoQ800L4HuiOmHyaAUTurrp1+ kRiQ== 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=xwiI5qXhSHcogajJMkI4UaEN6tlC18kHeoiNqs6evFM=; b=bBqyIaPnrNflk9OasUeoxVaqfv6fkvOZSn/vNivX4IgJSDDzIAiHpoPW2zo6+roqVY HBYT6FQPJ7PEtXw2g88FmVcBY+3gqlDfp5nljyImC4fmRTiDca1C1MRMTkAfn9uijnuf 1kas9BgvgcDXtWuLt19HGDlGCoMAVkosgd7H6OTFp5O3pM3l3XknMTRf6rm2EXNC4tJF z0DFnvQxXMvM0CiHIwtiTzCxM8JGlhhGUojHorfCdJH+OPMC11R6/hFkMTovDQBUEmc/ UnAZm4ZJoDEYtbmEJbAh0JxH22IsHV8dkuX2RWoR+ob9jUJNIpgkH0Shc0l0Twqfz+I8 sQjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Phi6LubU; 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 d10-v6si4703906pgh.385.2018.11.08.14.38.39; Thu, 08 Nov 2018 14:38:54 -0800 (PST) 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=Phi6LubU; 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 S1729519AbeKIHfA (ORCPT + 99 others); Fri, 9 Nov 2018 02:35:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:51734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbeKIHe7 (ORCPT ); Fri, 9 Nov 2018 02:34:59 -0500 Received: from localhost (unknown [208.72.13.198]) (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 A272020892; Thu, 8 Nov 2018 21:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714251; bh=g9CKklW3DOSlSRKpjkQ/uqB4JAmZNCcKj8F37Necm+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Phi6LubUyWWdNmfwn8R1gApA5agOcESe3nSCPqlTdWT1groGZ0NpBjQPalpAlm1Tc CtiHFvWtArKxtbsyoxKbYRzV+w1fWMtiGR21TnarsbpsYpfNvwHn7vXyc7++tvXieZ locH4+vyOmB0ZNUmlCylHtFeJDqKY6DU8IDg6D5A= 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 3.18 136/144] r8169: fix NAPI handling under high load Date: Thu, 8 Nov 2018 13:51:47 -0800 Message-Id: <20181108215108.017916293@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@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 3.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 @@ -7445,17 +7445,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;