Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2140834lqz; Tue, 2 Apr 2024 08:20:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUBn4V2rkXzzXxmpMxWPW36IC3fHoP4umA7FiBxQTshPco9vOB+YFawrw7HrkeI/Ey1hQKNIV1FffoHYGsc1hb87t+VqVPA4sl+2uaxQ== X-Google-Smtp-Source: AGHT+IEYpdHTwt/RFXJJPh3OO3g49kVx7UmAkW3tykveJGuBx7ghILreF/2fedZBDQK5Sp0ZF5kQ X-Received: by 2002:a05:6a20:549f:b0:1a6:f8cf:1e23 with SMTP id i31-20020a056a20549f00b001a6f8cf1e23mr11346765pzk.41.1712071210620; Tue, 02 Apr 2024 08:20:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712071210; cv=pass; d=google.com; s=arc-20160816; b=b4EBrv/nUU/D93PErRPdNgjq8uKZmHjKdXRbnBn4SkmJcoh2V/tU6k8lNW4u34yTQ+ WUmtT7Q5ZXWurJe9nJ12hyDceV7WJYzjHl1TRRI26dOjFrnkgVGzB6uYvXSDzIhz8UU+ OqPh3DwxXMeoFhFhNbp562VNRBZiq1LFi2WxSVT3H9OLqQ6L/NhUkyUvXuCOVm7+E/oR noraOZH91wmKydOm4u3w6FJRE/AejdCExsAEALHDL1aDO4fbY/NFaVW5nK6TPrv9eBjj +zSAkCbK9+vJPhG/cozczyJAPyroxWeMlvshfi+n+zBA7a3kerDZsn1zNuhIeirGzUw3 UUVQ== 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:message-id:date:subject:cc:to :from; bh=29jd9Wfg7VhNIjpYpdozL+UNvCQbLPWmDDbtATW+5M0=; fh=j0MLfB6f8wY/yMmUt3eov58LYhq54KIVPO8bUVQhh8w=; b=EpXVfPT6Epps3nwINXVa+zpW8r42+RDoYse6ke6i2Ic8wqp77ya/+LP5mj0o1xiDlk g8G2FLlphfXAmIpoJfYE0evNRkv1TyXyGAozNBpFTs4yt123m5+iGaR9cmLJiIUFipw8 CxLQArgCtI5cUcg+0bp0fZoRi6YURt+1cmrwOztaSqnVhrwGLwSCXK8TAOeX8za3MKwH 3J1XgtKr12y6wJlzc5vPL5BwLhLdCisL5w2hNy5lfmGYbPISeq0GT9Wy4USh+XO3A9MS AIOymyP5fOvP3gak+CNK6YC1AJha+J22BsE3xEnfCorbDRyrptjlC8QrRaD14AD7vQNn AbNA==; 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-128206-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i64-20020a636d43000000b005cf64c90ecbsi11362904pgc.215.2024.04.02.08.20.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 08:20:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128206-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-128206-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128206-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9C9D6B2FBF7 for ; Tue, 2 Apr 2024 14:53:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB90D12C539; Tue, 2 Apr 2024 14:53:39 +0000 (UTC) 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=20S=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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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(-) 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 */ base-commit: ea2a1cfc3b2019bdea6324acd3c03606b60d71ad -- 2.39.2