拥抱开源,分享知识~|

园龄:粉丝:关注:

dpdk-debug

1. download dpdk source and build it

ref: https://core.dpdk.org/doc/quick-start/
meson --buildtype=debug debugbuild

2. Reserve huge pages memory.

mkdir -p /dev/hugepages
mountpoint -q /dev/hugepages || mount -t hugetlbfs nodev /dev/hugepages
echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages

3. construct Sample Topology

This tutorial uses the following topology to carry out the tests.

+ +
| |
| +-----+ |
| | | |
| | | |
| +----------+ | DPDK| +----------+ |
| | left | | App | | right | |
| | namespace| | | |namespace | |
+-----+ A +------+ +-----+ B +--------+
| | | A'| | B' | | |
| | | | | | | |
| +----------+ | | +----------+ |
| | | |
| | | |
| | | |
| +-----+ |
| |
| |
+ +

192.168.0.X n/w 10.0.0.X n/w

A = veth_l1
A' = veth_l0
B = veth_r1
B' = veth_r0

Diagram: Sample Topology for conntrack testing
The steps for creation of the setup are mentioned below.

Create “left” network namespace:

$ ip netns add left
Create “right” network namespace:

$ ip netns add right
Create first pair of veth interfaces:

$ ip link add veth_l0 type veth peer name veth_l1
Add veth_l1 to “left” network namespace:

$ ip link set veth_l1 netns left
Create second pair of veth interfaces:

$ ip link add veth_r0 type veth peer name veth_r1
Add veth_r1 to “right” network namespace:

$ ip link set veth_r1 netns right

4. start test dpdk-app:

./debugbuild/app/dpdk-testpmd -c7 --vdev=net_pcap0,iface=veth_l0 --vdev=net_pcap1,iface=veth_r0 -- -i --nb-cores=2 --nb-ports=2 --total-num-mbufs=2048

testpmd> set verbose 1
testpmd> start

left ns:

ip netns exec left ping 192.168.0.6 -c1

right ns:

ip netns exec right tcpdump -i veth_r1 -nn
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on veth_r1, link-type EN10MB (Ethernet), capture size 262144 bytes
15:49:09.967117 ARP, Request who-has 192.168.0.6 tell 192.168.0.2, length 28
15:49:09.967137 ARP, Reply 192.168.0.6 is-at ca:24:08:0c:52:ca, length 28
16:07:16.624179 IP 192.168.0.2 > 192.168.0.6: ICMP echo request, id 30308, seq 1, length 64
16:07:16.624217 IP 192.168.0.6 > 192.168.0.2: ICMP echo reply, id 30308, seq 1, length 64

5. vscode setting

remote-ssh setting:

# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host linux
HostName 100.85.244.203
User root
IdentityFile "C:\Users\{replace-username}\.ssh\id_rsa"

NOTE: run ssh-copy-id root@100.85.244.203 to set no-pass login.

launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}/debugbuild/app/dpdk-testpmd",
"cwd": "${workspaceFolder}",
"processId": "19083",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "/usr/bin/gdb",
}
]
}

install Dependency

yum install zlib-devel
pip3 install meson
pip3 install pyelftools

本文作者:不开心的时候写写代码

本文链接:https://www.cnblogs.com/sixloop/p/dpdk-debug.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @ 2021-12-25 16:07  changxun  阅读(342)  评论(0)    收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 希望的新一天 陈致逸 / HOYO-MiX
  2. 2 不再年轻的村庄 (轻策夜间) 陈致逸 / HOYO-MiX
  3. 3 千人千面 《天涯明月刀》游戏配乐 陈致逸
  4. 4 金风玉露 《天涯明月刀》游戏配乐 陈致逸
  5. 5 雪之舞 《天涯明月刀》游戏配乐 陈致逸
  6. 6 皎洁的笑颜 陈致逸 / HOYO-MiX
  7. 7 春弦 塞壬唱片-MSR,横山克
  8. 8 让风告诉你 花玲 / 喵☆酱 / 宴宁 / kinsen
希望的新一天 - 陈致逸 / HOYO-MiX
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.

Not available