Browse Source

Merge "Add ability to add linux network interface into OVS dpdk bridge"

pull/148/merge
Ondrej Smola 6 years ago
parent
commit
48741cfbb9
3 changed files with 43 additions and 0 deletions
  1. +19
    -0
      README.rst
  2. +19
    -0
      linux/network/interface.sls
  3. +5
    -0
      tests/pillar/network_openvswitch_dpdk.sls

+ 19
- 0
README.rst View File

tag: 101 tag: 101
mtu: 9000 mtu: 9000




**DPDK OVS bridge with Linux network interface**

.. code-block:: yaml

linux:
network:
...
interface:
eth0:
type: eth
ovs_bridge: br-prv
...
br-prv:
enabled: true
type: dpdk_ovs_bridge
...

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



+ 19
- 0
linux/network/interface.sls View File



{%- set interface_name = interface.get('name', interface_name) %} {%- set interface_name = interface.get('name', interface_name) %}


{# add linux network interface into OVS dpdk bridge #}

{%- if interface.type == 'dpdk_ovs_bridge' %}

{%- for int_name, int in network.interface.items() %}

{%- set int_name = int.get('name', int_name) %}

{%- if int.ovs_bridge is defined and interface_name == int.ovs_bridge %}

add_int_{{ int_name }}_to_ovs_dpdk_bridge_{{ interface_name }}:
cmd.run:
- unless: ovs-vsctl show | grep -w {{ int_name }}
- name: ovs-vsctl add-port {{ interface_name }} {{ int_name }}

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

{# it is not used for any interface with type preffix dpdk,eg. dpdk_ovs_port #} {# it is not used for any interface with type preffix dpdk,eg. dpdk_ovs_port #}
{%- if interface.get('managed', True) and not 'dpdk' in interface.type %} {%- if interface.get('managed', True) and not 'dpdk' in interface.type %}



+ 5
- 0
tests/pillar/network_openvswitch_dpdk.sls View File

name: "openvswitch-vhost" name: "openvswitch-vhost"
path: "/run/openvswitch-vhost" path: "/run/openvswitch-vhost"
interface: interface:
eth0:
enabled: true
type: eth
proto: manual
ovs_bridge: br-prv
dpdk0: dpdk0:
name: enp5s0f1 name: enp5s0f1
pci: "0000:05:00.1" pci: "0000:05:00.1"

Loading…
Cancel
Save