On Wed, Jan 17, 2018 at 04:35:01PM +0000, Vishal Deep Ajmera wrote:
> > What happens if you have two or more bonds or if we fix dpdk port too, 
> > what happens when you have more than one? 
> >  I think you will see errors/failures.
> 
> I tried with two dpdk ports and I do see following print on console though 
> it seem harmless and does not impact route table. Also, this happens only 
> when bridge mac was unchanged by addition of new DPDK port. 
> 
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists
> RTNETLINK answers: File exists

OK, what about this patch instead? It should fix the issue without the
errors.  I have not tested.

diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs 
b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index b95220a7f..b455e356e 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -167,10 +167,17 @@ 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 will change its MAC to be the lower one among all 
its
+               # ports. Restore the configuration if that happens.
+               if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
+                       OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
+               fi
                ;;
        OVSDPDKRPort)
                ifup_ovs_bridge
@@ -196,12 +203,19 @@ 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 will change its MAC to be the lower one among all 
its
+               # ports. Restore the configuration if that happens.
+               if [ "$BRIDGE_MAC_ORIG" != "$BRIDGE_MAC" ]; then
+                       OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
+               fi
                ;;
        *)
                echo $"Invalid OVS interface type $TYPE"

-- 
Flavio

_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to