2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-01 23:05:29 +00:00

system-traffic: Add link-args for ADD_NATIVE_TUNNEL.

Ubuntu 14.04 with kernel 3.13 fails to set a GRE tunnel's mac address
after device state is up.  The patch first introduces additional args
'link-args' for 'ip link set' and uses it to adds mac address setting
in ADD_NATIVE_TUNNEL.  As a result, the device could be configured before
becoming up state.  Note that the original 'link-args' is renamed to
'type-args'.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
This commit is contained in:
William Tu
2016-08-18 11:09:39 -07:00
committed by Joe Stringer
parent fe996936e5
commit 2b9f392443
2 changed files with 9 additions and 8 deletions

View File

@@ -118,22 +118,23 @@ m4_define([ADD_OVS_TUNNEL],
) )
# ADD_NATIVE_TUNNEL([type], [port], [namespace], [remote-addr], [overlay-addr], # ADD_NATIVE_TUNNEL([type], [port], [namespace], [remote-addr], [overlay-addr],
# [link-args]) # [type-args], [link-args])
# #
# Add a native tunnel device within 'namespace', with name 'port' and type # Add a native tunnel device within 'namespace', with name 'port' and type
# 'type'. The tunnel device will be configured as point-to-point with the # 'type'. The tunnel device will be configured as point-to-point with the
# 'remote-addr' as the underlay address of the remote tunnel endpoint (as # 'remote-addr' as the underlay address of the remote tunnel endpoint (as
# viewed from the perspective of that namespace). # viewed from the perspective of that namespace).
# #
# 'port' will be configured with the address 'overlay-addr'. 'link-args' is # 'port' will be configured with the address 'overlay-addr'. 'type-args' is
# made available so that additional arguments can be passed to "ip link", # made available so that additional arguments can be passed to "ip link add"
# for instance to configure the vxlan destination port. # for configuring specific link type's arguments, for instance to configure
# the vxlan destination port. 'link-args' is made for arguments passed to
# "ip link set", for instance to configure MAC address.
# #
m4_define([ADD_NATIVE_TUNNEL], m4_define([ADD_NATIVE_TUNNEL],
[NS_CHECK_EXEC([$3], [ip link add dev $2 type $1 remote $4 $6]) [NS_CHECK_EXEC([$3], [ip link add dev $2 type $1 remote $4 $6])
NS_CHECK_EXEC([$3], [ip addr add dev $2 $5]) NS_CHECK_EXEC([$3], [ip addr add dev $2 $5])
NS_CHECK_EXEC([$3], [ip link set dev $2 up]) NS_CHECK_EXEC([$3], [ip link set dev $2 mtu 1450 $7 up])
NS_CHECK_EXEC([$3], [ip link set dev $2 mtu 1450])
] ]
) )

View File

@@ -384,9 +384,9 @@ AT_CHECK([ip link set dev br-underlay up])
dnl Set up tunnel endpoints on OVS outside the namespace and with a native dnl Set up tunnel endpoints on OVS outside the namespace and with a native
dnl linux device inside the namespace. dnl linux device inside the namespace.
ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24]) ADD_OVS_TUNNEL([gre], [br0], [at_gre0], [172.31.1.1], [10.1.1.100/24])
ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], [10.1.1.1/24]) ADD_NATIVE_TUNNEL([gretap], [ns_gre0], [at_ns0], [172.31.1.100], [10.1.1.1/24],
[], [address e6:66:c1:11:11:11])
AT_CHECK([ovs-vsctl -- set interface at_gre0 ofport_request=1]) AT_CHECK([ovs-vsctl -- set interface at_gre0 ofport_request=1])
NS_CHECK_EXEC([at_ns0], [ip link set dev ns_gre0 address e6:66:c1:11:11:11])
NS_CHECK_EXEC([at_ns0], [arp -s 10.1.1.2 e6:66:c1:22:22:22]) NS_CHECK_EXEC([at_ns0], [arp -s 10.1.1.2 e6:66:c1:22:22:22])
dnl Set up (p1 and ovs-p1) at br0 dnl Set up (p1 and ovs-p1) at br0