Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2217067rdb; Fri, 8 Dec 2023 01:28:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IE62zz34cepN3ah9Z89IY2ZPHd6lXi6IN3v3P7cs/i+Xq38GpwcUXIrCa8vpsDd9nazK7QG X-Received: by 2002:a05:6808:13c5:b0:3b8:382b:8e1f with SMTP id d5-20020a05680813c500b003b8382b8e1fmr4688596oiw.28.1702027705810; Fri, 08 Dec 2023 01:28:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702027705; cv=none; d=google.com; s=arc-20160816; b=boiTqoN8cU20beo0pqSWHdO/35IwrtCTiZHPjXnZeA2JC7XNqXXpotbFpyM82zTPwH FjSPwMf7YhsOgqqTdXn+i9e+p7jHHSPsOCn10HaZwiTPeImAenQJr2Vr/GR6IFKrUfCZ 3mfMfgA5Sdx+HN9qcbaWRBLKEBdOnuJNXJ3AKtoSnTKwiw4EV1N4ilsuricADFKiC1yq vL9vuWmCBNrS3hUgImjelJJFHxZ4L2Tv8i4OS1BzotRe95lRqg5C0SbFx03yvZL1WYJA YhKVXKkXAc/cx3W6+WVeYwezamGSSh9g/RyJG2NEQPjx9/qtRaarsTqCmytprjFQB8Hu dSbg== 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=5q+BlcK5Xsrzi73w7R13YJNUsZm4i6v0PILHSupzo9w=; fh=IYJcvjruGo/ROSo30p5Adi0uNhPR2XdImYJiyUWh+ug=; b=yKnOtJfYr1/1kUwGQxO+y2BH0QPRh5HUf5wm3ftRW4KcayZ7u8PMWBxGtDhjczhnj7 0emmVRkIQOMmZBu1qsZZNXx1+ji6ab7mBj8ptYZY5yw9a0AGLsDdtT5099dxYCMzAi5U F2aFXAu/kIxyzW1Dy8bawfUecUDW6+1kyI965sILGKWWnBXNtudgJSGVhVX2FnA5jzkT pop8GB3MiUeE9YyW71+L2HXW4+JX11QCQEc5ZBlMHYIf0Ws0dN1yHiv5SV3JjvAHuGUz Ef8dH1HMk7rLaPrP/EUutG3MuFP6KmmRzq9son0HZMvNytrhFpdy/uBHMUVV065QDN7Q UrQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id y190-20020a6364c7000000b005c60319034bsi1239307pgb.481.2023.12.08.01.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 01:28:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id CD243810FBC2; Fri, 8 Dec 2023 01:28:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235827AbjLHJ2J convert rfc822-to-8bit (ORCPT + 99 others); Fri, 8 Dec 2023 04:28:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231902AbjLHJ2I (ORCPT ); Fri, 8 Dec 2023 04:28:08 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5B1F1724; Fri, 8 Dec 2023 01:28:13 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3B89RiMA2781900, 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.95/5.92) with ESMTPS id 3B89RiMA2781900 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Dec 2023 17:27:44 +0800 Received: from RTEXMBS02.realtek.com.tw (172.21.6.95) 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; Fri, 8 Dec 2023 17:27:45 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS02.realtek.com.tw (172.21.6.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 8 Dec 2023 17:27:44 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7]) by RTEXMBS04.realtek.com.tw ([fe80::40c2:6c24:2df4:e6c7%5]) with mapi id 15.01.2375.007; Fri, 8 Dec 2023 17:27:44 +0800 From: Justin Lai To: Jakub Kicinski CC: "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "andrew@lunn.ch" , Ping-Ke Shih , Larry Chiu Subject: RE: [PATCH net-next v13 01/13] rtase: Add pci table supported in this module Thread-Topic: [PATCH net-next v13 01/13] rtase: Add pci table supported in this module Thread-Index: AQHaI4J1hYqre02tzkGBvHQzDpC7MLCU5PoAgAV9LKCAALy7AIAECGwQ Date: Fri, 8 Dec 2023 09:27:44 +0000 Message-ID: References: <20231130114327.1530225-1-justinlai0215@realtek.com> <20231130114327.1530225-2-justinlai0215@realtek.com> <20231201203602.7e380716@kernel.org> <20231205194050.7033cc2b@kernel.org> In-Reply-To: <20231205194050.7033cc2b@kernel.org> Accept-Language: zh-TW, en-US Content-Language: zh-TW x-originating-ip: [172.21.210.185] x-kse-serverinfo: RTEXMBS02.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.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 08 Dec 2023 01:28:23 -0800 (PST) > > On Wed, 6 Dec 2023 03:28:32 +0000 Justin Lai wrote: > > > > +static void rtase_remove_one(struct pci_dev *pdev) { > > > > + struct net_device *dev = pci_get_drvdata(pdev); > > > > + struct rtase_private *tp = netdev_priv(dev); > > > > + struct rtase_int_vector *ivec; > > > > + u32 i; > > > > + > > > > + for (i = 0; i < tp->int_nums; i++) { > > > > + ivec = &tp->int_vector[i]; > > > > + netif_napi_del(&ivec->napi); > > > > > > NAPI instances should be added on ndo_open() > > > > Do you want me to call netif_napi_add() in the .ndo_open function, and > > netif_napi_del() in the .ndo_stop function? However, I saw that many > > drivers do it in probe and remove. What is the purpose of doing this > > in .ndo_open and .ndo_stop? > > They will sit in a fixed-size hash table used for NAPI lookup in the core. Not a > big deal, but not the best way either. > > I think the main thing that prompted me to ask was that I couldn't find > napi_disable() in the first few patches. You should probably call it on close, > otherwise making sure NAPI is not running when you start freeing rings is hard. > synchronize_irq() will not help you at all if you're using NAPI. Thanks, I will call napi_disable() on close to fix this issue.