From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D5892A0506 for ; Mon, 4 Apr 2022 12:29:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F77042826; Mon, 4 Apr 2022 12:29:22 +0200 (CEST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id 667AA4014F for ; Thu, 31 Mar 2022 15:20:45 +0200 (CEST) Received: by mail-lf1-f48.google.com with SMTP id bu29so41578758lfb.0 for ; Thu, 31 Mar 2022 06:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=NV+jgROzwbUhAaA7Z1xusKx4iZgwP408+klx7dzXxao=; b=hZpLFC+icZZiPEwvZW7K1GVt/yTUJxl1XK+aHyGWgeN0HYfoBdkmfm5D1sAykHy/Ni BbQud4JerbaiesTrdyaAn255M/YhthJlHolkI1u/SlpU3LnjZFjknDgBkffqahd/uaWi /jEXNk46ILQOjkNJSdpdDiH6iSycXTBTKyHclQJvrYVJN+Tg/+tNKrTWG0k/gF+I7mpR wBTBo6rjBeVFnSyWZQnHIYzBD0ANxax8cvVbYvTphteHa71Dn5b8hIJOxjOFsxI56HC1 4RV+S1M3sH9iHbe9wxtdvOU8Pyx7gi+S+LfsHeSTmDvVpjJ0fV1/C3SVkZm6HG1JSgmg VRUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=NV+jgROzwbUhAaA7Z1xusKx4iZgwP408+klx7dzXxao=; b=kBkXwN5dDguwKgtw5WEjqnozqz5X+q/E74lK5erxdFzs0Bzw+UaIiIxzJbYh7pJU7/ sYZWx4ooHgloIljkiZad0S9AesaFQ0rMbJZKWt7FhtgY49QJ0g6fK25RxdgrluuCuZfD PVD6YsIS8FE1NCm4ZOOMwqrjRX5mFNUqQmCGPpd23poaSZjXscsmtMviVcamZDYTkYBV oqbcqzLN5H/kZuA8Jc+3NQYEYNY39BD0L1yVUSbuAfLPPiBz76lnsflAG3T3Nb3tNpiZ IubquhqcjSjSnNoJzisbnPdq6xwHPNr/bykTeWjvbnXEK9+RSQZWSc0nsGSNRomijlZ9 YrxQ== X-Gm-Message-State: AOAM531TURnOTq0+thbiHiNd5vFLVdatBMhIffb3lCbn8zfn3WAL8M44 +t4EoYpNU9YdBNtFN1a2C8M= X-Google-Smtp-Source: ABdhPJyHhNYlSEpAbyfbbxJ2fBHi3scKE6X+pmPxyoux3g/VbWEUMzI4bdNjaOsdsqrZjHYfA+rqTA== X-Received: by 2002:a05:6512:318a:b0:44a:4dab:4cd2 with SMTP id i10-20020a056512318a00b0044a4dab4cd2mr10910856lfe.606.1648732844642; Thu, 31 Mar 2022 06:20:44 -0700 (PDT) Received: from [192.168.1.44] (141.244.226.109.ip.orionnet.ru. [109.226.244.141]) by smtp.gmail.com with ESMTPSA id x14-20020a05651c104e00b0024afde54b6dsm59689ljm.119.2022.03.31.06.20.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 06:20:44 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------oxd3f2NTt68HS04aTMnrNlwl" Message-ID: Date: Thu, 31 Mar 2022 20:20:41 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: NIC is unavailable in DPDK application Content-Language: en-US To: =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0KHRgtC10L/QsNC90L7Qsg==?= Cc: users@dpdk.org References: From: Danil Onishchenko In-Reply-To: X-Mailman-Approved-At: Mon, 04 Apr 2022 12:29:19 +0200 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org This is a multi-part message in MIME format. --------------oxd3f2NTt68HS04aTMnrNlwl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 > : > > 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? > --------------oxd3f2NTt68HS04aTMnrNlwl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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?

--------------oxd3f2NTt68HS04aTMnrNlwl--