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:
Karthik S 2022-12-13 12:20:03 +05:30
parent 23d97d35af
commit c99f19ce78
4 changed files with 12 additions and 4 deletions

View File

@ -32,7 +32,8 @@
"macaddr": "00:78:90:80:cc:30",
"trust": true,
"state": "auto",
"promisc": false
"promisc": false,
"ethtool_opts": "speed 1000 duplex full"
},
{
"type": "ovs_bridge",

View File

@ -75,6 +75,8 @@ network_config:
# referred to as unmatched traffic.
# The default value is false. Requires the enabling of trust mode
promisc: false
# Set ethtool options (optional)
ethtool_opts: "speed 1000 duplex full"
# Attach a SR-IOV VF to a ovs bridge
- type: ovs_bridge
name: br-vfs

View File

@ -1429,7 +1429,8 @@ class SriovVF(_BaseOpts):
defroute=True, dhclient_args=None, dns_servers=None,
nm_controlled=False, onboot=True, domain=None, vlan_id=0,
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 []
routes = routes or []
rules = rules or []
@ -1462,7 +1463,7 @@ class SriovVF(_BaseOpts):
self.promisc = promisc
self.pci_address = pci_address
self.driver = None
self.ethtool_opts = ethtool_opts
utils.update_sriov_vf_map(device, self.vfid, name,
vlan_id=self.vlan_id,
qos=self.qos,
@ -1512,10 +1513,12 @@ class SriovVF(_BaseOpts):
msg = 'Expecting state to match auto/enable/disable'
raise InvalidConfigException(msg)
macaddr = json.get('macaddr')
ethtool_opts = json.get('ethtool_opts', None)
return SriovVF(device, vfid, *opts, vlan_id=vlan_id, qos=qos,
spoofcheck=spoofcheck, trust=trust, state=state,
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):

View File

@ -438,6 +438,8 @@ definitions:
$ref: "#/definitions/bool_or_param"
domain:
$ref: "#/definitions/list_of_domain_name_string_or_domain_name_string"
ethtool_opts:
$ref: "#/definitions/string_or_param"
required:
- type
- device