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

[WIP] Add systemd for binding dpdk port after reboot #15

Closed
wants to merge 5 commits into from

Conversation

sufuf3
Copy link
Contributor

@sufuf3 sufuf3 commented Aug 6, 2018

cc linkernetworks/vortex#212

  • Add dpdkbind.service for systemd
  • Update kernel module from uio to igb_uio
  • Update inventory/group_vars/network-setup.yml for production

@sufuf3 sufuf3 force-pushed the sufuf3/add-dpdk-systemd branch 10 times, most recently from 80a2a70 to e1a7db2 Compare August 7, 2018 06:09
- Add dpdkbind.service for systemd
- Update kernel module from uio to igb_uio
cc linkernetworks/vortex#212
@sufuf3 sufuf3 force-pushed the sufuf3/add-dpdk-systemd branch from e1a7db2 to dc32ad7 Compare August 7, 2018 06:35
@sufuf3
Copy link
Contributor Author

sufuf3 commented Aug 7, 2018

@John-Lin 這隻 PR 可以在 reboot 後也可以 reload 我們要的 modules 以及 bind 好原本的 dpdk port && 用 ovs-vsctl show 也可以成功。

$ /usr/src/dpdk-stable-17.05.2/usertools/dpdk-devbind.py -s

Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'I350 Gigabit Network Connection 1521' drv=igb_uio unused=

Network devices using kernel driver
===================================
0000:00:1f.6 'Ethernet Connection (2) I219-V 15b8' if=enp0s31f6 drv=e1000e unused=igb_uio *Active*
0000:01:00.1 'I350 Gigabit Network Connection 1521' if=enp1s0f1 drv=igb unused=igb_uio
0000:02:00.0 'I350 Gigabit Network Connection 1521' if=enp2s0f0 drv=igb unused=igb_uio
0000:02:00.1 'I350 Gigabit Network Connection 1521' if=enp2s0f1 drv=igb unused=igb_uio

$ sudo ovs-vsctl show
e0bf1158-b58c-4c44-ab18-6ad395e9e9b3
    Bridge "br0"
        Port "dpdk0"
            Interface "dpdk0"
                type: dpdk
                options: {dpdk-devargs="0000:01:00.0"}
        Port "br0"
            Interface "br0"
                type: internal
    ovs_version: "2.8.0"

$ cat /proc/meminfo | grep Huge
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
HugePages_Total:    1024
HugePages_Free:     1024
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

$ lsmod | grep uio
igb_uio                16384  0
uio                    20480  1 igb_uio

$ lsmod | grep openvswitch
openvswitch           131072  0
nsh                    16384  1 openvswitch
nf_nat_ipv6            16384  1 openvswitch
nf_nat_ipv4            16384  1 openvswitch
nf_defrag_ipv6         36864  2 nf_conntrack_ipv6,openvswitch
nf_nat                 32768  3 openvswitch,nf_nat_ipv6,nf_nat_ipv4
nf_conntrack          131072  6 nf_conntrack_ipv6,openvswitch,nf_conntrack_ipv4,nf_nat_ipv6,nf_nat_ipv4,nf_nat
libcrc32c              16384  3 openvswitch,nf_conntrack,nf_nat

但有個問題,就是 ovs-vswitchd.service 起不來,開完機後會顯示

$ sudo service ovs-vswitchd status
Warning: ovs-vswitchd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● ovs-vswitchd.service - Open vSwitch Forwarding Unit
   Loaded: loaded (/etc/systemd/system/ovs-vswitchd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)

要重新下 systemctl start ovs-vswitchd 就會成功。htop 也會看到用到原本指定的 CPU

$ systemctl start ovs-vswitchd
systemctl status ovs-vswitchd
● ovs-vswitchd.service - Open vSwitch Forwarding Unit
   Loaded: loaded (/etc/systemd/system/ovs-vswitchd.service; enabled; vendor preset: enabled)
   Active: active (running) since 二 2018-08-07 15:26:29 CST; 9s ago
  Process: 1631 ExecStart=/usr/share/openvswitch/scripts/ovs-ctl --no-ovsdb-server --no-monitor --system-id=random --ovs-user=${OVS_USER_ID} st
 Main PID: 1664 (ovs-vswitchd)
   CGroup: /system.slice/ovs-vswitchd.service
           └─1664 ovs-vswitchd unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir --log-file=/var/

 八  07 15:26:28 vortex-130 systemd[1]: Starting Open vSwitch Forwarding Unit...
 八  07 15:26:29 vortex-130 ovs-ctl[1631]:  * Starting ovs-vswitchd
 八  07 15:26:29 vortex-130 ovs-ctl[1631]:  * Enabling remote OVSDB managers
 八  07 15:26:29 vortex-130 systemd[1]: Started Open vSwitch Forwarding Unit.

另外,我有修改 ovs-vswitchd.service 因為如果沒改,就無法 ssh 。

@sufuf3
Copy link
Contributor Author

sufuf3 commented Aug 7, 2018

close this PR due to dpdkbind.service problem, let's move to #16

@sufuf3 sufuf3 closed this Aug 7, 2018
@sufuf3 sufuf3 deleted the sufuf3/add-dpdk-systemd branch August 7, 2018 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant