aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
authorKarthik S <ksundara@redhat.com>2017-07-05 06:52:36 -0400
committerEmilien Macchi <emilien@redhat.com>2017-08-02 18:08:22 +0000
commit312a77a1ac353c1a135ac0b901863bbe8ee66f20 (patch)
tree5e5d8775ec2004c88982285b09bf1d6d8388525b /os_net_config/impl_ifcfg.py
parentd7a8b39585778e17d995df09079e7a1a0b8780a6 (diff)
OvS 2.7 support - dpdk-devargs needs to provided for DPDK devices
The pci address of the DPDK NIC needs to be specified as dpdk-devargs when adding the DPDK port. This is required for using DPDK with OvS 2.7 Change-Id: I4975130961199ee04dd002ec987081299e3ddd4a Closes-Bug: #1702457 Signed-off-by: Karthik S <ksundara@redhat.com>
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index f065f63..3a82597 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -299,6 +299,14 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data += "DEVICETYPE=ovs\n"
data += "TYPE=OVSDPDKPort\n"
data += "OVS_BRIDGE=%s\n" % base_opt.bridge_name
+ # Validation of DPDK port having only one interface is done prior
+ # to this. So accesing the interface name statically.
+ # Also pci_address would be valid here, since
+ # bind_dpdk_interfaces() is invoked before this.
+ pci_address = utils.get_stored_pci_address(
+ base_opt.members[0].name, self.noop)
+ ovs_extra.append("set Interface $DEVICE options:dpdk-devargs="
+ "%s" % pci_address)
if base_opt.mtu:
ovs_extra.append("set Interface $DEVICE mtu_request=$MTU")
if base_opt.rx_queue:
@@ -318,6 +326,16 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data += "TYPE=OVSDPDKBond\n"
data += "OVS_BRIDGE=%s\n" % base_opt.bridge_name
if base_opt.members:
+ for bond_member in base_opt.members:
+ # Validation of DPDK port having only one interface is done
+ # prior to this. So accesing the interface name statically.
+ # Also pci_address would be valid here, since
+ # bind_dpdk_interfaces () is invoked before this.
+ pci_address = utils.get_stored_pci_address(
+ bond_member.members[0].name, self.noop)
+ ovs_extra.append("set Interface %s options:"
+ "dpdk-devargs=%s"
+ % (bond_member.name, pci_address))
members = [member.name for member in base_opt.members]
data += ("BOND_IFACES=\"%s\"\n" % " ".join(members))
# MTU configuration given for the OvsDpdkbond shall be applied