[ovs-dev] rhel: Avoid losing bridge configuration after adding DPDK ports

Message ID 1519327129-12523-1-git-send-email-vishal.deep.ajmera@ericsson.com
State Accepted
Delegated to: Russell Bryant
Headers show
Series
  • [ovs-dev] rhel: Avoid losing bridge configuration after adding DPDK ports
Related show

Commit Message

Vishal Deep Ajmera Feb. 22, 2018, 7:18 p.m.
Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge
interface is reconfigured with the lowest MAC address among the connected DPDK
ports. When changing the MAC address, OVS performs a sequences of events
UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL
distribution this results in loosing Linux networking configuration attached to
the bridge interface (e.g. static routes).

This patch changes the interface configuration scripts used in a RHEL deployment
to trigger post-up operations on the bridge device after a change of MAC address.

Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
Signed-off-by: Flavio Leitner <fbl@sysclose.org>

---
 rhel/README.RHEL.rst                        |  5 +++++
 rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)

Comments

Vishal Deep Ajmera Feb. 28, 2018, 12:32 p.m. | #1
Hi,

If the patch looks fine I request to get this cherry-pick on 2.9 branch as well.

Warm Regards,
Vishal Ajmera

-----Original Message-----
From: Vishal Deep Ajmera 
Sent: Friday, February 23, 2018 12:49 AM
To: dev@openvswitch.org
Cc: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>; Flavio Leitner <fbl@sysclose.org>
Subject: [PATCH] rhel: Avoid losing bridge configuration after adding DPDK ports

Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge
interface is reconfigured with the lowest MAC address among the connected DPDK
ports. When changing the MAC address, OVS performs a sequences of events
UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL
distribution this results in loosing Linux networking configuration attached to
the bridge interface (e.g. static routes).

This patch changes the interface configuration scripts used in a RHEL deployment
to trigger post-up operations on the bridge device after a change of MAC address.

Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
Signed-off-by: Flavio Leitner <fbl@sysclose.org>

---
 rhel/README.RHEL.rst                        |  5 +++++
 rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
index f3d2942..1cd2065 100644
--- a/rhel/README.RHEL.rst
+++ b/rhel/README.RHEL.rst
@@ -93,6 +93,11 @@ Note
   answers: File exists`` printed on the console. This comes from ifup-eth
   trying to add zeroconf route multiple times and is harmless.
 
+* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
+  Since OVS changes the device state to DOWN before changing its mac address this
+  result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
+  operation on the bridge again to restore configuration.
+
 Examples
 --------
 
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index b95220a..1c65f13 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -167,10 +167,18 @@ case "$TYPE" in
 		;;
 	OVSDPDKPort)
 		ifup_ovs_bridge
+		BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE)
 		ovs-vsctl -t ${TIMEOUT} \
 			-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
 			-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
 			-- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA}
+		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
+		# The bridge may change its MAC to be the lower one among all its
+		# ports. If that happens, bridge configuration (e.g. routes) will
+		# be lost. Restore the post-up bridge configuration again.
+		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
+			${OTHERSCRIPT} "$OVS_BRIDGE"
+		fi
 		;;
 	OVSDPDKRPort)
 		ifup_ovs_bridge
@@ -196,12 +204,20 @@ case "$TYPE" in
 		;;
 	OVSDPDKBond)
 		ifup_ovs_bridge
+		BRIDGE_MAC_ORIG=$(get_hwaddr $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}
+		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
+		# The bridge may change its MAC to be the lower one among all its
+		# ports. If that happens, bridge configuration (e.g. routes) will
+		# be lost. Restore the post-up bridge configuration again.
+		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
+			${OTHERSCRIPT} "$OVS_BRIDGE"
+		fi
 		;;
 	*)
 		echo $"Invalid OVS interface type $TYPE"
Flavio Leitner Feb. 28, 2018, 6:21 p.m. | #2
On Fri, Feb 23, 2018 at 12:48:49AM +0530, Vishal Deep Ajmera wrote:
> Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge
> interface is reconfigured with the lowest MAC address among the connected DPDK
> ports. When changing the MAC address, OVS performs a sequences of events
> UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL
> distribution this results in loosing Linux networking configuration attached to
> the bridge interface (e.g. static routes).
> 
> This patch changes the interface configuration scripts used in a RHEL deployment
> to trigger post-up operations on the bridge device after a change of MAC address.
> 
> Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
> Signed-off-by: Flavio Leitner <fbl@sysclose.org>
> 
> ---

Thanks Vishal!

Acked-by: Flavio Leitner <fbl@sysclose.org>
Flavio Leitner Feb. 28, 2018, 6:22 p.m. | #3
On Wed, Feb 28, 2018 at 12:32:23PM +0000, Vishal Deep Ajmera wrote:
> Hi,
> 
> If the patch looks fine I request to get this cherry-pick on 2.9 branch as well.

Makes sense to me.
fbl


> 
> Warm Regards,
> Vishal Ajmera
> 
> -----Original Message-----
> From: Vishal Deep Ajmera 
> Sent: Friday, February 23, 2018 12:49 AM
> To: dev@openvswitch.org
> Cc: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>; Flavio Leitner <fbl@sysclose.org>
> Subject: [PATCH] rhel: Avoid losing bridge configuration after adding DPDK ports
> 
> Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge
> interface is reconfigured with the lowest MAC address among the connected DPDK
> ports. When changing the MAC address, OVS performs a sequences of events
> UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL
> distribution this results in loosing Linux networking configuration attached to
> the bridge interface (e.g. static routes).
> 
> This patch changes the interface configuration scripts used in a RHEL deployment
> to trigger post-up operations on the bridge device after a change of MAC address.
> 
> Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
> Signed-off-by: Flavio Leitner <fbl@sysclose.org>
> 
> ---
>  rhel/README.RHEL.rst                        |  5 +++++
>  rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 ++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
> index f3d2942..1cd2065 100644
> --- a/rhel/README.RHEL.rst
> +++ b/rhel/README.RHEL.rst
> @@ -93,6 +93,11 @@ Note
>    answers: File exists`` printed on the console. This comes from ifup-eth
>    trying to add zeroconf route multiple times and is harmless.
>  
> +* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
> +  Since OVS changes the device state to DOWN before changing its mac address this
> +  result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
> +  operation on the bridge again to restore configuration.
> +
>  Examples
>  --------
>  
> diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
> index b95220a..1c65f13 100755
> --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
> +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
> @@ -167,10 +167,18 @@ case "$TYPE" in
>  		;;
>  	OVSDPDKPort)
>  		ifup_ovs_bridge
> +		BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE)
>  		ovs-vsctl -t ${TIMEOUT} \
>  			-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
>  			-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
>  			-- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA}
> +		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
> +		# The bridge may change its MAC to be the lower one among all its
> +		# ports. If that happens, bridge configuration (e.g. routes) will
> +		# be lost. Restore the post-up bridge configuration again.
> +		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
> +			${OTHERSCRIPT} "$OVS_BRIDGE"
> +		fi
>  		;;
>  	OVSDPDKRPort)
>  		ifup_ovs_bridge
> @@ -196,12 +204,20 @@ case "$TYPE" in
>  		;;
>  	OVSDPDKBond)
>  		ifup_ovs_bridge
> +		BRIDGE_MAC_ORIG=$(get_hwaddr $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}
> +		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
> +		# The bridge may change its MAC to be the lower one among all its
> +		# ports. If that happens, bridge configuration (e.g. routes) will
> +		# be lost. Restore the post-up bridge configuration again.
> +		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
> +			${OTHERSCRIPT} "$OVS_BRIDGE"
> +		fi
>  		;;
>  	*)
>  		echo $"Invalid OVS interface type $TYPE"
> -- 
> 1.9.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Ben Pfaff Feb. 28, 2018, 6:22 p.m. | #4
Russell, are you the right one to consider applying this?

On Wed, Feb 28, 2018 at 12:32:23PM +0000, Vishal Deep Ajmera wrote:
> Hi,
> 
> If the patch looks fine I request to get this cherry-pick on 2.9 branch as well.
> 
> Warm Regards,
> Vishal Ajmera
> 
> -----Original Message-----
> From: Vishal Deep Ajmera 
> Sent: Friday, February 23, 2018 12:49 AM
> To: dev@openvswitch.org
> Cc: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>; Flavio Leitner <fbl@sysclose.org>
> Subject: [PATCH] rhel: Avoid losing bridge configuration after adding DPDK ports
> 
> Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge
> interface is reconfigured with the lowest MAC address among the connected DPDK
> ports. When changing the MAC address, OVS performs a sequences of events
> UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL
> distribution this results in loosing Linux networking configuration attached to
> the bridge interface (e.g. static routes).
> 
> This patch changes the interface configuration scripts used in a RHEL deployment
> to trigger post-up operations on the bridge device after a change of MAC address.
> 
> Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
> Signed-off-by: Flavio Leitner <fbl@sysclose.org>
> 
> ---
>  rhel/README.RHEL.rst                        |  5 +++++
>  rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 ++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
> index f3d2942..1cd2065 100644
> --- a/rhel/README.RHEL.rst
> +++ b/rhel/README.RHEL.rst
> @@ -93,6 +93,11 @@ Note
>    answers: File exists`` printed on the console. This comes from ifup-eth
>    trying to add zeroconf route multiple times and is harmless.
>  
> +* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
> +  Since OVS changes the device state to DOWN before changing its mac address this
> +  result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
> +  operation on the bridge again to restore configuration.
> +
>  Examples
>  --------
>  
> diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
> index b95220a..1c65f13 100755
> --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
> +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
> @@ -167,10 +167,18 @@ case "$TYPE" in
>  		;;
>  	OVSDPDKPort)
>  		ifup_ovs_bridge
> +		BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE)
>  		ovs-vsctl -t ${TIMEOUT} \
>  			-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
>  			-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
>  			-- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA}
> +		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
> +		# The bridge may change its MAC to be the lower one among all its
> +		# ports. If that happens, bridge configuration (e.g. routes) will
> +		# be lost. Restore the post-up bridge configuration again.
> +		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
> +			${OTHERSCRIPT} "$OVS_BRIDGE"
> +		fi
>  		;;
>  	OVSDPDKRPort)
>  		ifup_ovs_bridge
> @@ -196,12 +204,20 @@ case "$TYPE" in
>  		;;
>  	OVSDPDKBond)
>  		ifup_ovs_bridge
> +		BRIDGE_MAC_ORIG=$(get_hwaddr $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}
> +		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
> +		# The bridge may change its MAC to be the lower one among all its
> +		# ports. If that happens, bridge configuration (e.g. routes) will
> +		# be lost. Restore the post-up bridge configuration again.
> +		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
> +			${OTHERSCRIPT} "$OVS_BRIDGE"
> +		fi
>  		;;
>  	*)
>  		echo $"Invalid OVS interface type $TYPE"
> -- 
> 1.9.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Russell Bryant March 7, 2018, 4:19 p.m. | #5
I've applied this to master and branch-2.9.

On Wed, Feb 28, 2018 at 1:22 PM, Ben Pfaff <blp@ovn.org> wrote:
> Russell, are you the right one to consider applying this?
>
> On Wed, Feb 28, 2018 at 12:32:23PM +0000, Vishal Deep Ajmera wrote:
>> Hi,
>>
>> If the patch looks fine I request to get this cherry-pick on 2.9 branch as well.
>>
>> Warm Regards,
>> Vishal Ajmera
>>
>> -----Original Message-----
>> From: Vishal Deep Ajmera
>> Sent: Friday, February 23, 2018 12:49 AM
>> To: dev@openvswitch.org
>> Cc: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>; Flavio Leitner <fbl@sysclose.org>
>> Subject: [PATCH] rhel: Avoid losing bridge configuration after adding DPDK ports
>>
>> Whenever a DPDK port is added to or deleted from an OVS bridge, the bridge
>> interface is reconfigured with the lowest MAC address among the connected DPDK
>> ports. When changing the MAC address, OVS performs a sequences of events
>> UP -> DOWN -> UP on the bridge interface. In deployments of OVS in RHEL
>> distribution this results in loosing Linux networking configuration attached to
>> the bridge interface (e.g. static routes).
>>
>> This patch changes the interface configuration scripts used in a RHEL deployment
>> to trigger post-up operations on the bridge device after a change of MAC address.
>>
>> Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
>> Signed-off-by: Flavio Leitner <fbl@sysclose.org>
>>
>> ---
>>  rhel/README.RHEL.rst                        |  5 +++++
>>  rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 ++++++++++++++++
>>  2 files changed, 21 insertions(+)
>>
>> diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
>> index f3d2942..1cd2065 100644
>> --- a/rhel/README.RHEL.rst
>> +++ b/rhel/README.RHEL.rst
>> @@ -93,6 +93,11 @@ Note
>>    answers: File exists`` printed on the console. This comes from ifup-eth
>>    trying to add zeroconf route multiple times and is harmless.
>>
>> +* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
>> +  Since OVS changes the device state to DOWN before changing its mac address this
>> +  result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
>> +  operation on the bridge again to restore configuration.
>> +
>>  Examples
>>  --------
>>
>> diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
>> index b95220a..1c65f13 100755
>> --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
>> +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
>> @@ -167,10 +167,18 @@ case "$TYPE" in
>>               ;;
>>       OVSDPDKPort)
>>               ifup_ovs_bridge
>> +             BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE)
>>               ovs-vsctl -t ${TIMEOUT} \
>>                       -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
>>                       -- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
>>                       -- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA}
>> +             BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
>> +             # The bridge may change its MAC to be the lower one among all its
>> +             # ports. If that happens, bridge configuration (e.g. routes) will
>> +             # be lost. Restore the post-up bridge configuration again.
>> +             if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
>> +                     ${OTHERSCRIPT} "$OVS_BRIDGE"
>> +             fi
>>               ;;
>>       OVSDPDKRPort)
>>               ifup_ovs_bridge
>> @@ -196,12 +204,20 @@ case "$TYPE" in
>>               ;;
>>       OVSDPDKBond)
>>               ifup_ovs_bridge
>> +             BRIDGE_MAC_ORIG=$(get_hwaddr $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}
>> +             BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
>> +             # The bridge may change its MAC to be the lower one among all its
>> +             # ports. If that happens, bridge configuration (e.g. routes) will
>> +             # be lost. Restore the post-up bridge configuration again.
>> +             if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
>> +                     ${OTHERSCRIPT} "$OVS_BRIDGE"
>> +             fi
>>               ;;
>>       *)
>>               echo $"Invalid OVS interface type $TYPE"
>> --
>> 1.9.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Vishal Deep Ajmera March 8, 2018, 11:55 a.m. | #6
-----Original Message-----
From: Russell Bryant [mailto:russell@ovn.org] 
Sent: Wednesday, March 07, 2018 9:49 PM
To: Ben Pfaff <blp@ovn.org>
Cc: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>; dev@openvswitch.org; Flavio Leitner <fbl@sysclose.org>
Subject: Re: [ovs-dev] [PATCH] rhel: Avoid losing bridge configuration after adding DPDK ports

I've applied this to master and branch-2.9.

>> Thank you Russell & Ben.

Patch

diff --git a/rhel/README.RHEL.rst b/rhel/README.RHEL.rst
index f3d2942..1cd2065 100644
--- a/rhel/README.RHEL.rst
+++ b/rhel/README.RHEL.rst
@@ -93,6 +93,11 @@  Note
   answers: File exists`` printed on the console. This comes from ifup-eth
   trying to add zeroconf route multiple times and is harmless.
 
+* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
+  Since OVS changes the device state to DOWN before changing its mac address this
+  result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
+  operation on the bridge again to restore configuration.
+
 Examples
 --------
 
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index b95220a..1c65f13 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -167,10 +167,18 @@  case "$TYPE" in
 		;;
 	OVSDPDKPort)
 		ifup_ovs_bridge
+		BRIDGE_MAC_ORIG=$(get_hwaddr $OVS_BRIDGE)
 		ovs-vsctl -t ${TIMEOUT} \
 			-- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
 			-- add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS \
 			-- set Interface "$DEVICE" type=dpdk ${OVS_EXTRA+-- $OVS_EXTRA}
+		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
+		# The bridge may change its MAC to be the lower one among all its
+		# ports. If that happens, bridge configuration (e.g. routes) will
+		# be lost. Restore the post-up bridge configuration again.
+		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
+			${OTHERSCRIPT} "$OVS_BRIDGE"
+		fi
 		;;
 	OVSDPDKRPort)
 		ifup_ovs_bridge
@@ -196,12 +204,20 @@  case "$TYPE" in
 		;;
 	OVSDPDKBond)
 		ifup_ovs_bridge
+		BRIDGE_MAC_ORIG=$(get_hwaddr $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}
+		BRIDGE_MAC=$(get_hwaddr $OVS_BRIDGE)
+		# The bridge may change its MAC to be the lower one among all its
+		# ports. If that happens, bridge configuration (e.g. routes) will
+		# be lost. Restore the post-up bridge configuration again.
+		if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
+			${OTHERSCRIPT} "$OVS_BRIDGE"
+		fi
 		;;
 	*)
 		echo $"Invalid OVS interface type $TYPE"