Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1793908rdb; Wed, 31 Jan 2024 09:11:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2rCj9xRgw0NxcPYFWkffJS8PxzfcdVHe04JBdW7epi4tEmxdpk6rOTihGVL6VHwwrbNnh X-Received: by 2002:a05:6a20:1716:b0:19c:9ebc:93b1 with SMTP id bn22-20020a056a20171600b0019c9ebc93b1mr2057056pzb.59.1706721074871; Wed, 31 Jan 2024 09:11:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706721074; cv=pass; d=google.com; s=arc-20160816; b=pdws4dD3Qep0o92dBof4BADWEWeJggwqL/Vo3xMpWMD89scdlhP/+aE0TQE+ZN96ue Kvz5ANMt6zwaAnXUOAqPii1SvHa7yKiFtb2Jv3JMFXIkKjTOgzk5pFOQQxkBiw1xn30d kucySY0p2sSms9h0HLZBkXWi421TUVhUStQ8qXKY8J2pKGVz5gNe2FZgeV0uc/DfBQZX 7wmTTD72fQkHiWkararE13B0xnHOgnVi+O1Iq3y1tbSQ1aV0zopnSDYLjkJ2jnWYtFCQ Fta3hKv/4BgVTSgo2t93PiOddyFhjxj9JafuaYaC0LGzuhdPxQ1l6XEf2svVrEO0E9ac 20bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=f5TyMU74VJHcMlxN6wPFUQAAvDmFWv443Th+PifQ9nM=; fh=k+OH81GErTP4L+27m/nYla17PvyGfe7H9pVnzmt/7Ok=; b=wMu3TtNmGvFOX1ydeXxLp2u9rK9XXX7AwGc92/TW1pqjokvx/vpTBQTfB6ijdG0Hqy l3fJ5aTEkD4o/GzPWej29WGnM7GMXShSNdY23gGNZAro+9PAOSezPJZm11A50XuFOCxq KQA0P8GLG68qv2vmXdPhtYgIGD0s2+tVLN9zCI2kU0mPfHE4lno+PcjRgO4M9Qu27PZi egu8PZ59jR3qyQqLuJE+ZhhCNTZ4gH69NjYx5eB3hCBopnrJRRHgBLFBX6eW2dJ+Ub2K ZwusUubWmlZ2qtRbqrK6HUpZwNDdACLZmPPpKivweK/hQ5VhpARQ4yzi5izc+knaGGcp 92iQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-46869-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46869-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCWBiNh73tO/LIW1uEvu1AQAqZ9Nia6OmYtez/m36d1w/fB/8wEfWrUCQ3N60iifW3azzBHtgawOBV/Iar8e1H+Z1IXjZ8nH7lXZke00vQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r18-20020aa78b92000000b006ddc1bf70ecsi9659728pfd.34.2024.01.31.09.11.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 09:11:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46869-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-46869-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46869-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 50E5728A0E4 for ; Wed, 31 Jan 2024 17:08:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C087D13AA2B; Wed, 31 Jan 2024 17:06:14 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69F33137C5B; Wed, 31 Jan 2024 17:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720774; cv=none; b=uoX33JkQQyLKUQTcfBuKYfAT/wC3gr1Npf+gly5z+9CHkxQ7/txQDPPKcBjYFnYCtj2dvw6UtoSyuKp7X47fVsIJme6Ec9C8HgO2eYg0cLyiwVu302fN4McgV0XahjMSUgawLlEzU3ZxsJTJkoDmcIYWYKdDrSOyT+g1tgEWDc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720774; c=relaxed/simple; bh=Xmw9KV3Egdvfg0TUeQfDphSDxUXsZykmY75UH/aGsXc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Zg7AKqvopXKiqghYFlym6RmRWJDczcXfvCZHTUb6lelnxKIGamCl9kGhWxml7+UKIriyi0X/9vhBcSxUHRCKfknNfyP9a+2vFWrPm3IA4hm5U4rpvSzXUOgUViumKoY5tFzwFZNtJApmYYZ7uUOIflRBEYMNRU7WssDzHyAr2j8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.05,231,1701097200"; d="scan'208";a="196315544" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Feb 2024 02:06:11 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.92.158]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id D134440344FE; Thu, 1 Feb 2024 02:06:07 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Paul Barker , Yoshihiro Shimoda , Wolfram Sang , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 6/8] net: ravb: Align GbEth poll function with NAPI docs Date: Wed, 31 Jan 2024 17:05:20 +0000 Message-Id: <20240131170523.30048-7-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131170523.30048-1-paul.barker.ct@bp.renesas.com> References: <20240131170523.30048-1-paul.barker.ct@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Call napi_complete_done() in accordance with the documentation in `Documentation/networking/napi.rst`. Signed-off-by: Paul Barker --- drivers/net/ethernet/renesas/ravb_main.c | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index a90e70b25875..c3a5e4bb61f9 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1363,23 +1363,19 @@ static int ravb_poll_gbeth(struct napi_struct *napi, int budget) if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors) ndev->stats.rx_fifo_errors = priv->rx_fifo_errors; - if (work_done == budget) - goto out; - - napi_complete(napi); - - /* Re-enable RX/TX interrupts */ - spin_lock_irqsave(&priv->lock, flags); - if (!info->irq_en_dis) { - ravb_modify(ndev, RIC0, mask, mask); - ravb_modify(ndev, TIC, mask, mask); - } else { - ravb_write(ndev, mask, RIE0); - ravb_write(ndev, mask, TIE); + if (work_done < budget && napi_complete_done(napi, work_done)) { + /* Re-enable RX/TX interrupts */ + spin_lock_irqsave(&priv->lock, flags); + if (!info->irq_en_dis) { + ravb_modify(ndev, RIC0, mask, mask); + ravb_modify(ndev, TIC, mask, mask); + } else { + ravb_write(ndev, mask, RIE0); + ravb_write(ndev, mask, TIE); + } + spin_unlock_irqrestore(&priv->lock, flags); } - spin_unlock_irqrestore(&priv->lock, flags); -out: return work_done; } -- 2.39.2