├── .gitignore ├── SR-IOV_DPDK_Hands-on_Lab ├── README.pdf ├── docs │ ├── SR-IOV-HandsOn-IEEE.pdf │ ├── OVS-DPDK-Tutorial-IEEE.pdf │ ├── SDN-NFV Hands-on Lab.pdf │ └── LICENSE ├── provisioning │ ├── LICENSE │ ├── host-vm │ │ ├── training │ │ │ ├── sr-iov-lab │ │ │ │ ├── 00_show_net_info.sh │ │ │ │ ├── 01_stop_VMs.sh │ │ │ │ ├── 07_unload_all_x710_drivers.sh │ │ │ │ ├── 02_stop_ovs.sh │ │ │ │ ├── 03_unload_dpdk.sh │ │ │ │ ├── 06_build_start_pktgen_on_vf.sh │ │ │ │ └── 04_build_load_dpdk_on_vf.sh │ │ │ └── dpdk-lab │ │ │ │ ├── dump-flows.sh │ │ │ │ ├── dump-ports.sh │ │ │ │ ├── 04_start_VNF-VM.sh │ │ │ │ ├── 05_start_TenantVM.sh │ │ │ │ ├── 11_stop_VMs.sh │ │ │ │ ├── 10_cleanup_dpdk-lab.sh │ │ │ │ ├── VNF-VM │ │ │ │ ├── root │ │ │ │ │ ├── run_testpmd.sh │ │ │ │ │ └── setup_env.sh │ │ │ │ └── home │ │ │ │ │ └── user │ │ │ │ │ └── .bash_profile │ │ │ │ ├── 00_setup_dpdk-lab.sh │ │ │ │ ├── TenantVM │ │ │ │ ├── root │ │ │ │ │ ├── start_pktgen.sh │ │ │ │ │ └── setup_env.sh │ │ │ │ └── home │ │ │ │ │ └── user │ │ │ │ │ └── .bash_profile │ │ │ │ ├── 03_addroutes_vm-vm.sh │ │ │ │ ├── 12_stop_ovs.sh │ │ │ │ ├── 02_createports_ovs.sh │ │ │ │ ├── start_Tenant-VM.sh │ │ │ │ ├── start_VNF-VM.sh │ │ │ │ └── 01_start_ovs.sh │ │ └── 07_unload_all_x710_drivers.sh │ ├── utility │ │ ├── pingHostVMs.sh │ │ ├── pingComputeNodes.sh │ │ ├── pingSR-IOVHostVMs.sh │ │ ├── listHostVMs.sh │ │ ├── cn_02_load_vfs_into_libvirt.sh │ │ ├── stopHostVMs.sh │ │ ├── cn_03_insert_vfs_into_vm.sh │ │ ├── cn_01_create_vf.sh │ │ ├── cn_change_hostvm_cpu_topology.sh │ │ ├── cn_00_cleanup_sr-iov.sh │ │ ├── aptInstall.sh │ │ ├── startHostVMs.sh │ │ ├── cn_04_remove_vfs_from_vm.sh │ │ └── hvm_07_unload_all_x710_drivers.sh │ ├── user │ ├── files │ │ ├── macvtap.xml │ │ └── sr-iov-networks │ │ │ ├── sr-iov-port0.xml │ │ │ ├── sr-iov-port1.xml │ │ │ ├── sr-iov-port2.xml │ │ │ └── sr-iov-port3.xml │ ├── roles │ │ ├── aptInstall.yaml │ │ ├── snapshotGuestVMs.yaml │ │ ├── shutdownGuestVMs.yaml │ │ ├── startGuestVMs.yaml │ │ ├── cleanImages.yaml │ │ ├── copyFile.yaml │ │ ├── edit_host_vm_kernel_params.yaml │ │ ├── runScript.yaml │ │ ├── copyImages.yaml │ │ ├── createmacvtap.yaml │ │ ├── change-hostvm-cpu-topology.yaml │ │ ├── remove_sr-iov_nics.yaml │ │ ├── insert_sr-iov_nics.yaml │ │ └── load_vfs_into_libvirt.yaml │ ├── scripts │ │ ├── shutdownGuestVMs.py │ │ ├── startGuestVMs.py │ │ ├── create_macvtapif.sh │ │ ├── copy-id.sh │ │ └── 02_load_vfs_into_libvirt.sh │ ├── compute-node │ │ ├── 02_load_vfs_into_libvirt.sh │ │ ├── 00_cleanup_sr-iov.sh │ │ └── 01_create_vfs.sh │ └── ansible_hosts └── LICENSE ├── README.md ├── LICENSE ├── DPDK_in_Containers_Hands-on_Lab ├── LICENSE └── dpdk-container-lab │ ├── show_ovs_traffic.sh │ ├── step13-build_pktgen_container.sh │ ├── step11-build_testpmd_container.sh │ ├── docker-build │ ├── pktgen │ │ ├── Dockerfile │ │ └── dpdk-container-lab │ │ │ ├── build_pktgen.sh │ │ │ ├── build_dpdk.sh │ │ │ ├── step19-run_pktgen.sh │ │ │ └── step18-set_pktgen_dpdk_params.sh │ └── testpmd │ │ ├── LICENSE_DPDK │ │ ├── Dockerfile │ │ └── dpdk-container-lab │ │ ├── build_dpdk.sh │ │ ├── build_testpmd.sh │ │ ├── step17-run_testpmd.sh │ │ └── step16-set_testpmd_dpdk_params.sh │ ├── step14-run_testpmd_container.sh │ ├── step15_run_pktgen_container.sh │ ├── step07-show_ovs_ports.sh │ ├── step09-show_ovs_routes.sh │ ├── step01-build_dpdk.sh │ ├── step02-build_ovs.sh │ ├── step08-add_ovs_routes.sh │ ├── step06-create_ovs_ports.sh │ ├── step00-setenv │ ├── step05-start_ovs.sh │ ├── step04-configure_ovs_db.sh │ ├── step03-prep_OvS.sh │ └── cleanup.sh └── SR-IOV_Network_Virtual_Functions_in_KVM ├── listvfs.sh └── listvfs_by_pf.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/SDN-NFV-Hands-on-Samples/HEAD/SR-IOV_DPDK_Hands-on_Lab/README.pdf -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/docs/SR-IOV-HandsOn-IEEE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/SDN-NFV-Hands-on-Samples/HEAD/SR-IOV_DPDK_Hands-on_Lab/docs/SR-IOV-HandsOn-IEEE.pdf -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/docs/OVS-DPDK-Tutorial-IEEE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/SDN-NFV-Hands-on-Samples/HEAD/SR-IOV_DPDK_Hands-on_Lab/docs/OVS-DPDK-Tutorial-IEEE.pdf -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/docs/SDN-NFV Hands-on Lab.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/SDN-NFV-Hands-on-Samples/HEAD/SR-IOV_DPDK_Hands-on_Lab/docs/SDN-NFV Hands-on Lab.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DISCONTINUATION OF PROJECT. 2 | 3 | This project will no longer be maintained by Intel. 4 | 5 | Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project. 6 | 7 | Intel no longer accepts patches to this project. 8 | 9 | If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project. 10 | # SDN-NFV-Hands-on-Samples 11 | Scripts and source code for SDN NFV Hands-on Labs 12 | 13 | This software is subject to the U.S. Export Administration Regulations and other U.S. law, and may not be exported or re-exported to certain countries (Cuba, Iran, North Korea, Sudan, and Syria) or to persons or entities prohibited from receiving U.S. exports (including Denied Parties, Specially Designated Nationals, and entities on the Bureau of Export Administration Entity List or involved with missile technology or nuclear, chemical or biological weapons). 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Intel Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Intel Corporation 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Intel Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Intel Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/docs/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Intel Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/00_show_net_info.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #lists pci info filtering for the phrase 'net' 25 | lspci | grep net 26 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/pingHostVMs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #A simple script that uses Ansible to 'ping' all of the HostVM systems 25 | ansible host_vms -m ping -bK 26 | 27 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/pingComputeNodes.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #A simple script that uses Ansible to 'ping' all of the compute_nodes. 25 | ansible compute_nodes -m "ping" -bK 26 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/dump-flows.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #displays the Open vSwitch flows on br0 every 1 second 25 | watch -n1 /home/user/ovs/utilities/ovs-ofctl dump-flows br0 26 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/dump-ports.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #Displays the Open vSwitch ports on br0 every 1 second 25 | watch -n1 /home/user/ovs/utilities/ovs-ofctl dump-ports br0 26 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/show_ovs_traffic.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #!/bin/bash 25 | 26 | #displays the Open vSwitch flows on br0 every 1 second 27 | watch -n 1 $OVS_DIR/utilities/ovs-ofctl dump-flows br0 28 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/pingSR-IOVHostVMs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #A simple script that uses Ansible to 'ping' all of the SR-IOV VMs. See /etc/ansible/hosts. 25 | ansible sr-iov_vms -m "ping" -bK 26 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/user: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #when placed in /etc/sudoers.d/, this file allows a user named 'user' to have sudo access without requiring a password. 25 | 26 | user ALL=(root) NOPASSWD:ALL 27 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/listHostVMs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #A simple script that uses Ansible to call $sudo virsh list all on all of the compute_nodes to show the status of each of the HostVM systems. 25 | 26 | ansible compute_nodes -a "virsh list --all" -bK 27 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step13-build_pktgen_container.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | DOCKER_BUILD_DIR="$TRAINING_DIR/docker-build/pktgen" 28 | DOCKER_TAG="dpdk-containers/pktgen" 29 | 30 | cd "$DOCKER_BUILD_DIR" 31 | 32 | docker build . -t $DOCKER_TAG 33 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step11-build_testpmd_container.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | DOCKER_BUILD_DIR="$TRAINING_DIR/docker-build/testpmd" 28 | DOCKER_TAG="dpdk-containers/testpmd" 29 | 30 | cd "$DOCKER_BUILD_DIR" 31 | 32 | docker build . -t $DOCKER_TAG 33 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/files/macvtap.xml: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | macvtap-net 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/cn_02_load_vfs_into_libvirt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script runs the Ansible load_vfs_into_libvirt.yaml role from ../roles on the compute_nodes. See the load_vfs_into_libvirt.yaml documentation for more information. 27 | 28 | SCOPE="compute_nodes" 29 | 30 | ansible-playbook ~/provisioning-master/roles/load_vfs_into_libvirt.yaml -l $SCOPE -Kf14 -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/aptInstall.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This role simply uses apt to install a package on the target inventory, assuming the target inventory is running Ubuntu or Debian. It's only input parameter is package_name, which must be defined as an --extra-vars on the command line. 25 | --- 26 | - hosts: all 27 | become: true 28 | tasks: 29 | - name: install the {{ package_name }} package 30 | apt: name={{ package_name }} state=present 31 | ... 32 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/01_stop_VMs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2016 Intel Corporation 3 | 4 | # Permission is hereby granted, free of charge, to any person obtaining a 5 | # copy of this software and associated documentation files (the 6 | # "Software"), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, 8 | # distribute, sublicense, and/or sell copies of the Software, and to 9 | # permit persons to whom the Software is furnished to do so, subject to 10 | # the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included 13 | # in all copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | # Author: Clayne B. Robison 24 | #This script starts an ssh session into the nested VNF and Tenant VMs and runs the 'shutdown -h now' command to shut them down gracefully. Note: This script may not be run as root. 25 | 26 | if [ $(id -u) -eq 0 ]; then 27 | echo "Sorry, you cannot run this as root." 28 | exit 1 29 | fi 30 | 31 | ssh -t 192.168.120.10 "sudo shutdown -h now" 32 | ssh -t 192.168.120.11 "sudo shutdown -h now" 33 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/scripts/shutdownGuestVMs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #The shutdownGuestVMs.py script simply calls the VMManager.shutdown_domains function with a mask of VMManager.VM_MASK_ALL. See the VMManager.shutdown_domains documentation for more information. Its only precondition is that the VMManager module is present in the current working directory. 27 | 28 | from VMManager import VMManager 29 | 30 | VMManager.shutdown_domains(VMManager.VM_MASK_ALL) 31 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/scripts/startGuestVMs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #The startGuestVMs.py script simply calls the VMManager.start_domains function with a mask of VMManager.VM_MASK_ALL. See the VMManager.start_domains documentation for more information. Its only precondition is that the VMManager module is present in the current working directory. 27 | 28 | from VMManager import VMManager 29 | 30 | VMManager.start_domains(VMManager.VM_MASK_ALL) 31 | 32 | 33 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/stopHostVMs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script uses the shutdownGuestVMs.yaml Ansible role found in ../roles to shutdown all of the HostVMs. The role will not return from each compute node until all VMs on that system are shutdown. See ../roles/shutdownGuestVMs.yaml for more information. 27 | 28 | YAML_DIR="/home/sdnnfv-admin/provisioning-master/roles" 29 | 30 | ansible-playbook $YAML_DIR/shutdownGuestVMs.yaml -f14 -bKl compute_nodes 31 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/pktgen/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | FROM dpdk-containers/testpmd 26 | COPY ./dpdk-container-lab /root/dpdk-container-lab 27 | WORKDIR /root/dpdk-container-lab 28 | COPY ./pktgen /usr/src/pktgen 29 | RUN apt-get update && apt-get install -y libpcap-dev 30 | ENV PKTGEN_DIR "/usr/src/pktgen" 31 | RUN ./build_pktgen.sh; exit 0 #for some reason, the first time always fails, so we do this twice (??) 32 | RUN ./build_pktgen.sh 33 | CMD ["/bin/bash"] 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/cn_03_insert_vfs_into_vm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script uses Ansible to list the libvirt networks on each of the compute nodes, and then executes the insert_sr-iov_nics.yaml Ansible role found in ../roles. See the documentation in insert_sr-iov_nics.yaml for more information. 27 | 28 | SCOPE=compute_nodes 29 | ansible $SCOPE -a "virsh net-list --all" -bK 30 | ansible-playbook ~/provisioning-master/roles/insert_sr-iov_nics.yaml -l $SCOPE -Kf14 31 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/files/sr-iov-networks/sr-iov-port0.xml: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | sr-iov-port0 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/files/sr-iov-networks/sr-iov-port1.xml: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | sr-iov-port1 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/files/sr-iov-networks/sr-iov-port2.xml: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | sr-iov-port2 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/files/sr-iov-networks/sr-iov-port3.xml: -------------------------------------------------------------------------------- 1 | 27 | 28 | 29 | sr-iov-port3 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/04_start_VNF-VM.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This script launches the VNF-VM using the start_VNF-VM.sh script in a background screen and then prints the IP address of the nested VM to stdout. 25 | 26 | if [ "$(id -u)" != "0" ]; then 27 | echo "Sorry, you are not root." 28 | exit 1 29 | fi 30 | 31 | screen -dmS VNF_VM_SCREEN /home/user/training/dpdk-lab/start_VNF-VM.sh 32 | sleep 3 33 | ps ax | grep VNF 34 | echo "*****VNF VM IP Address=192.168.120.10****" 35 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/05_start_TenantVM.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This script launches the Tenant VM using the start_Tenant-VM.sh script in a background screen and then prints the IP address of the nested VM to stdout. 25 | if [ "$(id -u)" != "0" ]; then 26 | echo "Sorry, you are not root." 27 | exit 1 28 | fi 29 | 30 | screen -dmS TENANT_VM_SCREEN /home/user/training/dpdk-lab/start_Tenant-VM.sh 31 | sleep 3 32 | ps ax |grep -i Tenant 33 | echo "*****Tenant VM IP Address=192.168.120.11****" 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/11_stop_VMs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | 27 | #This script starts an ssh session into the nested VNF and Tenant VMs and runs the 'shutdown -h now' command to shut them down gracefully. Note: This script may not be run as root. 28 | if [ $(id -u) -eq 0 ]; then 29 | echo "Sorry, you cannot run this as root." 30 | exit 1 31 | fi 32 | 33 | ssh -t 192.168.120.10 "sudo shutdown -h now" 34 | ssh -t 192.168.120.11 "sudo shutdown -h now" 35 | 36 | ps ax | grep qemu 37 | 38 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/10_cleanup_dpdk-lab.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This script is optional and runs the following scripts to clean up the dpdk-lab and free its resources: 25 | # 11_stop_VMs.sh 26 | # 12_stop_ovs.sh 27 | 28 | if [ "$(id -u)" != "0" ]; then 29 | echo "Sorry, you are not root." 30 | exit 1 31 | fi 32 | 33 | SCRIPT_DIR=$(pwd) 34 | 35 | echo "Stopping the VMs..." 36 | $SCRIPT_DIR/11_stop_VMs.sh 37 | 38 | echo "Stopping OpenvSwitch and DPDK ..." 39 | $SCRIPT_DIR/12_stop_ovs.sh 40 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/cn_01_create_vf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script uses Ansible to copy the 01_create_vfs.sh script from the ../compute_node directory to the compute nodes and then executes it. See the documentation in 01_create_vfs.sh and runScript.yaml for more information. 27 | 28 | SCOPE="compute_nodes" 29 | PARAM="script_name='01_create_vfs.sh' relative_source_path='compute-node'" 30 | 31 | ansible-playbook ~/provisioning-master/roles/runScript.yaml -l $SCOPE -Kf14 --extra-vars "$PARAM" 32 | 33 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/cn_change_hostvm_cpu_topology.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script runs the change-hostvm-cpu-topology.yaml Ansible role found in ../roles, and then uses ansible to run lscpu on each HostVM to verify that the CPU topology changed. See change-hostvm-cpu-topology.yaml for more information about what the role does. 27 | 28 | SCOPE=compute_nodes 29 | 30 | ansible-playbook ~/provisioning-master/roles/change-hostvm-cpu-topology.yaml -l $SCOPE -Kf14 31 | 32 | ansible host_vms -a "lscpu" -bK 33 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step14-run_testpmd_container.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | export DOCKER_TAG="dpdk-containers/testpmd" 33 | 34 | echo "Launching docker container in privileged mode with access to host hugepages and OVS DPDK sockets" 35 | CMD="docker run -tiv /mnt/huge:/mnt/huge -v /usr/local/var/run/openvswitch:/var/run/openvswitch --privileged $DOCKER_TAG" 36 | echo "Running $CMD" 37 | $CMD 38 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step15_run_pktgen_container.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | export DOCKER_TAG="dpdk-containers/pktgen" 33 | 34 | echo "Launching docker container in privileged mode with access to host hugepages and OVS DPDK sockets" 35 | CMD="docker run -tiv /mnt/huge:/mnt/huge -v /usr/local/var/run/openvswitch:/var/run/openvswitch --privileged $DOCKER_TAG" 36 | echo "Running $CMD" 37 | $CMD 38 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/cn_00_cleanup_sr-iov.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script uses Ansible to copy the 00_cleanup_sr-iov.sh from the ../compute_node directory to the compute nodes and then executes it. See the documentation in 00_cleanup_sr-iov.sh and runScript.yaml for more information. 27 | 28 | SCOPE="compute_nodes" 29 | PARAM="script_name='00_cleanup_sr-iov.sh' relative_source_path='compute-node'" 30 | 31 | ansible-playbook ~/provisioning-master/roles/runScript.yaml -l $SCOPE -Kf14 --extra-vars "$PARAM" 32 | 33 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step07-show_ovs_ports.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$OVS_DIR" == "" ]; then 33 | echo "Sorry, OVS_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | cd "$OVS_DIR" 38 | 39 | echo "Show br0 info:" 40 | ./utilities/ovs-vsctl show 41 | 42 | echo "Showing vhost-user sockets in /usr/local/var/run/openvswitch" 43 | ls -la /usr/local/var/run/openvswitch | grep vhost-user 44 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step09-show_ovs_routes.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$OVS_DIR" == "" ]; then 33 | echo "Sorry, OVS_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | cd "$OVS_DIR" 38 | alias echo='echo' 39 | 40 | echo "Showing the current flow configuration:" 41 | ./utilities/ovs-ofctl dump-flows br0 42 | 43 | echo "Showing OpenFlow to Open vSwitch port mapping:" 44 | ./utilities/ovs-ofctl show br0 45 | sleep 1 46 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/aptInstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This helper script used the Ansible apt module to install packages on compute nodes and on the HostVMs, both of which ran Ubuntu 16.04. It used the aptInstall.yaml role found in ../roles. See the comments in aptInstall.yaml for more information. 27 | 28 | #Note: the SCOPE host_vms is a group defined in /etc/ansible/hosts 29 | 30 | PARAM="package_name='virtualbox'" 31 | SCOPE=host_vms 32 | 33 | ansible-playbook /home/sdnnfv-admin/provisioning-master/roles/aptInstall.yaml -l $SCOPE -Kf14 --extra-vars "$PARAM" 34 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/startHostVMs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script uses the startGuestVMs.yaml Ansible role found in ../roles to start all of the HostVMs. Then it sleeps for 20 seconds to give the VMs time to start, and then uses Ansible to list all of the HostVM system to ascertain their status. See the ../roles/startGuestVMs.yaml for more information. 27 | 28 | YAML_DIR="/home/sdnnfv-admin/provisioning-master/roles" 29 | 30 | ansible-playbook $YAML_DIR/startGuestVMs.yaml -f14 -bKl compute_nodes 31 | sleep 20 32 | ansible compute_nodes -a "virsh list --all" -bK 33 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/VNF-VM/root/run_testpmd.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script launches the working version of testpmd in case the learner wants to see how the lab is supposed to work in the end. It locks DPDK to cores 2 and 3, and gives DPDK 512M of memory per socket. Then is starts testpmd with 64 byte packet bursts, and 2048 tx and rx descriptors. 25 | 26 | DPDK_DIR=/root/dpdk-16.07 27 | 28 | #not working testpmd 29 | #cd $DPDK_DIR/app/testpmd 30 | 31 | #working testpmd 32 | cd $DPDK_DIR/app/test-pmd-working 33 | 34 | ./testpmd -c 0x6 -n 4 --socket-mem=512 -- --burst=64 -i --txd=2048 --rxd=2048 35 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/testpmd/LICENSE_DPDK: -------------------------------------------------------------------------------- 1 | /*- 2 | * BSD LICENSE 3 | * 4 | * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * * Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * * Neither the name of Intel Corporation nor the names of its 18 | * contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/pktgen/dpdk-container-lab/build_pktgen.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR env var has not been set to root of DPDK src tree" 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_BUILD" == "" ]; then 38 | echo "Sorry, DPDK_BUILD env var has not been set to DPDK target build env" 39 | exit 1 40 | fi 41 | 42 | 43 | echo "Building pktgen..." 44 | export PKTGEN_DIR=/usr/src/pktgen 45 | cd "$PKTGEN_DIR" 46 | make -j8 47 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step01-build_dpdk.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_BUILD" == "" ]; then 38 | echo "Sorry, DPDK_BUILD has not been defined." 39 | exit 1 40 | fi 41 | 42 | cd "$DPDK_DIR" 43 | echo "Building the $DPDK_BUILD flavor of DPDK in the $DPDK_DIR/$DPDK_BUILD directory" 44 | make config O="$DPDK_BUILD" T="$DPDK_BUILD" 45 | cd "$DPDK_BUILD" 46 | make -j8 47 | 48 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/testpmd/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | FROM ubuntu 26 | COPY ./dpdk-container-lab /root/dpdk-container-lab 27 | WORKDIR /root/dpdk-container-lab 28 | COPY ./dpdk /usr/src/dpdk 29 | RUN apt-get update && apt-get install -y build-essential automake python-pip libcap-ng-dev gawk pciutils linux-headers-$(uname -a | awk '{print $3}') vim kmod 30 | RUN pip install -U pip six 31 | ENV DPDK_DIR "/usr/src/dpdk" 32 | ENV DPDK_BUILD "x86_64-native-linuxapp-gcc" 33 | ENV RTE_SDK "/usr/src/dpdk" 34 | ENV RTE_TARGET "x86_64-native-linuxapp-gcc" 35 | RUN ./build_dpdk.sh 36 | RUN ./build_testpmd.sh 37 | CMD ["/bin/bash"] 38 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/pktgen/dpdk-container-lab/build_dpdk.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_BUILD" == "" ]; then 38 | echo "Sorry, DPDK_BUILD has not been defined." 39 | exit 1 40 | fi 41 | 42 | cd "$DPDK_DIR" 43 | echo "Building the $DPDK_BUILD flavor of DPDK in the $DPDK_DIR/$DPDK_BUILD directory" 44 | make config O="$DPDK_BUILD" T="$DPDK_BUILD" 45 | cd "$DPDK_BUILD" 46 | make -j8 47 | 48 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/testpmd/dpdk-container-lab/build_dpdk.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_BUILD" == "" ]; then 38 | echo "Sorry, DPDK_BUILD has not been defined." 39 | exit 1 40 | fi 41 | 42 | cd "$DPDK_DIR" 43 | echo "Building the $DPDK_BUILD flavor of DPDK in the $DPDK_DIR/$DPDK_BUILD directory" 44 | make config O="$DPDK_BUILD" T="$DPDK_BUILD" 45 | cd "$DPDK_BUILD" 46 | make -j8 47 | 48 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/scripts/create_macvtapif.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script creates a simple macvtap libvirt network on the compute node, activates, the network and sets it to autostart. The libvirt network is defined in macvtap.xml, and the name of the network is macvtap-net. 27 | 28 | if [ "$(id -u)" != "0" ]; then 29 | echo "Sorry, you are not root." 30 | exit 1 31 | fi 32 | 33 | PROVISIONING_DIR="/home/sdnnfv-admin/provisioning-slave" 34 | MAC_VTAP_DEF_FILE="macvtap.xml" 35 | MAC_VTAP_NET_NAME="macvtap-net" 36 | modprobe macvlan 37 | 38 | virsh net-define $PROVISIONING_DIR/$MAC_VTAP_DEF_FILE 39 | 40 | virsh net-autostart $MAC_VTAP_NET_NAME 41 | virsh net-start $MAC_VTAP_NET_NAME 42 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/VNF-VM/home/user/.bash_profile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | # .bash_profile 25 | #This is the .bash_profile from the VNF-VM /home/user directory. It exports the following variables and then calls /root/setup_env.sh: 26 | #RTE_SDK: This is the location of DPDK. RTE stands for Real Time Environment 27 | #RTE_TARGET: This is the type of DPDK build (64-bit native linux app using gcc) 28 | 29 | # Get the aliases and functions 30 | if [ -f ~/.bashrc ]; then 31 | . ~/.bashrc 32 | fi 33 | 34 | # User specific environment and startup programs 35 | 36 | PATH=$PATH:$HOME/.local/bin:$HOME/bin 37 | 38 | export PATH 39 | 40 | export RTE_SDK=/root/dpdk-16.07 41 | export RTE_TARGET=x86_64-native-linuxapp-gcc 42 | 43 | sudo sh /root/setup_env.sh 44 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/scripts/copy-id.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This helper script copied my ssh public key to all of the systems in the entire cluster, both compute node, and Host, Tenant, and VNF VMs. Ideally, those SSH keys would be copied during the cloning and creation process; I just didn't figure that out until it was too late. I copied the user ssh keys rather than the root ssh keys so that ansible could be run as non-root user. 25 | 26 | PREFIX="HostVM-" 27 | MAX_NODES=55 28 | i=0 29 | while [ $i -le $MAX_NODES ]; do 30 | #if the current id is less than 10, prefix it with a 0 31 | if [ $i -lt 10 ]; then 32 | host=${PREFIX}0$i 33 | else 34 | host=${PREFIX}$i 35 | fi 36 | echo "Host=$host" 37 | ssh-copy-id $host 38 | (( i++ )) 39 | done 40 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/testpmd/dpdk-container-lab/build_testpmd.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$RTE_SDK" == "" ]; then 33 | echo "Sorry, RTE_SDK env var has not been set to root of DPDK src tree" 34 | exit 1 35 | fi 36 | 37 | if [ "$RTE_TARGET" == "" ]; then 38 | echo "Sorry, RTE_TARGET env var has not been set to DPDK target build env" 39 | exit 1 40 | fi 41 | 42 | #echo "Making sure that DPDK has been built" 43 | #cd $RTE_SDK 44 | #make config O=$RTE_TARGET T=$RTE_TARGET 45 | #cd $RTE_TARGET 46 | #make -j8 47 | 48 | echo "Building testpmd..." 49 | cd "$RTE_SDK/app/test-pmd" 50 | make -j8 51 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/VNF-VM/root/setup_env.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script mounts the 1GB huge pages that were allocate at system boot. Thenit loads the igb_uio driver into the kernel and then binds PCI devices 00:04.0 and 00:05.0 (the DPDK-enabled vhostuser ports attached to Open vSwitch in the HostVM) to the igb_uio DPDK driver. 25 | umount /mnt/huge 26 | #umount /mnt/huge_2mb 27 | mount -t hugetlbfs nodev /mnt/huge 28 | #mount -t hugetlbfs nodev /mnt/huge_2mb -o pagesize=2mb 29 | mount 30 | 31 | 32 | DPDK_DIR=/root/dpdk-16.07 33 | 34 | modprobe uio 35 | insmod $DPDK_DIR/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko 36 | 37 | $DPDK_DIR/tools/dpdk-devbind.py -b igb_uio 00:04.0 38 | $DPDK_DIR/tools/dpdk-devbind.py -b igb_uio 00:05.0 39 | 40 | $DPDK_DIR/tools/dpdk-devbind.py --status 41 | 42 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step02-build_ovs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_BUILD" == "" ]; then 38 | echo "Sorry, DPDK_BUILD has not been defined." 39 | exit 1 40 | fi 41 | 42 | if [ "$OVS_DIR" == "" ]; then 43 | echo "Sorry, OVS_DIR has not been defined." 44 | exit 1 45 | fi 46 | 47 | 48 | cd "$OVS_DIR" 49 | echo "Running running the autoconf magic script" 50 | ./boot.sh 51 | echo "Configuring OVS with DPDK support" 52 | CFLAGS='-march=native' ./configure --with-dpdk="$DPDK_DIR"/"$DPDK_BUILD" 53 | 54 | echo "Building OVS" 55 | make -j8 56 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/00_setup_dpdk-lab.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This script is optional and runs the following scripts: 25 | # 01_start_ovs.sh 26 | # 02_createports_ovs.sh 27 | # 03_addroutes_vm-vm.sh 28 | # 04_start_VNF-VM.sh 29 | # 05_start_TenantVM.sh 30 | 31 | if [ "$(id -u)" != "0" ]; then 32 | echo "Sorry, you are not root." 33 | exit 1 34 | fi 35 | 36 | SCRIPT_DIR=$(pwd) 37 | 38 | echo "Starting OpenvSwitch..." 39 | $SCRIPT_DIR/01_start_ovs.sh 40 | 41 | echo "Creating OpenvSwitch ports..." 42 | $SCRIPT_DIR/02_createports_ovs.sh 43 | 44 | echo "Adding routes/flows..." 45 | $SCRIPT_DIR/03_addroutes_vm-vm.sh 46 | 47 | echo "Starting the VNF VM..." 48 | $SCRIPT_DIR/04_start_VNF-VM.sh 49 | 50 | echo "Starting the Tenant VM..." 51 | $SCRIPT_DIR/05_start_TenantVM.sh 52 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/TenantVM/root/start_pktgen.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script launches pktgen. The parameters allow DPDK to run on CPUs 2-6, allocate 512M of memory per socket, and specify that the hugepage memory for this process should have prefix of 'pg' to distinguish it from other applications that might be using the hugepages. The pktgen parameters specify that it should run in promiscuous mode and that 25 | 26 | # core 2 should handle port 0 rx 27 | # core 4 should handle port 0 tx 28 | # core 3 should handle port 1 rx 29 | # core 5 should handle port 1 tx 30 | 31 | export PKTGEN_DIR=/root/pktgen-3.0.14 32 | cd $PKTGEN_DIR 33 | ./app/app/x86_64-native-linuxapp-gcc/app/pktgen -c 0x3E -n 4 --proc-type auto --socket-mem 512 --file-prefix pg -- -T -p 0x3 -P -m "[2:4].0,[3:5].1" 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/TenantVM/root/setup_env.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script mounts the 1GB huge pages that were allocated at system boot. Then it loads the igb_uio driver into the kernel and then binds PCI devices 00:04.0 and 00:05.0 (the DPDK-enabled vhostuser ports attached to Open vSwitch in the HostVM) to the igb_uio DPDK driver. 25 | 26 | umount /mnt/huge 27 | #umount /mnt/huge_2mb 28 | mount -t hugetlbfs nodev /mnt/huge 29 | #mount -t hugetlbfs nodev /mnt/huge_2mb -o pagesize=2mb 30 | mount 31 | 32 | DPDK_DIR=/root/dpdk-16.07 33 | 34 | 35 | modprobe uio 36 | insmod $DPDK_DIR/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko 37 | 38 | $DPDK_DIR/tools/dpdk-devbind.py -b igb_uio 00:04.0 39 | $DPDK_DIR/tools/dpdk-devbind.py -b igb_uio 00:05.0 40 | 41 | $DPDK_DIR/tools/dpdk-devbind.py --status 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/07_unload_all_x710_drivers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #THis script verifies that the caller is root, and then unloads from the kernel all drivers for the XL710 virtual function (both kernel and DPDK) in the HostVM. It also unmounts the hugepages that DPDK was using. 27 | 28 | #This script can be called during the lab by each learner, or the instructor can call it on each HostVM by using the provisioning-master/utility/hvm_07_unload_all_x710_drivers.sh script. 29 | 30 | if [ "$(id -u)" != "0" ]; then 31 | echo "Sorry, you are not root." 32 | exit 1 33 | fi 34 | 35 | rmmod i40e 36 | rmmod i40evf 37 | rmmod ixgbe 38 | rmmod igb_uio 39 | rmmod cuse 40 | rmmod fuse 41 | rmmod uio 42 | rmmod eventfd_link 43 | rmmod ioeventfd 44 | umount /mnt/huge -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/07_unload_all_x710_drivers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | 27 | #THis script verifies that the caller is root, and then unloads from the kernel all drivers for the XL710 virtual function (both kernel and DPDK) in the HostVM. It also unmounts the hugepages that DPDK was using. 28 | 29 | #This script can be called during the lab by each learner, or the instructor can call it on each HostVM by using the provisioning-master/utility/hvm_07_unload_all_x710_drivers.sh script on the Ansible controller. 30 | 31 | if [ "$(id -u)" != "0" ]; then 32 | echo "Sorry, you are not root." 33 | exit 1 34 | fi 35 | 36 | rmmod i40e 37 | rmmod i40evf 38 | rmmod ixgbe 39 | rmmod igb_uio 40 | rmmod cuse 41 | rmmod fuse 42 | rmmod uio 43 | rmmod eventfd_link 44 | rmmod ioeventfd 45 | umount /mnt/huge -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/TenantVM/home/user/.bash_profile: -------------------------------------------------------------------------------- 1 | # .bash_profile 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Irene Liew 25 | 26 | 27 | #This is the .bash_profile from the TenanVM /home/user directory. It exports the following variables, calls /root/setup_env.sh, and then launches pktgen using /root/start_pktgen.sh: 28 | # RTE_SDK: This is the location of DPDK. RTE stands for Real Time Environment 29 | # RTE_TARGET: This is the type of DPDK build (64-bit native linux app using gcc) 30 | 31 | 32 | # Get the aliases and functions 33 | if [ -f ~/.bashrc ]; then 34 | . ~/.bashrc 35 | fi 36 | 37 | # User specific environment and startup programs 38 | 39 | PATH=$PATH:$HOME/.local/bin:$HOME/bin 40 | 41 | export PATH 42 | 43 | export RTE_SDK=/root/dpdk-16.07 44 | export RTE_TARGET=x86_64-native-linuxapp-gcc 45 | 46 | sudo sh /root/setup_env.sh 47 | sleep 1 48 | sudo sh /root/start_pktgen.sh 49 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step08-add_ovs_routes.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$OVS_DIR" == "" ]; then 33 | echo "Sorry, OVS_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | cd "$OVS_DIR" 38 | alias echo='echo' 39 | 40 | echo "**********Clearing current flows" 41 | ./utilities/ovs-ofctl del-flows br0 42 | 43 | echo "(Add bi-directional flow vhost-user2 and vhost-user3)" 44 | ./utilities/ovs-ofctl add-flow br0 in_port=2,dl_type=0x800,idle_timeout=0,action=output:3 45 | ./utilities/ovs-ofctl add-flow br0 in_port=3,dl_type=0x800,idle_timeout=0,action=output:2 46 | 47 | echo "(Add bi-directional flow between vhost-user1 and vhost-user4)" 48 | ./utilities/ovs-ofctl add-flow br0 in_port=1,dl_type=0x800,idle_timeout=0,action=output:4 49 | ./utilities/ovs-ofctl add-flow br0 in_port=4,dl_type=0x800,idle_timeout=0,action=output:1 50 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/cn_04_remove_vfs_from_vm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script launches the remove_sr-iov_nics.yaml found in the ../roles directory, and then sleeps for 20 seconds to give each of the newly redefined domains adequate time to reboot before printing out the network bus information of each of the domains that previously had SR-IOV interfaces. See remove_sr-iov_nics.yaml documentation for more information about what that role does. 27 | 28 | SCOPE=compute_nodes 29 | 30 | #run the remove_sr-iov_nics.yaml role on all compute_nodes as defined in /etc/ansible/hosts; ask for the SUDO password before running, and launch 14 parallel processes 31 | ansible-playbook ~/provisioning-master/roles/remove_sr-iov_nics.yaml -l $SCOPE -Kf14 32 | 33 | #This gives the newly redefined domains adequate time to boot 34 | sleep 20 35 | 36 | #run lshw on each of the SR-IOV VMs and display network device bus info 37 | ansible sr-iov_vms -a "lshw -c network -businfo" -bK 38 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/pktgen/dpdk-container-lab/step19-run_pktgen.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$PKTGEN_DIR" == "" ]; then 33 | echo "Sorry, PKTGEN_DIR env var has not been set to root of PKTGEN src tree" 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_DIR" == "" ]; then 38 | echo "Sorry, DPDK_DIR env var has not been set to root of DPDK src tree" 39 | exit 1 40 | fi 41 | 42 | if [ "$DPDK_BUILD" == "" ]; then 43 | echo "Sorry, DPDK_BUILD env var has not been set to DPDK target build env" 44 | exit 1 45 | fi 46 | 47 | #-P: Promiscuous mode 48 | #-T: Color terminal output 49 | #-m "0.0,4.1" (core.port): core 0: port 0 rx/tx; core 4: port 1 rx/tx 50 | PKTGEN_PARAMS='-T -P -m "0.0,4.1"' 51 | 52 | cd $PKTGEN_DIR 53 | 54 | CMD="./app/app/$DPDK_BUILD/pktgen $DPDK_PARAMS -- $PKTGEN_PARAMS" 55 | echo "Launching pktgen...CMD=$CMD" 56 | $CMD 57 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/testpmd/dpdk-container-lab/step17-run_testpmd.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR env var has not been set to root of DPDK src tree" 34 | exit 1 35 | fi 36 | 37 | #-i -- interactive mode 38 | #--burst=64: we are going to fetch 64 packets at at time 39 | #--txd=2048/--rxd=2048: we want 2048 descriptors in the rx and tx rings 40 | #--forward-mode=io: forward all packets received 41 | #--auto-start: start forwarding packets immediately on launch 42 | #--disable-hw-vlan: disable hardware VLAN 43 | #--coremask=0xC0: lock tespmd to run on cores 6-7 (0b1100 0000) 44 | export TESTPMD_PARAMS="--burst=64 -i --disable-hw-vlan --txd=2048 --rxd=2048 --forward-mode=io --auto-start --coremask=0xC0" 45 | 46 | CMD="$DPDK_DIR/app/test-pmd/testpmd $DPDK_PARAMS -- $TESTPMD_PARAMS" 47 | echo "Running $CMD" 48 | $CMD 49 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step06-create_ovs_ports.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$OVS_DIR" == "" ]; then 33 | echo "Sorry, OVS_DIR has not been defined." 34 | exit 1 35 | fi 36 | 37 | cd "$OVS_DIR" 38 | echo "Before creating the DPDK ports, tell OVS to use Core 2 for the DPDK PMD" 39 | ./utilities/ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x4 #1core 40 | 41 | echo "Done" 42 | 43 | echo "Create bridge br0 and vhost ports" 44 | ./utilities/ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev 45 | ./utilities/ovs-vsctl add-port br0 vhost-user1 -- set Interface vhost-user1 type=dpdkvhostuser 46 | ./utilities/ovs-vsctl add-port br0 vhost-user2 -- set Interface vhost-user2 type=dpdkvhostuser 47 | ./utilities/ovs-vsctl add-port br0 vhost-user3 -- set Interface vhost-user3 type=dpdkvhostuser 48 | ./utilities/ovs-vsctl add-port br0 vhost-user4 -- set Interface vhost-user4 type=dpdkvhostuser 49 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/snapshotGuestVMs.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #The snapshotGuestVMs.yaml Ansible play copied the snapshotGuest.sh script from the ../scripts directory to the remote compute nodes, and then ran that script. See the snapshotGuestVMs.sh script for more information. 25 | #This play has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts. 28 | --- 29 | - hosts: all 30 | become: true 31 | vars: 32 | script_name: snapshotGuestVMs.sh 33 | tasks: 34 | - name: copy the startup script 35 | copy: src={{ provisioning_master_dir }}/scripts/{{ script_name }} dest={{ provisioning_slave_dir }}/{{ script_name}} mode=0744 36 | - name: Run the script 37 | command: "{{ provisioning_slave_dir }}/{{ script_name }}" 38 | become_user: root 39 | become_method: sudo 40 | ... 41 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/03_addroutes_vm-vm.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script clears any existing flows, sets traffic flows in the following pattern, and then dumps the flows for debugging purposes: 25 | # in port 2, out port 3 26 | # in port 3, out port 2 27 | # in port 1, out port 4 28 | # in port 4, out port 1 29 | 30 | if [ "$(id -u)" != "0" ]; then 31 | echo "Sorry, you are not root." 32 | exit 1 33 | fi 34 | 35 | export OVS_DIR=/usr/src/ovs-branch-2.6 36 | 37 | cd $OVS_DIR 38 | 39 | # Clear current flows 40 | ./utilities/ovs-ofctl del-flows br0 41 | 42 | # Add Flow for port 0 to port 1 and port 1 to port 0 43 | ./utilities/ovs-ofctl add-flow br0 in_port=2,dl_type=0x800,idle_timeout=0,action=output:3 44 | ./utilities/ovs-ofctl add-flow br0 in_port=3,dl_type=0x800,idle_timeout=0,action=output:2 45 | ./utilities/ovs-ofctl add-flow br0 in_port=1,dl_type=0x800,idle_timeout=0,action=output:4 46 | ./utilities/ovs-ofctl add-flow br0 in_port=4,dl_type=0x800,idle_timeout=0,action=output:1 47 | 48 | 49 | ./utilities/ovs-ofctl dump-flows br0 50 | 51 | sleep 1 52 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step00-setenv: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | DPDK_VERSION="/home/ubuntu/dpdk-stable-16.11.1" 26 | OVS_VERSION="/home/ubuntu/openvswitch-2.6.1" 27 | export RTE_SDK="/home/ubuntu/dpdk" 28 | export OVS_DIR="/home/ubuntu/ovs" 29 | 30 | echo "Checking for DPDK directory" 31 | if [ ! -e $DPDK_VERSION ]; then 32 | echo "Unable to find the correct DPDK version in $DPDK_VERSION. Exiting" 33 | exit 1 34 | fi 35 | 36 | if [ ! -L $RTE_SDK ]; then 37 | echo "Creating symbolic link to DPDK directory" 38 | ln -s $DPDK_VERSION $RTE_SDK 39 | fi 40 | 41 | echo "Checking for OVS directory" 42 | if [ ! -e $OVS_VERSION ]; then 43 | echo "Unable to find the correct OVS version in $OVS_VERSION. Exiting" 44 | exit 1 45 | fi 46 | 47 | if [ ! -L $OVS_DIR ]; then 48 | echo "Creating symbolic link to OVS directory" 49 | ln -s $OVS_VERSION $OVS_DIR 50 | fi 51 | 52 | export RTE_TARGET="x86_64-native-linuxapp-gcc" 53 | export DPDK_DIR=$RTE_SDK 54 | export DPDK_BUILD=$RTE_TARGET 55 | export TRAINING_DIR="/home/ubuntu/training/dpdk-container-lab" 56 | alias sudo='sudo -E' 57 | echo "Done." 58 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/12_stop_ovs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script kills all Open vSwitch processes and cleans up all databases and shared memory. It then removes all dpdk drivers from the kernel and inserts i40e and ixgbe drivers into the kernel. Finally, it unmounts the 1 GB huge pages at /mnt/huge. 25 | 26 | if [ "$(id -u)" != "0" ]; then 27 | echo "Sorry, you are not root." 28 | exit 1 29 | fi 30 | 31 | #Kill Open vSwitch and clean it up 32 | pkill -9 ovs 33 | rm -rf /usr/local/var/run/openvswitch 34 | rm -rf /usr/local/etc/openvswitch/ 35 | rm -f /tmp/conf.db 36 | 37 | #Unload DPDK drivers from the kernel 38 | rmmod igb_uio 39 | rmmod cuse 40 | rmmod fuse 41 | rmmod openvswitch 42 | rmmod uio 43 | rmmod eventfd_link 44 | rmmod ioeventfd 45 | rm -rf /dev/vhost-net 46 | 47 | #load the kernel NIC drivers 48 | insmod i40e 49 | insmod ixgbe 50 | 51 | 52 | #display the NIC bind status 53 | export DPDK_DIR=/usr/src/dpdk-16.07 54 | export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc 55 | python $DPDK_DIR/tools/dpdk-devbind.py --status 56 | 57 | #free up the hugepage memory 58 | umount nodev /mnt/huge 59 | mount | grep huge 60 | 61 | 62 | -------------------------------------------------------------------------------- /SR-IOV_Network_Virtual_Functions_in_KVM/listvfs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #!/bin/bash 25 | 26 | NIC_DIR="/sys/class/net" 27 | declare -a PARENT_PF_PCI_INFO 28 | declare -a VF_INTERFACE_INFO 29 | declare -a PARENT_PF_DESCRIPTION_INFO 30 | num_vfs=0 31 | for i in $( ls $NIC_DIR) ; 32 | do 33 | # echo "Determining Physfn info for $i" 34 | if [ -L "${NIC_DIR}/$i/device/physfn" ]; then 35 | PARENT_PF_PCI=$( readlink "${NIC_DIR}/$i/device/physfn" | cut -d '/' -f2 ) 36 | PARENT_PF_VENDOR=$( lspci -vmmks $PARENT_PF_PCI | grep ^Vendor | cut -f2) 37 | PARENT_PF_NAME=$( lspci -vmmks $PARENT_PF_PCI | grep ^Device | cut -f2) 38 | VF_INTERFACE_INFO[$num_vfs]="$i" 39 | PARENT_PF_PCI_INFO[$num_vfs]="$PARENT_PF_PCI" 40 | PARENT_PF_DESCRIPTION_INFO[$num_vfs]="$PARENT_PF_VENDOR $PARENT_PF_NAME" 41 | ((num_vfs++)) 42 | fi 43 | done 44 | 45 | if [[ $num_vfs -gt 0 ]]; then 46 | echo -e "VF Device\tParent PF PCI BDF\tParent PF Description" 47 | echo -e "=========\t=================\t=====================" 48 | for (( i=0; i < $num_vfs; i++ )) ; 49 | do 50 | echo -e "${VF_INTERFACE_INFO[$i]}\t\t${PARENT_PF_PCI_INFO[$i]}\t\t${PARENT_PF_DESCRIPTION_INFO[$i]}" 51 | done 52 | echo " " 53 | fi 54 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/shutdownGuestVMs.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible role prepares the compute nodes to run the shutdownGuestVMs.py script found in ../scripts and then executes that script. See the documentation in shutdownGuestVMs.py for more information. 25 | #This role has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts. 28 | --- 29 | - hosts: all 30 | become: true 31 | vars: 32 | script_name: shutdownGuestVMs.py 33 | tasks: 34 | - name: copy the VMManager module 35 | copy: src={{ provisioning_master_dir }}/scripts/VMManager.py dest={{ provisioning_slave_dir }}/VMManager.py mode=0744 36 | - name: copy the startup script 37 | copy: src={{ provisioning_master_dir }}/scripts/{{ script_name }} dest={{ provisioning_slave_dir }}/{{ script_name}} mode=0744 38 | - name: Run the script 39 | command: "{{ provisioning_slave_dir }}/{{ script_name }}" 40 | become: true 41 | ... 42 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/startGuestVMs.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible role prepares the compute nodes to run the startGuestVMs.py script found in ../scripts and then executes that script. See the documentation in startGuestVMs.py for more information. 25 | #This role has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts. 28 | --- 29 | - hosts: all 30 | become: true 31 | vars: 32 | script_name: startGuestVMs.py 33 | tasks: 34 | - name: copy the VMManager module 35 | copy: src={{ provisioning_master_dir }}/scripts/VMManager.py dest={{ provisioning_slave_dir }}/VMManager.py mode=0744 36 | - name: copy the startup script 37 | copy: src={{ provisioning_master_dir }}/scripts/{{ script_name }} dest={{ provisioning_slave_dir }}/{{ script_name}} mode=0744 38 | - name: Run the startup script 39 | command: "{{ provisioning_slave_dir }}/{{ script_name }}" 40 | become: true 41 | ... 42 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/02_createports_ovs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #This script creates the Open vSwitch bridge br0 and adds 4 DPDK enabled vhost-user ports to the bridge. 25 | if [ "$(id -u)" != "0" ]; then 26 | echo "Sorry, you are not root." 27 | exit 1 28 | fi 29 | 30 | 31 | OVS_DIR=/usr/src/ovs-branch-2.6 32 | 33 | echo "Set PMD cores: 1 core" 34 | $OVS_DIR/utilities/ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=4 #1core 35 | 36 | echo "Done" 37 | sleep 5 38 | 39 | echo "Create bridge br0 and vhost ports" 40 | #create vhost ports 41 | $OVS_DIR/utilities/ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev 42 | sleep 3 43 | $OVS_DIR/utilities/ovs-vsctl add-port br0 vhost-user0 -- set Interface vhost-user0 type=dpdkvhostuser 44 | sleep 3 45 | $OVS_DIR/utilities/ovs-vsctl add-port br0 vhost-user1 -- set Interface vhost-user1 type=dpdkvhostuser 46 | sleep 3 47 | $OVS_DIR/utilities/ovs-vsctl add-port br0 vhost-user2 -- set Interface vhost-user2 type=dpdkvhostuser 48 | sleep 3 49 | $OVS_DIR/utilities/ovs-vsctl add-port br0 vhost-user3 -- set Interface vhost-user3 type=dpdkvhostuser 50 | 51 | echo "Show br0 info:" 52 | $OVS_DIR/utilities/ovs-vsctl show 53 | 54 | 55 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/cleanImages.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible play cleans out the default libvirt image store location (/var/lib/libvirt/images), by deleting the directory and re-creating it. The play spares only the master VM image by first moving it to a temporary directory and then putting it back. Pre-conditions: this play assumes that all VMs are shutdown and have been undefined. 25 | --- 26 | - hosts: all 27 | become: true 28 | vars: 29 | tmp_dir: /tmp 30 | images_dir: /var/lib/libvirt/images 31 | master_vm_image: HostVM-Master.qcow2 32 | tasks: 33 | - name: Temp move the Master image 34 | command: mv {{ images_dir }}/{{ master_vm_image }} {{ tmp_dir }}/ 35 | become_user: root 36 | become_method: sudo 37 | - name: clean out the images directory 38 | file: path={{ images_dir }} state=absent 39 | become: true 40 | - name: Create the images directory again 41 | file: path={{ images_dir }} state=directory 42 | become_user: root 43 | become_method: sudo 44 | - name: Move the Master image back 45 | command: mv {{ tmp_dir }}/{{ master_vm_image }} {{ images_dir }}/ 46 | become_user: root 47 | become_method: sudo 48 | ... 49 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/02_stop_ovs.sh: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2016 Intel Corporation 3 | 4 | # Permission is hereby granted, free of charge, to any person obtaining a 5 | # copy of this software and associated documentation files (the 6 | # "Software"), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, 8 | # distribute, sublicense, and/or sell copies of the Software, and to 9 | # permit persons to whom the Software is furnished to do so, subject to 10 | # the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included 13 | # in all copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | # Author: Clayne B. Robison 24 | 25 | #This script kills all Open vSwitch processes and cleans up all databases and shared memory. It then removes all dpdk drivers from the kernel and inserts i40e and ixgbe drivers into the kernel. Finally, it unmounts the 1 GB huge pages at /mnt/huge. 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | #kill Open vSwitch and clean it up 33 | pkill -9 ovs 34 | rm -rf /usr/local/var/run/openvswitch 35 | rm -rf /usr/local/etc/openvswitch/ 36 | rm -f /tmp/conf.db 37 | 38 | 39 | #remove any remaining DPDK and OvS drivers from the kernel 40 | rmmod igb_uio 41 | rmmod cuse 42 | rmmod fuse 43 | rmmod openvswitch 44 | rmmod uio 45 | rmmod eventfd_link 46 | rmmod ioeventfd 47 | rm -rf /dev/vhost-net 48 | 49 | #insert the Intel kernel NIC drivers into the kernel 50 | insmod i40e 51 | insmod ixgbe 52 | 53 | 54 | export DPDK_DIR=/usr/src/dpdk-16.07 55 | export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc 56 | python $DPDK_DIR/tools/dpdk-devbind.py --status 57 | 58 | #unmount the hugepages to free them 59 | umount nodev /mnt/huge 60 | mount | grep huge 61 | 62 | 63 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step05-start_ovs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$RTE_SDK" == "" ]; then 33 | echo "Sorry, RTE_SDK has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$RTE_TARGET" == "" ]; then 38 | echo "Sorry, RTE_TARGET has not been defined." 39 | exit 1 40 | fi 41 | 42 | if [ "$DPDK_BUILD" == "" ]; then 43 | echo "Sorry, DPDK_BUILD has not been defined." 44 | exit 1 45 | fi 46 | 47 | if [ "$DPDK_DIR" == "" ]; then 48 | echo "Sorry, DPDK_DIR has not been defined." 49 | exit 1 50 | fi 51 | 52 | if [ "$OVS_DIR" == "" ]; then 53 | echo "Sorry, OVS_DIR has not been defined." 54 | exit 1 55 | fi 56 | 57 | cd "$OVS_DIR" 58 | echo "Telling the OVS controller to start OVS with DPDK using 512MB hugepage memory and run the ovswitchd daemon on logical core 1" 59 | ./utilities/ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true \ 60 | other_config:dpdk-lcore-mask=0x2 other_config:dpdk-socket-mem="512" 61 | 62 | echo "Starting the OVS daemon..." 63 | ./vswitchd/ovs-vswitchd unix:/usr/local/var/run/openvswitch/db.sock --pidfile --detach 64 | 65 | sleep 2 66 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/03_unload_dpdk.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | #This script explictly binds the NICs at PCI addresses 00:09.0 and 00:0a.0 to the Intel kernel drivers. This is necessary so that we can find out what IP address has been allocated to the NIC ports. 24 | 25 | if [ "$(id -u)" != "0" ]; then 26 | echo "Sorry, you are not root." 27 | exit 1 28 | fi 29 | 30 | if [ "$RTE_SDK" == "" ]; then 31 | echo "Sorry, RTE_SDK has not been defined." 32 | exit 1 33 | fi 34 | 35 | if [ "$RTE_TARGET" == "" ]; then 36 | echo "Sorry, RTE_TARGET has not been defined." 37 | exit 1 38 | fi 39 | 40 | export PCI_PORT_0="00:09.0" 41 | export PCI_PORT_1="00:0a.0" 42 | DRIVER="i40evf" 43 | 44 | insmod i40e 45 | insmod i40evf 46 | insmod ixgbe 47 | 48 | 49 | echo "Binding $PCI_PORT_0 to $DRIVER" 50 | python $RTE_SDK/tools/dpdk-devbind.py --bind=$DRIVER $PCI_PORT_0 51 | echo "Binding $PCI_PORT_1 to $DRIVER" 52 | python $RTE_SDK/tools/dpdk-devbind.py --bind=$DRIVER $PCI_PORT_1 53 | 54 | rmmod igb_uio 55 | rmmod cuse 56 | rmmod fuse 57 | rmmod uio 58 | rmmod eventfd_link 59 | rmmod ioeventfd 60 | 61 | python $RTE_SDK/tools/dpdk-devbind.py --status 62 | 63 | umount /mnt/huge 64 | 65 | cat /proc/meminfo 66 | 67 | 68 | -------------------------------------------------------------------------------- /SR-IOV_Network_Virtual_Functions_in_KVM/listvfs_by_pf.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #!/bin/bash 25 | 26 | NIC_DIR="/sys/class/net" 27 | for i in $( ls $NIC_DIR) ; 28 | do 29 | if [ -d "${NIC_DIR}/$i/device" -a ! -L "${NIC_DIR}/$i/device/physfn" ]; then 30 | declare -a VF_PCI_BDF 31 | declare -a VF_INTERFACE 32 | k=0 33 | for j in $( ls "${NIC_DIR}/$i/device" ) ; 34 | do 35 | if [[ "$j" == "virtfn"* ]]; then 36 | VF_PCI=$( readlink "${NIC_DIR}/$i/device/$j" | cut -d '/' -f2 ) 37 | VF_PCI_BDF[$k]=$VF_PCI 38 | #get the interface name for the VF at this PCI Address 39 | for iface in $( ls $NIC_DIR ); 40 | do 41 | link_dir=$( readlink ${NIC_DIR}/$iface ) 42 | if [[ "$link_dir" == *"$VF_PCI"* ]]; then 43 | VF_INTERFACE[$k]=$iface 44 | fi 45 | done 46 | ((k++)) 47 | fi 48 | done 49 | NUM_VFs=${#VF_PCI_BDF[@]} 50 | if [[ $NUM_VFs -gt 0 ]]; then 51 | echo "Physical Function $i has the following virtual functions:" 52 | echo -e "PCI BDF\t\tInterface" 53 | echo -e "=======\t\t=========" 54 | for (( l = 0; l < $NUM_VFs; l++ )) ; 55 | do 56 | echo -e "${VF_PCI_BDF[$l]}\t${VF_INTERFACE[$l]}" 57 | done 58 | unset VF_PCI_BDF 59 | unset VF_INTERFACE 60 | echo " " 61 | fi 62 | fi 63 | done 64 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step04-configure_ovs_db.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$RTE_SDK" == "" ]; then 33 | echo "Sorry, RTE_SDK has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$RTE_TARGET" == "" ]; then 38 | echo "Sorry, RTE_TARGET has not been defined." 39 | exit 1 40 | fi 41 | 42 | if [ "$DPDK_BUILD" == "" ]; then 43 | echo "Sorry, DPDK_BUILD has not been defined." 44 | exit 1 45 | fi 46 | 47 | if [ "$DPDK_DIR" == "" ]; then 48 | echo "Sorry, DPDK_DIR has not been defined." 49 | exit 1 50 | fi 51 | 52 | if [ "$OVS_DIR" == "" ]; then 53 | echo "Sorry, OVS_DIR has not been defined." 54 | exit 1 55 | fi 56 | 57 | echo "Initializing the new OVS database" 58 | cd "$OVS_DIR" 59 | ./ovsdb/ovsdb-tool create /usr/local/etc/openvswitch/conf.db ./vswitchd/vswitch.ovsschema 60 | 61 | echo "Starting the OVS database server" 62 | ./ovsdb/ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ 63 | --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ 64 | --pidfile --detach 65 | 66 | echo "Initializing the OVS database" 67 | ./utilities/ovs-vsctl --no-wait init 68 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/utility/hvm_07_unload_all_x710_drivers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script used the generic runScript.yaml Ansible role found in ../roles to run the 07_unload_all_x710_drivers.sh script from ../host-vm on each one of the HOSTVM systems. See the documentation for 07_unload_all_x710_drivers.sh for more information about what that script does. This script passes three parameters into the runScript.yaml role: 27 | # dest_path: this variable is defined in runScript.yaml, but the command-line --extra-vars definition overrides that definition. It is the directory on the HostVM into which the script should be copied before it is run. 28 | # script_name: this is the name of the script, in this case 07_unload_all_x710_drivers.sh. 29 | # relative_source_path: this is the location of the script relative to provisioning_master_dir, which is defined in /etc/ansible/hosts. Thus, the location of the 07_unload_all_x710_drivers.sh script is {{ provisioning_master_dir }}/host-vm 30 | 31 | PARAM="dest_path='/home/user/training/sr-iov-lab' script_name='07_unload_all_x710_drivers.sh' relative_source_path='host-vm'" 32 | 33 | SCOPE="host_vms" 34 | 35 | ansible-playbook ~/provisioning-master/roles/runScript.yaml -l $SCOPE -Kf14 --extra-vars "$PARAM" 36 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/copyFile.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible play copies a file to the inventory by 1) removing the existing file from the remote system; 2) copying the file to a temp location on the remote system; 3) moving the file to the right location on the remote system; and 4) changing file ownership. The play has one input parameter: 25 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts. 26 | 27 | --- 28 | - hosts: all 29 | become: true 30 | vars: 31 | file_name: sdnnfv-admin 32 | tmp_dir: /home/sdnnfv-admin/ 33 | src_dir: "{{ provisioning_master_dir }}/files" 34 | dest_dir: /etc/sudoers.d 35 | owner: root 36 | mode: 0664 37 | tasks: 38 | - name: remove the the existing file 39 | file: path={{ dest_dir }}/{{ file_name }} state=absent 40 | - name: copy the file to the machine 41 | copy: src={{ src_dir }}/{{ file_name }} dest={{ tmp_dir }}/{{ file_name}} 42 | - name: move the file to the right location 43 | command: mv {{ tmp_dir }}/{{ file_name }} {{ dest_dir }}/{{ file_name}} 44 | become: true 45 | - name: CHange file ownership 46 | file: path={{ dest_dir }}/{{ file_name }} mode={{ mode }} owner={{ owner }} group={{ owner }} 47 | become: true 48 | ... 49 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/edit_host_vm_kernel_params.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible play modified the deployed HostVM guest machines grub command lines to add support for 9 hugepages of size 1GB, remove CPUs 1-4 from the SMP scheduler algorithms, and set the other parameters for tickless kernel on CPUs 1-4. It then rebooted the HostVM system and waited for their return. Obviously, if the base image already has this in in the boot/grub command line, this play is not necessary. 25 | --- hosts: all 26 | become: true 27 | vars: 28 | search_expression: ^GRUB_CMDLINE_LINUX_DEFAULT 29 | file_name: /etc/default/grub 30 | line: GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0,38400n8 console=tty0 default_hugepagesz=1GB hugepagesz=1GB hugepages=9 isolcpus=1,2,3,4 nohz_full=1,2,3,4 rcu_nocbs=1,2,3,4" 31 | tasks: 32 | - name: Add the Hugepage support parameters to the kernel cmdline 33 | lineinfile: dest={{ file_name }} regexp={{ search_expression }} line={{ line }} 34 | - name: Rebuild the kernel 35 | command: update-grub 36 | - name: Reboot 37 | command: shutdown -r now "kernel modified, rebooting" 38 | async: 0 39 | poll: 0 40 | ignore_errors: true 41 | - name: Wait for server to come back 42 | local_action: wait_for host={{ inventory_hostname }} state=started 43 | sudo: false 44 | 45 | ... 46 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/runScript.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This script is a generic script that copies a specified script to remote inventory and then executes it as root. 25 | # Input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts 28 | # relative_source_path: this is a path relative to provisioning_master_dir in which the script file is located. This variable MUST be defined on the command line when instantiating this Ansible role. 29 | # script_name: this is the name of the script that is found at provisioning_master_dir/relative_source_path and which will be copied to provisioning_slave_dir on the remote node and then executed. This variable MUST be defined on the command line when instantiating this Ansible role. 30 | --- 31 | - hosts: all 32 | become: true 33 | vars: 34 | dest_path: "{{ provisioning_slave_dir }}" 35 | source_path: "{{ provisioning_master_dir }}/{{ relative_source_path }}" 36 | tasks: 37 | - name: copy the script 38 | copy: src={{ source_path }}/{{ script_name }} dest={{ dest_path }}/{{ script_name }} mode=0775 39 | - name: Run the script 40 | command: "{{ dest_path }}/{{ script_name }}" 41 | become: true 42 | ... 43 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/step03-prep_OvS.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$RTE_SDK" == "" ]; then 33 | echo "Sorry, RTE_SDK has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$RTE_TARGET" == "" ]; then 38 | echo "Sorry, RTE_TARGET has not been defined." 39 | exit 1 40 | fi 41 | 42 | if [ "$DPDK_BUILD" == "" ]; then 43 | echo "Sorry, DPDK_BUILD has not been defined." 44 | exit 1 45 | fi 46 | 47 | if [ "$DPDK_DIR" == "" ]; then 48 | echo "Sorry, DPDK_DIR has not been defined." 49 | exit 1 50 | fi 51 | 52 | if [ "$OVS_DIR" == "" ]; then 53 | echo "Sorry, OVS_DIR has not been defined." 54 | exit 1 55 | fi 56 | 57 | echo "Cleaning up any allocated resources" 58 | ./cleanup.sh 59 | 60 | echo "Re-allocating hugepages" 61 | echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages 62 | 63 | echo "Creating openvswitch directories" 64 | mkdir -p /usr/local/etc/openvswitch 65 | mkdir -p /usr/local/var/run/openvswitch 66 | 67 | echo "Mounting the hugepage tlfs" 68 | mount -t hugetlbfs none /mnt/huge 69 | 70 | echo "Show the fs table:" 71 | mount | grep -i huge 72 | 73 | echo "Inserting the user-space IO driver into the kernel" 74 | modprobe uio 75 | insmod $DPDK_DIR/$DPDK_BUILD/kmod/igb_uio.ko 76 | 77 | echo "Show free/used hugepage info" 78 | cat /proc/meminfo | grep -i huge 79 | 80 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/testpmd/dpdk-container-lab/step16-set_testpmd_dpdk_params.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$DPDK_DIR" == "" ]; then 33 | echo "Sorry, DPDK_DIR env var has not been set to root of DPDK src tree" 34 | exit 1 35 | fi 36 | 37 | #-c 0xE0: DPDK can run on core 5-7: (0b1110 0000) 38 | #--master-lcore 5: make the make the master testpmd thread run on core 5 (0b0010 0000) 39 | #-n 1: we only have one memory bank in this VM 40 | # --single-file -m 512: allocate hugepage memory in a single file. See http://dpdk.org/dev/patchwork/patch/10406/ 41 | #--file-prefix testpmd: "testpmd" will be appended to hugepage memory files used by this process 42 | #--no-pci don't look for any PCI devices 43 | #--vdev=net_virtio_user3,mac=00:00:00:00:00:03,path=/var/run/openvswitch/vhost-user3 44 | #--vdev=net_virtio_user4,mac=00:00:00:00:00:04,path=/var/run/openvswitch/vhost-user4: use a virtual 45 | # device using the net_virtio_user driver, MAC address 00:00:00:00:00:03, and the path to the 46 | # unix socket is /var/run/openvswitch/vhost-user3 47 | export DPDK_PARAMS="-c 0xE0 --master-lcore 5 -n 1 --single-file -m 512 --file-prefix testpmd --no-pci --vdev=net_virtio_user3,mac=00:00:00:00:00:03,path=/var/run/openvswitch/vhost-user3 --vdev=net_virtio_user4,mac=00:00:00:00:00:04,path=/var/run/openvswitch/vhost-user4" 48 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/copyImages.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible play was used to prepare for the cloneImages.yaml play. It copies the HostVM-Master domain definition XML file and image files to the target inventory. This play has two pre-conditions: 25 | # 1. the HostVM-Master.qcow2 image must be located at /var/lib/libvirt/images on the ansible controller node. 26 | # 2. the HostVM-Master.xml domain definition file must be located at {{ provisioning_master_dir }}. 27 | 28 | # This role has several input parameters: 29 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 30 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts. 31 | --- 32 | - hosts: all 33 | become: true 34 | vars: 35 | src_dir: "{{ provisioning_master_dir }}" 36 | dest_dir: "{{ provisioning_slave_dir }}" 37 | tasks: 38 | - name: copy the xml file to the target 39 | become: true 40 | copy: src={{ src_dir }}/HostVM-Master.xml dest=/home/sdnnfv-admin/provisioning/HostVM-Master.xml 41 | - name: copy the Master file to the target 42 | copy: src=/var/lib/libvirt/images/HostVM-Master.qcow2 dest=/var/lib/libvirt/images/HostVM-Master.qcow2 43 | become: true 44 | - name: change the permissions on the /var/lib/libvirt/images folder 45 | file: path=/var/lib/libvirt/images/ mode=0711 46 | become: true 47 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/compute-node/02_load_vfs_into_libvirt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script creates libvirt networks on the SR-IOV functions that have been 27 | #defined in the previous step. It assumes that the XML files sr-iov-port0-3.xml 28 | #are already present at $SR_IOV_NET_FILE_PATH 29 | 30 | if [ "$(id -u)" != "0" ]; then 31 | echo "Sorry, you are not root." 32 | exit 1 33 | fi 34 | 35 | #Change this to be the location of the XML files that define the SR-IOV NIC-based networks 36 | 37 | SR_IOV_NET_FILE_PATH="/home/sdnnfv-admin/provisioning-slave/sr-iov-networks" 38 | 39 | #This script loads the existing virtual functions into the system libvirt network 40 | echo "Defining network pools of Virtual Functions..." 41 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port0.xml 42 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port1.xml 43 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port2.xml 44 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port3.xml 45 | 46 | #Start the SR-IOV based networks, otherwise libvirt will whine when we start the VMs 47 | #The names of these networks are the names that are found in the XML files, and have nothing to do with the names of the XML files that defined them. 48 | echo "Starting virtual function networks..." 49 | virsh net-start sr-iov-port0 50 | virsh net-start sr-iov-port1 51 | virsh net-start sr-iov-port2 52 | virsh net-start sr-iov-port3 53 | 54 | #display the status of the KVM networks on this node 55 | virsh net-list --all 56 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/scripts/02_load_vfs_into_libvirt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script creates libvirt networks on the SR-IOV functions that have been 27 | #defined in the previous step. It assumes that the XML files sr-iov-port0-3.xml 28 | #are already present at $SR_IOV_NET_FILE_PATH 29 | 30 | if [ "$(id -u)" != "0" ]; then 31 | echo "Sorry, you are not root." 32 | exit 1 33 | fi 34 | 35 | #Change this to be the location of the XML files that define the SR-IOV NIC-based networks 36 | 37 | SR_IOV_NET_FILE_PATH="/home/sdnnfv-admin/provisioning-slave/sr-iov-networks" 38 | 39 | #This script loads the existing virtual functions into the system libvirt network 40 | echo "Defining network pools of Virtual Functions..." 41 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port0.xml 42 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port1.xml 43 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port2.xml 44 | virsh net-define $SR_IOV_NET_FILE_PATH/sr-iov-port3.xml 45 | 46 | #Start the SR-IOV based networks, otherwise libvirt will whine when we start the VMs 47 | #The names of these networks are the names that are found in the XML files, and have nothing to do with the names of the XML files that defined them. 48 | echo "Starting virtual function networks..." 49 | virsh net-start sr-iov-port0 50 | virsh net-start sr-iov-port1 51 | virsh net-start sr-iov-port2 52 | virsh net-start sr-iov-port3 53 | 54 | #display the status of the KVM networks on this node 55 | virsh net-list --all 56 | 57 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/06_build_start_pktgen_on_vf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script re-builds DPDK and then launches pktgen. See comments below for more details about parameters 27 | 28 | if [ "$(id -u)" != "0" ]; then 29 | echo "Sorry, you are not root." 30 | exit 1 31 | fi 32 | 33 | if [ "$RTE_SDK" == "" ]; then 34 | echo "Sorry, RTE_SDK env var has not been set to root of DPDK src tree" 35 | exit 1 36 | fi 37 | 38 | if [ "$RTE_TARGET" == "" ]; then 39 | echo "Sorry, RTE_TARGET env var has not been set to DPDK target build env" 40 | exit 1 41 | fi 42 | 43 | #In these parameters, we lock pktgen to do 44 | # -m "[1:2].0" -- on port 0, core 1 does rx, core 2 does tx 45 | # -P -- promiscuos mode 46 | # -T -- colored terminal display mode 47 | PKTGEN_PARAMS='-T -p 0x3 -P -m "[1:2].0"' 48 | 49 | #-c 0x6 -- DPDK can run on cpus: 0000 0110 50 | #-n 1 we only have one memory bank in this VM 51 | #--pci-whitelist -- DPDK will only use the device at PCI address 52 | #--socket-mem 512 -- 512M of memory for each socket 53 | #--file-prefix pg -- prefix the hugepage memory files with a 'pg' prefix 54 | DPDK_PARAMS="-c 0x06 -n 1 --proc-type auto --socket-mem 512 --file-prefix pg --pci-whitelist 00:0a.0" 55 | 56 | #make sure that DPDK has been built 57 | cd $RTE_SDK 58 | make config O=$RTE_TARGET T=$RTE_TARGET 59 | cd $RTE_TARGET 60 | make -j10 61 | 62 | export PKTGEN_DIR=/usr/src/pktgen-3.0.14 63 | cd $PKTGEN_DIR 64 | make -j10 65 | 66 | 67 | ./app/app/$RTE_TARGET/pktgen $DPDK_PARAMS -- $PKTGEN_PARAMS 68 | 69 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/docker-build/pktgen/dpdk-container-lab/step18-set_pktgen_dpdk_params.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$PKTGEN_DIR" == "" ]; then 33 | echo "Sorry, PKTGEN_DIR env var has not been set to root of PKTGEN src tree" 34 | exit 1 35 | fi 36 | 37 | if [ "$DPDK_DIR" == "" ]; then 38 | echo "Sorry, DPDK_DIR env var has not been set to root of DPDK src tree" 39 | exit 1 40 | fi 41 | 42 | if [ "$DPDK_BUILD" == "" ]; then 43 | echo "Sorry, DPDK_BUILD env var has not been set to DPDK target build env" 44 | exit 1 45 | fi 46 | 47 | #-c 0x19: DPDK can run on core 0,3-4: (0b0001 1001) 48 | #--master-lcore 3: make the pktgen dpdk thread run on core 3 (0b1000) 49 | #-n 1: we only have one memory bank in this VM 50 | # --single-file -m 512: allocate hugepage memory in a single file. See http://dpdk.org/dev/patchwork/patch/10406/ 51 | #--file-prefix pktgen: "pktgen" will be appended to hugepage memory files used by this process 52 | #--no-pci don't look for any PCI devices 53 | #--vdev 'virtio_user1,mac=00:00:00:00:00:01,path=/var/run/openvswitch/vhost-user1' 54 | #--vdev 'virtio_user2,mac=00:00:00:00:00:02,path=/var/run/openvswitch/vhost-user2' 55 | export DPDK_PARAMS="-c 0x19 --master-lcore 3 -n 1 --single-file -m 512 --file-prefix pktgen --no-pci --vdev=net_virtio_user1,mac=00:00:00:00:00:01,path=/var/run/openvswitch/vhost-user1 --vdev=net_virtio_user2,mac=00:00:00:00:00:02,path=/var/run/openvswitch/vhost-user2" 56 | -------------------------------------------------------------------------------- /DPDK_in_Containers_Hands-on_Lab/dpdk-container-lab/cleanup.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | 25 | #!/bin/bash 26 | 27 | if [ "$(id -u)" != "0" ]; then 28 | echo "Sorry, you are not root." 29 | exit 1 30 | fi 31 | 32 | if [ "$RTE_SDK" == "" ]; then 33 | echo "Sorry, RTE_SDK has not been defined." 34 | exit 1 35 | fi 36 | 37 | if [ "$RTE_TARGET" == "" ]; then 38 | echo "Sorry, RTE_TARGET has not been defined." 39 | exit 1 40 | fi 41 | 42 | if [ "$DPDK_BUILD" == "" ]; then 43 | echo "Sorry, DPDK_BUILD has not been defined." 44 | exit 1 45 | fi 46 | 47 | if [ "$DPDK_DIR" == "" ]; then 48 | echo "Sorry, DPDK_DIR has not been defined." 49 | exit 1 50 | fi 51 | 52 | if [ "$OVS_DIR" == "" ]; then 53 | echo "Sorry, OVS_DIR has not been defined." 54 | exit 1 55 | fi 56 | 57 | echo "Terminating Open vSwitch processes" 58 | pkill -9 ovs 59 | 60 | echo "Removing directories used by Open vSwitch" 61 | rm -rf /usr/local/var/run/openvswitch 62 | rm -rf /usr/local/etc/openvswitch/ 63 | rm -f /tmp/conf.db 64 | 65 | echo "Unmounting hugepages" 66 | umount nodev /mnt/huge 67 | 68 | echo "Deleting huge page memory files..." 69 | rm -rf /dev/hugepages/* 70 | 71 | echo "Show the fs table's hugepage mounts" 72 | mount | grep -i huge 73 | 74 | echo "De-allocating hugepages" 75 | echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages 76 | 77 | echo "Show free/used hugepage info" 78 | cat /proc/meminfo | grep -i huge 79 | 80 | echo "Removing from the kernel any DPDK drivers that may still be in use" 81 | #rmmod i40e 82 | #rmmod ixgbe 83 | rmmod igb_uio 84 | rmmod cuse 85 | rmmod fuse 86 | rmmod openvswitch 87 | rmmod uio 88 | rmmod eventfd_link 89 | rmmod ioeventfd 90 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/createmacvtap.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #The createmacvtap.yaml Ansible play creates macvtap NICs on the compute nodes that the HostVMs use to communicate directly with the cluster 'public' network, or the network that the learners use. Theses macvtap logical NICs are simpler than a linux bridge, and allow the learners to ssh directly to their assigned HostVM directly from the cluster jump server. The libvirt macvtap network is defined in ../files/macvtap.xml; the script to create the interfaces is in ../scripts/create_macvtapif.sh. See the create_macvtapif.sh script for more information. 25 | #This role has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts 28 | --- 29 | - hosts: all 30 | vars: 31 | network_file_name: macvtap.xml 32 | macvtap_script: create_macvtapif.sh 33 | tasks: 34 | - name: copy the {{ network_file_name }} file to the target 35 | copy: src={{ provisioning_master_dir }}/files/{{ network_file_name }} dest={{ provisioning_slave_dir }}/{{ network_file_name }} 36 | - name: copy the {{ macvtap_script }} file to the target and make it executable 37 | copy: src={{ provisioning_master_dir }}/scripts/{{ macvtap_script }} dest={{ provisioning_slave_dir }}/{{ macvtap_script }} mode=0774 38 | become: true 39 | - name: Run the {{ macvtap_script }} script 40 | command: "{{ provisioning_slave_dir }}/{{ macvtap_script }}" 41 | become: true 42 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/compute-node/00_cleanup_sr-iov.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2016 Intel Corporation 3 | 4 | # Permission is hereby granted, free of charge, to any person obtaining a 5 | # copy of this software and associated documentation files (the 6 | # "Software"), to deal in the Software without restriction, including 7 | # without limitation the rights to use, copy, modify, merge, publish, 8 | # distribute, sublicense, and/or sell copies of the Software, and to 9 | # permit persons to whom the Software is furnished to do so, subject to 10 | # the following conditions: 11 | 12 | # The above copyright notice and this permission notice shall be included 13 | # in all copies or substantial portions of the Software. 14 | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | # Author: Clayne B. Robison 24 | 25 | #This script shuts down the networks that are using SR-IOV and unloads the VFs from the compute node kernel. It assumes that the 4 ports on the XL710 NIC have been assigned interfaces enp6s0f0-3 (PCI Bus 6, Slot 0, Function 0-3) 26 | 27 | #make sure we are root 28 | if [ "$(id -u)" != "0" ]; then 29 | echo "Sorry, you are not root." 30 | exit 1 31 | fi 32 | 33 | #destroy the sr-iov networks if they are running 34 | echo "Shutting down sr-iov networks..." 35 | virsh net-destroy sr-iov-port0 36 | virsh net-destroy sr-iov-port1 37 | virsh net-destroy sr-iov-port2 38 | virsh net-destroy sr-iov-port3 39 | 40 | #undefine them 41 | echo "Undefining sr-iov networks..." 42 | virsh net-undefine sr-iov-port0 43 | virsh net-undefine sr-iov-port1 44 | virsh net-undefine sr-iov-port2 45 | virsh net-undefine sr-iov-port3 46 | 47 | virsh net-list --all 48 | 49 | #This is how you do it on kernel versions 3.8 and above 50 | echo "Removing Virtual Functions..." 51 | echo 0 > /sys/class/net/enp6s0f0/device/sriov_numvfs 52 | echo 0 > /sys/class/net/enp6s0f1/device/sriov_numvfs 53 | echo 0 > /sys/class/net/enp6s0f2/device/sriov_numvfs 54 | echo 0 > /sys/class/net/enp6s0f3/device/sriov_numvfs 55 | lspci | grep -i "net" 56 | 57 | #Deactivate the Physical NIC ports 58 | echo "Deactivating NIC ports..." 59 | ip l set dev enp6s0f0 down 60 | ip l set dev enp6s0f1 down 61 | ip l set dev enp6s0f2 down 62 | ip l set dev enp6s0f3 down 63 | 64 | 65 | #You might get errors from this if they aren't already loaded in the kernel. Ignore them. 66 | echo "removing SR-IOV drivers from kernel..." 67 | rmmod pci-stub 68 | rmmod i40evf -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/compute-node/01_create_vfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script automates the host device (compute node) OS parts of creating the SR-IOV 27 | #NICs. It creates one Virtual Function for each of the 4 ports on the XL710 NIC 28 | #It assumes that the 4 ports have been assigned interfaces enp6s0f0-3 (PCI Bus 6, Slot 0, Function 0-3) 29 | 30 | #make sure we are root 31 | if [ "$(id -u)" != "0" ]; then 32 | echo "Sorry, you are not root." 33 | exit 1 34 | fi 35 | 36 | echo "Inserting pci-stub module into kernel..." 37 | modprobe pci_stub 38 | lsmod | grep pci 39 | 40 | 41 | #This will insert the i40evf module into the kernel 42 | echo "Creating Virtual functions..." 43 | echo 1 > /sys/class/net/enp6s0f0/device/sriov_numvfs 44 | echo 1 > /sys/class/net/enp6s0f1/device/sriov_numvfs 45 | echo 1 > /sys/class/net/enp6s0f2/device/sriov_numvfs 46 | echo 1 > /sys/class/net/enp6s0f3/device/sriov_numvfs 47 | lspci | grep net 48 | 49 | #These MAC addresses appear to be ignored by libvirt. 50 | echo "assigning mac addresses to virtual functions" 51 | ip l set dev enp6s0f0 vf 0 mac aa:bb:cc:dd:ee:00 52 | ip l set dev enp6s0f1 vf 0 mac aa:bb:cc:dd:ee:01 53 | ip l set dev enp6s0f2 vf 0 mac aa:bb:cc:dd:ee:02 54 | ip l set dev enp6s0f3 vf 0 mac aa:bb:cc:dd:ee:03 55 | 56 | #Activate the NIC ports otherwise libvirt whines when we create virtual networks on them 57 | echo "Activating NIC ports..." 58 | ip l set dev enp6s0f0 up 59 | ip l set dev enp6s0f1 up 60 | ip l set dev enp6s0f2 up 61 | ip l set dev enp6s0f3 up 62 | 63 | #Show the current state of the interfaces 64 | ip l show dev enp6s0f0 65 | ip l show dev enp6s0f1 66 | ip l show dev enp6s0f2 67 | ip l show dev enp6s0f3 -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/change-hostvm-cpu-topology.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible role runs the change-hostvm-cpu-topology.py script script found in ../scripts and then runs that script on the compute nodes. It also prepares the compute nodes to run the startGuestVMs.py script found in ../scripts and then executes that script. It copies the VMManager.py module to the remote node as well. See the documentation in change-hostvm-cpu-topology.py and startGuestVMs.py for more information. 25 | #This role has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts. 28 | --- 29 | - hosts: all 30 | become: true 31 | vars: 32 | script_name: change-hostvm-cpu-topology.py 33 | tasks: 34 | - name: copy the VMManager module 35 | copy: src={{ provisioning_master_dir }}/scripts/VMManager.py dest={{ provisioning_slave_dir }}/ mode=0744 36 | - name: copy change topology script 37 | copy: src={{ provisioning_master_dir }}/scripts/{{ script_name }} dest={{ provisioning_slave_dir }}/{{ script_name }} mode=0744 38 | - name: Run the CHange topology script 39 | command: "{{ provisioning_slave_dir }}/{{ script_name }}" 40 | become: true 41 | - name: copy the start VM script 42 | copy: src={{ provisioning_master_dir }}/scripts/startGuestVMs.py dest={{ provisioning_slave_dir }}/startGuestVMs.py mode=0744 43 | - name: Run the start VM script 44 | command: "{{ provisioning_slave_dir }}/startGuestVMs.py" 45 | become: true 46 | ... 47 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/remove_sr-iov_nics.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible role prepares the compute nodes to run the remove_sr-iov_nics.py script found in ../scripts and then runs that script on the compute nodes. It copies the VMManager.py module to the remote node as well. It also prepares the compute nodes to run the startGuestVMs.py script found in ../scripts and then executes that script. See the documentation in remove_sr-iov_nics.py and startGuestVMs.py for more information. 25 | #This role has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts 28 | --- 29 | - hosts: all 30 | become: true 31 | vars: 32 | script_name: remove_sr-iov_nics.py 33 | tasks: 34 | - name: copy the VMManager module 35 | copy: src={{ provisioning_master_dir }}/scripts/VMManager.py dest={{ provisioning_slave_dir }}/ mode=0744 36 | - name: copy the remove SR-IOV nics script 37 | copy: src={{ provisioning_master_dir }}/scripts/{{ script_name }} dest={{ provisioning_slave_dir }}/{{ script_name }} mode=0744 38 | - name: Run the remove SR-IOV nics script 39 | command: "{{ provisioning_slave_dir }}/{{ script_name }}" 40 | become: true 41 | - name: copy the start VM script 42 | copy: src={{ provisioning_master_dir }}/scripts/startGuestVMs.py dest={{ provisioning_slave_dir }}/startGuestVMs.py mode=0744 43 | - name: Run the start VM script 44 | command: "{{ provisioning_slave_dir }}/startGuestVMs.py" 45 | become: true 46 | ... 47 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/insert_sr-iov_nics.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #This Ansible role prepares the compute nodes to run the insert_sr-iov_nics.py script found in ../scripts and then runs that script on the compute nodes. It copies the VMManager.py module to the remote node as well. It also prepares the compute nodes to run the startGuestVMs.py script found in ../scripts and then executes that script. See the documentation in insert_sr-iov_nics.py and startGuestVMs.py for more information. 25 | #This role has several input parameters: 26 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 27 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts 28 | --- 29 | - hosts: all 30 | become: true 31 | vars: 32 | script_name: insert_sr-iov_nics.py 33 | tasks: 34 | - name: copy the VMManager module because it is a dependency 35 | copy: src={{ provisioning_master_dir }}/scripts/VMManager.py dest={{ provisioning_slave_dir }}/ mode=0744 36 | - name: copy insert SR-IOV nics script 37 | copy: src={{ provisioning_master_dir }}/scripts/{{ script_name }} dest={{ provisioning_slave_dir }}/{{ script_name }} mode=0744 38 | - name: Run the Insert SR-IOV nics script 39 | command: "{{ provisioning_slave_dir }}/{{ script_name }}" 40 | become: true 41 | - name: copy the start VM script 42 | copy: src={{ provisioning_master_dir }}/scripts/startGuestVMs.py dest={{ provisioning_slave_dir }}/startGuestVMs.py mode=0744 43 | - name: Run the start VM script 44 | command: "{{ provisioning_slave_dir }}/startGuestVMs.py" 45 | become: true 46 | ... 47 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/roles/load_vfs_into_libvirt.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | #The load_vs_into_libvirt.yaml play loads the SR-IOV Virtual Functions into libvirt networks. It has four tasks: 25 | # 1. Copy the 02_load_vfs_into_libvirt.sh script to the compute node; 26 | # 2. Change the owner of the script to root and make it executable; 27 | # 3. Copy the SR-IOV libvirt network definition XML files to the compute node; and 28 | # 4. Execute the 02_load_vfs_into_libvirt.sh script on the compute node. 29 | #This play has several input parameters: 30 | # provisioning_slave_dir: this is the directory on the remote node into which the script file is copied. This variable is defined in /etc/ansible/hosts. 31 | # provisioning_master_dir: this is the Ansible root directory on the Ansible controller. This variable is defined in /etc/ansible/hosts 32 | --- 33 | - hosts: all 34 | become: true 35 | vars: 36 | script_name: 02_load_vfs_into_libvirt.sh 37 | sr_iov_network_files: sr-iov-networks 38 | network_files_src_dir: "{{ provisioning_master_dir }}/files" 39 | script_src_dir: "{{ provisioning_master_dir }}/scripts" 40 | dest_dir: "{{ provisioning_slave_dir }}" 41 | owner: root 42 | tasks: 43 | - name: copy the {{ script_name }} script to the machine 44 | copy: src={{ script_src_dir }}/{{ script_name }} dest={{ dest_dir }}/{{ script_name}} 45 | - name: CHange file ownership 46 | file: path={{ dest_dir }}/{{ script_name }} mode=0775 owner={{ owner }} group={{ owner }} 47 | become: true 48 | - name: copy the SR-IOV libvirt network definition files 49 | copy: src={{ network_files_src_dir }}/{{ sr_iov_network_files }} dest={{ dest_dir }}/ mode=0664 50 | - name: Run the script 51 | command: "{{ dest_dir }}/{{ script_name }}" 52 | become: true 53 | ... 54 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/start_Tenant-VM.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Irene Liew 25 | 26 | #This script launches the TenantVM using the Fedora 23 image found at /home/usr/vm-images/Fed23_TenantVM.img. The image is launched with 4G of RAM on 4 1G Hugepages from the HostVM. It has 3 NICs, 2 of which use the DPDK-enabled vhostuser ports from Open vSwitch, and the remaining NIC is attached to a tuntap bridge interface and assigned the static IP address 192.168.120.11 by the OS upon boot. 27 | 28 | vm=/home/user/vm-images/Fed23_TenantVM.img 29 | vm_name=TenantVM-16 30 | vnc=15 31 | n1=tap50 32 | bra=virbr0 33 | dn_scrp_a=/root/br-mgt-ifdown 34 | mac1=00:00:14:42:04:29 35 | 36 | if [ ! -f $vm ]; 37 | then 38 | echo "VM $vm not found!" 39 | else 40 | echo "VM $vm started! VNC: $vnc, net0: $n1, net1: $n2" 41 | tunctl -d $n1 42 | tunctl -t $n1 43 | brctl addif $bra $n1 44 | ifconfig $n1 0.0.0.0 up 45 | 46 | /home/user/qemu-2.6.0/x86_64-softmmu/qemu-system-x86_64 -m 4096 -smp 6 -cpu host -hda $vm -boot c -enable-kvm -name $vm_name \ 47 | -object memory-backend-file,id=mem,size=4096M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem -mem-prealloc -nographic \ 48 | -net nic,model=e1000,netdev=eth0,macaddr=$mac1 \ 49 | -netdev tap,ifname=$n1,id=eth0,script=no,downscript=no \ 50 | -chardev socket,id=char1,path=/usr/local/var/run/openvswitch/vhost-user2 \ 51 | -netdev type=vhost-user,id=net1,chardev=char1,vhostforce -device virtio-net-pci,mq=on,netdev=net1,mac=00:00:00:00:00:03,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf=off \ 52 | -chardev socket,id=char2,path=/usr/local/var/run/openvswitch/vhost-user3 \ 53 | -netdev type=vhost-user,id=net2,chardev=char2,vhostforce -device virtio-net-pci,mq=on,netdev=net2,mac=00:00:00:00:00:04,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf=off 54 | 55 | fi 56 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/start_VNF-VM.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Irene Liew 25 | 26 | #This script launches the TenantVM using the Fedora 23 image found at /home/usr/vm-images/Fed23_VNFVM.img. The image is launched with 4G of RAM on 4 1G Hugepages from the HostVM. It has 3 NICs, 2 of which use the DPDK-enabled vhostuser ports from Open vSwitch, and the remaining NIC is attached to a tuntap bridge interface and assigned the static IP address 192.168.120.10 by the OS upon boot. 27 | 28 | vm=/home/user/vm-images/Fed23_VNFVM.img 29 | vm_name=VNFVM-61 30 | vnc=3 31 | n1=tap1 32 | bra=virbr0 33 | dn_scrp_a=/root/br-mgt-ifdown 34 | mac1=00:00:14:42:04:28 35 | system_ram=4096 36 | dpdk_ram=4096 37 | 38 | if [ ! -f $vm ]; 39 | then 40 | echo "VM $vm not found!" 41 | else 42 | echo "VM $vm started! VNC: $vnc, net0: $n1, net1: $n2" 43 | tunctl -d $n1 44 | tunctl -t $n1 45 | brctl addif $bra $n1 46 | ifconfig $n1 0.0.0.0 up 47 | 48 | /home/user/qemu-2.6.0/x86_64-softmmu/qemu-system-x86_64 -m $system_ram -smp 3 -cpu host -hda $vm -boot c -enable-kvm -name $vm_name \ 49 | -object memory-backend-file,id=mem,size=${dpdk_ram}M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem -mem-prealloc -nographic \ 50 | -netdev tap,id=t0,ifname=$n1,script=no,downscript=no \ 51 | -device e1000,netdev=t0,id=nic0,mac=$mac1 \ 52 | -chardev socket,id=char1,path=/usr/local/var/run/openvswitch/vhost-user0 \ 53 | -netdev type=vhost-user,id=net1,chardev=char1,vhostforce -device virtio-net-pci,netdev=net1,mac=00:00:00:00:00:01,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf=off \ 54 | -chardev socket,id=char2,path=/usr/local/var/run/openvswitch/vhost-user1 \ 55 | -netdev type=vhost-user,id=net2,chardev=char2,vhostforce -device virtio-net-pci,netdev=net2,mac=00:00:00:00:00:02,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf=off 56 | 57 | fi 58 | 59 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/dpdk-lab/01_start_ovs.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Irene Liew 23 | 24 | #01_start_ovs.sh cleans up any existing Open vSwitch processes and resources, and then launches Open vSwitch with DPDK using one 1 GB HugePage. 25 | if [ "$(id -u)" != "0" ]; then 26 | echo "Sorry, you are not root." 27 | exit 1 28 | fi 29 | 30 | 31 | umount nodev /mnt/huge 32 | #umount nodev /mnt/huge_2mb 33 | mount -t hugetlbfs nodev /mnt/huge 34 | #mount -t hugetlbfs nodev /mnt/huge_2mb -o pagesize=2MB 35 | mount 36 | 37 | #rmmod i40e 38 | #rmmod ixgbe 39 | rmmod igb_uio 40 | rmmod cuse 41 | rmmod fuse 42 | rmmod openvswitch 43 | rmmod uio 44 | rmmod eventfd_link 45 | rmmod ioeventfd 46 | rm -rf /dev/vhost-net 47 | 48 | modprobe uio 49 | insmod $DPDK_BUILD/kmod/igb_uio.ko 50 | 51 | export DPDK_DIR=/usr/src/dpdk-16.07 52 | export DPDK_BUILD=$DPDK_DIR/x86_64-native-linuxapp-gcc 53 | export OVS_DIR=/usr/src/ovs-branch-2.6 54 | python $DPDK_DIR/tools/dpdk-devbind.py --status 55 | 56 | # terminate OVS 57 | 58 | pkill -9 ovs 59 | rm -rf /usr/local/var/run/openvswitch 60 | rm -rf /usr/local/etc/openvswitch/ 61 | rm -f /tmp/conf.db 62 | 63 | mkdir -p /usr/local/etc/openvswitch 64 | mkdir -p /usr/local/var/run/openvswitch 65 | 66 | # initialize new OVS database 67 | 68 | cd $OVS_DIR 69 | ./ovsdb/ovsdb-tool create /usr/local/etc/openvswitch/conf.db ./vswitchd/vswitch.ovsschema 70 | 71 | #start database server 72 | ./ovsdb/ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ 73 | --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ 74 | --pidfile --detach 75 | 76 | #initialize OVS database 77 | ./utilities/ovs-vsctl --no-wait init 78 | 79 | 80 | #start OVS with DPDK portion using 1GB 81 | ./utilities/ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true other_config:dpdk-lcore-mask=0x2 other_config:dpdk-socket-mem="1024" 82 | 83 | ./vswitchd/ovs-vswitchd unix:/usr/local/var/run/openvswitch/db.sock --pidfile --detach 84 | 85 | sleep 2 86 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/host-vm/training/sr-iov-lab/04_build_load_dpdk_on_vf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2016 Intel Corporation 4 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | # Author: Clayne B. Robison 25 | 26 | #This script builds and configures DPDK on the target PCI/SR-IOV NIC ports. It 27 | # 1. determines the MAC address for the testpmd and pktgen interfaces, 28 | # 2. builds DPDK, 29 | # 3. loads the DPDK igb_uio driver into the kernel, 30 | # 4. mounts the hugepage memory, 31 | # 5. binds the SR-IOV NICS at PCI address 00:09.0 and 00:0a.0 to thte DPDK igb_uio driver, and then 32 | # 6. displays the MAC addresses for the SR-IOV NICS that were just bound to DPDK so that information can be used in the following steps of the lab. 33 | 34 | if [ "$(id -u)" != "0" ]; then 35 | echo "Sorry, you are not root." 36 | exit 1 37 | fi 38 | 39 | if [ "$RTE_SDK" == "" ]; then 40 | echo "Sorry, RTE_SDK has not been defined." 41 | exit 1 42 | fi 43 | 44 | if [ "$RTE_TARGET" == "" ]; then 45 | echo "Sorry, RTE_TARGET has not been defined." 46 | exit 1 47 | fi 48 | 49 | export PCI_PORT_0="00:09.0" 50 | export PCI_PORT_1="00:0a.0" 51 | export TESTPMD_VF_IF="ens9" 52 | export PKTGEN_VF_IF="ens10" 53 | export TESTPMD_VF_MAC=$(ip l show ${TESTPMD_VF_IF} | grep ether | awk '{ print $2 }') 54 | export PKTGEN_VF_MAC=$(ip l show ${PKTGEN_VF_IF} | grep ether | awk '{ print $2 }') 55 | cd $RTE_SDK 56 | make config O=$RTE_TARGET T=$RTE_TARGET 57 | cd $RTE_TARGET 58 | make -j10 59 | 60 | modprobe uio 61 | insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko 62 | 63 | mount -t hugetlbfs nodev /mnt/huge 64 | 65 | cat /proc/meminfo 66 | 67 | echo "Binding $PCI_PORT_0 to igb_uio" 68 | python $RTE_SDK/tools/dpdk-devbind.py --bind=igb_uio $PCI_PORT_0 69 | echo "Binding $PCI_PORT_1 to igb_uio" 70 | python $RTE_SDK/tools/dpdk-devbind.py --bind=igb_uio $PCI_PORT_1 71 | python $RTE_SDK/tools/dpdk-devbind.py --status 72 | 73 | echo "******Keep these for the next step*****" 74 | echo "PKTGEN_MAC=$PKTGEN_VF_MAC" 75 | echo "TESTPMD_MAC=$TESTPMD_VF_MAC" 76 | echo "******Keep these for the next step*****" 77 | 78 | -------------------------------------------------------------------------------- /SR-IOV_DPDK_Hands-on_Lab/provisioning/ansible_hosts: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 Intel Corporation 2 | 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | # Author: Clayne B. Robison 23 | 24 | # This is the default ansible 'hosts' file. 25 | # 26 | # It should live in /etc/ansible/hosts 27 | 28 | #dcomp01, dcomp02, ... dcomp14 29 | [compute_nodes] 30 | dcomp[01:14] 31 | 32 | #variables that apply to the compute_nodes 33 | [compute_nodes:vars] 34 | provisioning_slave_dir=/home/sdnnfv-admin/provisioning-slave 35 | provisioning_master_dir=/home/sdnnfv-admin/provisioning-master 36 | 37 | #HostVM-00, HostVM-01,...HostVM-55 38 | [host_vms] 39 | HostVM-[00:55] 40 | 41 | #variables that apply to the HostVMs 42 | [host_vms:vars] 43 | provisioning_master_dir=/home/sdnnfv-admin/provisioning-master 44 | provisioning_slave_dir=/home/user/provisioning-slave 45 | 46 | #These are nested inside the HostVMs 47 | #VNF-VM-00, VNF-VM-01, ... VNF-VM-55 48 | [vnf_vms] 49 | VNF-VM-[00:55] 50 | 51 | #variables that apply to the VNF-VMs 52 | [vnf_vms:vars] 53 | provisioning_master_dir=/home/sdnnfv-admin/provisioning-master 54 | provisioning_slave_dir=/home/user/provisioning-slave 55 | 56 | #These are nested inside the HostVMs 57 | #TenantVM-00, TenantVM-01, ... TenantVM-55 58 | [tenant_vms] 59 | TenantVM-[00:55] 60 | 61 | #variables that apply to the TenantVMs 62 | [tenant_vms:vars] 63 | provisioning_master_dir=/home/sdnnfv-admin/provisioning-master 64 | provisioning_slave_dir=/home/user/provisioning-slave 65 | 66 | 67 | #allows us to specify an inventory that targets all VMS that have SR-IOV NICs 68 | [sr-iov_vms:children] 69 | sr-iov_loop0_vms 70 | sr-iov_loop1_vms 71 | 72 | #These HostVMs use ports 0 and 1 on the XL710 NIC 73 | #HostVM-00, HostVM-04, ... HostVM-52 74 | [sr-iov_loop0_vms] 75 | HostVM-[00:52:4] 76 | 77 | #These HostVMs use ports 2 and 3 on the XL710 NIC 78 | #HostVM-02, HostVM-06, ... HostVM-54 79 | [sr-iov_loop1_vms] 80 | HostVM-[02:54:4] 81 | 82 | #The interface names for ports 0 and 1 (PCI Bus 6, Slot 0, Function 0 and 1) 83 | [sr-iov_loop0_vms:vars] 84 | source_nic_0=enp6s0f0 85 | source_nic_1=enp6s0f1 86 | 87 | #The interface names for ports 2 and 3 (PCI Bus 6, Slot 0, Function 2 and 3) 88 | [sr-iov_loop1_vms:vars] 89 | source_nic_0=enp6s0f2 90 | source_nic_1=enp6s0f3 91 | --------------------------------------------------------------------------------