diff mbox

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

Message ID 1469553071-25709-1-git-send-email-fbl@redhat.com
State Superseded
Headers show

Commit Message

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

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

Comments

Aaron Conole July 26, 2016, 5:35 p.m. UTC | #1
Flavio Leitner <fbl@redhat.com> writes:

> The current ifcfg file lacks support for OVS DPDK Bond.
>
> Signed-off-by: Flavio Leitner <fbl@redhat.com>
> ---
>  rhel/README.RHEL                            | 20 +++++++++++++++++---
>  rhel/etc_sysconfig_network-scripts_ifup-ovs |  9 +++++++++
>  2 files changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/rhel/README.RHEL b/rhel/README.RHEL
> index 54c1b44..0f51be5 100644
> --- a/rhel/README.RHEL
> +++ b/rhel/README.RHEL
> @@ -33,13 +33,16 @@ 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.
> +
> +

Small nit - why insert two newlines here as opposed to one?

Otherwise, this looks good to me.

Reviewed-by: Aaron Conole <aconole@redhat.com>
Flavio Leitner July 26, 2016, 5:49 p.m. UTC | #2
On Tue, Jul 26, 2016 at 01:35:58PM -0400, Aaron Conole wrote:
> Flavio Leitner <fbl@redhat.com> writes:
> 
> > The current ifcfg file lacks support for OVS DPDK Bond.
> >
> > Signed-off-by: Flavio Leitner <fbl@redhat.com>
> > ---
> >  rhel/README.RHEL                            | 20 +++++++++++++++++---
> >  rhel/etc_sysconfig_network-scripts_ifup-ovs |  9 +++++++++
> >  2 files changed, 26 insertions(+), 3 deletions(-)
> >
> > diff --git a/rhel/README.RHEL b/rhel/README.RHEL
> > index 54c1b44..0f51be5 100644
> > --- a/rhel/README.RHEL
> > +++ b/rhel/README.RHEL
> > @@ -33,13 +33,16 @@ 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.
> > +
> > +
> 
> Small nit - why insert two newlines here as opposed to one?

No good reason.  Will follow up with v2.

> Otherwise, this looks good to me.
> 
> Reviewed-by: Aaron Conole <aconole@redhat.com>
Thanks!
fbl
diff mbox

Patch

diff --git a/rhel/README.RHEL b/rhel/README.RHEL
index 54c1b44..0f51be5 100644
--- a/rhel/README.RHEL
+++ b/rhel/README.RHEL
@@ -33,13 +33,16 @@  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 +56,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 +253,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