dpdk初识

dpdk需要至少两块网卡,eth0和eth1

eth0用于dpdk使用,eth1用于跟主机通信;

编译dpdk的时候需要设置变量:

export RTE_SDK= 
export RTE_TARGET=  
export EXTRA_CFLAGS="-O0 -g"
其中EXTRA_CFLAGS把编译优化去掉,并加上调试信息;

预留hugepage个数,并挂载

echo 128 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

mount -t hugetlbfs nodev /mnt/huge

加载uio和igb_uio

modprobe uio
insmod ./build/kmod/igb_uio.ko

绑定设备

./tools/igb_uio_bind.py --bind=igb_uio eth0 
解绑定:

./tools/igb_uio_bind.py --unbind 02:02.0

hellworld的运行结果:

./examples/helloworld/build/helloworld -c 0xf -n 2

EAL: Cannot read numa node link for lcore 0 - using physical package id instead
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Cannot read numa node link for lcore 1 - using physical package id instead
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Cannot read numa node link for lcore 2 - using physical package id instead
EAL: Detected lcore 2 as core 0 on socket 1
EAL: Cannot read numa node link for lcore 3 - using physical package id instead
EAL: Detected lcore 3 as core 1 on socket 1
EAL: 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 0
EAL: Ask a virtual area of 0xe800000 bytes
EAL: Virtual area found at 0xa8400000 (size = 0xe800000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0xa8000000 (size = 0x200000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0xa7a00000 (size = 0x400000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0xa7600000 (size = 0x200000)
EAL: Ask a virtual area of 0xc00000 bytes
EAL: Virtual area found at 0xa6800000 (size = 0xc00000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0xa6400000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0xa6000000 (size = 0x200000)
EAL: Requesting 128 pages of size 2MB from socket 0
EAL: TSC frequency is ~2660068 KHz
EAL: 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 1
hello from core 3
hello from core 2
hello from core 0

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值