Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp88311rdb; Thu, 7 Sep 2023 14:40:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxDMh2KyDS16wn5ddVezN23rc6qwa5IkzA7bwT9S7R7HSLpL7LGN57lndjlMJ1BdeHY9rl X-Received: by 2002:a05:6870:b292:b0:1d5:426c:4c13 with SMTP id c18-20020a056870b29200b001d5426c4c13mr980578oao.14.1694122837771; Thu, 07 Sep 2023 14:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694122837; cv=none; d=google.com; s=arc-20160816; b=cVQBUOyX4bwXS6C0J2DBuePfPka6unnlxESbVQFyJKlK+kKo5O6cnGRK/TcV5ecic7 6WRj76NVoBMjSY5yk3pKt0BcHlgsqxxCb4tQFLHXZF6jRQM1ydymk1qCLZWvUWJH9CpR URm3XFN9aVdGRgLfAOVm3ZUxsIgMI1Ip8TNHD+AJGak0ZIxbJT/tSoz2mVnsZT1EG4dM C+ART0O0ykTytw+oNRk9teh/rOBKKsOm6Qxb5AvrgM9f5y+VIuvSpYt1shgASjB3OQTt NKypJPtV5qpshjr8pmwRCHx0Gd+wQ1UUpVvDBxiIQcrwyabURJ79PSyLp3BFv+F/L6Mi FdpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=MMt2H63vEpEVb9kqg4fqHYB19iHZgdX4eGzD546Kj5E=; fh=LPvoDgiOoOdn0Cv1cFYkLvNWwd4agmLPhFEVpIqTwm8=; b=YSN3Yc0XMKF2TXMX8QvAnA0x7aEOcUzUMEhoNGkTe3H+c90kfsYKIoZemZP2ZqektH rOHoWUKahZMrRs3CjYh5KuQMB6HzybWFoa4KmmGJzpJW8KbEPBOzumknyrspzpoYngKN pfGKUAqOrOs/E3789yBq89pvDXe02RvwnXsbgM5hoVSe5LrtA3vjxJvp4fJuz8k7EAjD IjgCGL6KVbOiJTQE1Q+b0v5151bgnhTTIKK+TK5o3ILvPVUIr6wbMJHhcRKTM5PMsrfx jTaLUfe7TqBdaRy9OXHJi0FENFHf0pA2TUjDfK9aEqV6jJjZ49xv9S28yrlliIhJLogY RZ5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020a656498000000b00565e2f4ad4esi177850pgv.213.2023.09.07.14.40.22; Thu, 07 Sep 2023 14:40:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241967AbjIGSda convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Sep 2023 14:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241110AbjIGSd2 (ORCPT ); Thu, 7 Sep 2023 14:33:28 -0400 X-Greylist: delayed 1536 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 07 Sep 2023 11:33:03 PDT Received: from rtits2.realtek.com.tw (211-75-126-66.hinet-ip.hinet.net [211.75.126.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56D5F1BE6; Thu, 7 Sep 2023 11:33:02 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3877GN1m8002884, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 3877GN1m8002884 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 7 Sep 2023 15:16:23 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 7 Sep 2023 15:16:51 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) 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; Thu, 7 Sep 2023 15:16:50 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::7445:d92b:d0b3:f79c]) by RTEXMBS04.realtek.com.tw ([fe80::7445:d92b:d0b3:f79c%5]) with mapi id 15.01.2375.007; Thu, 7 Sep 2023 15:16:50 +0800 From: Hayes Wang To: Jakub Kicinski CC: "davem@davemloft.net" , "netdev@vger.kernel.org" , nic_swsd , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: RE: [PATCH net v2] r8152: avoid the driver drops a lot of packets Thread-Topic: [PATCH net v2] r8152: avoid the driver drops a lot of packets Thread-Index: AQHZ4G/uLCHLeDMawES5jAj/REiJSrAN/YuAgADpM2A= Date: Thu, 7 Sep 2023 07:16:50 +0000 Message-ID: <7f8b32a91f5849c99609f78520b23535@realtek.com> References: <20230906031148.16774-421-nic_swsd@realtek.com> <20230906172847.2b3b749a@kernel.org> In-Reply-To: <20230906172847.2b3b749a@kernel.org> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.22.228.6] x-kse-serverinfo: RTEXMBS04.realtek.com.tw, 9 x-kse-antispam-interceptor-info: fallback x-kse-antivirus-interceptor-info: fallback Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jakub Kicinski > Sent: Thursday, September 7, 2023 8:29 AM [...] > Good to see that you can repro the problem. I don't reproduce the problem. I just find some information about it. > Before we tweak the heuristics let's make sure rx_bottom() behaves > correctly. Could you make sure that > - we don't perform _any_ rx processing when budget is 0 > (see the NAPI documentation under Documentation/networking) The work_done would be 0, and napi_complete_done() wouldn't be called. However, skb_queue_len(&tp->rx_queue) may be increased. I think it is not acceptable, right? > - finish the current aggregate even if budget run out, return > work_done = budget in that case. > With this change the rx_queue thing should be gone completely. Excuse me. I don't understand this part. I know that when the packets are more than budget, the maximum packets which could be handled is budget. That is, return work_done = budget. However, the extra packets would be queued to rx_queue. I don't understand what you mean about " the rx_queue thing should be gone completely". I think the current driver would return work_done = budget, and queue the other packets. I don't sure what you want me to change. > - instead of copying the head use napi_get_frags() + napi_gro_frags() > it gives you an skb, you just attach the page to it as a frag and > hand it back to GRO. This makes sure you never pull data into head > rather than just headers. I would study about them. Thanks. Should I include above changes for this patch? I think I have to submit another patches for above. > Please share the performance results with those changes. I couldn't reproduce the problem, so I couldn't provide the result with the differences. Best Regards, Hayes