aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_impl_ifcfg.py
diff options
context:
space:
mode:
authorKarthik S <ksundara@redhat.com>2017-05-31 05:29:33 -0400
committerKarthik S <ksundara@redhat.com>2017-05-31 05:29:33 -0400
commitc8901b8ac34cf180c0a62c39a2b31def9c28aaf3 (patch)
tree00a625a3bd7100c0ac582a611d3d3c450f04c71f /os_net_config/tests/test_impl_ifcfg.py
parentcc7ff987cae3452a28f85ca3cabef49a3a64a2ff (diff)
Multiqueue support for OvsDpdkBond
This patch allows the Multiqueue setting for DPDK bonds. In case of DPDK bonds, the Multiqueue setting needs to be done for each of the interfaces attached to the bond. Implements: blueprint ovs-2-6-features-dpdk Signed-off-by: Karthik S <ksundara@redhat.com> Change-Id: I21b46cee902a17f13df51d456648368e468aadb7
Diffstat (limited to 'os_net_config/tests/test_impl_ifcfg.py')
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py79
1 files changed, 79 insertions, 0 deletions
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py
index 0e5eca2..2d25a39 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -994,6 +994,85 @@ OVS_EXTRA="set Interface dpdk0 mtu_request=$MTU \
self.assertEqual(dpdk_bond_config,
self.get_interface_config('dpdkbond0'))
+ def test_network_ovs_dpdk_bond_with_rx_queue(self):
+ nic_mapping = {'nic1': 'eth0', 'nic2': 'eth1', 'nic3': 'eth2'}
+ self.stubbed_mapped_nics = nic_mapping
+
+ iface0 = objects.Interface(name='nic2')
+ dpdk0 = objects.OvsDpdkPort(name='dpdk0', members=[iface0])
+ iface1 = objects.Interface(name='nic3')
+ dpdk1 = objects.OvsDpdkPort(name='dpdk1', members=[iface1])
+ bond = objects.OvsDpdkBond('dpdkbond0', rx_queue=4,
+ members=[dpdk0, dpdk1])
+ bridge = objects.OvsUserBridge('br-link', members=[bond])
+
+ def test_bind_dpdk_interfaces(ifname, driver, noop):
+ self.assertIn(ifname, ['eth1', 'eth2'])
+ self.assertEqual(driver, 'vfio-pci')
+ self.stubs.Set(utils, 'bind_dpdk_interfaces',
+ test_bind_dpdk_interfaces)
+
+ self.provider.add_ovs_dpdk_bond(bond)
+ self.provider.add_ovs_user_bridge(bridge)
+
+ dpdk_bond_config = """# This file is autogenerated by os-net-config
+DEVICE=dpdkbond0
+ONBOOT=yes
+HOTPLUG=no
+NM_CONTROLLED=no
+PEERDNS=no
+DEVICETYPE=ovs
+TYPE=OVSDPDKBond
+OVS_BRIDGE=br-link
+BOND_IFACES="dpdk0 dpdk1"
+RX_QUEUE=4
+OVS_EXTRA="set Interface dpdk0 options:n_rxq=$RX_QUEUE \
+-- set Interface dpdk1 options:n_rxq=$RX_QUEUE"
+"""
+ self.assertEqual(dpdk_bond_config,
+ self.get_interface_config('dpdkbond0'))
+
+ def test_network_ovs_dpdk_bond_with_mtu_and_rx_queue(self):
+ nic_mapping = {'nic1': 'eth0', 'nic2': 'eth1', 'nic3': 'eth2'}
+ self.stubbed_mapped_nics = nic_mapping
+
+ iface0 = objects.Interface(name='nic2')
+ dpdk0 = objects.OvsDpdkPort(name='dpdk0', members=[iface0])
+ iface1 = objects.Interface(name='nic3')
+ dpdk1 = objects.OvsDpdkPort(name='dpdk1', members=[iface1])
+ bond = objects.OvsDpdkBond('dpdkbond0', rx_queue=4, mtu=9000,
+ members=[dpdk0, dpdk1])
+ bridge = objects.OvsUserBridge('br-link', members=[bond])
+
+ def test_bind_dpdk_interfaces(ifname, driver, noop):
+ self.assertIn(ifname, ['eth1', 'eth2'])
+ self.assertEqual(driver, 'vfio-pci')
+ self.stubs.Set(utils, 'bind_dpdk_interfaces',
+ test_bind_dpdk_interfaces)
+
+ self.provider.add_ovs_dpdk_bond(bond)
+ self.provider.add_ovs_user_bridge(bridge)
+
+ dpdk_bond_config = """# This file is autogenerated by os-net-config
+DEVICE=dpdkbond0
+ONBOOT=yes
+HOTPLUG=no
+NM_CONTROLLED=no
+PEERDNS=no
+DEVICETYPE=ovs
+TYPE=OVSDPDKBond
+OVS_BRIDGE=br-link
+BOND_IFACES="dpdk0 dpdk1"
+RX_QUEUE=4
+MTU=9000
+OVS_EXTRA="set Interface dpdk0 mtu_request=$MTU \
+-- set Interface dpdk1 mtu_request=$MTU \
+-- set Interface dpdk0 options:n_rxq=$RX_QUEUE \
+-- set Interface dpdk1 options:n_rxq=$RX_QUEUE"
+"""
+ self.assertEqual(dpdk_bond_config,
+ self.get_interface_config('dpdkbond0'))
+
class TestIfcfgNetConfigApply(base.TestCase):