Skip to content

Commit

Permalink
Merge pull request #212 from linkernetworks/sufuf3/update-vagrant
Browse files Browse the repository at this point in the history
Add systemd for binding dpdk port after reboot
  • Loading branch information
John-Lin authored Aug 6, 2018
2 parents d65e8c8 + 96a70be commit 35860c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
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"

0 comments on commit 35860c4

Please sign in to comment.