Article View: linux.kernel.netdev
Article #16690Re: [PATCH net] net: ethernet: sunplus: check budget before calling napi_complete_done()
From: Andrew Lunn
Date: Sun, 15 Nov 2026 15:50
Date: Sun, 15 Nov 2026 15:50
23 lines
9016 bytes
9016 bytes
On Sun, Nov 15, 2026 at 12:27:44AM +0200, Janis Edvarts Lacis wrote:
> Sunplus drivers currently do napi_complete() after each rx/tx poll is
> done without checking whether budget was exhausted or not. Interrupts
> are also unmasked before the call to napi_complete().
>
> Replace napi_complete() with napi_complete_done() and add a check for
> budget_left. Call napi_complete_done() only when the budget has been
> not exhausted fully, e.g. budget_left > 0 and unmask interrupts only when
> napi_complete_done() returns true.
>
> I do not have the hardware necessary, this patch is not tested on real
> hardware.
>
> Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021")
> Signed-off-by: Janis Edvarts Lacis <janislacis06@gmail.com>
Does this bother anybody? If not, net-next. No Fixes: tag.
Given that you have not tested this, how confident are you it is
correct?
Andrew
Technical Details
Message-ID:
<26c5c08f-d6f5-49b2-9fa8-de6f8c244a78@lunn.ch>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363748-linux-kernel-netdev=dewy.ruReferences:
<20261114222744.535158-1-janislacis06@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363748-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net: ethernet: sunplus: check budget before calling napi_complete_done() Date: Sun, 15 Nov 2026 16:50:03 +0100 Organization: Usenet Network Message-ID: <26c5c08f-d6f5-49b2-9fa8-de6f8c244a78@lunn.ch> References: <20261114222744.535158-1-janislacis06@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1843766"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Ied7OcZ/bGejuL3nFRHCEWv92G4= sha256:/sDcbjvIzCJ31tl6SHzJVSY61HnBHzx3P56LA6O7svo= sha1:VeTgYZeaCNbmVagTF2re5QLl47Y= sha256:4r05//J68thjmPS1lwvnxE+JlqDefhM37CeCOrVItts= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 3EC571149FD; Sun, 15 Nov 2026 18:50:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dr-fcwImVn86; Sun, 15 Nov 2026 18:50:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363748-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 918411149E1; Sun, 15 Nov 2026 18:50:14 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 16CCC37992; Sun, 15 Nov 2026 15:50:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794757811; b=xUHaojHU05kN+WBdWCWevbXAnV0Op0CGnMEuiZJ80Lr2aZ29/PwvNOQtQr8359nBpylC IX5jM0PCilyVCD9vXVKBdBBCiwkpig4ChXSMA97pYmyE6hSHdhSOTDZH6YRwYf96ewvtI Z2gQbbByS66h7j2S0Y3ptfZh0/APbHXSmg7OgE4cLrFU+Gdc783gg6eULjpq5mr5+6K0U msNIhXiMqVCtq/V3M4X7MIIaE7qxzQUymNqBYbkGQqRfYlrc+rM9f2W5FiwllNSt96b8y h/xjgcb+E3z9+gR21Cmd0DKUFHjZ4NcAJTGaiziW9NbCt4JWHP06lwgMN3wH8foWgkA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794757811; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=lFBXZH74vWcYYZEl9ttEX3rp67WAxy4DNbzoeffy2Q8=; b=DtBcN8djjxgVCXTlVKxtoLzYOini8QrU1wQpBhv4aNJcu/bxjaNVW2kbAB+e2F7F7rWP OhORINGNNnOfSm2IxL/vTKdpdTgm1Om8oM58p7a+KydI0ITsqEZL81n5uEmvUsLdeI+7r DCuOXDG+y8jWSQCb89+50c0QR3BKQ3kk5PdoB+AA6VHzRmdmPUPZvdeNsc+Pm9UYeNMDa 358gaYjBewb4sbFSr6w2aPX4O9n8tGuOTB2JtRmS+1Vxf8akSLoLTNC1mr+YXN4F+T236 FBTKt/4i6rpEJniAHzgfo2i/+G4BjPCgs5tjlCHOJjPA0v+qQaV7wPhgAYC7qgIs7Ng== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=nXqdp2Z2; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52F35606A32D; Sun, 15 Nov 2026 15:50:11 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=nXqdp2Z2 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794757810; b=v4rW9mLvHRD1FvHjEeI8QibWd5UHR1DQZXZfnh0A+h6iGBCrQubG+RJU03dGwkAy2Rkm WKmZfSFOonwh8Kkv6LQcDXMDDV4cmGWkOnDzYih6RsCELSGTAeiU2rJ5CFMXUfnUP1l+V dx1+nV97TLAJQDC0mOxnqdVH+FIhFdyUV7R7eFYxrLdmodXVDyPc77UL5kDmGM+xe/zUT XcqAM87CtFrMCjf0de1UtTwl+uzSg48kjHt7Uvh00mp69y8P0m+sRKzf8ZM2fyqLUGeX8 8CZ43nzTpiLdptV1PDOvYQ4RSw16bd6MawRzG/gR/t7eIePbM/cC1Q3YkNRiItOhQoA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794757810; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=lFBXZH74vWcYYZEl9ttEX3rp67WAxy4DNbzoeffy2Q8=; b=02/67cw+nG4h+ZHIL9s9nRY5Wht/4mTJSZHNZBnB7cJisUXYTiiTlP2yToT2BvWjOQUK O10ed70Wu7qVE3GTpU4yEkqQ4Zgx53nu7ON5Rvz+kXGpMlALI83pPheUxF/vOQ8PaI1Rg YWDzJoIVdyUzP2QpRywVMeVOhr/+IVHB6aeQpFkoi5LJ20STFVwCGBHAotgdf7kFu3JY8 AN0GKqGoggzi7EE27qhLj4/OqV1yXhlBKyRB3rfIibjj9zsDzgd2RE5WJ/nM6CCm4KAsz Rb4GlUZTbb5/QND/j2zNcbSQaeqSfhAUixEJQwiopKUk6Wq2Rm/sH7RLikA3HbyW5jA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=nXqdp2Z2; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DB73606A31A; Sun, 15 Nov 2026 15:50:09 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2DB73606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=lFBXZH74vWcYYZEl9ttEX3rp67WAxy4DNbzoeffy2Q8=; b=nXqdp2Z2IJDSVspORvKT7As2t0 4ldH7v37KEPQApEgZKKUJKvperbtnrvfdLu8TSxgK+2PejLXkimP7CkdNXmSYYsas/vNfnwkhTE++ YDC7rEUA3OprRU7s9v/sqRMgUGzk8wbMZ7hvwNaAsY+DQvHUxjY3hIH/GHv2YNXfemSo=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xScUV-00GdWb-BA; Sun, 15 Nov 2026 16:50:03 +0100 X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, wellslutw@gmail.com, linux-kernel@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261114222744.535158-1-janislacis06@gmail.com>