From patchwork Tue Feb 6 09:19:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Barker X-Patchwork-Id: 197276 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1417343dyb; Tue, 6 Feb 2024 01:20:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMS0gaWcMl3lrROMuD6I9ltYnDbs8V65kp53a/gXJuUIRdWXwJRvQuJrATDJsxRlPPrEUc X-Received: by 2002:a37:c24c:0:b0:785:8f96:7beb with SMTP id j12-20020a37c24c000000b007858f967bebmr1036492qkm.33.1707211226889; Tue, 06 Feb 2024 01:20:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707211226; cv=pass; d=google.com; s=arc-20160816; b=bEP2y6UIr7hnYV2RRvz522CJJqO2C00Ssz+ZKuiB/JQoS9cqsxOJ3ilcXzHKu6Vc22 MZp24FeUaHx4S/HgabLE9KloGQvp0dML2E4faEQ/eUEBKPgCrsoxHf2xCzvEW7Mh/k9h k4lfBqQxKrXNcw+V/4Dm0KRQHyTHj4bLPXTMyGpWEEI4WYkdZlVi2JcLkxbThIJnAkN5 aOGCDlhJ3uFJn2Vpy9C+F0yk97j3ZuO4GO9pM5jzOwsCZKafnq5Psgt5mNLCp0rtULrU y3fe0I+eWkGs9JJDWwhkQb5IaWVoxCFwOOlnrmOY4wZUrynv9xYyeBFlRsTrZv3eYVwO Jc+Q== 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=bnQIUEZaFRaaHLkozmOLTfBDaYHORu0QaABBrOvq5bU=; fh=HfZGM2GfBilWsBSahFfz73odcrYAjaGDE/ngPd1lUC0=; b=OIMso+BHov5Pkdt/JbgeMdN7Km9JvNMBNalymL7f6SH+c7VdGs5PptRCx5cxO1sEVb 5VqPKQrDqdL6Qjuk/R/UsJuECNTH3UDLH+G6otZXJt2KgnWtWmBzQUwwFJJUe8dJcsUs 7B8LYHtX6DX/S/n0DERlCrJOtPoIT3r/mfTML9BbfCctAZ/AW5AVGmL2tFpphLNSb4bd eU3ImH1xAYCOUb/iizUHmRn6CyajtP3VD17JyUMB2Z5nFa1vfFWAXLGhGMtiYaaM5gEq YixyqvCC0+k+b13zRV+rvC1lEP07aF+Wj9a5AygKbKNBfc77fEO+sE+BDW5vCfOIctrO dIIw==; 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-54571-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54571-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com X-Forwarded-Encrypted: i=1; AJvYcCX/anPk+6/+hTujxGCBaQOFeGGxBif+fr9TPwYnj5hnzFMsGswEY+B6QMoaJA2nBvf0ZPixfsUn1NT9D/YRlPoOB/gW8w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n5-20020a05620a222500b007858c916862si1248628qkh.612.2024.02.06.01.20.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 01:20:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54571-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-54571-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54571-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A05F21C22184 for ; Tue, 6 Feb 2024 09:20:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0163D12D151; Tue, 6 Feb 2024 09:19:36 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2573612D74A; Tue, 6 Feb 2024 09:19:32 +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=1707211174; cv=none; b=ca8Kv5RNPKPIJA3qTdXxbPok9wu4zfzAXhuMOnOw0cGnbnnsuGqmQ5ed64SmNA4OD+O4jaLpD4bmJijeBvzicXqRDuD3BVM3+2HrT2MPV41OgfzBtrUJ6rxayr6EmKJmKIuUDIGa9ArA/cnf/oO/SNP8Y/USddeWoe0lfrjnlQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707211174; c=relaxed/simple; bh=wMCMA52G6QYbcIfsCp50vOc4fUzt5+fBqBVJp0vQUgU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pyMfN1P0xk0HEeFOwGONIvRbUhpDco+esn955C5iOsVI3XdoiqlNBVRJ8ROOAaUty9SvMDyVca1ApJilmj0IQ2RdAYQbvkycJzkr90ItJm3tj2MNGlWzcGkDphyl3vPvxi/C2wgI8Ixp3VTQSGLZZ1Riya5JPTLfLHfsPtuA6Io= 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,246,1701097200"; d="scan'208";a="196934634" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 06 Feb 2024 18:19:30 +0900 Received: from GBR-5CG2373LKG.adwin.renesas.com (unknown [10.226.93.63]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0011241B9447; Tue, 6 Feb 2024 18:19:26 +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: [RFC PATCH net-next v2 3/7] net: ravb: Always process TX descriptor ring Date: Tue, 6 Feb 2024 09:19:05 +0000 Message-Id: <20240206091909.3191-4-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240206091909.3191-1-paul.barker.ct@bp.renesas.com> References: <20240206091909.3191-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: 1790140719620359182 X-GMAIL-MSGID: 1790140719620359182 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 20193944c143..10f11141569f 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1349,8 +1349,6 @@ static int ravb_poll(struct napi_struct *napi, int budget) /* Clear RX interrupt */ ravb_write(ndev, ~(mask | RIS0_RESERVED), RIS0); work_done = ravb_rx(ndev, budget, q); - if (work_done == budget) - goto out; /* Processing TX Descriptor Ring */ spin_lock_irqsave(&priv->lock, flags); @@ -1360,6 +1358,9 @@ static int ravb_poll(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 */