From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 397152A5D for ; Thu, 12 Oct 2017 10:21:58 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id k4so11007705wmc.1 for ; Thu, 12 Oct 2017 01:21:58 -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=S58+Z7NW0X+9l5EhX8zZSurK0papLYC9NcMSTrNV+wk=; b=F7cy35Q+RaDETBYV9RIBN+RaXRspC4KJc0dxnl0bAhdeCku7YikxZa64TdoxpcjZ/o Bg1pE5acK69enfwFfGQAXtFFQcbs2zCoVGDADMc+7N5jouJtavDsq4GIvk5A5f833unC drh9MIw8NJ1QokJS+mgTynHYmvnjEsijzlOgEhfH4Uj7X6sUJTGxYzqgoeI6y93TIirE IwtqTL+zY30UQsaBpXqA4NTCkL/pXo7IUCFP+mo0sy1OypMwINBfIp8hA0ikICIS1O2g 0lG9pvjABLNoK3h7zNPl1O+DYGhmNbGz0Z1nmwGvd/Vk9p3azZ9g6h4tbu41sdNhSlG9 SThA== 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=S58+Z7NW0X+9l5EhX8zZSurK0papLYC9NcMSTrNV+wk=; b=qKFyXQ7uHMGyTzo1G9ct2LhVxEOKEHcr8xotlfXaflUV8CdQxC0fH1XrnSbL53IJxR LmhV0Sz4jp+TRhzXwh17gwiNmF+DoDN+0X0yNQ87P4K99oQOvL/H9K5MitoVvMMz5HUv DeLIxz8xCIBwPeJeXUixDHSI945VHRPXYjbO2kvqu88zVz8FUt/aR4d3zQyuBeBMU5sx FlNt6KfeBNUIrcuTGOuVT4WzvM45Kq5sTivgAMoYZYiRgaTVQig1LaJIHCYTvTV3lymZ pgnsGwvYGvFtFpQdsrBXhDkiyRowYMVlEIqv//mV20ckp+oF+FmT3fVr62q888oGdS3w 7FcQ== X-Gm-Message-State: AMCzsaVKmb7u3J6xNMcritCvtrxUfi1pw8+RGjVYtzZY9oUdN90qtKjH yq6BxmgY+4a/AEG7Mb1So3NgwKGP X-Google-Smtp-Source: AOwi7QAylqsHWkXMZc8bS0SuYEmjnnihiyyJyZ/Ydn2BPWGO/Rt8D3AG1zOSD8UkoLm3jgSwNkyy4w== X-Received: by 10.28.93.200 with SMTP id r191mr1278094wmb.19.1507796517592; Thu, 12 Oct 2017 01:21:57 -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.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 01:21:56 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 12 Oct 2017 10:21:21 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 14/18] net/failsafe: keep legacy sub-device declaration 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:58 -0000 Allow users to use the same sub-device declaration format. The rte_devargs library now requires the bus name to be prepended to device declarations. While it is possible to use this new format, the transition to the new one can be made smoother. Signed-off-by: Gaetan Rivet --- drivers/net/failsafe/failsafe_args.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index 08ce4ad..0c98264 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -83,12 +84,20 @@ closing_paren(const char *text) static int fs_parse_device(struct sub_device *sdev, char *args) { + struct rte_bus *bus; struct rte_devargs *d; int ret; d = &sdev->devargs; DEBUG("%s", args); - ret = rte_eal_devargs_parse(d, "%s", args); + bus = rte_bus_find_by_device_name(args); + if (bus == NULL) + /* args may contain the bus name */ + ret = rte_eal_devargs_parse(d, "%s", args); + else + /* args is a device name */ + ret = rte_eal_devargs_parse(d, "%s:%s", + bus->name, args); if (ret) { DEBUG("devargs parsing failed with code %d", ret); return ret; -- 2.1.4