PKTGEN一种是linux系统自带的内核模块,另一种是依赖于dpdk的pktgen程序集,ubuntu 14.04.6带的pktgen模块版本是2.75,本文不记录内核模块的用法。

用的小主机,BIOS有HPET的设置,具体配置(Advanced->...(杂项) -> High Precision Timer 选择Enable)

这个回头再研究,看看怎么回事。

安装物理机用的Ubuntu desktop的iso做的u盘,安装时没有联网,否则会下载一些包,时间太长。

内核4.4.0和gcc 4.8.4,版本应该够,

root@mnffgw:/home/sc# ldd --version
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.14) 2.19
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

检查机器是否支持NUMA

 grep -i numa /var/log/dmesg

[    0.000000] No NUMA configuration found

这个情况说明你是non-NUMA架构,在指定大页面内存的时候用单个。

下载DPDK

wget http://fast.dpdk.org/rel/dpdk-19.11.1.tar.xz

xz -d dpdk-19.11.1.tar.xz

tar xvf dpdk-19.11.1.tar

回到上一级,make config T=x86_64-native-linuxapp-gcc

make(下面有坑,先安装其他包)

碰到问题和解决:

/root/dpdk/dpdk-stable-19.11.1/lib/librte_eal/linux/eal/eal_memory.c:32:18: fatal error: numa.h: No such file or directory
 #include <numa.h>

apt-get install  libnuma-dev

DPDK参考资料:

图片引用自:https://www.cnblogs.com/qcloud1001/p/9585724.html  (此文DPDK的解释很好,值得多读读)

make install

装载模块,在build目录

modprobe uio【可以配置到/etc/modules里,开机自动加载】

insmod kmod/igb_uio.ko 【这两个ko可以配置到/etc/rc.local里,需要带绝对路径指明文件位置,开机自动加载】

insmod kmod/rte_kni.ko

设置大页内存

cat /proc/cpuinfo | grep pdpe1gb ,如果有显示,则支持1G大内存页
默认支持2M内存页cat /proc/cpuinfo |grep pse如果有显示,则支持2M内存页

我的内存只有4G,准备给大页内存2G,

我的cpu只有4个核,用第3、4个核。

命令是临时的,需要的话用配置文件,启动时配置好。

mkdir -p /mnt/huge【开机自启配置到/etc/rc.local】
mount -t hugetlbfs nodev /mnt/huge【通过/etc/fstab增加nodev /mnt/huge hugetlbfs defaults   0     0挂载配置】
echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages【通过/etc/sysctl.conf增加vm.nr_hugepages=1024配置】设置多了不要紧,会自动算的。

grep -i huge /proc/meminfo可以查看huge的情况。

查找捆绑网卡

./usertools/dpdk-devbind.py --status

Network devices using kernel driver
===================================
0000:01:00.0 'I211 Gigabit Network Connection 1539' if=eth0 drv=igb unused=igb_uio *Active*
0000:02:00.0 'I211 Gigabit Network Connection 1539' if=eth1 drv=igb unused=igb_uio 
0000:03:00.0 'I211 Gigabit Network Connection 1539' if=eth2 drv=igb unused=igb_uio 
0000:04:00.0 'I211 Gigabit Network Connection 1539' if=eth3 drv=igb unused=igb_uio

No 'Baseband' devices detected
==============================

Crypto devices using kernel driver
==================================
0000:00:1a.0 'Atom Processor Z36xxx/Z37xxx Series Trusted Execution Engine 0f18' if= drv=mei_txe unused=igb_uio

No 'Eventdev' devices detected
==============================

No 'Mempool' devices detected
=============================

No 'Compress' devices detected
==============================

No 'Misc (rawdev)' devices detected
===================================

准备绑定eth2,3

考虑命令配置在/etc/rc.local中,启动后有效

Network devices using DPDK-compatible driver
============================================
0000:03:00.0 'I211 Gigabit Network Connection 1539' drv=igb_uio unused=
0000:04:00.0 'I211 Gigabit Network Connection 1539' drv=igb_uio unused=

Network devices using kernel driver
===================================
0000:01:00.0 'I211 Gigabit Network Connection 1539' if=eth0 drv=igb unused=igb_uio *Active*
0000:02:00.0 'I211 Gigabit Network Connection 1539' if=eth1 drv=igb unused=igb_uio

No 'Baseband' devices detected
==============================

Crypto devices using kernel driver
==================================
0000:00:1a.0 'Atom Processor Z36xxx/Z37xxx Series Trusted Execution Engine 0f18' if= drv=mei_txe unused=igb_uio

No 'Eventdev' devices detected
==============================

No 'Mempool' devices detected
=============================

No 'Compress' devices detected
==============================

No 'Misc (rawdev)' devices detected
===================================

检查得知已经绑定

然后设置环境变量到/etc/profile

#dpdk
export RTE_SDK=/root/dpdk/dpdk-stable-19.11.1
export RTE_TARGET=x86_64-native-linuxapp-gcc

最优配置的链接:https://doc.dpdk.org/guides/linux_gsg/nic_perf_intel_platform.html

dpdk下example下的helloword可以运行,

运行example下ethtool

运行检查的port就是绑定uio驱动的端口重新编号为port 0 ,port 1

有些网卡不支持,这个地方放有点晚了,我曾经因为网卡进坑。

https://core.dpdk.org/supported/nics/

dpdk pktgen资料链接:https://pktgen-dpdk.readthedocs.io/en/latest/

安装个git工具,apt-get install git

下载Pktgen-DPDK,git clone https://github.com/pktgen/Pktgen-DPDK.git

据说要下载一下头文件,apt-get install linux-headers-4.4.0-142-generic
apt-get install libpcap-dev

make                下面有坑,有些包要先装

提示少了#include <lua.h>

据说此处需要lua5.3

wget http://www.lua.org/ftp/lua-5.3.5.tar.gz,安装,make linux install(写lua的老师们怎么想的,readme用的是doc/*.html,切记用make linux install)

发现没有readline.h,

apt-get install libreadline-dev

回到Pktgen-DPDK

还是lua没正确安装才有

"Lua pkg-config was not found"
"Get lua-5.3 from lua.org and build it on your system"
"Also install lua 5.3 into /usr/local/include and /usr/local/lib"
"Make sure the library in /usr/local/lib is called liblua.a"
"Lua pkg-config was not found"
"Get lua-5.3 from lua.org and build it on your system"
"Also install lua 5.3 into /usr/local/include and /usr/local/lib"
"Make sure the library in /usr/local/lib is called liblua.a"

先用个命令行跑一下,

./app/x86_64-native-linuxapp-gcc/pktgen -l 1-3 -n 1 -- -P -m "[2].0,[3].1"

在pktgen下,运行start 0,开始跑,stop 0,停止。

ubuntu 14.04.6(64bit) 安装DPDK19.11.1LTS和 PKTGEN(非模块)相关推荐

  1. 红帽 linux 安装gns3,Ubuntu 14.04 LTS 64-bit安装GNS3 1.3.7

    在Ubuntu 14.04 LTS 64-bit安装GNS3 1.3.7过程,全英文. Updated for GNS3 version 1.3.7 Please NOTE: This documen ...

  2. 在Ubuntu 14.04.5 64bit上安装git GUI客户端GitKraken

    git的图像化管理工具很多,有两个是比较推荐用的,sourceTree以及GitKraken.个人比较喜欢GitKraken.下面是我在Ubuntu 14.04.5 64bit上的安装过程. 从官网下 ...

  3. Ubuntu 14.04 python3.6 安装

    参考 how-do-i-install-python-3-6-using-apt-get Ubuntu 14.04 python3.6 安装 sudo add-apt-repository ppa:j ...

  4. Ubuntu 14.04 LTS, 64bit, cuda 7, Caffe环境配置编译和安装

    1 GPU设备 1.1 本人使用的GPU设备 名称: 七彩虹GTX980Ti显卡iGame980Ti烈焰战神X 6G 1.2 硬件问题 Laboratory Tested Hardware: Berk ...

  5. Ubuntu 14.04 LTS 的安装和配置以及各种问题的解决

    折腾了几天的时间终于把Ubuntu 14.04 LTS 环境配置好了,为防止遗忘,特作此记录,也方便遇到同样问题的童鞋们查看 步骤一,系统安装 可以拷贝一个系统盘,我用的是 ubuntu-14.04- ...

  6. ubuntu 14.04 双显卡安装NVIDIA GPU驱动+CUDA+编译配置caffe

    ******************************** 安装ubuntu************************* 1.在bios里设置使用集成显卡 2.安装ubuntu 14.04 ...

  7. 在 Ubuntu 14.04 Chrome中安装Flash Player(转)

    在 Ubuntu 14.04 中安装 Pepper Flash Player For Chromium 一个 Pepper Flash Player For Chromium 的安装器已经被 Ubun ...

  8. Redis、Redis+sentinel安装(Ubuntu 14.04下Redis安装及简单测试)

    Ubuntu下Redis安装两种安装方式: 1.apt-get方式 步骤: 以root权限登录,切换到/usr目录下. 接下来输入命令,apt-get install redis-server,如图: ...

  9. 玩转mini2440开发板之【在Ubuntu 14.04下编译安装tslib 1.4版本】

    今天在研究mini2440的QT程序时,发现缺少tslib,于是想办法安装. 一开始想直接去tslib官网上下载最新版本的,但是编译时发现无法通过,于是只好按照大多数网友的做法,取了一个最成熟最稳定的 ...

最新文章

  1. 41款实用工具,数据获取、清洗、建模、可视化都有了
  2. 编辑器的合并用不了_Excel多工作簿合并为一个工作簿,10秒搞定,这才是最高效的方式...
  3. 编码 Unicode utf-8
  4. 计算机操作简介,什么是计算机操作的快捷键?计算机操作快捷方式简介
  5. FPGA专有名词的积累
  6. 移植U-BOOT之支持烧写YAFFS文件系统以及制作U-BOOT补丁
  7. 软件测试几个概念 --dev sit uat
  8. 利用scrapy框架爬取动态加载的数据
  9. shell if判断语句
  10. oracle rac 清理log,Oacle rac架构监听日志清理
  11. C++小游戏 双人贪吃蛇
  12. python docx官网_Python操作docx文档
  13. js pug 代码_pug模板引擎(原jade)
  14. 一个 SAP 开发工程师的 2022 年终总结:四十不惑
  15. 烤仔TVのCCW丨密码学通识(二)什么是“安全的加密”
  16. 阿里云ACA课程之云上安全防护
  17. 安装python与编译工具vs code(中文版)和pycharm(中文版)
  18. 孰能浊以止,静之徐清
  19. python的深浅拷贝与linux中的软硬链接
  20. UCK Network英国伦敦Meetup,超级云矿再起关注热潮

热门文章

  1. QEMU零知识学习3 —— QEMU配置
  2. Windows下的Java开发环境搭建+常用软件(含下载传送门)
  3. hive 修改分桶数 分桶表_hive 学习之路(五)、Hive的分区表与分桶表
  4. BZOJ1037洛谷P2592 [ZJOI2008]生日聚会
  5. 操作系统学习总结-第三章
  6. 题目:下面那个流类输出面向字符的输入流()
  7. Leetcode14:最长公共前缀【c语言实现】
  8. AR联机初探+官方项目代码解析
  9. 佳能EOS6D和电脑通过wifi连接
  10. podman的部署以及用法