Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install dpdk in vmware virtual machine

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to install dpdk in the vmware virtual machine". In the daily operation, I believe that many people have doubts about how to install dpdk in the vmware virtual machine. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "how to install dpdk in the vmware virtual machine". Next, please follow the editor to study!

1. Open vmware, select the centos7.6 image, and start installing the operating system

two。 After installation, turn off the computer, click the "Edit Virtual Machine Settings" button, click "processor", and check the third "Virtualization IOMMU" on the right. Since my host is win11 and Intel VT-x is already supported, there is no need to check the first option. Win7 and win10 may need to be checked.

In addition, I added a few more network adapters for testing.

Note that if the first option is checked:

Error starting virtual machine times:.

You need to uncheck the first one.

3. Edit this virtual machine configuration file CentOS 7 64-bit .vmx (open using notepad), (the new virtual machine configuration file I created is located in: d:\ vmware_machine\ machines\ CentOS-dpdk) change the network card driver from e1000 to e1000e, save and start the virtual machine.

4. After startup, check the name of the network card through the ifconfig command, and view / etc/sysconfig/network-scripts/ifcfg-* the corresponding network card file to ensure that the file name and the name of the network card in the file content are the same as the name of the network card viewed by the ifconfig command. If it is inconsistent, you need to manually modify and restart the network card:

5. Install python3.9, the specific installation method is not written, you can install it yourself.

Wget https://repo.huaweicloud.com/python/3.9.10/Python-3.9.10.tgz tar-zxf Python-3.9.10.tgz cd Python-3.9.10. / configure-- prefix=/usr/local/python3-- with-ssl make & & make install ln-s / usr/local/python3/bin/python3 / usr/bin/ ln-s / usr/local/python3/bin/pip3 / usr/bin/

6. After python3.9 is installed, there will be a pip3 command to install meson and ninja through pip (later versions of dpdk20.11 need to be compiled and installed by meson+ninja)

Pip3 install mesonpip3 install ninjaln-s / usr/local/python3/bin/meson / usr/bin/ln-s / usr/local/python3/bin/ninja / usr/bin/

7. To install dpdk, I downloaded version 20.11.4

Cd / home/wget https://fast.dpdk.org/rel/dpdk-20.11.4.tar.xzxz-d dpdk-20.11.4.tar.xztar-xf dpdk-20.11.4.tarcd dpdk-stable-20.11.4/meson. / dpdk_buildcd.. / dpdk_build/meson configure-Dbuildtype=debug-Dexamples=l3fwd-graphninjaninja installldconfigecho "/ usr/local/lib64/" > > / etc/ld.so.conf.d/dpdk.conf # add dpdk's lib library to the System path ldconfigecho "export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig" > > / etc/profile # set pkg-config path echo "modprobe vfio-pci" > > / etc/profile # load vfio-pci module echo "sysctl-w vm.nr_hugepages=256" > / etc/profile # set large page memory to 256Gsource / etc/profile

8. Verify that the installation is successful, and the output of the picture is considered successful.

Ldconfig-p | grep librte | wc-lldconfig-p | grep librte_graphpkg-config-- variable pc_path pkg-configpkg-config-- modversion libdpdk

9. Use dpdk script to view Nic information

Python3 / home/dpdk-stable-20.11.4/usertools/dpdk-devbind.py-s

Output the following, which is the status of the network card that has not been bound, and write down the bus information of each network card (a string at the beginning of 0000 per line):

10. Bind the network card to dpdk

Python3 / home/dpdk-stable-20.11.4/usertools/dpdk-devbind.py-b vfio-pci 0b:00.0 # indicates binding the network card ens192.

Note that if you output at this time:

You need to shut down the Nic ens192 first:

Execute the binding script again:

If there is no output, the binding is successful.

11. If you look at the binding status information of the network card again, you can see that the binding has been successful.

twelve。 Run the dpdk sample program to verify that dpdk is available

Cp-r / home/dpdk-stable-20.11.4/examples/helloworld/ / home/cd / home/helloworld/make

Execute the helloworl binary file, and the output is as follows:

At this point, the study on "how to install dpdk in the vmware virtual machine" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report