From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E5C5A0A0C; Fri, 2 Jul 2021 18:05:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE9AD41363; Fri, 2 Jul 2021 18:05:20 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id A750C41353 for ; Fri, 2 Jul 2021 18:05:19 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id F33117F517; Fri, 2 Jul 2021 19:05:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru F33117F517 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1625241919; bh=5VuecIpAA7ZkyOoASBXQbXOa2mq3oBIhQFAk1MMQ9Dk=; h=Subject:To:References:From:Date:In-Reply-To; b=N4/yk1JBzE7cw0LgN04IDfNGru9rz7B/aWT9E9gORl3m8drE53iC7EjRe6lCg3YdJ uJlClJKRDLErmFhc4Ihgf6YeoxReUqK8O/B0TgEGGBWb6dlcRfeGfQz2GCA3MmeerT r4sm04RwEurbp1cespb3p/cTapf48ypydPP5mqEo= To: Jiawen Wu , dev@dpdk.org References: <20210617110005.4132926-1-jiawenwu@trustnetic.com> <20210617110005.4132926-6-jiawenwu@trustnetic.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <1455afe4-a4cf-88e5-7fad-9af9b6d0df05@oktetlabs.ru> Date: Fri, 2 Jul 2021 19:05:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210617110005.4132926-6-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 05/19] net/ngbe: set MAC type and LAN ID with device initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 6/17/21 1:59 PM, Jiawen Wu wrote: > Add basic init and uninit function. > Map device IDs and subsystem IDs to single ID for easy operation. > Then initialize the shared code. > > Signed-off-by: Jiawen Wu [snip] > diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c > index e05766752a..a355c7dc29 100644 > --- a/drivers/net/ngbe/ngbe_ethdev.c > +++ b/drivers/net/ngbe/ngbe_ethdev.c > @@ -53,9 +71,9 @@ eth_ngbe_dev_uninit(struct rte_eth_dev *eth_dev) > if (rte_eal_process_type() != RTE_PROC_PRIMARY) > return 0; > > - RTE_SET_USED(eth_dev); > + ngbe_dev_close(eth_dev); Why is return value ignored? > > - return -EINVAL; > + return 0; > } > > static int > @@ -86,6 +104,19 @@ static struct rte_pci_driver rte_ngbe_pmd = { > .remove = eth_ngbe_pci_remove, > }; > > +/* > + * Reset and stop device. > + */ > +static int > +ngbe_dev_close(struct rte_eth_dev *dev) > +{ > + PMD_INIT_FUNC_TRACE(); > + > + RTE_SET_USED(dev); > + > + return -EINVAL; Is it really a problem to implement close here for the symmetry? Such asymmetry will result in failures if I try to run, for example, testpmd on the patch. > +} > + > RTE_PMD_REGISTER_PCI(net_ngbe, rte_ngbe_pmd); > RTE_PMD_REGISTER_PCI_TABLE(net_ngbe, pci_id_ngbe_map); > RTE_PMD_REGISTER_KMOD_DEP(net_ngbe, "* igb_uio | uio_pci_generic | vfio-pci"); [snip]