From patchwork Mon Jul 31 10:57:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Rivet?= X-Patchwork-Id: 27278 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id B728799E0; Mon, 31 Jul 2017 12:57:20 +0200 (CEST) Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by dpdk.org (Postfix) with ESMTP id 4EF3799DE for ; Mon, 31 Jul 2017 12:57:19 +0200 (CEST) Received: by mail-wr0-f176.google.com with SMTP id 12so177877964wrb.1 for ; Mon, 31 Jul 2017 03:57:19 -0700 (PDT) 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; bh=qEZbFLGxtHlU/YBWqOrbFX/OYUyQCsqo5riFQjsm0b4=; b=uODkQHfy3Lo9NRD78x2BxlsTwGZdidjWMdHtqmOGPbYWBQF8Go+1cmaYbZLpLPe24a xipUsT47RCd3o0OnL7tyGyChB8G3ptX1zfMhGXhmU/zKm8Va1fFv1Q/+LSGBtiKIJVN9 BlJimgv2vZ+sI7CV6RD0Qs7RjZ30QoQFbX/Y10GYr424+w81v+9SDUFXw6vQqG1cR33G U1qev38aID0s79GKPvy+0T7j66WbvchBBT6lBdhIBWdYmEp6KVBcMB9FWK+/1vU04vV0 EY0EoZ86pM+r+EhQ0VbvfrXyNZVHLmYgIY9f10cUW+kIxtSItw4FCyu9FRfe8OcpSwc5 wYfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qEZbFLGxtHlU/YBWqOrbFX/OYUyQCsqo5riFQjsm0b4=; b=BwFcresoS5fRd2ofHUozM3if6pV2DjtrmbNJvug/60Ma2qHH6dhS802yR/2z8SfOAa zx1lECTEMm6D68AZnqypTBghfJW0c+lotUXth8n+apcOebOhKdTny3OpZD4TyfRFGZb/ bUVqyXGw5cGIh1n3BiOuEsuCOHp+OKvVPrZi48zvoLC+enfvE7PHQEKqicbW49xr/u0V M5owbZvwtluMlrm1o+ZYi+9EUx4FptuNA6QHWo7r8e+LBwRcr/vYmnX/N2FhsidqJ0MN eq7G/aVGh9O1U0xfI6lRSuu6V5SYVTXubxSi7PGo3O8IIPAHzOrCgRG9jZP7X74ph/f+ WtQA== X-Gm-Message-State: AIVw113X16MN9SWdK8CGIu0weZYCt8blJz1bFxhE/ftQWlhq7Xst7f3r KPVXzMFI6bNBDoxR3+g= X-Received: by 10.223.145.106 with SMTP id j97mr2384226wrj.172.1501498638575; Mon, 31 Jul 2017 03:57:18 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id q141sm5544055wmb.11.2017.07.31.03.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 03:57:17 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Mon, 31 Jul 2017 12:57:05 +0200 Message-Id: <30721dc00d3d6e2509974511ba4c7d1850191d77.1501496837.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] dev: fix virtual dev attach 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" If the device cannot be parsed as a PCI device, the rte_devargs function returns -EFAULT. This error code signifies that the address given to the PCI bus is invalid. When it happens, the best course of action is to try to plug the device using the vdev bus. Fixes: 1c35f666df07 ("dev: fix attach proceeding with vdev on PCI success") Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index d74f978..97b063e 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -74,7 +74,7 @@ int rte_eal_dev_attach(const char *name, const char *devargs) } ret = rte_eal_hotplug_add("pci", name, devargs); - if (ret != -EINVAL) + if (ret != -EINVAL && ret != -EFAULT) return ret; /*