From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by dpdk.org (Postfix) with ESMTP id 9DF589A91 for ; Tue, 10 Mar 2015 09:16:21 +0100 (CET) Received: by wesw62 with SMTP id w62so8808wes.0 for ; Tue, 10 Mar 2015 01:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:thread-index :content-language; bh=dqn9K0Tv6CA7/00jZ7q9GNeXKGeswAQA3DV5/ViamcM=; b=bJOVAJc0PSkOT064+DKzn10FIV46/DmSGZflIIf+Pii7ZuGrUTSadxKBC/F7T1wNcS J2DzbV/y51rflgcaqHH0hLTTi0D0tSt9vJ+kjes8o140yKjP0nZsfI1T5gFCxydU37bV n/HhlHqlVfaOzxq45UuPVpl12AwFTV7Zflg30K4tEHnCi8b8+MM341eNu9cPGrQHz5hF xgHfJj7qvU5AS/XufjPBumAB/9VR8dR/kMC5QkPbeBPTugMdN/MeUPI0H2TFWj2JldoL BDQMJRe6ssk0KgyZOGzKcM8adBYAwoagsVRR8Rd+7CB7zhQsLWgYlWfH56vIol3Ireof A0fg== X-Received: by 10.194.86.194 with SMTP id r2mr67275339wjz.41.1425975381442; Tue, 10 Mar 2015 01:16:21 -0700 (PDT) Received: from laptop1 ([149.78.58.66]) by mx.google.com with ESMTPSA id l9sm398070wij.16.2015.03.10.01.16.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 01:16:20 -0700 (PDT) From: "Raz Amir" To: "'Bruce Richardson'" References: <1424932400-66862-1-git-send-email-razamir22@gmail.com> <1425467754-2693-1-git-send-email-razamir22@gmail.com> <84B1AA3E-21E4-4A41-ADEE-B37E27147243@gmail.com> <20150309102742.GA960@bricha3-MOBL3> In-Reply-To: <20150309102742.GA960@bricha3-MOBL3> Date: Tue, 10 Mar 2015 10:15:07 +0200 Message-ID: <084e01d05b0a$52f28350$f8d789f0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQL76vl+o9soqPI/+Wx+6keMGfRa0gJJaZE4AQwN+B0CFKMEapqS7c9A Content-Language: en-gb Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3] pci: save list of detached devices, and re-probe during driver unload X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Mar 2015 08:16:21 -0000 Sorry for that. Will send the new patch soon -----Original Message----- From: Bruce Richardson [mailto:bruce.richardson@intel.com] Sent: 09 March 2015 12:28 To: Raz Amir Cc: dev@dpdk.org Subject: Re: [PATCH v3] pci: save list of detached devices, and re-probe during driver unload On Mon, Mar 09, 2015 at 10:07:29AM +0200, Raz Amir wrote: > Hi, gentle reminder about this patch... > > On Mar 4, 2015, at 1:15 PM, Raz Amir wrote: > > Added code that saves the pointers to the detached devices, during > driver loading, and during driver unloading, go over the list, and > re-attach them by calling device_probe_and_attach on each device. > > Signed-off-by: Raz Amir > --- > lib/librte_eal/bsdapp/nic_uio/nic_uio.c | 32 > ++++++++++++++++++++++++++++---- > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c > b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c > index 5ae8560..78e4dea 100644 > --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c > +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c > @@ -55,6 +55,9 @@ __FBSDID("$FreeBSD$"); > > #define MAX_BARS (PCIR_MAX_BAR_0 + 1) > > +#define MAX_DETACHED_DEVICES 128 > +static device_t detached_devices[MAX_DETACHED_DEVICES] = {}; static > +int num_detached = 0; > > struct nic_uio_softc { > device_t dev_t; > @@ -289,16 +292,37 @@ nic_uio_load(void) > > dev = pci_find_bsf(bus, device, function); > if (dev != NULL) > - for (i = 0; i < NUM_DEVICES; i++) > - if (pci_get_vendor(dev) == devices[i].vend && > - pci_get_device(dev) == devices[i].dev) > - device_detach(dev); > + continue; Since we have changed the body to be a continue statement, I think the condition above needs to be flipped. /Bruce