From patchwork Wed Jan 31 17:05:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 194868 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp2032281dyb; Wed, 31 Jan 2024 09:10:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhxuZ43XtPfJAXjr932JLLXtjfeCGh8NhVnKxKEGmIxqaGCOsYIQmRV/LppFuvfDLodhkM X-Received: by 2002:a05:6a20:5182:b0:19c:9a9a:2a7e with SMTP id j2-20020a056a20518200b0019c9a9a2a7emr1716175pzf.61.1706721039343; Wed, 31 Jan 2024 09:10:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706721039; cv=pass; d=google.com; s=arc-20160816; b=fvAeNk/+jIci1FjF8mJ+MKij3wqqwfMCvbt0jyAPd0tCEvbNyvTiybOsSdCmdk05v+ cFApc96X7aRsuTKkFEpUjUv+Is+QA/ZMkPsBLNish8s3tw+5HksZpGYhlXydAw7zkyJo 5vrrsrANBU9mkKDYHVlyvyY7Je/8nRP0Gp118hHDU6cyXhJQQjUrqX+/pgytuuZa8WP7 xz7ZkYo+vIocD8vrBLFVUzYN5ulcWxQtqAhYc7b6Lq7YtKkIslWvrwpok6gl6YNa16jO m3Zdeq2TOfbQ+Ar6V7dRr6C1XegZP20ZsseRIH+KM0YCNIRcCSOkxs3MxX3KpT2pnsQ7 1IBw== 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=IHPM0PqTvzRWPqX9nw1RspBAUOZ1xC22nMm5upmOPMs=; fh=iqAajZ2+e8Qeao00JZcayMij89nrO0sjLG5z027KPQw=; b=idjpp5vPSO2tzQIzduaEg3wXCuEwyOWap9FZf3dGQuUM391j7MaP2ZJIFPu4X/XCgo oqDI/RtKl5wZj7mZPh3+edO+9mMXfTaBr5679ab0VJL5gX/wP/lKXQwNvaJbhrLk/YgB cDSHZTe9sPf8psiEfWOHbQyE/DHXotHEhSGmso2UClFZFAUGZzB4SPunDjfuC86FrB0O uMWI5NQnwBuCXfTo03lG5poln0f8AKun6Enw/lgh9CsIRC16w+Tl1zfiwSI6s05M4CYK uy6aA4XFAtqxt7S27tWlL6eFOR9YcM2OmbJAA2hc7Z+8ng7GdDio7XuAUPM39OdQ+w/H Lbmg==; 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-46866-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46866-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCWtBo1EgRW12vjPuUNf4Zv/+p3Wxd5Tc2Bp8jIZ5eXAhoBB4fBNJMCq6nUBWRyCmDXnoz+hU9nA3sc5w/89pJ0jlSxSLw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x20-20020a17090aa39400b00290a6a5dd08si1603659pjp.144.2024.01.31.09.10.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 09:10:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46866-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-46866-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46866-ouuuleilei=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 AD6CF28A9C1 for ; Wed, 31 Jan 2024 17:07:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB806131E49; Wed, 31 Jan 2024 17:06:06 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C8FD12C539; Wed, 31 Jan 2024 17:06:03 +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=1706720765; cv=none; b=iOtmyN/0tHfJRBFDCcQYC59Ei4E5pzwLujs381fTRpnubc3pyhuc/8kNsFivWbMNnpydy1ypMFNVwbaj6LmD9HGwNkE+e0QefBm1x9mjbl+VR6PTxW7YEL6Swm0IKZPF6ZbJZlK4KZWLtjCjxrTr3YCB2CO/xSpt/VosaZTCyys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706720765; c=relaxed/simple; bh=mvngnWhUGFgDKAimI+Ks/pS3pEFP764zRzb5IWxzsLU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XO+6qYdeew1F24THDOJuzp84Xr1HlaLzHQy5+WshAMjEolSPKBshv3LV6hcGYTS6v+3Ophnd+dhi9meUNvV1ZRsqDi3uFqZRW2lrBJuQ4h2qds7dHXym7dyRumRCcQqENNjXN5Mz37qKPJR+tB3UOw+ftLMuJtMcRThuEUBEM8A= 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="196315533" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 01 Feb 2024 02:06:03 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.92.158]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 760E440344FE; Thu, 1 Feb 2024 02:05:59 +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 4/8] net: ravb: Always process TX descriptor ring in GbEth poll Date: Wed, 31 Jan 2024 17:05:18 +0000 Message-Id: <20240131170523.30048-5-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789626720280218500 X-GMAIL-MSGID: 1789626720280218500 The TX queue should be serviced each time the poll function is called, even if the full RX work budget has been consumed. This prevents starvation of the TX queue when RX bandwidth usage is high. Signed-off-by: Paul Barker --- drivers/net/ethernet/renesas/ravb_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 077c189bcc6f..9b0ed269e69b 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1345,8 +1345,6 @@ static int ravb_poll_gbeth(struct napi_struct *napi, int budget) /* Clear RX interrupt */ ravb_write(ndev, ~(mask | RIS0_RESERVED), RIS0); work_done = ravb_rx_gbeth(ndev, budget, q); - if (work_done == budget) - goto out; /* Processing TX Descriptor Ring */ spin_lock_irqsave(&priv->lock, flags); @@ -1356,6 +1354,9 @@ static int ravb_poll_gbeth(struct napi_struct *napi, int budget) netif_wake_subqueue(ndev, q); spin_unlock_irqrestore(&priv->lock, flags); + if (work_done == budget) + goto out; + napi_complete(napi); /* Re-enable RX/TX interrupts */