From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v6 03/19] ethdev: enable hotplug on multi-process Date: Thu, 28 Jun 2018 10:19:30 +0100 Message-ID: <34aa331a-8d03-69dd-4699-597c6005febf@intel.com> References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180628015247.42232-1-qi.z.zhang@intel.com> <20180628015247.42232-4-qi.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; 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 Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id B22BC7CBC for ; Thu, 28 Jun 2018 11:19:33 +0200 (CEST) In-Reply-To: <20180628015247.42232-4-qi.z.zhang@intel.com> Content-Language: en-US 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 28-Jun-18 2:52 AM, Qi Zhang wrote: > We are going to introduce the solution to handle different hotplug > cases in multi-process situation, it include below scenario: > > 1. Attach a share device from primary > 2. Detach a share device from primary > 3. Attach a share device from secondary > 4. Detach a share device from secondary > 5. Attach a private device from secondary > 6. Detach a private device from secondary > 7. Detach a share device from secondary privately > 8. Attach a share device from secondary privately > > In primary-secondary process model, we assume device is shared by default. > that means attach or detach a device on any process will broadcast to > all other processes through mp channel then device information will be > synchronized on all processes. > > Any failure during attaching process will cause inconsistent status > between processes, so proper rollback action should be considered. > Also it is not safe to detach a share device when other process still use > it, so a handshake mechanism is introduced. > > This patch covers the implementation of case 1,2,5,6,7,8. > Case 3,4 will be implemented on separate patch as well as handshake > mechanism. > > Scenario for Case 1, 2: > > attach device > a) primary attach the new device if failed goto h). > b) primary send attach sync request to all secondary. > c) secondary receive request and attach device and send reply. > d) primary check the reply if all success go to i). > e) primary send attach rollback sync request to all secondary. > f) secondary receive the request and detach device and send reply. > g) primary receive the reply and detach device as rollback action. > h) attach fail > i) attach success > > detach device > a) primary perform pre-detach check, if device is locked, goto i). > b) primary send pre-detach sync request to all secondary. > c) secondary perform pre-detach check and send reply. > d) primary check the reply if any fail goto i). > e) primary send detach sync request to all secondary > f) secondary detach the device and send reply (assume no fail) > g) primary detach the device. > h) detach success > i) detach failed > > Case 5, 6: > Secondary process can attach private device which only visible to itself, > in this case no IPC is involved, primary process is not allowed to have > private device so far. > > Case 7, 8: > Secondary process can also temporally to detach a share device "privately" > then attach it back later, this action also not impact other processes. > > APIs changes: > > rte_eth_dev_attach and rte_eth_dev_attach are extended to support > share device attach/detach in primary-secondary process model, it will > be called in case 1,2,3,4. > > New API rte_eth_dev_attach_private and rte_eth_dev_detach_private are > introduced to cover case 5,6,7,8, this API can only be invoked in secondary > process. > > Signed-off-by: Qi Zhang > --- Missed one issue - new API's should be added to the .map file. -- Thanks, Anatoly