DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Rosen, Rami" <rami.rosen@intel.com>
To: santhosh K.S <santhoshachar08@gmail.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Accessing "device_id" from "rte_pci_device"
Date: Tue, 24 Jul 2018 19:22:58 +0000	[thread overview]
Message-ID: <9B0331B6EBBD0E4684FBFAEDA55776F9673376EC@HASMSX110.ger.corp.intel.com> (raw)
In-Reply-To: <CAHJickZAooHhYASeZM5naa0ixAUb6U3JuiwpaL+YaWS4=UsgUg@mail.gmail.com>

Hi, Santosh,

Indeed the following patch from Ferruh removed the 
rte_pci_device from the rte_eth_dev_info object, and instead added an 
object of rte_device:

http://patchwork.dpdk.org/patch/37654/

However, I see that the date that this patch was applied to dpdk-next-net/master is 
4/10/2018. Are you absolutely sure the patch is applied in dpdk-17.11? I checked in 17.11.3 (stable), and I do 
see struct rte_pci_device *pci_dev in struct rte_eth_dev_info.

It seems to me that the following snippet of code from DPDK-18.05 can do 
what you want:
dpdk-18.05/examples/ethtool/lib/rte_ethtool.c:
rte_ethtool_get_drvinfo()
{
....
	const struct rte_pci_device *pci_dev;
	...

       if (dev_info.device)
                bus = rte_bus_find_by_device(dev_info.device);
        if (bus && !strcmp(bus->name, "pci")) {
                pci_dev = RTE_DEV_TO_PCI(dev_info.device);
                snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info),
                        "%04x:%02x:%02x.%x",
                        pci_dev->addr.domain, pci_dev->addr.bus,
                        pci_dev->addr.devid, pci_dev->addr.function);
        } else {
                        pci_dev->addr.devid, pci_dev->addr.function);

Regards,
Rami Rosen
Intel 


-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of santhosh K.S
Sent: Tuesday, July 24, 2018 13:10
To: dev@dpdk.org
Subject: [dpdk-dev] Accessing "device_id" from "rte_pci_device"

Hi,

I'm currently trying to migrate our old DPDK 16.11 version to 17.11 release.

For this activity, I'm able to build the 17.11 DPDK successfully. When I try to use the new libs, I noticed that few of the struct members which we are using in our code is moved to some other struct.

In the 16.11 version we were using "*rte_eth_dev_info_get*" API to get the device_id information using "*rte_pci_device*" struct which was initialized inside the rte_eth_dev_info_get() API.

But now in 17.11 "*rte_pci_device" pointer * is not initialized inside the
ret_eth_dev_inf_get() API, that is because rte_pic_device is no longer a member of the struct "*rte_eth_dev*". Hence I'm not able to retrive the device_id from "*pci_dev->id.device_id*"

Can anyone please point me to an example code which illustrates the same?

I've already googled and got this link
<http://doc.dpdk.org/api-17.11/examples_2ethtool_2lib_2rte_ethtool_8c-example.html#a5>.
Which unfortunately doesn't show how to extract the *device_id*.

Best Regards,
Santy

  reply	other threads:[~2018-07-24 19:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 10:09 santhosh K.S
2018-07-24 19:22 ` Rosen, Rami [this message]
     [not found]   ` <CAHJickaT+gCoJ_O=jjwfyr8Hnm3PF60zt7fWpfChOm6p0yvhjg@mail.gmail.com>
     [not found]     ` <CAHJickYNGDAe=pNBhdqNykns0NUD6k0xjTvjTx0sKQLVaVnWyA@mail.gmail.com>
2018-07-25  6:40       ` Rosen, Rami
2018-07-25 10:28         ` santhosh K.S
2018-07-25 11:21           ` Rosen, Rami

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=9B0331B6EBBD0E4684FBFAEDA55776F9673376EC@HASMSX110.ger.corp.intel.com \
    --to=rami.rosen@intel.com \
    --cc=dev@dpdk.org \
    --cc=santhoshachar08@gmail.com \
    /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).