Change in vdsm[master]: network: support PCI passthrough of SR-IOV network interfaces.

mpolednik at redhat.com mpolednik at redhat.com
Mon Mar 2 14:06:35 UTC 2015


Martin Polednik has posted comments on this change.

Change subject: network: support PCI passthrough of SR-IOV network interfaces.
......................................................................


Patch Set 2: Code-Review-1

(7 comments)

Also make sure you understand and implement the routine for such device, in order to support unmanaged mode. As far as I understand, this should be required as you're creating new hwclass - please see https://gerrit.ovirt.org/#/c/37700/4/vdsm/virt/vm.py.

https://gerrit.ovirt.org/#/c/38249/2//COMMIT_MSG
Commit Message:

Line 6: 
Line 7: network: support PCI passthrough of SR-IOV network interfaces.
Line 8: 
Line 9: This implementation uses the SRIOV supporting libvirt API only
Line 10: when agine is passing a MAC addredss for the interface. otherwise,
typo: engine, address, capital O
Line 11: vdsm defaults to the standard host device API.
Line 12: Only SR-IOV (Single Root I/O Virtualization) virtual function (VF)
Line 13: devices can be assigned in this manner.
Line 14: 


Line 9: This implementation uses the SRIOV supporting libvirt API only
Line 10: when agine is passing a MAC addredss for the interface. otherwise,
Line 11: vdsm defaults to the standard host device API.
Line 12: Only SR-IOV (Single Root I/O Virtualization) virtual function (VF)
Line 13: devices can be assigned in this manner.
s/devices/network interfaces (in order to avoid collision with generic SR-IOV)
Line 14: 
Line 15: Change-Id: Ib962fbf1bb08cd5b82b649cc05612471e4e4d0b8


https://gerrit.ovirt.org/#/c/38249/2/vdsm/virt/vmdevices/hostdevice.py
File vdsm/virt/vmdevices/hostdevice.py:

Line 23: from . import hwclass
Line 24: 
Line 25: 
Line 26: class HostDevice(core.Base):
Line 27:     __slots__ = ('name', '_deviceParams', '_mac_address')
For the sake of consistence, I would use macAddr as in network.py.
Line 28: 
Line 29:     def __init__(self, conf, log, **kwargs):
Line 30:         super(HostDevice, self).__init__(conf, log, **kwargs)
Line 31:         self._deviceParams = {}


Line 39:         self._deviceParams = detach_detachable(self.name)
Line 40: 
Line 41:     def getXML(self):
Line 42:         if self._mac_address:
Line 43:             return self._build_network_host_device()
What about _build_interface_xml and _build_generic_xml (and possibly create instead of build)? Because we're only creating XML elements, not really building the device.
Line 44:         else:
Line 45:             return self._build_standard_host_device()
Line 46: 
Line 47:     def _build_standard_host_device(self):


Line 101:         </devices>
Line 102:         """
Line 103:         interface = self.createXmlElem(hwclass.INTERFACE, hwclass.HOSTDEV)
Line 104:         interface.setAttrs(managed='no')
Line 105:         interface.appendChildWithArgs('driver', name='vfio')
What is the behaviour of having driver='vfio' on a host that doesn't support legacy passthrough? Does such host even support SR-IOV? It's possible that we could simply omit this element.
Line 106:         source = interface.appendChildWithArgs('source')
Line 107:         source.appendChildWithArgs('address', **self._deviceParams['address'])
Line 108:         if self._mac_address:
Line 109:             interface.appendChildWithArgs('mac', address=self._mac_address)


Line 103:         interface = self.createXmlElem(hwclass.INTERFACE, hwclass.HOSTDEV)
Line 104:         interface.setAttrs(managed='no')
Line 105:         interface.appendChildWithArgs('driver', name='vfio')
Line 106:         source = interface.appendChildWithArgs('source')
Line 107:         source.appendChildWithArgs('address', **self._deviceParams['address'])
I would explicitely state that text=None.
Line 108:         if self._mac_address:
Line 109:             interface.appendChildWithArgs('mac', address=self._mac_address)
Line 110: 


https://gerrit.ovirt.org/#/c/38249/2/vdsm/virt/vmdevices/hwclass.py
File vdsm/virt/vmdevices/hwclass.py:

Line 33: CONSOLE = 'console'
Line 34: SMARTCARD = 'smartcard'
Line 35: TPM = 'tpm'
Line 36: HOSTDEV = 'hostdev'
Line 37: INTERFACE = 'interface'
Because you defined your own hwclass, you also need to reflect the routines of host device on startup/vmdestroy and implement XML parsing - see https://gerrit.ovirt.org/#/c/37700/4/vdsm/virt/vm.py


-- 
To view, visit https://gerrit.ovirt.org/38249
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib962fbf1bb08cd5b82b649cc05612471e4e4d0b8
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkaplan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list