* [dpdk-dev] Accessing "device_id" from "rte_pci_device"
@ 2018-07-24 10:09 santhosh K.S
2018-07-24 19:22 ` Rosen, Rami
0 siblings, 1 reply; 5+ messages in thread
From: santhosh K.S @ 2018-07-24 10:09 UTC (permalink / raw)
To: dev
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Accessing "device_id" from "rte_pci_device"
2018-07-24 10:09 [dpdk-dev] Accessing "device_id" from "rte_pci_device" santhosh K.S
@ 2018-07-24 19:22 ` Rosen, Rami
[not found] ` <CAHJickaT+gCoJ_O=jjwfyr8Hnm3PF60zt7fWpfChOm6p0yvhjg@mail.gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Rosen, Rami @ 2018-07-24 19:22 UTC (permalink / raw)
To: santhosh K.S, dev
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Accessing "device_id" from "rte_pci_device"
[not found] ` <CAHJickYNGDAe=pNBhdqNykns0NUD6k0xjTvjTx0sKQLVaVnWyA@mail.gmail.com>
@ 2018-07-25 6:40 ` Rosen, Rami
2018-07-25 10:28 ` santhosh K.S
0 siblings, 1 reply; 5+ messages in thread
From: Rosen, Rami @ 2018-07-25 6:40 UTC (permalink / raw)
To: santhosh K.S; +Cc: dev
Hi Santhos.
>There is no member named "device" in "rte_eth_dev_info" struct. I looked at both 17.11 API documentation<http://doc.dpdk.org/api-17.11/structrte__eth__dev__info.html> and 18.05 API documentation<http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html>.
This is not accurate. There is no “device” in rte_eth_dev_info
In 17.11, but there is a “device” in rte_eth_dev_info
in 18.05 (this is exactly what Ferru pathc did)
See for example:
http://doc.dpdk.org/api-18.05/rte__ethdev_8h_source.html
and look for the first member of rte_eth_dev_info:
truct rte_eth_dev_info<http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html> {
1055 struct rte_device<http://doc.dpdk.org/api-18.05/structrte__device.html> *device;
(Or download 18.05 and look in the header file)
It seems that the 18.05 API documentation<http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html> is not complete,
should be fixed.
Regards,
Rami Rosen
Intel Corporation
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Accessing "device_id" from "rte_pci_device"
2018-07-25 6:40 ` Rosen, Rami
@ 2018-07-25 10:28 ` santhosh K.S
2018-07-25 11:21 ` Rosen, Rami
0 siblings, 1 reply; 5+ messages in thread
From: santhosh K.S @ 2018-07-25 10:28 UTC (permalink / raw)
To: rami.rosen; +Cc: dev
Hi Rami Rosen, et al,
Thanks for the response. Yes I can see in the code that rte_device struct
is part of rte_eth_dev_info. I tried to apply the patch you pointed o
<http://patchwork.dpdk.org/patch/37654/>n 17.11.3. But it failed at many
places. We don't want to migrate to 18.05 as it is not a stable release.
I've been asked to migrate to a stable version only. I also noticed from
the release note
<https://doc.dpdk.org/guides-18.05/rel_notes/release_18_05.html> that
*rte_ctrlmbuf_init()
API *is deprecated in 18.05. Which results in breaking our code, which
means more re-work; which we are trying our best to avoid at this point in
time. Hence We are not interested in migrating to 18.05. Can you please
suggest a safer alternative patch, which I can use to get around this
problem?
Best Regards,
Santhosh K S
On Wed, Jul 25, 2018 at 12:11 PM Rosen, Rami <rami.rosen@intel.com> wrote:
> Hi Santhos.
>
>
>
> >There is no member named "*device*" in "*rte_eth_dev_info*" struct. I
> looked at both 17.11 API documentation
> <http://doc.dpdk.org/api-17.11/structrte__eth__dev__info.html> and 18.05
> API documentation
> <http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html>.
>
>
>
> This is not accurate. There is no “device” in rte_eth_dev_info
>
> In 17.11, but there is a “device” in rte_eth_dev_info
>
> in 18.05 (this is exactly what Ferru pathc did)
>
> See for example:
>
> http://doc.dpdk.org/api-18.05/rte__ethdev_8h_source.html
>
>
>
> and look for the first member of rte_eth_dev_info:
>
>
>
> truct rte_eth_dev_info
> <http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html> {
>
> 1055 struct rte_device
> <http://doc.dpdk.org/api-18.05/structrte__device.html> *device;
>
>
>
> (Or download 18.05 and look in the header file)
>
>
>
> It seems that the 18.05 API documentation
> <http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html> is not
> complete,
>
> should be fixed.
>
>
>
> Regards,
>
> Rami Rosen
>
> Intel Corporation
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] Accessing "device_id" from "rte_pci_device"
2018-07-25 10:28 ` santhosh K.S
@ 2018-07-25 11:21 ` Rosen, Rami
0 siblings, 0 replies; 5+ messages in thread
From: Rosen, Rami @ 2018-07-25 11:21 UTC (permalink / raw)
To: santhosh K.S; +Cc: dev
Hi Santosh,
My personal opinion is:
Look at the patch in
http://patchwork.dpdk.org/patch/37654/
Three lines were changes in rte_ethdev.c and rte_ethdev.h:
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 2 +-
Take these changes as a basis, and add everything else which
is mandatory. To reduce the work, you can disable build of
unneeded PMD or apps (by editing build/.config), if it is an option for you.
Hope this sounds reasonable.
Regards,
Rami Rosen
From: santhosh K.S [mailto:santhoshachar08@gmail.com]
Sent: Wednesday, July 25, 2018 13:28
To: Rosen, Rami <rami.rosen@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] Accessing "device_id" from "rte_pci_device"
Hi Rami Rosen, et al,
Thanks for the response. Yes I can see in the code that rte_device struct is part of rte_eth_dev_info. I tried to apply the patch you pointed o<%20http:/patchwork.dpdk.org/patch/37654/>n 17.11.3. But it failed at many places. We don't want to migrate to 18.05 as it is not a stable release. I've been asked to migrate to a stable version only. I also noticed from the release note<https://doc.dpdk.org/guides-18.05/rel_notes/release_18_05.html> that rte_ctrlmbuf_init() API is deprecated in 18.05. Which results in breaking our code, which means more re-work; which we are trying our best to avoid at this point in time. Hence We are not interested in migrating to 18.05. Can you please suggest a safer alternative patch, which I can use to get around this problem?
Best Regards,
Santhosh K S
On Wed, Jul 25, 2018 at 12:11 PM Rosen, Rami <rami.rosen@intel.com<mailto:rami.rosen@intel.com>> wrote:
Hi Santhos.
>There is no member named "device" in "rte_eth_dev_info" struct. I looked at both 17.11 API documentation<http://doc.dpdk.org/api-17.11/structrte__eth__dev__info.html> and 18.05 API documentation<http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html>.
This is not accurate. There is no “device” in rte_eth_dev_info
In 17.11, but there is a “device” in rte_eth_dev_info
in 18.05 (this is exactly what Ferru pathc did)
See for example:
http://doc.dpdk.org/api-18.05/rte__ethdev_8h_source.html
and look for the first member of rte_eth_dev_info:
truct rte_eth_dev_info<http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html> {
1055 struct rte_device<http://doc.dpdk.org/api-18.05/structrte__device.html> *device;
(Or download 18.05 and look in the header file)
It seems that the 18.05 API documentation<http://doc.dpdk.org/api-18.05/structrte__eth__dev__info.html> is not complete,
should be fixed.
Regards,
Rami Rosen
Intel Corporation
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-25 11:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24 10:09 [dpdk-dev] Accessing "device_id" from "rte_pci_device" santhosh K.S
2018-07-24 19:22 ` Rosen, Rami
[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
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).