Merge "Add ethtool_opts config for sriov VF" into stable/wallaby
This commit is contained in:
		@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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):
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user