From e5cf068ad18d27e989234d10b176061adc997b4c Mon Sep 17 00:00:00 2001 From: Sanjay Upadhyay Date: Fri, 28 Apr 2017 12:46:39 +0530 Subject: 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 --- etc/os-net-config/samples/ovs_dpdk.json | 1 + etc/os-net-config/samples/ovs_dpdk.yaml | 2 ++ os_net_config/impl_ifcfg.py | 2 ++ os_net_config/tests/test_impl_ifcfg.py | 5 ++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/os-net-config/samples/ovs_dpdk.json b/etc/os-net-config/samples/ovs_dpdk.json index aa6a321..37b79e0 100644 --- a/etc/os-net-config/samples/ovs_dpdk.json +++ b/etc/os-net-config/samples/ovs_dpdk.json @@ -7,6 +7,7 @@ "type": "ovs_dpdk_port", "name": "dpdk0", "driver": "igb_uio", + "mtu": 8192, "members": [ { "type": "interface", diff --git a/etc/os-net-config/samples/ovs_dpdk.yaml b/etc/os-net-config/samples/ovs_dpdk.yaml index f5af9ce..47fd3ab 100644 --- a/etc/os-net-config/samples/ovs_dpdk.yaml +++ b/etc/os-net-config/samples/ovs_dpdk.yaml @@ -14,6 +14,8 @@ network_config: name: dpdk0 # driver is optional argument, default driver is 'vfio-pci' driver: igb_uio + # MTU is optional, used for jumbo frames + mtu: 8192 members: - type: interface name: nic2 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']) -- cgit 1.2.3-korg