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 44E0FA0A02; Tue, 27 Apr 2021 18:46:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFCA8410D8; Tue, 27 Apr 2021 18:46:20 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 85D8B4003E for ; Tue, 27 Apr 2021 18:46:18 +0200 (CEST) IronPort-SDR: d5BeG4Stq3S79EkSX15dGQilqpgPO3oSx71QIPWW4Ka9TgX5iybEdwgvMTtvMJcRWtAWUijkMz FOMnxEEwVTRA== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="193361477" X-IronPort-AV: E=Sophos;i="5.82,254,1613462400"; d="scan'208";a="193361477" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 09:46:17 -0700 IronPort-SDR: kocT4NaFqe5p6MSWJZzH/dj0QVsgDAmPDVQGPjuaBRW4nUHzxnNYWAs7IBlzdX2t2dFVD4AiFJ g739DYIWGK2A== X-IronPort-AV: E=Sophos;i="5.82,254,1613462400"; d="scan'208";a="457739841" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.221.231]) ([10.213.221.231]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 09:46:16 -0700 To: Jiawen Wu , dev@dpdk.org References: <20210425080347.20376-1-jiawenwu@trustnetic.com> <20210425080347.20376-4-jiawenwu@trustnetic.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <2e535676-2d8e-5fb2-ceb7-2f3da4831c0a@intel.com> Date: Tue, 27 Apr 2021 17:46:15 +0100 MIME-Version: 1.0 In-Reply-To: <20210425080347.20376-4-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 3/4] net/txgbe: remove port representor 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 4/25/2021 9:03 AM, Jiawen Wu wrote: > Remove port representor in device probe process. > It can be good to highlight that is because port representor is not supported by the driver. > Signed-off-by: Jiawen Wu > --- > drivers/net/txgbe/txgbe_ethdev.c | 21 ++------------------- > 1 file changed, 2 insertions(+), 19 deletions(-) > > diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c > index 87c041c2ec..afb25fb8a0 100644 > --- a/drivers/net/txgbe/txgbe_ethdev.c > +++ b/drivers/net/txgbe/txgbe_ethdev.c > @@ -930,32 +930,15 @@ static int > eth_txgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > struct rte_pci_device *pci_dev) > { > - struct rte_eth_dev *pf_ethdev; > - struct rte_eth_devargs eth_da; > int retval; > > - if (pci_dev->device.devargs) { > - retval = rte_eth_devargs_parse(pci_dev->device.devargs->args, > - ð_da); > - if (retval) > - return retval; > - } else { > - memset(ð_da, 0, sizeof(eth_da)); > - } > - > retval = rte_eth_dev_create(&pci_dev->device, pci_dev->device.name, > sizeof(struct txgbe_adapter), > eth_dev_pci_specific_init, pci_dev, > eth_txgbe_dev_init, NULL); > > - if (retval || eth_da.nb_representor_ports < 1) > + if (retval) > return retval; > - if (eth_da.type != RTE_ETH_REPRESENTOR_VF) > - return -ENOTSUP; > - > - pf_ethdev = rte_eth_dev_allocated(pci_dev->device.name); > - if (pf_ethdev == NULL) > - return -ENODEV; > After patch it becomes: if (retval) return retval; return 0; Why not just "return retval"? Or even can eliminate the 'retval' variable. > return 0; > } > @@ -966,7 +949,7 @@ static int eth_txgbe_pci_remove(struct rte_pci_device *pci_dev) > > ethdev = rte_eth_dev_allocated(pci_dev->device.name); > if (!ethdev) > - return -ENODEV; > + return 0; > > return rte_eth_dev_destroy(ethdev, eth_txgbe_dev_uninit); > } >