From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 584F31B1B2 for ; Thu, 12 Oct 2017 10:21:53 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id u138so10847886wmu.5 for ; Thu, 12 Oct 2017 01:21:53 -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:in-reply-to:references :in-reply-to:references; bh=jDj8WZXQ8I9RbHu8QCuOgqB/YPWizDZt8NAPm7wBvII=; b=ddgrPw0eJR30pQJS8vCUH8jdZs4QgXAgRF0XXkANyAZXTlKpnqCFBU8hecGD3k/JuD PWpxzqmuvXrGb2ti86kwY+uQfvRhr9ogR/cXbZQYCdUyrzDgyJJMK4NtHQxyfV/OHeuv dn9MLXUHv3+nxKvPwGNM9cIGhDqnlgmjJQ424hUqwTpZxGh32vB9NNhiyWvbbfon/2VD KcNJdoZBqGfjPY11AiHCHVyblyEBHHv7+eNGFE5ZUrGkE1IsLsmeILo6YTq/qqIDXVOJ braZR8oq/Nfx1B/+uKuZEL85BEGmVFgfTTOwRpieIqwspkUMcGKC/UXJ7LwUppQHLf9a CAtg== 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:in-reply-to :references:in-reply-to:references; bh=jDj8WZXQ8I9RbHu8QCuOgqB/YPWizDZt8NAPm7wBvII=; b=RIa4s4O4h4T+VgTTr9AVyXh3PBygzWNbtvPFbB1LyGhdQXAPJAuD7R9QlDfBOI0Fht K9qOJa5cIwv6c8KeFuzuh6ggG0cuAQsrdAkkA1xLQfRzadWk4cwJ53jkXP6s6NWtx/Qf zaim2r+Ha9t2PkadZiUf47X1r0qfynrtq3HNuHXBlYKXqXmDgehDtrzs0uGhkZgNolW1 G7aI+oAl5AzKYUpVO77UeH+8IPgxADz2vgxNQzU5kQAdJUE2rdFuYR1tN0DYJVClQhfz l9vvT/+msQGXMFjCjlmd7abz6JuuZ9D1qdh6Qp3m7/MmwT3ZL1mmWZ61dmtW9JZ4rsaA f/zQ== X-Gm-Message-State: AMCzsaUSrtDQb7H+eVHUPf2NxJA0AOl7ywtAxJnp6W17rRgL1S2wf/Qc gNhrh4Vm8ajyE6/1J/A6Oa0xmXfC X-Google-Smtp-Source: AOwi7QCTEIJRmo8/vF1btLDz1qum/9epWgb37dh8shsQjSc5ZY3R+t1e90ppMWqHeoQl7RRoVJYefQ== X-Received: by 10.223.134.157 with SMTP id 29mr1248450wrx.72.1507796512704; Thu, 12 Oct 2017 01:21:52 -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 200sm19424728wmu.44.2017.10.12.01.21.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 01:21:52 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 12 Oct 2017 10:21:17 +0200 Message-Id: <249121051d5623b26181f57e4fa80df07e834fa7.1507796100.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 10/18] devargs: require bus name prefix 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: , X-List-Received-Date: Thu, 12 Oct 2017 08:21:53 -0000 The EAL now requires the bus to be prepended to the device declaration string. Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_devargs.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index a21cc1a..49cc3b8 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -107,18 +107,17 @@ rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) va_start(ap, format); vsnprintf(dev, sizeof(dev), format, ap); va_end(ap); - /* Retrieve eventual bus info */ - do { - devname = dev; - bus = rte_bus_find(bus, bus_name_cmp, dev); - if (bus == NULL) - break; - devname = dev + strlen(bus->name) + 1; - if (rte_bus_find_by_device_name(devname) == bus) - break; - } while (1); + /* Retrieve bus info */ + bus = rte_bus_find(bus, bus_name_cmp, dev); + if (bus == NULL) { + fprintf(stderr, "ERROR: failed to parse bus from \"%s\"\n", + dev); + return -EFAULT; + } + da->bus = bus; /* Store device name */ i = 0; + devname = dev + strlen(bus->name) + 1; while (devname[i] != '\0' && devname[i] != ',') { da->name[i] = devname[i]; i++; @@ -130,15 +129,6 @@ rte_eal_devargs_parse(struct rte_devargs *da, const char *format, ...) } } da->name[i] = '\0'; - if (bus == NULL) { - bus = rte_bus_find_by_device_name(da->name); - if (bus == NULL) { - fprintf(stderr, "ERROR: failed to parse device \"%s\"\n", - da->name); - return -EFAULT; - } - } - da->bus = bus; /* Parse eventual device arguments */ if (devname[i] == ',') da->args = strdup(&devname[i + 1]); -- 2.1.4