DPDK usage discussions
 help / color / mirror / Atom feed
* NIC is unavailable in DPDK application
@ 2022-03-28 14:18 Danil Onishchenko
  2022-03-29  8:43 ` Дмитрий Степанов
  0 siblings, 1 reply; 3+ messages in thread
From: Danil Onishchenko @ 2022-03-28 14:18 UTC (permalink / raw)
  To: users

Hello,

I'm studying DPDK and trying to create a simple application, however it 
can't see a NIC bound to DPDK.

1. Here is a list of network devices I have on my machine

$ dpdk-devbind.py --status-dev net

Network devices using kernel driver
===================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 
8168' if=enp1s0 drv=r8169 unused=vfio-pci *Active*
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 
drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*

2. I disable my ethernet NIC (it can't be bound to DPDK while it is 
active) and bind it to vfio-pci driver successfully

$ ip link set enp1s0 down
$ dpdk-devbind.py -b vfio-pci enp1s0

3. Now dpdk-devbind.py shows that the NIC is using DPDK-compatible driver

$ dpdk-devbind.py --status-dev net

Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 
8168' drv=vfio-pci unused=r8169

Network devices using kernel driver
===================================
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 
drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*

4. However when I run any example DPDK application it says that there 
are no available NIC ports. For instance I wrote a simple application

int main(int argc, char *argv[])
{
     int ret;
     int total_ports, avail_ports;

     ret = rte_eal_init(argc, argv);
     if( ret < 0 )
         rte_exit(EXIT_FAILURE, "EAL initialization failed\n");

     total_ports = rte_eth_dev_count_total();
     avail_ports = rte_eth_dev_count_avail();
     printf("ETH PORTS %d %d\n", total_ports, avail_ports);

     rte_eal_cleanup();

     return 0;
}

and both rte_eth_dev_count_total() and rte_eth_dev_count_avail() return 0.

What am I doing wrong?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NIC is unavailable in DPDK application
  2022-03-28 14:18 NIC is unavailable in DPDK application Danil Onishchenko
@ 2022-03-29  8:43 ` Дмитрий Степанов
  2022-03-31 13:20   ` Danil Onishchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Дмитрий Степанов @ 2022-03-29  8:43 UTC (permalink / raw)
  To: Danil Onishchenko; +Cc: users

[-- Attachment #1: Type: text/plain, Size: 2528 bytes --]

Hey!
Realtek NICs are not supported by DPDK.
You can check the list of supported HW here -
https://core.dpdk.org/supported/
As a workaround you can setup virtual machine (e.g. using KVM) with virtual
NIC which is supported by DPDK (e.g. vmxnet3)

BTW: here is an article where someone tried to write his own PMD for
Realtek NIC -
https://medium.com/powerof2/writing-a-pmd-for-dpdk-56e6388467a8



вт, 29 мар. 2022 г. в 11:21, Danil Onishchenko <
danil.onishchenko.info@gmail.com>:

> Hello,
>
> I'm studying DPDK and trying to create a simple application, however it
> can't see a NIC bound to DPDK.
>
> 1. Here is a list of network devices I have on my machine
>
> $ dpdk-devbind.py --status-dev net
>
> Network devices using kernel driver
> ===================================
> 0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
> 8168' if=enp1s0 drv=r8169 unused=vfio-pci *Active*
> 0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0
> drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
>
> 2. I disable my ethernet NIC (it can't be bound to DPDK while it is
> active) and bind it to vfio-pci driver successfully
>
> $ ip link set enp1s0 down
> $ dpdk-devbind.py -b vfio-pci enp1s0
>
> 3. Now dpdk-devbind.py shows that the NIC is using DPDK-compatible driver
>
> $ dpdk-devbind.py --status-dev net
>
> Network devices using DPDK-compatible driver
> ============================================
> 0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
> 8168' drv=vfio-pci unused=r8169
>
> Network devices using kernel driver
> ===================================
> 0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0
> drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
>
> 4. However when I run any example DPDK application it says that there
> are no available NIC ports. For instance I wrote a simple application
>
> int main(int argc, char *argv[])
> {
>      int ret;
>      int total_ports, avail_ports;
>
>      ret = rte_eal_init(argc, argv);
>      if( ret < 0 )
>          rte_exit(EXIT_FAILURE, "EAL initialization failed\n");
>
>      total_ports = rte_eth_dev_count_total();
>      avail_ports = rte_eth_dev_count_avail();
>      printf("ETH PORTS %d %d\n", total_ports, avail_ports);
>
>      rte_eal_cleanup();
>
>      return 0;
> }
>
> and both rte_eth_dev_count_total() and rte_eth_dev_count_avail() return 0.
>
> What am I doing wrong?
>
>

[-- Attachment #2: Type: text/html, Size: 3268 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NIC is unavailable in DPDK application
  2022-03-29  8:43 ` Дмитрий Степанов
@ 2022-03-31 13:20   ` Danil Onishchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Danil Onishchenko @ 2022-03-31 13:20 UTC (permalink / raw)
  To: Дмитрий
	Степанов
  Cc: users

[-- Attachment #1: Type: text/plain, Size: 2807 bytes --]

Thank you for your reply!

On 29.03.2022 15:43, Дмитрий Степанов wrote:
> Hey!
> Realtek NICs are not supported by DPDK.
> You can check the list of supported HW here - 
> https://core.dpdk.org/supported/
> As a workaround you can setup virtual machine (e.g. using KVM) with 
> virtual NIC which is supported by DPDK (e.g. vmxnet3)
>
> BTW: here is an article where someone tried to write his own PMD for 
> Realtek NIC - 
> https://medium.com/powerof2/writing-a-pmd-for-dpdk-56e6388467a8
>
>
>
> вт, 29 мар. 2022 г. в 11:21, Danil Onishchenko 
> <danil.onishchenko.info@gmail.com>:
>
>     Hello,
>
>     I'm studying DPDK and trying to create a simple application,
>     however it
>     can't see a NIC bound to DPDK.
>
>     1. Here is a list of network devices I have on my machine
>
>     $ dpdk-devbind.py --status-dev net
>
>     Network devices using kernel driver
>     ===================================
>     0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet
>     Controller
>     8168' if=enp1s0 drv=r8169 unused=vfio-pci *Active*
>     0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0
>     drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
>
>     2. I disable my ethernet NIC (it can't be bound to DPDK while it is
>     active) and bind it to vfio-pci driver successfully
>
>     $ ip link set enp1s0 down
>     $ dpdk-devbind.py -b vfio-pci enp1s0
>
>     3. Now dpdk-devbind.py shows that the NIC is using DPDK-compatible
>     driver
>
>     $ dpdk-devbind.py --status-dev net
>
>     Network devices using DPDK-compatible driver
>     ============================================
>     0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet
>     Controller
>     8168' drv=vfio-pci unused=r8169
>
>     Network devices using kernel driver
>     ===================================
>     0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0
>     drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
>
>     4. However when I run any example DPDK application it says that there
>     are no available NIC ports. For instance I wrote a simple application
>
>     int main(int argc, char *argv[])
>     {
>          int ret;
>          int total_ports, avail_ports;
>
>          ret = rte_eal_init(argc, argv);
>          if( ret < 0 )
>              rte_exit(EXIT_FAILURE, "EAL initialization failed\n");
>
>          total_ports = rte_eth_dev_count_total();
>          avail_ports = rte_eth_dev_count_avail();
>          printf("ETH PORTS %d %d\n", total_ports, avail_ports);
>
>          rte_eal_cleanup();
>
>          return 0;
>     }
>
>     and both rte_eth_dev_count_total() and rte_eth_dev_count_avail()
>     return 0.
>
>     What am I doing wrong?
>

[-- Attachment #2: Type: text/html, Size: 4780 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-04 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 14:18 NIC is unavailable in DPDK application Danil Onishchenko
2022-03-29  8:43 ` Дмитрий Степанов
2022-03-31 13:20   ` Danil Onishchenko

DPDK usage discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git