DPDK usage discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Kevin Traynor <ktraynor@redhat.com>
Cc: "Loftus, Ciara" <ciara.loftus@intel.com>,
	devendra rawat <devendra.rawat.singh@gmail.com>,
	"ovs-dev@openvswitch.org" <ovs-dev@openvswitch.org>,
	nelio.laranjeiro@6wind.com, "users@dpdk.org" <users@dpdk.org>,
	Yuanhan Liu <yliu@fridaylinux.org>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-users] [ovs-dev] adding dpdk ports sharing same pci address to ovs-dpdk bridge
Date: Thu, 21 Sep 2017 11:17:59 +0200	[thread overview]
Message-ID: <20170921091759.GA11375@6wind.com> (raw)
In-Reply-To: <aa7c3082-8346-fbfb-22cc-e846defd88b6@redhat.com>

On Wed, Sep 20, 2017 at 06:33:43PM +0100, Kevin Traynor wrote:
> On 09/08/2017 10:56 AM, Loftus, Ciara wrote:
> >> Hi,
> >>
> >> I have compiled and built ovs-dpdk using DPDK v17.08 and OVS v2.8.0. The
> >> NIC that I am using is Mellanox ConnectX-3 Pro, which is a dual port 10G
> >> NIC. The problem with this NIC is that it provides only one PCI address for
> >> both the 10G ports.
> >>
> >> So when I am trying to add the two DPDK ports to my br0 bridge
> >>
> >> # ovs-vsctl --no-wait add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk
> >> options:dpdk-devargs=0002:01:00.0
> >>
> >> # ovs-vsctl --no-wait add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk
> >> options:dpdk-devargs=0002:01:00.0
> >>
> >> The port dpdk1 is added successfully and able to transfer data, but adding
> >> dpdk0 to br0 fails:
> >>
> >> 2017-09-06T14:19:20Z|00045|netdev_dpdk|INFO|Port 0: e4:1d:2d:4f:78:60
> >> 2017-09-06T14:19:20Z|00046|bridge|INFO|bridge br0: added interface dpdk1
> >> on
> >> port 1
> >> 2017-09-06T14:19:20Z|00047|bridge|INFO|bridge br0: added interface br0
> >> on
> >> port 65534
> >> 2017-09-06T14:19:20Z|00048|dpif_netlink|WARN|Generic Netlink family
> >> 'ovs_datapath' does not exist. The Open vSwitch kernel module is probably
> >> not loaded.
> >> 2017-09-06T14:19:20Z|00049|netdev_dpdk|WARN|'dpdk0' is trying to use
> >> device
> >> '0002:01:00.0' which is already in use by 'dpdk1'
> >> 2017-09-06T14:19:20Z|00050|netdev|WARN|dpdk0: could not set
> >> configuration
> >> (Address already in use)
> >> 2017-09-06T14:19:20Z|00051|bridge|INFO|bridge br0: using datapath ID
> >> 0000e41d2d4f7860
> >>
> >>
> >> With OVS v2.6.1 I never had this problem as dpdk-devargs was not
> >> mandatory
> >> and just specifying port name was enough to add that port to bridge.
> >>
> >> Is there a way to add port both ports to bridge ?
> > 
> > It seems the DPDK function rte_eth_dev_get_port_by_name() will always return the port ID of the first port on your NIC, when you specify the single PCI address and that's where the problem is. There doesn't seem to be a way currently to indicate to the calling application that in fact two (or more) port IDs are associated with the one PCI address.
> > 
> > I am cc-ing DPDK users mailing list for hopefully some input. Are there any plans for the rte_eth_dev_get_port_by_name function to be compatible with NICs with multiple ports under the same PCI address?
> > 
> 
> Hi Adrien/Nelio,
> 
> Is this something you can answer? We're wondering how to handle this in
> OVS and whether a temporary or long term solution is needed.
> 
> The original thread started here:
> https://mail.openvswitch.org/pipermail/ovs-dev/2017-September/338418.html

Hi,

I'm late to this thread and not too familiar with openvswitch's internals,
however after reading this thread here are some thoughts.

About rte_eth_dev_get_port_by_name(), contrary to other PMDs, mlx4 generates
for each port something that is not a PCI bus address precisely to avoid
collisions. The name is the concatenation of the associated Verbs device
name and the physical port number, e.g. "mlx4_0 port 0" instead of
"0000:02:42.0".

Referring to a port with this name through the above function should yield
the correct device.

If necessary, the PCI address to Verbs device name conversion can be
performed like the PMD itself by looking at sysfs, e.g:

 $ PCI=0000:02:42.0
 $ ls /sys/bus/pci/devices/$PCI/infiniband/
 mlx4_0

Since DPDK 17.05, there's also a way to select what ports the mlx4 PMD
should register DPDK devices for by providing a "port" parameter (DPDK
devargs). The default is to enable them all, see:

 http://dpdk.org/browse/dpdk/commit/?id=001a520e419fdbab8d83f572c2a4414c7bc8ed07

This can help for single port use cases where several ports are registered
by the PMD and the wrong one is used by the application.

-- 
Adrien Mazarguil
6WIND

  parent reply	other threads:[~2017-09-21  9:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACsJYqps0gM6NTUspVBcvjw1-VM4wj_UV2SbAhWGd-Y6WDBOzg@mail.gmail.com>
2017-09-08  9:56 ` Loftus, Ciara
2017-09-20 17:33   ` Kevin Traynor
2017-09-20 22:08     ` Thomas Monjalon
2017-09-21  8:04       ` Loftus, Ciara
2017-09-21  8:19         ` Thomas Monjalon
2017-09-21  8:28           ` Loftus, Ciara
2017-10-05 16:19             ` devendra rawat
2017-10-06 14:00               ` Loftus, Ciara
2017-10-10 12:56                 ` devendra rawat
2017-11-07  9:08                   ` Yuanhan Liu
2017-09-21  9:17     ` Adrien Mazarguil [this message]
2017-09-21  9:45       ` Adrien Mazarguil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170921091759.GA11375@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=ciara.loftus@intel.com \
    --cc=devendra.rawat.singh@gmail.com \
    --cc=ktraynor@redhat.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=ovs-dev@openvswitch.org \
    --cc=thomas@monjalon.net \
    --cc=users@dpdk.org \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).