Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp21959imu; Thu, 8 Nov 2018 14:04:08 -0800 (PST) X-Google-Smtp-Source: AJdET5eVXENluc9pTiEr81+yR4YC5sIF74wV5Osk2XUfGCGUu3A6NDo3IYNJ3y6omm5ySvdlPtGj X-Received: by 2002:a63:9b11:: with SMTP id r17mr5286862pgd.416.1541714648032; Thu, 08 Nov 2018 14:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714648; cv=none; d=google.com; s=arc-20160816; b=B+SO/NeuZUJTejj95hNcAuukjfn9HopEfkthZozbqem5mAVZnL900tlcVq5O6c5JL2 wWORxysGrvNu1d8CTKR7fKXxlTD6iPsTFW9qPHjU9pI6V9jAQTe+se5wp9zdqj+z0af/ jvx/Jd4jfVbdQWZqc4T8ynO0YIC79YmZWOxSmAN+8sEhFiZu1DLMFJX2emt/kKDW4MaP WygmG1BjFyku6BaTqrBxh4UTn4s3jzOXXMwozNnrLPXnqVPYS6xU2BxdmsXvVZZIZw2F xyFWnAHgnobDr4JvN9QrKkESqGIdrlJOdaFyFh24/S9QCb+Sb3749e0uy8tK6vg2u59Z NiCQ== 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=BUXJG5pyyStmU/kW9Gfhmp7uCl5fsRx20Fqi/TnLu7A=; b=zGbsVFiB+rtVP6R4AdLw7ml9Df+0lJ5ZrgvyrBV862vf+TiwmWvaRw3yMlGWWlIL1H 0aKQlBUbsfjS8OOn3UxEPip8VvrXnNfMCAnQoJhA0vKz4jq2YtFOKuCru/B+zA6zfuYb Y1aR7u3CqxmupOIuzKIYtn1ANXt1l6sEZpvro2S5WZ4zVU61z4um+mLih6xgIjgtRuJN Wf4jokfguxGXoc3ryuuMHWah9DiqbbCaMpL5BO66MW4DfRvbQ3CveLRSRgzyfKzetp8h qJa2+pG2LvyHHWmzmliabQlw6ZJm2sjKblrqO3UOk3xBbaxCd5P3IPw7FYh8Lv22Yx4/ xbKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iUUG7mJb; 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 p2-v6si6207041pli.79.2018.11.08.14.03.51; Thu, 08 Nov 2018 14:04:08 -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=iUUG7mJb; 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 S1730685AbeKIHiW (ORCPT + 99 others); Fri, 9 Nov 2018 02:38:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:57404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729667AbeKIHiQ (ORCPT ); Fri, 9 Nov 2018 02:38:16 -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 21C1520818; Thu, 8 Nov 2018 22:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714447; bh=/1tBfkjaEsYelUs1ankTAMi/j9a7qBbNkpUdGIZK7QE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUUG7mJbrGtZbAevsYgfWADjGP9VOkY3+Bdt7wa000AgAV7ym/G3BKvdodbNsdjkk oJQ5E7dWR+F1ZoG/JXYn7vigMuWjJZybc+OvDoe8BXfrXgEp6ha5SNs5nhRoXXPB9Q qeZyDA6zsuo5dMJapziIj2KD0sW8BqpZSBITsRFs= 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.4 096/114] r8169: fix NAPI handling under high load Date: Thu, 8 Nov 2018 13:51:51 -0800 Message-Id: <20181108215109.423482414@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@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.4-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 @@ -7540,17 +7540,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;