国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 操作系統 > 正文

DPDK helloworld

2024-06-28 13:27:10
字體:
來源:轉載
供稿:網友
DPDK helloworld

環境搭建:

手頭沒有intel的板子,暫時只能用虛擬機代替;

image

虛擬機的CPU數量不能超過真實的機器,因此暫時無法模擬出NUMA的環境;

dpdk需要至少兩塊網卡,eth0和eth1用于dpdk使用,eth2用于跟主機通信;

打開虛擬機的配置文件, xxx.vmx,把所有網卡都設置成e1000

ethernet0.PResent = "TRUE"ethernet0.connectionType = "hostonly"ethernet0.wakeOnPcktRcv = "FALSE"ethernet0.addressType = "static"ethernet0.virtualDev = "e1000"ethernet1.present = "TRUE"ethernet1.connectionType = "hostonly"ethernet1.wakeOnPcktRcv = "FALSE"ethernet1.addressType = "static"ethernet1.virtualDev = "e1000"ethernet2.present = "TRUE"ethernet2.connectionType = "nat"ethernet2.wakeOnPcktRcv = "FALSE"ethernet2.addressType = "static"ethernet2.virtualDev = "e1000"

下載dpdk源碼

git clone git://dpdk.org/dpdk

設置環境變量

export RTE_SDK=/root/dpdkexport RTE_TARGET=i686-default-linuxapp-gccexport EXTRA_CFLAGS="-O0 -g"

由于是32位機器,設置target為i686;更多target可以參考intel-dpdk-getting-started-guide

其中EXTRA_CFLAGS把編譯優化去掉,并加上調試信息;

編譯代碼

make config T=i686-default-linuxapp-gccmake install T=i686-default-linuxapp-gccmake -C i686-default-linuxapp-gccmake -C examples/helloworld

預留hugepage個數,并掛載

echo 128 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepagesmount -t hugetlbfs nodev /mnt/huge

加載uio和igb_uio

modprobe uioinsmod ./build/kmod/igb_uio.ko

綁定設備

./tools/igb_uio_bind.py --bind=igb_uio eth0./tools/igb_uio_bind.py --bind=igb_uio eth1

如果需要解綁定,后面的bus:slot.func各種設備不一樣

./tools/igb_uio_bind.py --unbind 02:01.0./tools/igb_uio_bind.py --unbind 02:02.0./tools/igb_uio_bind.py --bind=e1000 02:01.0./tools/igb_uio_bind.py --bind=e1000 02:02.0

最后就可以運行helloworld

root@bogon:~/dpdk# ./examples/helloworld/build/helloworld -c 0xf -n 2EAL: Cannot read numa node link for lcore 0 - using physical package id insteadEAL: Detected lcore 0 as core 0 on socket 0EAL: Cannot read numa node link for lcore 1 - using physical package id insteadEAL: Detected lcore 1 as core 1 on socket 0EAL: Cannot read numa node link for lcore 2 - using physical package id insteadEAL: Detected lcore 2 as core 0 on socket 1EAL: Cannot read numa node link for lcore 3 - using physical package id insteadEAL: Detected lcore 3 as core 1 on socket 1EAL: Skip lcore 4 (not detected)EAL: Skip lcore 5 (not detected)EAL: Skip lcore 6 (not detected)EAL: Skip lcore 7 (not detected)EAL: Skip lcore 8 (not detected)EAL: Skip lcore 9 (not detected)EAL: Skip lcore 10 (not detected)EAL: Skip lcore 11 (not detected)EAL: Skip lcore 12 (not detected)EAL: Skip lcore 13 (not detected)EAL: Skip lcore 14 (not detected)EAL: Skip lcore 15 (not detected)EAL: Skip lcore 16 (not detected)EAL: Skip lcore 17 (not detected)EAL: Skip lcore 18 (not detected)EAL: Skip lcore 19 (not detected)EAL: Skip lcore 20 (not detected)EAL: Skip lcore 21 (not detected)EAL: Skip lcore 22 (not detected)EAL: Skip lcore 23 (not detected)EAL: Skip lcore 24 (not detected)EAL: Skip lcore 25 (not detected)EAL: Skip lcore 26 (not detected)EAL: Skip lcore 27 (not detected)EAL: Skip lcore 28 (not detected)EAL: Skip lcore 29 (not detected)EAL: Skip lcore 30 (not detected)EAL: Skip lcore 31 (not detected)EAL: Skip lcore 32 (not detected)EAL: Skip lcore 33 (not detected)EAL: Skip lcore 34 (not detected)EAL: Skip lcore 35 (not detected)EAL: Skip lcore 36 (not detected)EAL: Skip lcore 37 (not detected)EAL: Skip lcore 38 (not detected)EAL: Skip lcore 39 (not detected)EAL: Skip lcore 40 (not detected)EAL: Skip lcore 41 (not detected)EAL: Skip lcore 42 (not detected)EAL: Skip lcore 43 (not detected)EAL: Skip lcore 44 (not detected)EAL: Skip lcore 45 (not detected)EAL: Skip lcore 46 (not detected)EAL: Skip lcore 47 (not detected)EAL: Skip lcore 48 (not detected)EAL: Skip lcore 49 (not detected)EAL: Skip lcore 50 (not detected)EAL: Skip lcore 51 (not detected)EAL: Skip lcore 52 (not detected)EAL: Skip lcore 53 (not detected)EAL: Skip lcore 54 (not detected)EAL: Skip lcore 55 (not detected)EAL: Skip lcore 56 (not detected)EAL: Skip lcore 57 (not detected)EAL: Skip lcore 58 (not detected)EAL: Skip lcore 59 (not detected)EAL: Skip lcore 60 (not detected)EAL: Skip lcore 61 (not detected)EAL: Skip lcore 62 (not detected)EAL: Skip lcore 63 (not detected)EAL: Setting up memory...EAL: cannot open /proc/self/numa_maps, consider that all memory is in socket_id 0EAL: Ask a virtual area of 0xe800000 bytesEAL: Virtual area found at 0xa8400000 (size = 0xe800000)EAL: Ask a virtual area of 0x200000 bytesEAL: Virtual area found at 0xa8000000 (size = 0x200000)EAL: Ask a virtual area of 0x400000 bytesEAL: Virtual area found at 0xa7a00000 (size = 0x400000)EAL: Ask a virtual area of 0x200000 bytesEAL: Virtual area found at 0xa7600000 (size = 0x200000)EAL: Ask a virtual area of 0xc00000 bytesEAL: Virtual area found at 0xa6800000 (size = 0xc00000)EAL: Ask a virtual area of 0x200000 bytesEAL: Virtual area found at 0xa6400000 (size = 0x200000)EAL: Ask a virtual area of 0x200000 bytesEAL: Virtual area found at 0xa6000000 (size = 0x200000)EAL: Requesting 128 pages of size 2MB from socket 0EAL: TSC frequency is ~2660068 KHzEAL: Master core 0 is ready (tid=b7599800)EAL: Core 1 is ready (tid=a5fffb40)EAL: Core 2 is ready (tid=a57feb40)EAL: Core 3 is ready (tid=a4ffdb40)hello from core 1hello from core 3hello from core 2hello from core 0

后面就可以用gdb調試了


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 屯留县| 西丰县| 莎车县| 灌云县| 东宁县| 罗源县| 玉山县| 民县| 凤阳县| 汾西县| 建德市| 古丈县| 塔河县| 馆陶县| 鄄城县| 南郑县| 阿拉善右旗| 炉霍县| 视频| 通河县| 合作市| 礼泉县| 镇康县| 思茅市| 电白县| 大邑县| 永嘉县| 安龙县| 新田县| 包头市| 定西市| 余干县| 蒲江县| 大厂| 蒙自县| 靖边县| 襄城县| 伊金霍洛旗| 昌图县| 宜良县| 临颍县|