Browse Source

Linux OVS dpdk vxlan tunnel endpoint ip address

Add possiblity to add ip address and mtu on dpdk ovs bridge to
be able use VXLAN as tenant segmentation.

Change-Id: I1394d30c5d9935218841b17ff7651dac7b4abefa
Epic: PROD-8957
tags/2017.4
Jakub Pavlik 7 years ago
parent
commit
aa75906e0b
2 changed files with 64 additions and 2 deletions
  1. +19
    -0
      README.rst
  2. +45
    -2
      linux/network/dpdk.sls

+ 19
- 0
README.rst View File

type: dpdk_ovs_port type: dpdk_ovs_port
n_rxq: 2 n_rxq: 2
bridge: br-prv bridge: br-prv
mtu: 9000
br-prv: br-prv:
enabled: true enabled: true
type: dpdk_ovs_bridge type: dpdk_ovs_bridge
enabled: true enabled: true
type: dpdk_ovs_port type: dpdk_ovs_port
n_rxq: 2 n_rxq: 2
mtu: 9000
dpdk_first_nic: dpdk_first_nic:
name: ${_param:primary_first_nic} name: ${_param:primary_first_nic}
pci: 0000:05:00.0 pci: 0000:05:00.0
enabled: true enabled: true
type: dpdk_ovs_port type: dpdk_ovs_port
n_rxq: 2 n_rxq: 2
mtu: 9000
dpdkbond0: dpdkbond0:
enabled: true enabled: true
bridge: br-prv bridge: br-prv
enabled: true enabled: true
type: dpdk_ovs_bridge type: dpdk_ovs_bridge


**DPDK OVS bridge for VXLAN**

If VXLAN is used as tenant segmentation then ip address must be set on br-prv

.. code-block:: yaml

linux:
network:
...
interface:
br-prv:
enabled: true
type: dpdk_ovs_bridge
address: 192.168.50.0
netmask: 255.255.255.0
mtu: 9000


Linux storage Linux storage
------------- -------------

+ 45
- 2
linux/network/dpdk.sls View File

- name: "ovs-vsctl add-br {{ interface_name }} -- set bridge {{ interface_name }} datapath_type=netdev" - name: "ovs-vsctl add-br {{ interface_name }} -- set bridge {{ interface_name }} datapath_type=netdev"
- unless: "ovs-vsctl show | grep {{ interface_name }}" - unless: "ovs-vsctl show | grep {{ interface_name }}"


{# OVS dpdk needs ip address for vxlan termination on bridge br-prv #}
{%- if interface.address is defined %}

{# create override for openvswitch dependency for dpdk br-prv #}
/etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf:
file.managed:
- require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface_name }}
- contents: |
[Unit]
Requires=openvswitch-switch.service
After=openvswitch-switch.service

{# enforce ip address and mtu for ovs dpdk br-prv #}
/etc/network/interfaces.d/ifcfg-{{ interface_name }}:
file.managed:
- contents: |
auto {{ interface_name }}
iface {{ interface_name }} inet static
address {{ interface.address }}
netmask {{ interface.netmask }}
{%- if interface.mtu is defined %}
mtu {{ interface.mtu }}
{%- endif %}
- require:
- file: /etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf

{%- endif %}

{%- elif interface.type == 'dpdk_ovs_port' and interface.bridge is defined %} {%- elif interface.type == 'dpdk_ovs_port' and interface.bridge is defined %}


linux_network_dpdk_bridge_port_interface_{{ interface_name }}: linux_network_dpdk_bridge_port_interface_{{ interface_name }}:
- require: - require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }} - cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }}


{# Multiqueue n_rxq setup on interfaces #}
{%- elif interface.type == 'dpdk_ovs_port' and interface.n_rxq is defined %}
{# Multiqueue n_rxq and mtu setup on interfaces #}
{%- elif interface.type == 'dpdk_ovs_port' and (interface.n_rxq is defined or interface.mtu is defined) %}

{%- if interface.n_rxq is defined %}


linux_network_dpdk_bridge_port_interface_n_rxq_{{ interface_name }}: linux_network_dpdk_bridge_port_interface_n_rxq_{{ interface_name }}:
cmd.run: cmd.run:


{%- endif %} {%- endif %}


{%- if interface.mtu is defined %}

{# MTU ovs dpdk setup on interfaces #}
linux_network_dpdk_bridge_port_interface_mtu_{{ interface_name }}:
cmd.run:
- name: "ovs-vsctl set Interface {{ interface_name }} mtu_request={{ interface.mtu }} "
- unless: "ovs-vsctl get Interface {{ interface_name }} mtu_request | grep {{ interface.mtu }}"

{%- endif %}

{%- endif %}

{%- endfor %} {%- endfor %}


{%- endif %} {%- endif %}

Loading…
Cancel
Save