diff options
author | Sanjay Upadhyay <supadhya@redhat.com> | 2017-04-28 12:46:39 +0530 |
---|---|---|
committer | Sanjay Upadhyay <supadhya@redhat.com> | 2017-04-28 20:38:03 +0530 |
commit | e5cf068ad18d27e989234d10b176061adc997b4c (patch) | |
tree | 515a3d816d04965782f8b4de1b8a52f5a1a5d2d6 /os_net_config | |
parent | 9d27aece869e7ded40b7719cae6e03c3c4c48ae9 (diff) |
Configure mtu value for DPDK port
MTU value is already written to ifcfg file if provided on the interface,
but for dpdk port, we have to apply this to ovs-vsctl command via ovs_extra.
This patch is adding the support to configure the given mtu vlaue to the
dpdk port using ovs_extra.
implements: blueprint ovs-2-6-features-dpdk
Change-Id: Ic01ed8cee2edbd648de0b64dc7f01da80c153d81
Diffstat (limited to 'os_net_config')
-rw-r--r-- | os_net_config/impl_ifcfg.py | 2 | ||||
-rw-r--r-- | os_net_config/tests/test_impl_ifcfg.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 8284ad5..6f35688 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -299,6 +299,8 @@ class IfcfgNetConfig(os_net_config.NetConfig): data += "DEVICETYPE=ovs\n" data += "TYPE=OVSDPDKPort\n" data += "OVS_BRIDGE=%s\n" % base_opt.bridge_name + if base_opt.mtu: + ovs_extra.append("set Interface $DEVICE mtu_request=$MTU") elif isinstance(base_opt, objects.OvsDpdkBond): ovs_extra.extend(base_opt.ovs_extra) # Referring to bug:1643026, the below commenting of the interfaces, diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py index d770415..9ff2bd6 100644 --- a/os_net_config/tests/test_impl_ifcfg.py +++ b/os_net_config/tests/test_impl_ifcfg.py @@ -885,7 +885,8 @@ DNS2=5.6.7.8 self.stubbed_mapped_nics = nic_mapping interface = objects.Interface(name='nic3') - dpdk_port = objects.OvsDpdkPort(name='dpdk0', members=[interface]) + dpdk_port = objects.OvsDpdkPort(name='dpdk0', members=[interface], + mtu=9000) bridge = objects.OvsUserBridge('br-link', members=[dpdk_port]) def test_bind_dpdk_interfaces(ifname, driver, noop): @@ -914,6 +915,8 @@ PEERDNS=no DEVICETYPE=ovs TYPE=OVSDPDKPort OVS_BRIDGE=br-link +MTU=9000 +OVS_EXTRA="set Interface $DEVICE mtu_request=$MTU" """ self.assertEqual(br_link_config, self.provider.bridge_data['br-link']) |