From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 833F29AA2 for ; Tue, 1 Mar 2016 09:23:57 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id l68so22172187wml.1 for ; Tue, 01 Mar 2016 00:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=jhW6I8/68smQPiI93f+fnpwPjPjlXQ2bj8lq74trskE=; b=Z0i1Xb+LBKyB1v/zSEHLLZ5iL12qU1pD5XH946b96EaDF18lPBUy3ae+AMsCdgReDf AaOxiW8o3UOgOoFoitPpoH4y3qwgr88XuIWWsGRqVTA25HXd1BAdtTCyCHueYRjQb2bb Bp/lcCpuaeNk8mGQYbnx4dTTroR9Ez8684wufGuC/4UiYkXvGbdGtSe8qoYyQJZUHEAp XJxJGgKQDmvrFSqsp8r6+i3HQVmbBahoOZ0urfl1r/+pmWdeTM3x8hK9O3RjiQiAg2Yw Vu2/FpGONSMkdwvE9FCMqq9sAQtDRWEez4f24ZzdnTuMU3Uby8K8si/8iNV8JSJI9J1a NtKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=jhW6I8/68smQPiI93f+fnpwPjPjlXQ2bj8lq74trskE=; b=bB4JH9RgfXQJHsgYQUsGYejbmADpU/ri6rnYqI/w5WAGgw9cK+wpsK6pW+S7N4tUtp 7stWDlYWwxOgvh4x1esPqU0pId/Le1yLkaqEtanBzq0k7ya8nkmrfT8zKvNc+NcGnXkh lFZ1gs+PlAsQ5i5JbaAUGHJF1jZ36eQnKVDNdSCYehpv5HohpNKi+qofoqQeaUywn38I azlpXFYh8dR2eMKhDrK0cJT3hRjXQtqSMItUnl0AsAjou5SrW1eQM0BHcrTg8DKw1OA2 L9OEgVwltMVwG5rCGgBLsAfHIxEMFI9C9pznr+idMZmF5FmqL4vaAhvooQnC+rArrKB+ oPKA== X-Gm-Message-State: AD7BkJLFcbTgmT+TfpdvwOkeDgaqUen/xP2KC2ZFu394z4fMQnj1zEuj04CEWOQC/wCrbDeg X-Received: by 10.28.9.19 with SMTP id 19mr2345601wmj.87.1456820637346; Tue, 01 Mar 2016 00:23:57 -0800 (PST) Received: from xps13.localnet (180.20.90.92.rev.sfr.net. [92.90.20.180]) by smtp.gmail.com with ESMTPSA id ka7sm29636952wjb.8.2016.03.01.00.23.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2016 00:23:56 -0800 (PST) From: Thomas Monjalon To: "Xie, Huawei" Date: Tue, 01 Mar 2016 09:20:54 +0100 Message-ID: <8208032.DLqNqWtROc@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <20151222035041.GA7532@pxdev.xzpeter.org> <1870056.1ZGr9B153f@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, "Troitsky, Nikita" Subject: Re: [dpdk-dev] [PATCH v4 4/4] virtio: return 1 to tell the upper layer we don't take over this device 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, 01 Mar 2016 08:23:57 -0000 2016-03-01 07:53, Xie, Huawei: > On 3/1/2016 3:18 PM, Thomas Monjalon wrote: > > 2016-02-26 09:53, Huawei Xie: > >> @@ -1037,8 +1039,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > >> > >> pci_dev = eth_dev->pci_dev; > >> > >> - if (vtpci_init(pci_dev, hw) < 0) > >> - return -1; > >> + ret = vtpci_init(pci_dev, hw); > >> + if (ret) { > >> + rte_free(eth_dev->data->mac_addrs); > > The freeing seems not related to this patch. > > I can send a separate patch, ok within this patchset? Yes > > [...] > >> PMD_INIT_LOG(INFO, "trying with legacy virtio pci."); > >> - if (legacy_virtio_resource_init(dev, hw) < 0) > >> + if (legacy_virtio_resource_init(dev, hw) < 0) { > >> + if (dev->kdrv == RTE_KDRV_UNKNOWN) { > >> + PMD_INIT_LOG(INFO, > >> + "skip kernel managed virtio device."); > >> + return 1; > >> + } > >> return -1; > >> + } > > You cannot skip a device if it was whitelisted. > > I think you should check RTE_DEVTYPE_WHITELISTED_PCI and throw an error > > in this case. > > I feel there is a subtle difference on the understanding of -w args. To > me, without it, probe all devices; with it, only probe whiltelisted API. > That is all. I don't know if it is clearly documented indeed. > Do you mean that -w implies that devices whitelisted must be probed > successfully otherwise we throw an error? If i get it right, then what > about the devices whitelisted but without PMD driver? Yes we should probably consider the whitelist as a "forced" init. Later, we could introduce some device flags for probing/discovery: PROBE_AUTO, PROBE_FORCE, PROBE_IGNORE. It would make white/black list more precise. > I will fix, :). > if (dev->kdrv == RTE_KDRV_UNKNOWN && dev->devargs->type != > RTE_DEVTYPE_WHITELISTED_PCI) { > .... > return 1; > } You should also consider the blacklist case: if there is a blacklist, the not blacklisted devices must be initialised or throw an error.