From patchwork Thu Jan 22 15:56:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 431911 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 22AFE140182 for ; Fri, 23 Jan 2015 02:56:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753114AbbAVP4f (ORCPT ); Thu, 22 Jan 2015 10:56:35 -0500 Received: from mail-ie0-f177.google.com ([209.85.223.177]:46508 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971AbbAVP4U (ORCPT ); Thu, 22 Jan 2015 10:56:20 -0500 Received: by mail-ie0-f177.google.com with SMTP id vy18so2076638iec.8 for ; Thu, 22 Jan 2015 07:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=YEUjfsuBsRj7dJuC39EQzf620TaIms1GV3HrIUfeLco=; b=evzgF5r0BA5ET4Vf0SVGw10X/a7H8DqyzFph9znxg2YpNF5+rZsyLxwHjCHEjzapT7 wGxabhYZcK8ElxjFp9hXdiDhM0lEeqUqOGPRJXaap3atIypBp7DpGwTa9D+82b3qU9eM lycbww6LN5JbCoN4OdmCklcfsCkw9Fm2nbmSahtHohBLXFGbBHNLqWzzfLAAgC3yoh2i Gg9jTozFZTMpimupIN6rHuUt/6qHJKiVoK3cl0NpUv5wvJ3bBI1EEBDjdfXFTz+Bq5a2 67O0bsHeYKA1yDyuWRTNpX8be45pToTCdRHu7eCXwKBfTPp8rtghatlQ06k+S78jTMN5 HPkw== X-Received: by 10.42.239.1 with SMTP id ku1mr3842334icb.45.1421942180049; Thu, 22 Jan 2015 07:56:20 -0800 (PST) Received: from [172.19.244.169] ([172.19.244.169]) by mx.google.com with ESMTPSA id l6sm2995140igv.8.2015.01.22.07.56.18 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 07:56:19 -0800 (PST) Message-ID: <1421942178.3471.10.camel@edumazet-glaptop2.roam.corp.google.com> Subject: [PATCH net] netxen: fix netxen_nic_poll() logic From: Eric Dumazet To: Mike Galbraith , David Miller Cc: netdev , Manish Chopra Date: Thu, 22 Jan 2015 07:56:18 -0800 In-Reply-To: <1421915821.5286.71.camel@marge.simpson.net> References: <1421901805.5286.37.camel@marge.simpson.net> <1421906274.4832.35.camel@edumazet-glaptop2.roam.corp.google.com> <1421907358.5286.42.camel@marge.simpson.net> <1421909520.3471.2.camel@edumazet-glaptop2.roam.corp.google.com> <1421915821.5286.71.camel@marge.simpson.net> X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet NAPI poll logic now enforces that a poller returns exactly the budget when it wants to be called again. If a driver limits TX completion, it has to return budget as well when the limit is hit, not the number of received packets. Reported-and-tested-by: Mike Galbraith Signed-off-by: Eric Dumazet Fixes: d75b1ade567f ("net: less interrupt masking in NAPI") Cc: Manish Chopra Acked-by: Manish Chopra --- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index 613037584d08..c531c8ae1be4 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c @@ -2388,7 +2388,10 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget) work_done = netxen_process_rcv_ring(sds_ring, budget); - if ((work_done < budget) && tx_complete) { + if (!tx_complete) + work_done = budget; + + if (work_done < budget) { napi_complete(&sds_ring->napi); if (test_bit(__NX_DEV_UP, &adapter->state)) netxen_nic_enable_int(sds_ring);