DPDK usage discussions
 help / color / mirror / Atom feed
From: Rakesh Venkatesh <rakeshv.com@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] Determining port type using API's
Date: Tue, 19 Jan 2016 15:40:57 -0800	[thread overview]
Message-ID: <CACcw_-ma6Mj+KhzY3XXvVYKVL-Li+2+tO5AyM1ShU954r5yOeQ@mail.gmail.com> (raw)

Hello


I have a VM running in our company lab which has two ports in it named
"int" and "ext" which is binded using dpdk. The port is initialized either
as virtio or sriov mode. My question is how do I determine the port type
using a C program? Are there any dpdk api's which tells me whether its
sriov or virtio based?

Using the shell script I can run "lspci" command and grep for keywords to
identify the port type but I am not finding a simpler way to do this from a
C program. Any help would be appreciated.

If I run "lspci", I get the following output

00:03.0 Ethernet controller: Red Hat, Inc Virtio network device  <<<<<<<<<
virtio based
00:06.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller
Virtual Function (rev 01) <<<<<<<<<sriov based

By running grep command on this output and matching the keywords, I can
identify the port type.

-- 
Thanks and regards

             reply	other threads:[~2016-01-19 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 23:40 Rakesh Venkatesh [this message]
2016-01-20  9:03 ` Van Haaren, Harry

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=CACcw_-ma6Mj+KhzY3XXvVYKVL-Li+2+tO5AyM1ShU954r5yOeQ@mail.gmail.com \
    --to=rakeshv.com@gmail.com \
    --cc=users@dpdk.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).