[ovs-dev] netdev_open and dpdk

Safka, JaroslavX jaroslavx.safka at intel.com
Mon Jan 11 14:12:08 UTC 2016


Hi all,
I have question regarding function netdev_open and dpdk.

I’m trying to get stats from dpdk interface by:
My example code:

    struct netdev_stats stats;
    const char *mtype = "dpdk";
    struct netdev *dev = 0;

    if(0 != netdev_open("dpdk0", mtype, &dev)) {
        printf("****port open failed\n");
    } else {
        int ret = netdev_get_stats(dev, &stats);
        if(0 != ret) {
            printf("Failed to get stats from device\n");
        } else {
            printf("Get stats success!");
        }
        netdev_close(dev);

which lead to error:
2016-01-11T13:43:39Z|00001|netdev|WARN|could not create netdev dpdk0 of unknown type dpdk
****port open failed

Also when I enum the types by:

   struct sset types;
    const char *type;
    sset_init(&types);
    netdev_enumerate_types(&types);
    SSET_FOR_EACH (type, &types) {
      printf("Enumerated type: %s\n", type);
    }
    sset_destroy(&types);
Then there is no “dpdk” type.
** BUT **
When I run command
---
utilities]# ./ovs-vsctl show
   Bridge "br-enp9s0f0"
        Port "phy-br-enp9s0f0"
            Interface "phy-br-enp9s0f0"
                type: patch
                options: {peer="int-br-enp9s0f0"}
        Port "br-enp9s0f0"
            Interface "br-enp9s0f0"
                type: internal
        Port "dpdk0"
            Interface "dpdk0"
                type: dpdk
---

I tried to put my code directly into ovs-vsctl, but with the same error result.
I’m quite lost what I’m doing wrong.

Can somebody please point me what I’m doing wrong? Or how I can get stats from OVS using dpdk?
(I only found API directly in DPDK, but this is not preferred way)

Thanks for any help
And have a nice day ☺
Jarek


--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.


More information about the dev mailing list