From patchwork Tue Apr 2 14:53:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 13614267 X-Patchwork-Delegate: kuba@kernel.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7402F3398A; Tue, 2 Apr 2024 14:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712069619; cv=none; b=f2o0lCTOT97UXwEBOtryI5Vw1y/v1R0doqMQ5oR1m93DCD5JLWJmrLW8jIqS4HDbA2mikg/Swhgkv5IDG0t4aybu8GIMgBXaf8rASMp9Y8YoMjBT4kXsX4SHwgYeQ/lb+pdocHq0GdnOv3P+m5Yu11NSuNgitj5agHE3Dp8H7zE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712069619; c=relaxed/simple; bh=3YQe4QnlUHJrCHfA4ZLPv1MwEhOpdVQet3ppNtXhx/g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=g1tRUxlGO9tyK2us1VfeXk/+vNou7hbaowM65NyLyEzRsOOCoRrZ7tc4UyUcyDbJZatCkkx4YthAzlvTe5fC/7RaK3I6Mu8HbNgi9++bnCqPPkvS8Y54MyuvpDWbdgql5dGrud4WymYCDnnJZ0fAezrWrMEbgbaxZq4ZzULexoQ= 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.171 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.07,175,1708354800"; d="scan'208";a="200115238" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 02 Apr 2024 23:53:29 +0900 Received: from renesas-deb12.cephei.uk (unknown [10.226.93.98]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 4B20F4254199; Tue, 2 Apr 2024 23:53:24 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?utf-8?q?Niklas_S=C3=B6derlund?= Cc: Paul Barker , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] net: ravb: Always process TX descriptor ring Date: Tue, 2 Apr 2024 15:53:04 +0100 Message-Id: <20240402145305.82148-1-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 --- Changes from v1: * Use the correct 'Fixes' tag. * Call the new variable 'unmask' and drop the unnecessary initializer, as requested by Sergey. drivers/net/ethernet/renesas/ravb_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) base-commit: ea2a1cfc3b2019bdea6324acd3c03606b60d71ad diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index d1be030c8848..48803050abdb 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1324,12 +1324,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 TX Descriptor Ring */ spin_lock_irqsave(&priv->lock, flags); @@ -1339,6 +1339,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 */