Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp724208rdb; Tue, 5 Dec 2023 19:41:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP2oTCJRf2JAB8/24SyxevVHqaf4kFH+EI4asbkAl7aV3hK2cHS/1JyS4Rc2oztAu52LA3 X-Received: by 2002:a17:90b:1650:b0:286:bd26:b5ab with SMTP id il16-20020a17090b165000b00286bd26b5abmr326156pjb.6.1701834067807; Tue, 05 Dec 2023 19:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701834067; cv=none; d=google.com; s=arc-20160816; b=GWuV4yc001UmODjmrx7Y8flZohxaHhlAmbm60qXc7kcOxHo36wf92in6Q36VQcyxAf TlykuLILngVsy1X2XZP2qdofbrYHUxtssycStgoDj/hs0L3bihSNH2aJIrqVsPRZ7FOV Cdl7+yYm6CYltZfKPVL16nvqzBL90o3TIrMbTUG5T2DjeV4LNl9wzZaQmDWXVtjzgYn3 0z3TILoIKukG2256jPVVrrOMy/EKSwKniJmBkFba8Gdrv7i+qYqz2Xdi2PkwwEVdnuEH Y7BvMqC1vZktDnolJWgqYzUdF+gF27DVUaFHMZoa3L7c8GtRPhi206Yv0rXdIwi3rpU9 cBJQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9ck5PtAvmgFZUypdTOdjxdCbgAJA0SNleqOSckfJ7xM=; fh=blwXTamj2CjAxFkoY6wwEDTNeIDAMZe/RDuhTHGRMdY=; b=neWdllwxtDr9948gjagN3su61/V1FW4ywOxB0fgeF9aJpvXt+kepBSPEFrVYEqTAl8 5SCN/dG7nNvN5R9YqTA0eGUwir8Yr5aBiuPIDDQOeQ9qnT+CZKoeTWkHnV02RIGJ3TRt QjhwcQifNxWXo7jCdPqbQgwp1Hwm3DQThEk5YdtXkGMUQ2YqkcN2fVdQrvW78+L50PhV 23fgdtc8A5qpHYEM1gBFjEH6AbfwpjjW3+3Kij1ohPPajONzlJ7EJSO7kWaCobTgvUVl 0VRtQshOeYLcCNVTQ4ZyVVbFvebHmhzdwqy3pfvB8p/asFuDFi4p7YJFdrQYt05xy1k9 rfyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oQ3N2opx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h13-20020a17090aa88d00b00286f189a050si1301998pjq.22.2023.12.05.19.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 19:41:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oQ3N2opx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9983182CBA4B; Tue, 5 Dec 2023 19:41:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231563AbjLFDkt (ORCPT + 99 others); Tue, 5 Dec 2023 22:40:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232252AbjLFDkp (ORCPT ); Tue, 5 Dec 2023 22:40:45 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00074D45 for ; Tue, 5 Dec 2023 19:40:51 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36809C433C7; Wed, 6 Dec 2023 03:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701834051; bh=FBt1ijYUbhiyz3fIsr/MI4Jbrx7bhqPm7FXx1/PgtrE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oQ3N2opxHiOiJT0bs8bAqxt9mQNIF6tOpDVgvU3PXVzIUzjsw53xB9l63Ru+q3zks /PhlNUWL7WgjoddEONyZOScLATQwfhxHfjvL+Cm27ap9xLZAluh7qIXPflZkpDpzv0 NdI5JVUTo9aYt2CiCbeh9d/W8BWBv5nntG0O6w4/JThd+Qk6byKsnpLYrNCMDMngVF 1xYUxnfytS/hADG4LtR77eMJnuKIsazR4Gt2gzPyKyZsT9nzz07siSeespLt2xC2XN yyugIcKwweowPFUip9aflKbDCOQfMAV9IxSOPGoCMh1HfjnUFoWcduZBJLDSAaNBGp xh4W0gnaE4Gkw== Date: Tue, 5 Dec 2023 19:40:50 -0800 From: Jakub Kicinski To: Justin Lai 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 Message-ID: <20231205194050.7033cc2b@kernel.org> In-Reply-To: References: <20231130114327.1530225-1-justinlai0215@realtek.com> <20231130114327.1530225-2-justinlai0215@realtek.com> <20231201203602.7e380716@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 19:41:03 -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.