From mboxrd@z Thu Jan 1 00:00:00 1970 From: Remy Horton Subject: Re: [PATCH v4 09/24] net/i40e: enable port detach on secondary process Date: Tue, 26 Jun 2018 11:36:17 +0100 Message-ID: <3da357df-4046-7fdd-a950-af24d7c1aa51@intel.com> References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180626070832.3055-1-qi.z.zhang@intel.com> <20180626070832.3055-10-qi.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: konstantin.ananyev@intel.com, dev@dpdk.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, benjamin.h.shelton@intel.com, narender.vangati@intel.com To: Qi Zhang , thomas@monjalon.net, anatoly.burakov@intel.com Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 24A1F1B46C for ; Tue, 26 Jun 2018 12:36:20 +0200 (CEST) In-Reply-To: <20180626070832.3055-10-qi.z.zhang@intel.com> 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 26/06/2018 08:08, Qi Zhang wrote: [..] > static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) > { > + struct rte_eth_dev *ethdev; > + ethdev = rte_eth_dev_allocated(pci_dev->device.name); > + > + if (!ethdev) > + return -ENODEV; > + > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return rte_eth_dev_release_port_private(ethdev); > + > return rte_eth_dev_pci_generic_remove(pci_dev, i40evf_dev_uninit); > } This identical code appears in multiple drivers. Is there anything stopping it being folded into rte_eth_dev_pci_generic_remove()?