From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pl0-f52.google.com (mail-pl0-f52.google.com
 [209.85.160.52]) by dpdk.org (Postfix) with ESMTP id 29BCB7EEF
 for <users@dpdk.org>; Thu, 19 Apr 2018 18:24:24 +0200 (CEST)
Received: by mail-pl0-f52.google.com with SMTP id w21-v6so3544391plq.2
 for <users@dpdk.org>; Thu, 19 Apr 2018 09:24:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=1eBVA1zEv7GlQB5igSHDBYdDRlreRIqcAd6kTetYSkU=;
 b=jwHe4qb4y6u+aQ29ujgae9T7g50zU/TmAt0oSlnt2sVEz3BYwuWaiaA8f4a/KtAk/w
 jmWZMWv/qdR9S+9Iep7h70l22oZau1y9zL4JUzIY629XB9cEWceStOekHvEAdgj9+6tF
 9+x1yHxs5ghphs5P4Ifa2w8dY4MgGdZIH0/3RXsGHBZmwT20W+O8nIppQFG3LUrCGh++
 N19te94Af638qgch0vKZHb43Cne2pNQWYcK/ARa+YsgoTpzJbCSp3ljYAQKTAx/UpwPB
 pf/WmrALLjQW4Y9hfiHGLDjgUrpoNIJ/x8ZkAuVrvTY4niIYpzYeUqPvdi/JLDGWGp6/
 RP0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=1eBVA1zEv7GlQB5igSHDBYdDRlreRIqcAd6kTetYSkU=;
 b=reqSTLF4kVx5Q3kTuMDUpxqw3LFnhy13R4SQQNM3AO2bTJu2AxdvOgbn0gTa+bNLyL
 obVLYRyPBY+o4ZtfzwDNJSLzcPNHSgliCVtq4ucQAUyo5B5mpxfwgun/W4mhw6uQfGRx
 KSoVKkywYuwK21LSb72TD/bcNMLyVURwqUB13fgNkNInJcYv7JJCCoTlBBlWc1h3XWvE
 1AoG9EgDjor8WywIg8N+Np9PXeEkerb66Dplzu/TopMxrBJtiAwhZPtZGT1D3JFV0lcc
 KxaLzdOUCtlaDQPULFj8jezGk1UNWBIIk0qwMWF4wSANWtQPZPiygbRQn1pJr7Hx7BHH
 +R8A==
X-Gm-Message-State: ALQs6tDht2YPFSFGts5GK3y9FziZqn79bsoF05zNTL/Kt18r9sJHd/dO
 QTGUwF7qjnF3tpJhizsqc+qsbQ==
X-Google-Smtp-Source: AIpwx49vmMbVDpjWojLhfwMGsmtRVjTeo7ZsoM0VKuVw0wCS1q6Ey/j83T1I84EtXVdi5D01j0no2w==
X-Received: by 2002:a17:902:bcc8:: with SMTP id
 o8-v6mr6594329pls.84.1524155063279; 
 Thu, 19 Apr 2018 09:24:23 -0700 (PDT)
Received: from shemminger-XPS-13-9360 ([167.220.59.143])
 by smtp.gmail.com with ESMTPSA id b72sm453073pfm.69.2018.04.19.09.24.23
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 19 Apr 2018 09:24:23 -0700 (PDT)
Date: Thu, 19 Apr 2018 09:24:20 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Rosen, Rami" <rami.rosen@intel.com>
Cc: Filip Janiszewski <contact@filipjaniszewski.com>, "users@dpdk.org"
 <users@dpdk.org>
Message-ID: <20180419092420.759a3959@shemminger-XPS-13-9360>
In-Reply-To: <9B0331B6EBBD0E4684FBFAEDA55776F9531E4503@HASMSX110.ger.corp.intel.com>
References: <cc2a5536-6c1d-a83d-fd60-f2cf60b6cf7c@filipjaniszewski.com>
 <9B0331B6EBBD0E4684FBFAEDA55776F9531E4503@HASMSX110.ger.corp.intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-users] DPDK device name
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://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: <https://dpdk.org/ml/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Apr 2018 16:24:24 -0000

On Thu, 19 Apr 2018 07:15:07 +0000
"Rosen, Rami" <rami.rosen@intel.com> wrote:

> Hi Flip,
> I assume that by "port numbers" you mean the PCI bus id (BDF)
> that is used by DPDK (for bind, for example).
> 
> You can fetch the bus id for a netdevice named "eth0" by
> ethtool -i eth0 | grep bus-info
> bus-info: 0000:01:00.0
> 
> If you mean the internal port number (starting from 0 for the first port, and so on) inside DPDK, then there is no 
> mapping between the interface name (as seen by ifconfig) and the internal DPDK port number.
> 
> Regards,
> Rami  Rosen
> 
> 
> 
> -----Original Message-----
> From: users [mailto:users-bounces@dpdk.org] On Behalf Of Filip Janiszewski
> Sent: Thursday, April 19, 2018 09:13
> To: users@dpdk.org
> Subject: [dpdk-users] DPDK device name
> 
> Hi,
> 
> Is there any mapping between the port names I see while using 'ifconfig'
> and the port numbers I use normally to handle NIC ports? In other words, is there a way to identify which ports number corresponds to a given linux interface name?
> 
> Thanks
> 
> --
> BR, Filip
> +48 666 369 823

Short answer No.

Long answer.
DPDK devices can be virtual, shared, or connected to a bus. Most devices are connected
to Pci bus and must be unbound and rebound to use DPDK userspace i/o. The PCI address
is the underlying value used by DPDK. You can find the value via sysfs 
/sys/class/net/ethN/device (reliable) or ethtool (works for most devices). But once
device is unbound from the kernel driver, it no longer has a kernel assigned name.

DPDK port numbers are assigned in order, so if multiple devices are used by DPDK
they are seen in lexical order as PCI scanning occurs.

It is also possible to use KNI to get a kernel network interface for a DPDK
port.

Lots of options.