Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add systemd for binding dpdk port after reboot #212

Merged
merged 3 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions developers/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ sudo sysctl -w vm.nr_hugepages=1024

sudo cp /tmp/ovs-vswitchd.service /etc/systemd/system/ovs-vswitchd.service
sudo cp /tmp/ovsdb-server.service /etc/systemd/system/ovsdb-server.service
sudo cp /tmp/dpdkbind.service /etc/systemd/system/dpdkbind.service

# Name of network interface provisioned for DPDK to bind
export NET_IF_NAME=enp0s18
Expand Down Expand Up @@ -179,9 +180,10 @@ echo "uio" | sudo tee -a /etc/modules
echo "igb_uio" | sudo tee -a /etc/modules

# Bind secondary network adapter
# Note that this NIC setup does not persist across reboots
sudo ifconfig ${NET_IF_NAME} down
sudo ${DPDK_DIR}/usertools/dpdk-devbind.py --bind=igb_uio ${NET_IF_NAME}
# Note that this NIC setup will binding dpdk port after reboot
echo 'NET_IF_NAME='${NET_IF_NAME} | sudo tee -a /etc/default/dpdkbind
sudo systemctl enable dpdkbind
sudo systemctl start dpdkbind
sudo ${DPDK_DIR}/usertools/dpdk-devbind.py --status

#### Install Open vSwitch with DPDK
Expand Down Expand Up @@ -230,6 +232,7 @@ SHELL
if dpdk_ovs_env == true
config.vm.provision "file", source: "systemctl/ovs-vswitchd.service", destination: "/tmp/ovs-vswitchd.service"
config.vm.provision "file", source: "systemctl/ovsdb-server.service", destination: "/tmp/ovsdb-server.service"
config.vm.provision "file", source: "systemctl/dpdkbind.service", destination: "/tmp/dpdkbind.service"
config.vm.provision "shell", privileged: false, inline: $ovs_dpdk
else
config.vm.provision "shell", privileged: false, inline: $apt_openvswitch
Expand Down
13 changes: 13 additions & 0 deletions developers/systemctl/dpdkbind.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Binding dpdk port after reboot
After=multi-user.target

[Install]
WantedBy=multi-user.target

[Service]
Type=oneshot
RemainAfterExit=true
EnvironmentFile=-/etc/default/dpdkbind
ExecStart=/sbin/ifconfig "$NET_IF_NAME" down
ExecStart=/usr/src/dpdk-stable-17.11.2/usertools/dpdk-devbind.py --bind=igb_uio "$NET_IF_NAME"