zoukankan      html  css  js  c++  java
  • DPDK环境搭建及Helloworld样例

    配置虚拟机环境


    • 多张网卡,一张网卡是无法运行DPDK的,至少要两张。
    • 多核CPU,可以在实现多个DPDK逻辑调度核lcore。

    安装DPDK


    1.在DPDK官网下载DPDK的压缩包:http://core.dpdk.org/download, 我下载的是稳定版本18.05.1.
    2.进入root权限,解压下载的安装包到用户目录下。

    tar xJf ddpdk-stable-18.05.1.tar.xz
    cd dpdk-stable-18.05.1/
    

    3.配置环境变量

    make config T=x86_64-native-linuxapp-gcc
    sed -ri 's,(PMD_PCAP=).*,1y,' build/.config
    

    4.安装

    make
    

    运行DPDK


    1.设置环境变量

    export RTE_SDK=/home/liuhy/dpdk-stable-18.05.1/
    export RTE_TARGET=build
    

    2.编译example程序

    make -C examples
    

    3.配置大页表

    mkdir -p /mnt/huge
    mount -t hugetlbfs nodev /mnt/huge
    echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
    

    4.运行helloworld,效果如下:

    root@liuhy-VirtualBox:/home/liuhy/dpdk-stable-18.05.1/examples/helloworld/build# ./helloworld -c f
    EAL: Detected 4 lcore(s)
    EAL: Detected 1 NUMA nodes
    EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
    EAL: Probing VFIO support...
    EAL: PCI device 0000:00:03.0 on NUMA socket -1
    EAL:   Invalid NUMA socket, default to 0
    EAL:   probe driver: 8086:100e net_e1000_em
    EAL: PCI device 0000:00:08.0 on NUMA socket -1
    EAL:   Invalid NUMA socket, default to 0
    EAL:   probe driver: 8086:100e net_e1000_em
    EAL: PCI device 0000:00:09.0 on NUMA socket -1
    EAL:   Invalid NUMA socket, default to 0
    EAL:   probe driver: 8086:100e net_e1000_em
    EAL: PCI device 0000:00:0a.0 on NUMA socket -1
    EAL:   Invalid NUMA socket, default to 0
    EAL:   probe driver: 8086:100e net_e1000_em
    hello from core 1
    hello from core 2
    hello from core 3
    hello from core 0
    
    
  • 相关阅读:
    每日思考(2020/07/13)
    每日思考(2020/07/12)
    每日思考(2020/07/11)
    每日思考(2020/07/10)
    每日思考(2020/07/09)
    每日思考(2020/05/12)
    Apache服务器的下载与安装
    知问前端——验证插件(二)
    知问前端——验证插件(一)
    知问前端——日历UI(三)
  • 原文地址:https://www.cnblogs.com/031602523liu/p/10531970.html
Copyright © 2011-2022 走看看