| Summary: | [RFE] DPDK - permit to specify how testpmd should connect the ports | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Franck Baudin <fbaudin> |
| Component: | dpdk | Assignee: | Kevin Traynor <ktraynor> |
| Status: | CLOSED WONTFIX | QA Contact: | Zhang Kexin <kzhang> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.3 | CC: | aconole, ctrautma, maxime.coquelin, ovs-team, rkhan |
| Target Milestone: | rc | Keywords: | Extras, FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-09-26 17:57:00 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Franck Baudin
2016-09-15 21:32:16 UTC
My notes to deploy a PV topology: one interface VM, connected to a single physical port: this works well as there are only two ports. In the VM, I configured testpmd with --port-topology=chained so all input packets are sent back on the port 0 (only one port).
Versions used: vanilla DPDK 16.07, RHEL 7.2 up to date (9th of September), both on hist and guest.
On the host:
sed -i -e '/CPUAffinity/d' /etc/systemd/system.conf
echo "CPUAffinity=0-17,36-53" >> /etc/systemd/system.conf
sed -i -e '/GRUB_CMDLINE_LINUX/d' /etc/default/grub
echo GRUB_CMDLINE_LINUX=\"crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap nomodeset console=tty0 console=ttyS0 nohz=on, nohz_full=18-35,54-71 rcu_nocbs=18-35,54-71 intel_pstate=disable nosoftlockup\" >> /etc/default/grub
grub2-mkconfig > /boot/grub2/grub.cfg
=> reboot once
umount /dev/hugepages
mount -t hugetlbfs nodev /dev/hugepages -o pagesize=1G
echo 10 > /sys/devices/system/node/node1/hugepages/hugepages-1048576kB/nr_hugepages
systemctl stop irqbalance
MASK=ffff # CPU 0-16, all on socket 0
for I in `ls -d /proc/irq/[0-9]*` ; do echo $MASK > ${I}/smp_affinity ; done
modprobe uio
insmod /root/dev/dpdk/build/kmod/igb_uio.ko
/root/dev/dpdk/tools/dpdk-devbind.py --bind=igb_uio 81:00.0
./build/app/testpmd -l 18,19 -n 4 --socket-mem=1024,1024 --vdev eth_vhost0,iface=/tmp/vhost0.sock,queues=1 -- -i --socket-num=1 --nb-cores=2
Then start kvm:
/usr/libexec/qemu-kvm -enable-kvm -hda /var/lib/libvirt/images/testpmd.qcow2 -no-reboot -nographic -echr 16 -smp 4 -m 2048 -cpu host -chardev socket,id=chr0,path=/tmp/vhost0.sock -netdev vhost-user,id=net0,chardev=chr0,vhostforce,queues=1 -device virtio-net-pci,netdev=net0 -object memory-backend-file,id=mem,size=2048M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem -mem-prealloc
Then back on the host testpmd:
set portmask 3
show config fwd
set promisc all on
start
And on the guest, start the testpmd:
systemctl stop irqbalance
MASK=1
for I in `ls -d /proc/irq/[0-9]*` ; do echo $MASK > ${I}/smp_affinity ; done
echo 512 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
modprobe uio
cd dev/dpdk
insmod build/kmod/igb_uio.ko
./tools/dpdk-devbind.py --bind=igb_uio 00:03.0
./build/app/testpmd -l 2,3 -n 4 -- -i --port-topology=chained
Note: the guest has also been pre-congigured as the host: all process pinned on CPU0, same boot parameters:
sed -i -e '/GRUB_CMDLINE_LINUX/d' /etc/default/grub
echo GRUB_CMDLINE_LINUX=\"crashkernel=auto rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap nomodeset console=tty0 console=ttyS0 nohz=on, nohz_full=1-4 rcu_nocbs=1-4 intel_pstate=disable nosoftlockup\" >> /etc/default/grub
grub2-mkconfig > /boot/grub2/grub.cfg
sed -i -e '/CPUAffinity/d' /etc/systemd/system.conf
echo "CPUAffinity=0" >> /etc/systemd/system.conf
|