From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 1A7201B3C0 for ; Tue, 23 Oct 2018 10:53:56 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AF60B211E5; Tue, 23 Oct 2018 04:53:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 23 Oct 2018 04:53:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=jKffozIvbXGd8Bvm3pmI2qdVgxa0nq9/+mDwAynNk18=; b=nsFxDBt8xPd1 MZmftH0wletzXv7EaQucC2zGvUq+lWKhsy6otRl8LuKX+KVm2gHju0pxyHP/SkS8 21e7hV6UunYmVUwX+dspJdskMA6C96mEXK6gjIzsg7+pHpiRYBz6UHEL/0NRA/qS Q4Loo4ldwWlHXcxFrTnSuUFDJVW8pVA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=jKffozIvbXGd8Bvm3pmI2qdVgxa0nq9/+mDwAynNk 18=; b=uWNPxi+Fty8/hSyCvQvDsFW8EKf7T9iYn9mG7F9bmWBWCTu7vPuxDkkhJ 4LTBlMRNT44U1723c7Lj2kQcp7pB6avjo/3xVTgHOtjsWmMIhKNaTEqsQOKURSeN sqMlEEsdH9bbErRFlhUWCcUmqjrOq8iwfOfFPQL7KfsDzyxsrLhS/ZALT2aKlKZj rYKLTTS7wl0fOxmt7/dKuC4coAQ1w/9F1zLEl7gv9cBsZjjNYgGK2FqpZzA/GHv0 Sk6e5X10Kkb4iKu/llZwSkpgcJKSD6WmT+/cZ7QMhd4oMbgoWetlpQ+8a57UHXld nXzxXYycVW4Wv2uF4MNZ0cq4/tW7w== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id DA5AFE4240; Tue, 23 Oct 2018 04:53:53 -0400 (EDT) From: Thomas Monjalon To: "Ananyev, Konstantin" Cc: Andrew Rybchenko , "dev@dpdk.org" , "gaetan.rivet@6wind.com" , "ophirmu@mellanox.com" , "Yigit, Ferruh" , "olivier.matz@6wind.com" , "Horton, Remy" , "Richardson, Bruce" Date: Tue, 23 Oct 2018 10:53:56 +0200 Message-ID: <8517734.I65333T3KJ@xps> In-Reply-To: <2601191342CEEE43887BDE71AB9772580102FEB3BB@IRSMSX106.ger.corp.intel.com> References: <20181009021858.19216-1-thomas@monjalon.net> <2293154.gpuvSuLZkp@xps> <2601191342CEEE43887BDE71AB9772580102FEB3BB@IRSMSX106.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 4/4] ethdev: support MAC address as iterator filter 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: Tue, 23 Oct 2018 08:53:56 -0000 23/10/2018 10:33, Ananyev, Konstantin: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 22/10/2018 23:24, Ananyev, Konstantin: > > > From: Thomas Monjalon > > > > 22/10/2018 15:37, Andrew Rybchenko: > > > > > On 10/22/18 4:15 PM, Thomas Monjalon wrote: > > > > > > The MAC addresses of a port can be matched with devargs. > > > > > > > > > > > > As the conflict between rte_ether.h and netinet/ether.h is not resolved, > > > > > > the MAC parsing is done with a rte_cmdline function. > > > > > > As a result, cmdline library becomes a dependency of ethdev. > > > > > > > > > > > > Signed-off-by: Thomas Monjalon > > > > > > > > > > I'd like to share my thought about a new dependency. > > > > > Looking at cmdline I think that it is a bad and strange > > > > > dependency for kvargs. IMHO, even duplication of the > > > > > code to parse MAC address it less evil in this case. > > > > > > > > cmdline is not a dependency for kvargs. > > > > I have added it as a dependency for ethdev. > > > > > > > > > May be it is possible to provide internal wrapper > > > > > which is implemented using ether_aton_r() and located > > > > > in a separate C file which does not include rte_ether.h etc? > > > > > > > > I raised the issue in technical board and it has been decided to fix the > > > > conflict with libc in the next release (with Olivier's help). > > > > So Bruce and me decided to use cmdline function in the meantime. > > > > > > As I can see, cmdline_parse_etheraddr() uses > > > static struct ether_addr * > > > my_ether_aton(const char *a) > > > internally. > > > Why not to make it public, rename to rte_ethet_aton(), > > > and move into rte_net? > > > And use that one instead? > > > Later if/when we'll have name conflict with libc resolved, > > > It can become just a wrapper around ether_aton_r(). > > > Konstantin > > > > Several reasons: > > - It would be one more (useless) wrapper > > Well, it would be *when* will have libc naming conflict resolved. > Till that it would be pretty useful I think. It is planned to be fixed in the next release. > > - cmdline_parse_etheraddr is already used in several places > > As I can see right now it is used just by bond PMD: > $ find lib drivers -type f | xargs grep -l cmdline_parse_etheraddr | grep -v librte_cmdline > drivers/net/bonding/rte_eth_bond_args.c It is also used in examples: examples/bond/main.c examples/ethtool/ethtool-app/ethapp.c examples/l3fwd/main.c examples/performance-thread/l3fwd-thread/main.c > Again if that function is *really* used in several places to convert string to mac, > then I suppose it is an indication that rte_ether_aton() would be useful. > Without forcing cmdline dependency. I don't like wrappers and reinventing the wheel. If we introduce this new wrapper, then we will have to deprecate it, and break the API to remove it. > > - ether_aton_r and my_ether_aton may have a different behavior > > Could you elaborate here? > What exactly would be different? The error path might be slightly different, and... > Both supposed to convert string to ether addr. > If our function can't do that properly, then I think it is a bug in our side. > If ether_aton_r() just supports extra formats(XXXX:XXXX:XXXX), then it > would be extension to current behavior. ... yes there is this extension. > > When the libc conflict will be solved, I prefer replacing uses of > > cmdline_parse_etheraddr one by one. > > We can do the same with rte_ether_aton() too, if we really want to. At the price of breaking the API again.