From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2018 03:36:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,274,1526367600"; d="scan'208";a="67801638" Received: from rhorton-mobl1.ger.corp.intel.com (HELO [163.33.230.68]) ([163.33.230.68]) by orsmga001.jf.intel.com with ESMTP; 26 Jun 2018 03:36:18 -0700 To: Qi Zhang , thomas@monjalon.net, anatoly.burakov@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> 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 From: Remy Horton Organization: Intel Shannon Limited Message-ID: <3da357df-4046-7fdd-a950-af24d7c1aa51@intel.com> Date: Tue, 26 Jun 2018 11:36:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20180626070832.3055-10-qi.z.zhang@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 09/24] net/i40e: enable port detach on secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2018 10:36:21 -0000 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()?