From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51048140E3D; Thu, 11 Apr 2024 10:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712830921; cv=none; b=RSJ+vFATniJDSc5CXYJMHwCGJ2vBpLj8H3wQuHQcwuiR1y4PrfYGGGtNULkUTsOSfnbcj3FD26hWkJCpoD4DKmOXIiv8EKZSG4DFxCOsFFLmWVL3rxK8qXxyJRvuF2s4ykC0gKhUONWACtUIti4z2k3azC7LhvL07WKSl3GNPe0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712830921; c=relaxed/simple; bh=VY4U1vEraptKK82Z4NF7UN+hZIm/vOn/5UZUk11pc3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HHDGq8PVh3AmSpotBYjfIqW0lNUOqgnDCehS/d88EvvUodsD/s9xAgRZ/qIne0AESHZQbSwZDxtLE2ohQfF1Ep2gnSS3DDKraqM8UAIoAlEYaPxjwUISVPYMcXT2YV71D64LKTPm4j44jZ73Wis51k+wq48CvQFEqlgLsAnrMuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MikucEAP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MikucEAP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92480C433C7; Thu, 11 Apr 2024 10:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712830921; bh=VY4U1vEraptKK82Z4NF7UN+hZIm/vOn/5UZUk11pc3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MikucEAPRkoxfAEHxLWH+vGSMGsOv6cSiJh6I/ywsi/TYa0yx/O+q+3bAToCiwbzp A4miR8ghu37irQnRxgdHB4hmQGTl3rNpuISa7pm8iz5JViARQPQUChb2ePyPts1EeN d4SNr+V5UV8p8Xx4Skjjg6eIgtF2olDkbBQUGPFk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paul Barker , Sergey Shtylyov , Paolo Abeni , Sasha Levin Subject: [PATCH 5.4 164/215] net: ravb: Always process TX descriptor ring Date: Thu, 11 Apr 2024 11:56:13 +0200 Message-ID: <20240411095429.805417168@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411095424.875421572@linuxfoundation.org> References: <20240411095424.875421572@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Barker [ Upstream commit 596a4254915f94c927217fe09c33a6828f33fb25 ] 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. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Signed-off-by: Paul Barker Reviewed-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20240402145305.82148-1-paul.barker.ct@bp.renesas.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/renesas/ravb_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 53b9c77c7f6a7..3cc312a526d9b 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -911,12 +911,12 @@ static int ravb_poll(struct napi_struct *napi, int budget) int q = napi - priv->napi; int mask = BIT(q); int quota = budget; + bool unmask; /* Processing RX Descriptor Ring */ /* Clear RX interrupt */ ravb_write(ndev, ~(mask | RIS0_RESERVED), RIS0); - if (ravb_rx(ndev, "a, q)) - goto out; + unmask = !ravb_rx(ndev, "a, q); /* Processing RX Descriptor Ring */ spin_lock_irqsave(&priv->lock, flags); @@ -926,6 +926,9 @@ static int ravb_poll(struct napi_struct *napi, int budget) netif_wake_subqueue(ndev, q); spin_unlock_irqrestore(&priv->lock, flags); + if (!unmask) + goto out; + napi_complete(napi); /* Re-enable RX/TX interrupts */ -- 2.43.0