summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail <mzhnichkov@mirantis.com>2017-01-16 23:40:10 +0400
committerFedor Zhadaev <fzhadaev@mirantis.com>2017-03-06 12:01:47 +0000
commit9c51c8e22ba7e69bfd84104d1c65a8a6df9acedc (patch)
treeba1ff4dcb3bb7871bb8c1c11612a106f816746e2
parentc0384fac05b78ed9edf198f34aa4a49516218f34 (diff)
Serialize mtu for dpdk interface with 'i40e' driver
On NIC: XL710 with driver 'i40e' MTU does not take into account 4 bytes VLAN tag, so we should increase it manually DocImpact Change-Id: I3d95db9ec6fae4d8cd397c429d785dbdf1502b21 Partial-Bug: #1587310 Co-Authored-By: Fedor Zhadaev <fzhadaev@mirantis.com>
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+2: Aleksey Kasatkin <akasatkin@mirantis.com> Code-Review+2: Alexander Kislitsky <akislitsky@mirantis.com> Workflow+1: Alexander Kislitsky <akislitsky@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 17 Mar 2017 09:44:55 +0000 Reviewed-on: https://review.openstack.org/420914 Project: openstack/fuel-web Branch: refs/heads/master
-rw-r--r--nailgun/nailgun/consts.py4
-rw-r--r--nailgun/nailgun/extensions/network_manager/managers/neutron.py23
-rw-r--r--nailgun/nailgun/objects/cluster.py4
-rw-r--r--nailgun/nailgun/test/integration/test_orchestrator_serializer_90.py13
-rw-r--r--nailgun/nailgun/test/unit/test_objects.py1
5 files changed, 43 insertions, 2 deletions
diff --git a/nailgun/nailgun/consts.py b/nailgun/nailgun/consts.py
index 5490d6c..3d3b1ae 100644
--- a/nailgun/nailgun/consts.py
+++ b/nailgun/nailgun/consts.py
@@ -528,3 +528,7 @@ HYPERVISORS = Enum(
528) 528)
529 529
530DPDK_DRIVER_IN_SRIOV_CASE = 'vfio-pci' 530DPDK_DRIVER_IN_SRIOV_CASE = 'vfio-pci'
531
532DEFAULT_MTU = 1500
533
534SIZE_OF_VLAN_TAG = 4
diff --git a/nailgun/nailgun/extensions/network_manager/managers/neutron.py b/nailgun/nailgun/extensions/network_manager/managers/neutron.py
index 5ae5575..3ff8742 100644
--- a/nailgun/nailgun/extensions/network_manager/managers/neutron.py
+++ b/nailgun/nailgun/extensions/network_manager/managers/neutron.py
@@ -554,3 +554,26 @@ class NeutronManager70(
554 554
555class NeutronManager80(AllocateVIPs80Mixin, NeutronManager70): 555class NeutronManager80(AllocateVIPs80Mixin, NeutronManager70):
556 pass 556 pass
557
558
559class NeutronManager90(NeutronManager80):
560 @classmethod
561 def get_iface_properties(cls, iface):
562 result = super(NeutronManager80, cls).get_iface_properties(iface)
563
564 if (iface.type == consts.NETWORK_INTERFACE_TYPES.ether and
565 iface.driver == 'i40e' and
566 objects.NIC.dpdk_enabled(iface)):
567 # On NIC with i40e driver MTU should be increased manually
568 # because driver automatically sets value 4 bytes less
569 # LP 1587310
570 mtu = result.get('mtu')
571 if mtu:
572 result.update({
573 'mtu': mtu + consts.SIZE_OF_VLAN_TAG
574 })
575 else:
576 result.update({
577 'mtu': consts.DEFAULT_MTU + consts.SIZE_OF_VLAN_TAG
578 })
579 return result
diff --git a/nailgun/nailgun/objects/cluster.py b/nailgun/nailgun/objects/cluster.py
index 37dd80e..669b963 100644
--- a/nailgun/nailgun/objects/cluster.py
+++ b/nailgun/nailgun/objects/cluster.py
@@ -517,8 +517,10 @@ class Cluster(NailgunObject):
517 if StrictVersion(ver) == StrictVersion('7.0'): 517 if StrictVersion(ver) == StrictVersion('7.0'):
518 return neutron.NeutronManager70 518 return neutron.NeutronManager70
519 519
520 if StrictVersion(ver) >= StrictVersion('8.0'): 520 if StrictVersion(ver) == StrictVersion('8.0'):
521 return neutron.NeutronManager80 521 return neutron.NeutronManager80
522 if StrictVersion(ver) >= StrictVersion('9.0'):
523 return neutron.NeutronManager90
522 524
523 return neutron.NeutronManager 525 return neutron.NeutronManager
524 elif net_provider == consts.CLUSTER_NET_PROVIDERS.nova_network: 526 elif net_provider == consts.CLUSTER_NET_PROVIDERS.nova_network:
diff --git a/nailgun/nailgun/test/integration/test_orchestrator_serializer_90.py b/nailgun/nailgun/test/integration/test_orchestrator_serializer_90.py
index a7ba96f..173a726 100644
--- a/nailgun/nailgun/test/integration/test_orchestrator_serializer_90.py
+++ b/nailgun/nailgun/test/integration/test_orchestrator_serializer_90.py
@@ -131,7 +131,7 @@ class TestDeploymentAttributesSerialization90(
131 @mock.patch('nailgun.objects.Release.get_supported_dpdk_drivers') 131 @mock.patch('nailgun.objects.Release.get_supported_dpdk_drivers')
132 def _check_dpdk_serializing(self, drivers_mock, has_vlan_tag=False, 132 def _check_dpdk_serializing(self, drivers_mock, has_vlan_tag=False,
133 sriov=False, max_queues=0, 133 sriov=False, max_queues=0,
134 dpdk_cpu_pinning=0): 134 dpdk_cpu_pinning=0, nic_driver=None):
135 drivers_mock.return_value = { 135 drivers_mock.return_value = {
136 'driver_1': ['test_id:1', 'test_id:2'] 136 'driver_1': ['test_id:1', 'test_id:2']
137 } 137 }
@@ -154,6 +154,8 @@ class TestDeploymentAttributesSerialization90(
154 dpdk_nic.meta['max_queues'] = max_queues 154 dpdk_nic.meta['max_queues'] = max_queues
155 if dpdk_cpu_pinning: 155 if dpdk_cpu_pinning:
156 node.attributes['cpu_pinning']['dpdk']['value'] = dpdk_cpu_pinning 156 node.attributes['cpu_pinning']['dpdk']['value'] = dpdk_cpu_pinning
157 if nic_driver:
158 dpdk_nic.driver = nic_driver
157 159
158 objects.Cluster.prepare_for_deployment(self.cluster_db) 160 objects.Cluster.prepare_for_deployment(self.cluster_db)
159 161
@@ -205,6 +207,9 @@ class TestDeploymentAttributesSerialization90(
205 min(max_queues, dpdk_cpu_pinning - 1)) 207 min(max_queues, dpdk_cpu_pinning - 1))
206 else: 208 else:
207 self.assertFalse('max_queues' in vendor_specific) 209 self.assertFalse('max_queues' in vendor_specific)
210 if nic_driver:
211 self.assertEqual(dpdk_interface['mtu'],
212 consts.DEFAULT_MTU + consts.SIZE_OF_VLAN_TAG)
208 213
209 def test_serialization_with_dpdk(self): 214 def test_serialization_with_dpdk(self):
210 self._check_dpdk_serializing() 215 self._check_dpdk_serializing()
@@ -220,6 +225,12 @@ class TestDeploymentAttributesSerialization90(
220 self._create_cluster_with_vxlan() 225 self._create_cluster_with_vxlan()
221 self._check_dpdk_serializing(has_vlan_tag=True) 226 self._check_dpdk_serializing(has_vlan_tag=True)
222 227
228 def test_serialization_with_dpdk_with_i40e_driver(self):
229 driver = 'i40e'
230 dpdk_cpu_pinning = 4
231 self._check_dpdk_serializing(nic_driver=driver,
232 dpdk_cpu_pinning=dpdk_cpu_pinning)
233
223 def test_serialization_with_dpdk_queues_limited_max_queues(self): 234 def test_serialization_with_dpdk_queues_limited_max_queues(self):
224 max_queues = 2 235 max_queues = 2
225 dpdk_cpu_pinning = 4 236 dpdk_cpu_pinning = 4
diff --git a/nailgun/nailgun/test/unit/test_objects.py b/nailgun/nailgun/test/unit/test_objects.py
index d3aad5d..3697cc9 100644
--- a/nailgun/nailgun/test/unit/test_objects.py
+++ b/nailgun/nailgun/test/unit/test_objects.py
@@ -1858,6 +1858,7 @@ class TestClusterObjectGetNetworkManager(BaseTestCase):
1858 ('2014.2.2-6.1', neutron.NeutronManager61), 1858 ('2014.2.2-6.1', neutron.NeutronManager61),
1859 ('2015.6.7-7.0', neutron.NeutronManager70), 1859 ('2015.6.7-7.0', neutron.NeutronManager70),
1860 ('2016.1.1-8.0', neutron.NeutronManager80), 1860 ('2016.1.1-8.0', neutron.NeutronManager80),
1861 ('mitaka-9.0', neutron.NeutronManager90)
1861 ): 1862 ):
1862 self.check_neutron_network_manager( 1863 self.check_neutron_network_manager(
1863 consts.CLUSTER_NET_PROVIDERS.neutron, 1864 consts.CLUSTER_NET_PROVIDERS.neutron,