diff --git a/etc/os-net-config/samples/sriov_pf.json b/etc/os-net-config/samples/sriov_pf.json index f63b7b89..383b5582 100644 --- a/etc/os-net-config/samples/sriov_pf.json +++ b/etc/os-net-config/samples/sriov_pf.json @@ -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", diff --git a/etc/os-net-config/samples/sriov_pf.yaml b/etc/os-net-config/samples/sriov_pf.yaml index e8d59fa4..1fd440af 100644 --- a/etc/os-net-config/samples/sriov_pf.yaml +++ b/etc/os-net-config/samples/sriov_pf.yaml @@ -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 diff --git a/os_net_config/objects.py b/os_net_config/objects.py index e8b7e8f5..709c6159 100644 --- a/os_net_config/objects.py +++ b/os_net_config/objects.py @@ -1425,7 +1425,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 [] @@ -1458,7 +1459,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, @@ -1508,10 +1509,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): diff --git a/os_net_config/schema.yaml b/os_net_config/schema.yaml index 78d67856..95a78053 100644 --- a/os_net_config/schema.yaml +++ b/os_net_config/schema.yaml @@ -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