Message ID | 20230918074202.2461-426-nic_swsd@realtek.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2495585vqi; Mon, 18 Sep 2023 01:01:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ5/GxQ/vPLv2xvY1XcZ2nlnjWU12ScHzEVy74Ik+CSPbDa/ly2Ygpa2CoD4BM8TDYu2em X-Received: by 2002:a05:6a20:4414:b0:140:8537:85c1 with SMTP id ce20-20020a056a20441400b00140853785c1mr2508787pzb.28.1695024110506; Mon, 18 Sep 2023 01:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695024110; cv=none; d=google.com; s=arc-20160816; b=dYRaXX1svRWur86WGTNdn5WTsUAajYDeu8cVMpuEiiNnnKVPyeszHSeZbBZe8PP00i wVh5Z8PBdENxrMmvNw7O5AGv9ZWZ4wzzwjlQKo9r7ndc2semXOdX7O9n//d2PpTxCGD3 a2z7N2BI7iTgnLEwJbQsvx6HYjdPGfAMGjTnb4/TmAaMIxbYKhyN6rF7Za4SjePOSI37 /A5NdAHwjgI+y+6xD9CyufeloJRXi9LxPtgwBttwM6DWidLoboBD0sG77Eie4oOdEnTO HKfhr2j5XuhXSEcX/ucX+wzj1W89IsAXQslUb0CswLY/h8Z5+sQx7Zr/9J1sRkoiu0sK 6djw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tCf45YmxUWxOe+p5gFscDZHIAvUGhOo205Ol7ijxi4o=; fh=ihIYiilCZXBu9x8WrnA4PYm4Oe+ipaGNn90/3600c/4=; b=T90JgXJrA4oQzqkdnVbNrKg6pSz4CTOCkY4NHYeTfHurcnsveFOZAFR8M3JdjZCZ5j SihRThk5iEzoEITb84MGhvKywcxF0iYpocFnepP/OjU2kB7pvZEh9NkEGDQ6CKZ9f5pB 1aFWYWVfYHNvPuTpM/GWHYa6suh6q7w8A0uzp7E2c9lYgV97i9uJr/NqLF+P+S1Ip4jt NjvVqcUx8n2lATB8MmfnzdOH8UdjLbuFCLBse66vw+jr9NLIKDqO4sIrh5UOycqijqUd 4pYbsgxftIFfseZzqPlujbhfvGJk9473ecfkaYRKYYFdIFy4CF6RLrddjoX3Lf4pea2O bxUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id l62-20020a638841000000b00565ff92bb14si7709010pgd.99.2023.09.18.01.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 01:01:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7E4798090EAE; Mon, 18 Sep 2023 00:47:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239935AbjIRHqc (ORCPT <rfc822;kernel.ruili@gmail.com> + 27 others); Mon, 18 Sep 2023 03:46:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240553AbjIRHp7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 03:45:59 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7AC10DE; Mon, 18 Sep 2023 00:43:12 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 38I7gUqV51835290, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.92/5.92) with ESMTPS id 38I7gUqV51835290 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Sep 2023 15:42:30 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Mon, 18 Sep 2023 15:42:30 +0800 Received: from fc38.localdomain (172.22.228.98) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 18 Sep 2023 15:42:29 +0800 From: Hayes Wang <hayeswang@realtek.com> To: <kuba@kernel.org>, <davem@davemloft.net> CC: <netdev@vger.kernel.org>, <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>, <edumazet@google.com>, <bjorn@mork.no>, <pabeni@redhat.com>, Hayes Wang <hayeswang@realtek.com> Subject: [PATCH net-next resend 0/2] r8152: modify rx_bottom Date: Mon, 18 Sep 2023 15:41:59 +0800 Message-ID: <20230918074202.2461-426-nic_swsd@realtek.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.22.228.98] X-ClientProxiedBy: RTEXH36505.realtek.com.tw (172.21.6.25) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 00:47:06 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777361601632772687 X-GMAIL-MSGID: 1777361601632772687 |
Series |
r8152: modify rx_bottom
|
|
Message
Hayes Wang
Sept. 18, 2023, 7:41 a.m. UTC
These patches are used to improve rx_bottom(). Hayes Wang (2): r8152: remove queuing rx packets in driver r8152: use napi_gro_frags drivers/net/usb/r8152.c | 80 +++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 48 deletions(-)
Comments
Eric Dumazet <edumazet@google.com> > Sent: Monday, September 18, 2023 3:55 PM [...] > > urb->actual_length = 0; > > list_add_tail(&agg->list, next); > > } > > + > > + /* Break if budget is exhausted. */ > > [1] More conventional way to to put this condition at the beginning of > the while () loop, > because the budget could be zero. If the budget is zero, the function wouldn't be called. a7b8d60b3723 ("r8152: check budget for r8152_poll") avoids it. > > + if (work_done >= budget) > > + break; > > } > > > > + /* Splice the remained list back to rx_done */ > > if (!list_empty(&rx_queue)) { > > spin_lock_irqsave(&tp->rx_lock, flags); > > - list_splice_tail(&rx_queue, &tp->rx_done); > > + list_splice(&rx_queue, &tp->rx_done); > > spin_unlock_irqrestore(&tp->rx_lock, flags); > > } > > > > out1: > > - return work_done; > > + if (work_done > budget) > > This (work_done >budget) condition would never be true if point [1] is > addressed. A bulk transfer may contain many packets, so the work_done may be more than budget. That is why I queue the packets in the driver before this patch. For example, if a bulk transfer contains 70 packet and budget is 64, napi_gro_receive would be called for the first 64 packets and 6 packets would be queued in driver for next schedule. After this patch, napi_gro_receive() would be called for the 70 packets, even the budget is 64. And the remained bulk transfers would be handled for next schedule. > > + return budget; > > + else > > + return work_done; > > } Best Regards, Hayes