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 AA585A0506 for ; Tue, 29 Mar 2022 10:43:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BC0D41151; Tue, 29 Mar 2022 10:43:54 +0200 (CEST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mails.dpdk.org (Postfix) with ESMTP id BDD2040691 for ; Tue, 29 Mar 2022 10:43:52 +0200 (CEST) Received: by mail-lf1-f45.google.com with SMTP id bu29so29133848lfb.0 for ; Tue, 29 Mar 2022 01:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9dMND55JCleMiLHH4WQnnEv5PdZvnfBOJEpWtcg+Zxo=; b=GKuhmT/dSHr7F+24BqXbu+ettuqIRO18jxdaS/PF0z0Zg5jk/jZ62sI5ZaGOUCGuht f+vK9EBtH4FlQoMcLbV+JdTkMFIdrVJV15rR+yVGUTBiWqwWo5xGDR+7Blw5JEOqz+Oq mrw8QvPnzBeiGWk4hpM4N4qeHrCVtOJg12dJ66sddxV1GX01vnPX3O8+2HgKuf7RGDZO O77Lj0juQpg9+L+pvkThPBtBoR35Sdfukk0mnFLq840NWE1zwDLMHGYuQkejkH4ZfYOE oWigK4Yr4aW4wcVg4M+zIMTkhjWFJIm9hr7izDxJ8N0q93vM2FOMmkKQpb/yNVZJoAoz Spfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9dMND55JCleMiLHH4WQnnEv5PdZvnfBOJEpWtcg+Zxo=; b=OpedjPZWEdovsrSIPohqoOh+AcoIz7+9QUHfGQgtEVUtJDMiNmG1DLjOJ8BP0cTqoQ lLcyvQu+ouFSy8zdhrC2pksRxx2az7CEr1x0Yjrjfm7Kg/VaWIOWrFf0nrSGA6FTcYSl 6VRGerkGOe7Sgut/2BjmqZVhvUahI+DuzPd5xAQzfKYraX1Av6Q5X/dKES+6RzQv/sOJ gImtwoJw8wIOKi2wtf35EaFkYUDOdRvl6vRzmiQZmbfweDZ4X98v7A648O59pTAIojBD j8G0/ejOBbO/Rb4KUt230KyOqy2DTyxiE8ESDhNzwpm7NLx1YSDybXLbFs78yQB9VaCk IbRQ== X-Gm-Message-State: AOAM530m1gytEzZFscGgFAsMHSwipz6hKdIiPxNDozhrl5PLWfkPx/ap FRN8hSZM9i6ljEt06UYv9mqQguyeW4aP0EVTtIk= X-Google-Smtp-Source: ABdhPJztDLUACXUoT71LFftzBvfhOt42IEOYVzsWZWP0l7j+fIrASAFfpYH90DvXCMP+g5KpI2776yFZxMCP4Q4p4g4= X-Received: by 2002:a05:6512:11eb:b0:448:8cd0:7d7e with SMTP id p11-20020a05651211eb00b004488cd07d7emr1634498lfs.593.1648543431991; Tue, 29 Mar 2022 01:43:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0KHRgtC10L/QsNC90L7Qsg==?= Date: Tue, 29 Mar 2022 11:43:40 +0300 Message-ID: Subject: Re: NIC is unavailable in DPDK application To: Danil Onishchenko Cc: users@dpdk.org Content-Type: multipart/alternative; boundary="000000000000a9254905db576d95" 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 --000000000000a9254905db576d95 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =D0=B2=D1=82, 29 =D0=BC=D0=B0=D1=80. 2022 =D0=B3. =D0=B2 11:21, Danil Onish= chenko < 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller > 8168' if=3Denp1s0 drv=3Dr8169 unused=3Dvfio-pci *Active* > 0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=3Dwlp2s0 > drv=3Drtw_8822be unused=3Drtw88_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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller > 8168' drv=3Dvfio-pci unused=3Dr8169 > > Network devices using kernel driver > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=3Dwlp2s0 > drv=3Drtw_8822be unused=3Drtw88_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 =3D rte_eal_init(argc, argv); > if( ret < 0 ) > rte_exit(EXIT_FAILURE, "EAL initialization failed\n"); > > total_ports =3D rte_eth_dev_count_total(); > avail_ports =3D 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? > > --000000000000a9254905db576d95 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey!
Realtek NICs are not supported by DPDK.
You can check the list of supported HW here -=C2=A0 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: her= e is an article where someone tried to write his own PMD for Realtek NIC - = https://medium.com/powerof2/writing-a-pmd-for-dpdk-56e6388467a8
<= div>


=D0=B2=D1=82, 29 =D0=BC=D0=B0=D1=80. 2022 =D0= =B3. =D0=B2 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller=
8168' if=3Denp1s0 drv=3Dr8169 unused=3Dvfio-pci *Active*
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=3Dwl= p2s0
drv=3Drtw_8822be unused=3Drtw88_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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller=
8168' drv=3Dvfio-pci unused=3Dr8169

Network devices using kernel driver
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=3Dwl= p2s0
drv=3Drtw_8822be unused=3Drtw88_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[])
{
=C2=A0=C2=A0=C2=A0=C2=A0 int ret;
=C2=A0=C2=A0=C2=A0=C2=A0 int total_ports, avail_ports;

=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D rte_eal_init(argc, argv);
=C2=A0=C2=A0=C2=A0=C2=A0 if( ret < 0 )
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_exit(EXIT_FAILURE, &qu= ot;EAL initialization failed\n");

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

=C2=A0=C2=A0=C2=A0=C2=A0 rte_eal_cleanup();

=C2=A0=C2=A0=C2=A0=C2=A0 return 0;
}

and both rte_eth_dev_count_total() and rte_eth_dev_count_avail() return 0.<= br>
What am I doing wrong?

--000000000000a9254905db576d95--