diff mbox

[ovs-dev,v2] rhel: Add support for DPDK Bond

Message ID 1469555468-27237-1-git-send-email-fbl@redhat.com
State Accepted
Headers show

Commit Message

Flavio Leitner July 26, 2016, 5:51 p.m. UTC
The current ifcfg file lacks support for OVS DPDK Bond.

Reviewed-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 rhel/README.RHEL                            | 19 ++++++++++++++++---
 rhel/etc_sysconfig_network-scripts_ifup-ovs |  9 +++++++++
 2 files changed, 25 insertions(+), 3 deletions(-)

ChangeLog:

v2: Removed extra line

Comments

Ben Pfaff Aug. 12, 2016, 8:47 p.m. UTC | #1
On Tue, Jul 26, 2016 at 02:51:08PM -0300, Flavio Leitner wrote:
> The current ifcfg file lacks support for OVS DPDK Bond.
> 
> Reviewed-by: Aaron Conole <aconole@redhat.com>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>

I have a feeling that no one was really comfortable with applying this.
It's not really a DPDK patch per se, so Daniele probably didn't pick it
up, and on the other hand it's more related to DPDK than to platform
integration, so Guru didn't pick it up, and so on.

But it seems pretty harmless and reasonable to me, so I applied it to
master.

Thank you!
diff mbox

Patch

diff --git a/rhel/README.RHEL b/rhel/README.RHEL
index 54c1b44..21b50cc 100644
--- a/rhel/README.RHEL
+++ b/rhel/README.RHEL
@@ -33,13 +33,15 @@  assignments.  The following OVS-specific variable names are supported:
         * "OVSDPDKPort", if <name> is a physical DPDK NIC port (name
           must start with "dpdk" and end with portid, eg "dpdk0")
 
-	* "OVSDPDKRPort", if <name> is a DPDK ring port (name must
+        * "OVSDPDKRPort", if <name> is a DPDK ring port (name must
           start with dpdkr and end with portid, eg "dpdkr0")
 
         * "OVSDPDKVhostPort" if <name> is a DPDK vhost-cuse port
 
         * "OVSDPDKVhostUserPort" if <name> is a DPDK vhost-user port
 
+        * "OVSDPDKBond" if <name> is an OVS DPDK bond.
+
     - OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to
       the name of the OVS bridge to which the port should be attached.
 
@@ -53,8 +55,8 @@  assignments.  The following OVS-specific variable names are supported:
     - OVS_EXTRA: Optionally, additional ovs-vsctl commands, separated
       by "--" (double dash).
 
-    - BOND_IFACES: For "OVSBond" interfaces, a list of physical
-      interfaces to bond together.
+    - BOND_IFACES: For "OVSBond" and "OVSDPDKBond" interfaces, a list of
+      physical interfaces to bond together.
 
     - OVS_TUNNEL_TYPE: For "OVSTunnel" interfaces, the type of the tunnel.
       For example, "gre", "vxlan", etc.
@@ -250,6 +252,17 @@  DEVICETYPE=ovs
 TYPE=OVSDPDKVhostUserPort
 OVS_BRIDGE=obr0
 
+==> ifcfg-bond0 <==
+DEVICE=bond0
+ONBOOT=yes
+DEVICETYPE=ovs
+TYPE=OVSDPDKBond
+OVS_BRIDGE=ovsbridge0
+BOOTPROTO=none
+BOND_IFACES="dpdk0 dpdk1"
+OVS_OPTIONS="bond_mode=active-backup"
+HOTPLUG=no
+
 Reporting Bugs
 --------------
 
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index 6850c9f..b6e0356 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -193,6 +193,15 @@  case "$TYPE" in
 			-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
 			-- set Interface "$DEVICE" type=dpdkvhostuser ${OVS_EXTRA+-- $OVS_EXTRA}
 		;;
+	OVSDPDKBond)
+		ifup_ovs_bridge
+		for _iface in $BOND_IFACES; do
+			IFACE_TYPES="${IFACE_TYPES} -- set interface ${_iface} type=dpdk"
+		done
+		ovs-vsctl -t ${TIMEOUT} \
+			-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
+			-- add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${IFACE_TYPES} ${OVS_EXTRA+-- $OVS_EXTRA}
+		;;
 	*)
 		echo $"Invalid OVS interface type $TYPE"
 		exit 1