From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id A24D3A00E6
	for <public@inbox.dpdk.org>; Thu, 16 May 2019 00:20:29 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id A4AF25F2A;
	Thu, 16 May 2019 00:20:08 +0200 (CEST)
Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com
 [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 117165F14
 for <dev@dpdk.org>; Thu, 16 May 2019 00:20:05 +0200 (CEST)
Received: by mail-pf1-f196.google.com with SMTP id y11so672624pfm.13
 for <dev@dpdk.org>; Wed, 15 May 2019 15:20:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=V6S4SrZPKD5RhbdoJ6Quu9gqFutejpSzCG3N29qiz80=;
 b=kAoHjGYkC6VbUkLCJ4uMDkBYwD4CALOG1mlz5jTyEPVNdGeh1qo2OAaLXcMCu7EKZl
 H9iTbFjaBmjyiOTuZwVaV/1fIz7R6oQo3L+94Ke2of5CmWEoIYwRGTfcfXiNODKKcUOV
 Uy/5a29Tzrs7zJt5F+5s5o6ixI6vdeSWaZ1eUXdzd5otqXXbTjzYBcp0rTIIR/Ww1zkz
 vUTDdJPntjdOIIdCfeHPG0jDrtq531gpXoq3Wc4OjcAASFAgd3lDdxXVcxe35A7kslau
 EnU2yhdh9bmdsHlLI6yJ7bgIirssaFCqjJOeY5RX4Vs3pUfumEqgUJ7KWJIT+9b+SPoM
 VIPw==
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:mime-version:content-transfer-encoding;
 bh=V6S4SrZPKD5RhbdoJ6Quu9gqFutejpSzCG3N29qiz80=;
 b=MifcX428UBh1XD9sFL+j+F3koYDYnZY7QIaRmu109WSX6EHy37Bbl67qmmxNS6tjSP
 3eWOAo3x+P8FrkHi09IThrib/5zTrwcLzteoSEwacT56XpjVIf1WhCW1eX3caWL/7qci
 sEg+8euD+taWN2MqLjWjGGB1mGKp0w6dHmvn9nkzmgW2kq8g6bGS+xBBvqbXTbfZNftl
 5sSf+sCSq2R6FgUznzvf+twe/uASR+cYAWKsTRo3NNjDHUpxpfwSKiBQddMHefJHLh2W
 +vf26osC6rX8qzgkcopBiu0Ak5tBumKX/0MC8ufl5Wg43vvKnwfH/Y6KonGdT6pWT6V1
 k2gw==
X-Gm-Message-State: APjAAAUnK6PPfuvMRaOAltSSne5qctX/BCLM/Y7YeyB1ymEbWWj4Mdn6
 f9OocHuDEN480xdxnyB7e426ivU/qG4=
X-Google-Smtp-Source: APXvYqx5X+zYWL0LljNhQKKY7IBLaIeEUpNLkcfKUbEPKQtrhKPxvrud2hN/xZ5ZAACRaM2DYO5f1w==
X-Received: by 2002:a63:4a66:: with SMTP id j38mr27552446pgl.199.1557958803996; 
 Wed, 15 May 2019 15:20:03 -0700 (PDT)
Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])
 by smtp.gmail.com with ESMTPSA id d5sm3549964pgb.33.2019.05.15.15.20.02
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 15 May 2019 15:20:03 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 15 May 2019 15:19:51 -0700
Message-Id: <20190515221952.21959-4-stephen@networkplumber.org>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20190515221952.21959-1-stephen@networkplumber.org>
References: <20190515221952.21959-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [RFC 3/4] ethdev: use eth_unformat_addr
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190515221951.DOuFtwPXJ6ZHaBAB3Zu_tPtVmary1gYiLhzh_3REcAQ@z>

Use eth_unformat_addr, so that ethdev can be built and work
without the cmdline library. The dependency on cmdline was
an arrangement of convenience anyway.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_ethdev/rte_class_eth.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lib/librte_ethdev/rte_class_eth.c b/lib/librte_ethdev/rte_class_eth.c
index cb99c92ece93..40ca936230c6 100644
--- a/lib/librte_ethdev/rte_class_eth.c
+++ b/lib/librte_ethdev/rte_class_eth.c
@@ -4,7 +4,6 @@
 
 #include <string.h>
 
-#include <cmdline_parse_etheraddr.h>
 #include <rte_class.h>
 #include <rte_compat.h>
 #include <rte_errno.h>
@@ -43,19 +42,13 @@ static int
 eth_mac_cmp(const char *key __rte_unused,
 		const char *value, void *opaque)
 {
-	int ret;
 	struct ether_addr mac;
 	const struct rte_eth_dev_data *data = opaque;
 	struct rte_eth_dev_info dev_info;
 	uint32_t index;
 
 	/* Parse devargs MAC address. */
-	/*
-	 * cannot use ether_aton_r(value, &mac)
-	 * because of include conflict with rte_ether.h
-	 */
-	ret = cmdline_parse_etheraddr(NULL, value, &mac, sizeof(mac));
-	if (ret < 0)
+	if (ether_unformat_addr(value, &mac) < 0)
 		return -1; /* invalid devargs value */
 
 	/* Return 0 if devargs MAC is matching one of the device MACs. */
-- 
2.20.1