ovs-dpdk: change dpdk-driver default to None
Some NICs do not work with vfi-pci or uio_pci_generic. E.g. mxl4/mlx5 which uses relies on the OFED or Kernel drivers (post 4.14). In this cases we don't want to generate entries in /etc/dpdk/inerfaces. Here we change the configuration processing behavior. The charm will omit adding entries in the aforementioned file when the value is not set. The default value is changed to empty (i.e. None) Change-Id: I2fb9f0404adbbee0f298729467794e172bae2d98
This commit is contained in:
parent
03016e4cc4
commit
7d5126e1c3
|
@ -144,7 +144,7 @@ options:
|
|||
Only used when DPDK is enabled.
|
||||
dpdk-driver:
|
||||
type: string
|
||||
default: uio_pci_generic
|
||||
default:
|
||||
description: |
|
||||
Kernel userspace device driver to use for DPDK devices, valid values
|
||||
include:
|
||||
|
|
|
@ -301,8 +301,11 @@ def numa_node_cores():
|
|||
class DPDKDeviceContext(OSContextGenerator):
|
||||
|
||||
def __call__(self):
|
||||
driver = config('dpdk-driver')
|
||||
if driver is None:
|
||||
return {}
|
||||
return {'devices': resolve_dpdk_ports(),
|
||||
'driver': config('dpdk-driver')}
|
||||
'driver': driver}
|
||||
|
||||
|
||||
class OVSDPDKDeviceContext(OSContextGenerator):
|
||||
|
|
|
@ -634,6 +634,7 @@ class TestDPDKDeviceContext(CharmTestCase):
|
|||
self.test_context = context.DPDKDeviceContext()
|
||||
|
||||
def test_context(self):
|
||||
self.test_config.set('dpdk-driver', 'uio_pci_generic')
|
||||
self.resolve_dpdk_ports.return_value = [
|
||||
'0000:00:1c.0',
|
||||
'0000:00:1d.0'
|
||||
|
@ -644,6 +645,14 @@ class TestDPDKDeviceContext(CharmTestCase):
|
|||
})
|
||||
self.config.assert_called_with('dpdk-driver')
|
||||
|
||||
def test_context_none_driver(self):
|
||||
self.resolve_dpdk_ports.return_value = [
|
||||
'0000:00:1c.0',
|
||||
'0000:00:1d.0'
|
||||
]
|
||||
self.assertEqual(self.test_context(), {})
|
||||
self.config.assert_called_with('dpdk-driver')
|
||||
|
||||
|
||||
class TestRemoteRestartContext(CharmTestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue