os-net-config/etc/os-net-config/samples/sriov_pf.yaml

148 lines
4.9 KiB
YAML

network_config:
# sriov_pf type shall be used to configure the PF's of NICs.
# The numvfs configured for the PF's shall be set on the sriov_numvfs of the
# sysfs for the corresponding NIC and the persistence of the same across reboots
# shall be handled
-
type: sriov_pf
# nic name or nic number of the NIC that needs to be configured for SRIOV
name: p2p1
# number of VFs required on the particular NIC
numvfs: 10
# Dont set the IP address on the PF
use_dhcp: false
# Allow all the traffic received. It might be needed when one of its VF
# is attached to a ovs bridge. Default: true
promisc: true
-
type: sriov_pf
name: p2p2
numvfs: 10
use_dhcp: false
promisc: true
# sriov_vf type shall be used to configure the VF's of NICs.
# It requires the PF devices to be configured via sriov_pf types
# "name" parameter is not required for VF's. It'll be derived from the VF id
# and the PF device name.
- type: sriov_vf
# The PF device needs to be configured via the sriov_pf type
# the PF device could be a nic number (ex: nic5) or nic name (ex: ens20f0)
device: p2p1
# The VF id shall be the VF number between 0 to (numvfs-1), where numvfs
# is the member of the sriov_pf type
vfid: 5
addresses:
- ip_netmask: 192.0.2.1/24
# When specified, all traffic sent from the VF will be tagged with the
# specified VLAN ID. Incoming traffic will be filtered for the specified
# VLAN ID, and will have all VLAN tags stripped before being passed to the
# VF. Setting this parameter to 0 disables VLAN tagging and filtering.
vlan_id: 100
# VLAN-Quality Of Service (priority) bits for the VLAN tag.
# When specified, all VLAN tags transmitted by the VF will include the
# specified priority bits in the VLAN tag. Requires vlan_id
# Default value is 0.
qos: 2
# MAC spoofing is a method of altering the MAC address
# The MAC address anti-spoofing when enabled protects from malicious MAC
# address spoofing. It should be disabled for 802.3ad bonds.
spoofcheck: true
# Change the MAC address of the VF.
macaddr: 00:78:90:80:cc:30
# Enabling trust (true) for VF allows enabling multicast/promiscuous mode
# on the VF. The default value is false.
trust: true
# Link state seen by the VF
# - auto: a reflection of the PF link state (default)
# - enable: lets the VF to communicate with other VFs on this host even
# if the PF link state is down
# - disable: causes the HW to drop any packets sent by the VF.
state: auto
# Enabling promisc mode allows the traffic originally targeted to go to the
# VF and it will also receive the unmatched traffic and all the multicast
# traffic received in the physical port. Note that all traffic that has
# destination mac that does not match any of the VFs/PF MAC addresses is
# referred to as unmatched traffic.
# The default value is false. Requires the enabling of trust mode
promisc: false
# Attach a SR-IOV VF to a ovs bridge
- type: ovs_bridge
name: br-vfs
use_dhcp: true
members:
# Specify the type
- type: sriov_vf
# Required field
device: p2p1
# Required field
vfid: 1
# Optional field
vlan_id: 116
# Optional field, but requires vlan_id
qos: 3
# For OVS Bridge, the default value is true (recommended)
trust: true
# For OVS Bridge, the default value is true (recommended)
promisc: true
# For OVS Bridge, the default value is false (recommended)
spoofcheck: false
- type: ovs_bridge
name: br-bond
use_dhcp: true
members:
-
type: ovs_bond
name: bond_vf
ovs_options: "bond_mode=active-backup"
members:
-
type: sriov_vf
device: p2p1
vfid: 2
vlan_id: 112
qos: 4
primary: true
# For OVS Bond, the default value is true (recommended)
trust: true
# For OVS Bond, the default value is true (recommended)
promisc: true
# For OVS Bond, the default value is false (recommended)
spoofcheck: false
-
type: sriov_vf
device: p2p2
vfid: 2
vlan_id: 112
qos: 4
trust: true
promisc: true
spoofcheck: false
- type: linux_bond
name: bond_lnx
use_dhcp: true
bonding_options: "mode=active-backup"
members:
-
type: sriov_vf
device: p2p1
vfid: 3
vlan_id: 113
qos: 5
# For linux_bond, the default value is true
spoofcheck: true
# For linux_bond, the default value is true
trust: true
# For linux_bond, the default value is false
promisc: false
primary: true
-
type: sriov_vf
device: p2p2
vfid: 3
vlan_id: 113
qos: 5
spoofcheck: true
trust: true
promisc: false