Add ethtool_opts config for sriov VF
SR-IOV VFs used for NIC partitioning shall include ethtool_opts configuration as well. Change-Id: Ia5e95daac6d8766a222d8bdde3e233475e203fa9
This commit is contained in:
@@ -32,7 +32,8 @@
|
|||||||
"macaddr": "00:78:90:80:cc:30",
|
"macaddr": "00:78:90:80:cc:30",
|
||||||
"trust": true,
|
"trust": true,
|
||||||
"state": "auto",
|
"state": "auto",
|
||||||
"promisc": false
|
"promisc": false,
|
||||||
|
"ethtool_opts": "speed 1000 duplex full"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "ovs_bridge",
|
"type": "ovs_bridge",
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ network_config:
|
|||||||
# referred to as unmatched traffic.
|
# referred to as unmatched traffic.
|
||||||
# The default value is false. Requires the enabling of trust mode
|
# The default value is false. Requires the enabling of trust mode
|
||||||
promisc: false
|
promisc: false
|
||||||
|
# Set ethtool options (optional)
|
||||||
|
ethtool_opts: "speed 1000 duplex full"
|
||||||
# Attach a SR-IOV VF to a ovs bridge
|
# Attach a SR-IOV VF to a ovs bridge
|
||||||
- type: ovs_bridge
|
- type: ovs_bridge
|
||||||
name: br-vfs
|
name: br-vfs
|
||||||
|
|||||||
@@ -1429,7 +1429,8 @@ class SriovVF(_BaseOpts):
|
|||||||
defroute=True, dhclient_args=None, dns_servers=None,
|
defroute=True, dhclient_args=None, dns_servers=None,
|
||||||
nm_controlled=False, onboot=True, domain=None, vlan_id=0,
|
nm_controlled=False, onboot=True, domain=None, vlan_id=0,
|
||||||
qos=0, spoofcheck=None, trust=None, state=None, macaddr=None,
|
qos=0, spoofcheck=None, trust=None, state=None, macaddr=None,
|
||||||
promisc=None, min_tx_rate=0, max_tx_rate=0):
|
promisc=None, min_tx_rate=0, max_tx_rate=0,
|
||||||
|
ethtool_opts=None):
|
||||||
addresses = addresses or []
|
addresses = addresses or []
|
||||||
routes = routes or []
|
routes = routes or []
|
||||||
rules = rules or []
|
rules = rules or []
|
||||||
@@ -1462,7 +1463,7 @@ class SriovVF(_BaseOpts):
|
|||||||
self.promisc = promisc
|
self.promisc = promisc
|
||||||
self.pci_address = pci_address
|
self.pci_address = pci_address
|
||||||
self.driver = None
|
self.driver = None
|
||||||
|
self.ethtool_opts = ethtool_opts
|
||||||
utils.update_sriov_vf_map(device, self.vfid, name,
|
utils.update_sriov_vf_map(device, self.vfid, name,
|
||||||
vlan_id=self.vlan_id,
|
vlan_id=self.vlan_id,
|
||||||
qos=self.qos,
|
qos=self.qos,
|
||||||
@@ -1512,10 +1513,12 @@ class SriovVF(_BaseOpts):
|
|||||||
msg = 'Expecting state to match auto/enable/disable'
|
msg = 'Expecting state to match auto/enable/disable'
|
||||||
raise InvalidConfigException(msg)
|
raise InvalidConfigException(msg)
|
||||||
macaddr = json.get('macaddr')
|
macaddr = json.get('macaddr')
|
||||||
|
ethtool_opts = json.get('ethtool_opts', None)
|
||||||
return SriovVF(device, vfid, *opts, vlan_id=vlan_id, qos=qos,
|
return SriovVF(device, vfid, *opts, vlan_id=vlan_id, qos=qos,
|
||||||
spoofcheck=spoofcheck, trust=trust, state=state,
|
spoofcheck=spoofcheck, trust=trust, state=state,
|
||||||
macaddr=macaddr, promisc=promisc,
|
macaddr=macaddr, promisc=promisc,
|
||||||
min_tx_rate=min_tx_rate, max_tx_rate=max_tx_rate)
|
min_tx_rate=min_tx_rate, max_tx_rate=max_tx_rate,
|
||||||
|
ethtool_opts=ethtool_opts)
|
||||||
|
|
||||||
|
|
||||||
class SriovPF(_BaseOpts):
|
class SriovPF(_BaseOpts):
|
||||||
|
|||||||
@@ -438,6 +438,8 @@ definitions:
|
|||||||
$ref: "#/definitions/bool_or_param"
|
$ref: "#/definitions/bool_or_param"
|
||||||
domain:
|
domain:
|
||||||
$ref: "#/definitions/list_of_domain_name_string_or_domain_name_string"
|
$ref: "#/definitions/list_of_domain_name_string_or_domain_name_string"
|
||||||
|
ethtool_opts:
|
||||||
|
$ref: "#/definitions/string_or_param"
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- device
|
- device
|
||||||
|
|||||||
Reference in New Issue
Block a user