Skip to content

Commit

Permalink
Update dpdkbind.service with EnvironmentFile
Browse files Browse the repository at this point in the history
  • Loading branch information
sufuf3 committed Aug 6, 2018
1 parent 3aa026b commit 02d5dc8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions developers/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,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
sudo cp /tmp/dpdkbind /etc/default/dpdkbind
# Name of network interface provisioned for DPDK to bind
export NET_IF_NAME=enp0s18
Expand Down Expand Up @@ -181,8 +182,6 @@ echo "igb_uio" | sudo tee -a /etc/modules
# Bind secondary network adapter
# Note that this NIC setup will binding dpdk port after reboot
echo "ExecStart=/sbin/ifconfig ${NET_IF_NAME} down" | sudo tee -a /etc/systemd/system/dpdkbind.service
echo "ExecStart=${DPDK_DIR}/usertools/dpdk-devbind.py --bind=igb_uio ${NET_IF_NAME}" | sudo tee -a /etc/systemd/system/dpdkbind.service
sudo systemctl enable dpdkbind
sudo systemctl start dpdkbind
sudo ${DPDK_DIR}/usertools/dpdk-devbind.py --status
Expand Down Expand Up @@ -234,6 +233,7 @@ SHELL
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 "file", source: "systemctl/dpdkbind", destination: "/tmp/dpdkbind"
config.vm.provision "shell", privileged: false, inline: $ovs_dpdk
else
config.vm.provision "shell", privileged: false, inline: $apt_openvswitch
Expand Down
1 change: 1 addition & 0 deletions developers/systemctl/dpdkbind
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NET_IF_NAME=enp0s18
3 changes: 3 additions & 0 deletions developers/systemctl/dpdkbind.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ 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 02d5dc8

Please sign in to comment.