From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yliu@fridaylinux.org>
Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com
 [66.111.4.224]) by dpdk.org (Postfix) with ESMTP id 968811B60A
 for <users@dpdk.org>; Tue,  7 Nov 2017 10:08:17 +0100 (CET)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailnew.nyi.internal (Postfix) with ESMTP id 23886142E;
 Tue,  7 Nov 2017 04:08:17 -0500 (EST)
Received: from frontend1 ([10.202.2.160])
 by compute1.internal (MEProxy); Tue, 07 Nov 2017 04:08:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org;
 h=cc:content-transfer-encoding:content-type:date:from
 :in-reply-to:message-id:mime-version:references:subject:to
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=F7LNoGt4IMUc8ceIX
 He8Xbbn6N5ADw/Fv6MF5amEViA=; b=So2j4PtdMB8GZ9/VAx3Z8UrCduRgEyTes
 hrIDYIZ5Bs4U/hXm7c/PuEaJA6RK3IHzvAV8uUThaH4cE8vzsfXEnGymKgPGYv26
 DiWOCKchgl3DiPKQHcM8xbzV6Qr8u6B6DbdoxHhnlj6WBdsdc6Z3p6MlhAE+xjo/
 ZVFz/Pi4xIOMppodrZuF7PST4hc7txAeGbaym755y6EzNpm7FCVlVru2+xpfIZbx
 bo8a556j8eWVKbtu22Jh7T7sxlhsef8FBFGD9gWvcHi0BxvKdr9UDcTr1wHomQd4
 RWjS8TkMtWQgyLURLVhnoMUj3jzjBd1oZYdXReD2qwLMuyZunbGzA==
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-sender:x-me-sender:x-sasl-enc; s=fm1; bh=F7LNoG
 t4IMUc8ceIXHe8Xbbn6N5ADw/Fv6MF5amEViA=; b=F2g+Sq3vm8bxHtwNXfPn+G
 zH++QStaNBVZUbqGFFjts7XZF2LVX8oMNccD2s+426fbaO9CY+Qjmn+5E0mt0O1j
 iSJqYUQnEQhgKR6ov4LcpiEGoyHhDYZwzR9FNozIgKown/KDqUKP0fPdyXjOmfyR
 8AHFpuA5ygh/IqoPpPHpconpCzOkW4pkbEA2b6LixQork/xMQZwNcgvGgkLxqA3w
 mb//gSXGojMGu7f+MCSm0mTnwVDE/0GoYyBvOD/YkessQJIlw8a1hwi1ZFH5Ea5v
 4jsXqETOdh1344Is5BBnV94qS5JcxjZGv1iwC4Levg+DRvPWYItsm9SaKMhKZzdA
 ==
X-ME-Sender: <xms:AHgBWgKa5D4b3YaYo9pQ6ew6cz6s92UysCFwTEg2uQcVN05NXnFXLA>
Received: from yliu-home (unknown [222.64.173.197])
 by mail.messagingengine.com (Postfix) with ESMTPA id C4DBA7FAD9;
 Tue,  7 Nov 2017 04:08:15 -0500 (EST)
Date: Tue, 7 Nov 2017 17:08:07 +0800
From: Yuanhan Liu <yliu@fridaylinux.org>
To: devendra rawat <devendra.rawat.singh@gmail.com>
Cc: "Loftus, Ciara" <ciara.loftus@intel.com>,
 Thomas Monjalon <thomas@monjalon.net>, Kevin Traynor <ktraynor@redhat.com>,
 "ovs-dev@openvswitch.org" <ovs-dev@openvswitch.org>,
 Adrien Mazarguil <adrien.mazarguil@6wind.com>,
 "nelio.laranjeiro@6wind.com" <nelio.laranjeiro@6wind.com>,
 "users@dpdk.org" <users@dpdk.org>,
 "olgas@mellanox.com" <olgas@mellanox.com>, Darrell Ball <dball@vmware.com>
Message-ID: <20171107090807.GP12931@yliu-home>
References: <CACsJYqps0gM6NTUspVBcvjw1-VM4wj_UV2SbAhWGd-Y6WDBOzg@mail.gmail.com>
 <1990042.kGnXgAYS5O@xps>
 <74F120C019F4A64C9B78E802F6AD4CC278E0EB1C@IRSMSX106.ger.corp.intel.com>
 <1785021.jQYphEuIaN@xps>
 <74F120C019F4A64C9B78E802F6AD4CC278E0EB69@IRSMSX106.ger.corp.intel.com>
 <CACsJYqpwnKPE9+WTXHuj-4Biwf+Zz4eX3jPnXCtaQhLnV7JFTQ@mail.gmail.com>
 <74F120C019F4A64C9B78E802F6AD4CC278E1B981@IRSMSX106.ger.corp.intel.com>
 <CACsJYqqNCChjQyA3csMAzxfcuGg2+-n-QPq1b9dgCr4eEOz-kg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CACsJYqqNCChjQyA3csMAzxfcuGg2+-n-QPq1b9dgCr4eEOz-kg@mail.gmail.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Mailman-Approved-At: Tue, 07 Nov 2017 15:32:19 +0100
Subject: Re: [dpdk-users] [ovs-dev] adding dpdk ports sharing same pci
 address to ovs-dpdk bridge
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 07 Nov 2017 09:08:17 -0000

On Tue, Oct 10, 2017 at 06:26:51PM +0530, devendra rawat wrote:
>     > Hi Everyone,
>     >
>     > Anything finalized for sorting out this issue, do you need any more
>     > information regarding this issue ?
> 
>     Hi,
> 
>     I put together a very rough RFC that aims to work-around the issue:
>     https://mail.openvswitch.org/pipermail/ovs-dev/2017-October/339496.html
> 
>     It hasn't been tested as I don't have access to the type of card that has
>     one PCI for multiple ports.
>     If anybody does have access to such a device, I welcome you to try the
>     patch although I'm not hopeful it will succeed first -pass.
>     Looking for feedback on implementation, interface, etc.
> 
> 
>  I applied the patch on top of OVS v2.8.1 and used DPDK v17.08. I used Mellanox
> ConnectX-3 pro NIC for testing, this NIC provides two 10G ports
> that share a single PCI address.
> 
> The patch is working fine, I was able to add both the 10G ports to OVS bridge
> by specifying the port no. (0 or 1) in the dpdk-devargs.
> 
> # ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk
> options:dpdk-devargs=0002:01:00.0,0
> # ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk
> options:dpdk-devargs=0002:01:00.0,1

I think the patch should work. But there something I want to point out:

- you were assuming the ports with the same PCI addresses are continuous
  in the port number. I don't think it's a good assumption, though it's
  very likely it's always the case in reality.

- I also think the index can not tell which port it is from the ports
  having the same PCI address.

Having said that, I think using the mac address to referencing a DPDK port
might be a better idea. Something like:

    options:dpdk-devargs=$mac_addr

Then from the ovs-dpdk point of you, it can detect whether it's a mac
or an PCI address, and use that to get the right port.

Or, we could have it both, if that's really needed:

    dpdk-devargs=$pci_addr,$mac_addr

In such way, the original issue would also be solved. Moreover, people
know exactly what the underlie port he want to deal with.

Comments/thought?

	--yliu

> 
> the port no. (0 and 1) are bound to actual physical port, i.e if I keep on
> adding and deleting port no. 0 to bridge br0 multiple times,
> every time I add the port back to br0, the same physical port is added to
> bridge br0.
>