From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 327BFA0350; Tue, 12 May 2020 06:01:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 78F781C0D7; Tue, 12 May 2020 06:01:38 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CF1CD1C0CD for ; Tue, 12 May 2020 06:01:36 +0200 (CEST) IronPort-SDR: XAMGVOVJGOYp55LrsKafswH8GcqbxeB9GTJ+kyptvd5KWiJ4ERZZq9vhwRzHI6iV6A7a4X1KHF KB2vJNpsczFQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 21:01:35 -0700 IronPort-SDR: F43B5aDXWsIh3T3z3l+mEHPecDLiKf9KCywKBZWbDpfy2O/hCRq4vhiCljNjd7L7mBvKbt5Wk5 HFDMbfSIFdEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,382,1583222400"; d="scan'208,217";a="409153560" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.67.68.165]) ([10.67.68.165]) by orsmga004.jf.intel.com with ESMTP; 11 May 2020 21:01:33 -0700 To: "Zhang, AlvinX" , "dev@dpdk.org" Cc: "Xing, Beilei" , "Lu, Wenzhuo" References: <20200429063724.17284-1-alvinx.zhang@intel.com> <6CE17E955B70FA409286764E3E0B3641164830A7@CDSMSX102.ccr.corp.intel.com> From: Jeff Guo Message-ID: <3412a687-bc5c-dbfb-8c3b-6841d63bbd8e@intel.com> Date: Tue, 12 May 2020 12:01:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <6CE17E955B70FA409286764E3E0B3641164830A7@CDSMSX102.ccr.corp.intel.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" hi alvin On 5/12/2020 11:44 AM, Zhang, AlvinX wrote: > Hi Jia, > > It shouldn't return error for secondary. 'rte_eth_dev_release_port()' has already process type in it, so returning '0' should work better which will cause some process specific variables cleared. > In otherwise, only primary process need to really close the device. > > BR, > Alvin Sounds that if driver no need to close, no need to show any useless log to user, make sense. >> -----Original Message----- >> From: Guo, Jia >> Sent: Tuesday, May 12, 2020 11:03 AM >> To: Zhang, AlvinX ; dev@dpdk.org >> Cc: Xing, Beilei ; Lu, Wenzhuo >> >> Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi- >> process >> >> hi, alvin >> >> >> On 4/29/2020 2:37 PM, alvinx.zhang@intel.com wrote: >>> From: Alvin Zhang >>> >>> Enable detach device on secondary process. >>> >>> Fixes: b9eee2cb8c29 (e1000: support port hotplug) >>> Cc: bernard.iremonger@intel.com >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Alvin Zhang >>> --- >>> drivers/net/e1000/em_ethdev.c | 2 +- >>> drivers/net/e1000/igb_ethdev.c | 4 ++-- >>> 2 files changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/net/e1000/em_ethdev.c >>> b/drivers/net/e1000/em_ethdev.c index 188cda3..902b1cd 100644 >>> --- a/drivers/net/e1000/em_ethdev.c >>> +++ b/drivers/net/e1000/em_ethdev.c >>> @@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct >> rte_eth_dev *dev, >>> PMD_INIT_FUNC_TRACE(); >>> >>> if (rte_eal_process_type() != RTE_PROC_PRIMARY) >>> - return -EPERM; >>> + return 0; >>> >> >> I guess you mean pass through the process of the RTE_PROC_SECONDARY >> case when detach device, but what about the other case like >> RTE_PROC_INVALID or RTE_PROC_AUTO ? >> >> >>> eth_em_close(eth_dev); >>> >>> diff --git a/drivers/net/e1000/igb_ethdev.c >>> b/drivers/net/e1000/igb_ethdev.c index 520fba8..a5551e8 100644 >>> --- a/drivers/net/e1000/igb_ethdev.c >>> +++ b/drivers/net/e1000/igb_ethdev.c >>> @@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev >> *eth_dev) >>> PMD_INIT_FUNC_TRACE(); >>> >>> if (rte_eal_process_type() != RTE_PROC_PRIMARY) >>> - return -EPERM; >>> + return 0; >>> >>> eth_igb_close(eth_dev); >>> >>> @@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev >> *eth_dev) >>> PMD_INIT_FUNC_TRACE(); >>> >>> if (rte_eal_process_type() != RTE_PROC_PRIMARY) >>> - return -EPERM; >>> + return 0; >>> >>> igbvf_dev_close(eth_dev); Reviewed-by: Jeff Guo