Merge remote-tracking branch 'upstream/master'
Sync with upstream
This commit is contained in:
commit
e65d9c5c88
@ -153,8 +153,8 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/union-mou
|
|||||||
sudo cp files/initramfs-tools/varlog $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog
|
sudo cp files/initramfs-tools/varlog $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog
|
||||||
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog
|
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog
|
||||||
# Management interface (eth0) dhcp can be optionally turned off (during a migration from another NOS to SONiC)
|
# Management interface (eth0) dhcp can be optionally turned off (during a migration from another NOS to SONiC)
|
||||||
sudo cp files/initramfs-tools/mgmt-intf-dhcp $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp
|
#sudo cp files/initramfs-tools/mgmt-intf-dhcp $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp
|
||||||
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp
|
#sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp
|
||||||
sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
|
sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
|
||||||
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
|
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
|
||||||
pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd
|
pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
PREREQS="union-mount"
|
|
||||||
|
|
||||||
prereqs() { echo "$PREREQS"; }
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
prereqs)
|
|
||||||
prereqs
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Extract kernel parameters
|
|
||||||
set -- $(cat /proc/cmdline)
|
|
||||||
for x in "$@"; do
|
|
||||||
case "$x" in
|
|
||||||
mgmt-intf-dhcp=*)
|
|
||||||
val="${x#mgmt-intf-dhcp=}"
|
|
||||||
|
|
||||||
if [ -z "$val" ]; then
|
|
||||||
echo "ERROR: mgmt-intf-dhcp value (on/off) not specified !"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "${rootmnt}/etc/network/interfaces" ]; then
|
|
||||||
if [ "$val" = "off" ]; then
|
|
||||||
sed -i 's/iface eth0 inet dhcp/iface eth0 inet static/g' ${rootmnt}/etc/network/interfaces
|
|
||||||
elif [ "$val" = "on" ]; then
|
|
||||||
sed -i 's/iface eth0 inet static/iface eth0 inet dhcp/g' ${rootmnt}/etc/network/interfaces
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
@ -0,0 +1,90 @@
|
|||||||
|
From fb00b070482dc587eec7b4e34acec094be1af00d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ying Xie <ying.xie@microsoft.com>
|
||||||
|
Date: Fri, 29 Mar 2019 20:54:49 +0000
|
||||||
|
Subject: [PATCH 10/11] [teamd] prevent private change handler reentrance
|
||||||
|
|
||||||
|
While handling PORT_CHANGE, teamd could casue an INTERFACE_CHANGE in the
|
||||||
|
same context. Which will interfere with the PORT_CHANGE handling and
|
||||||
|
causing it to fail.
|
||||||
|
|
||||||
|
Lock is not needed because the re-entrance happened in the same thread
|
||||||
|
context.
|
||||||
|
|
||||||
|
This issue was noticed while dynamically adding a port into a lag.
|
||||||
|
|
||||||
|
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
|
||||||
|
---
|
||||||
|
teamd/teamd.c | 2 ++
|
||||||
|
teamd/teamd.h | 2 ++
|
||||||
|
teamd/teamd_per_port.c | 13 +++++++++++--
|
||||||
|
3 files changed, 15 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/teamd/teamd.c b/teamd/teamd.c
|
||||||
|
index e28aa7d..140b98b 100644
|
||||||
|
--- a/teamd/teamd.c
|
||||||
|
+++ b/teamd/teamd.c
|
||||||
|
@@ -1255,6 +1255,8 @@ static int teamd_init(struct teamd_context *ctx)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
|
+ ctx->reentrant = false;
|
||||||
|
+
|
||||||
|
ctx->th = team_alloc();
|
||||||
|
if (!ctx->th) {
|
||||||
|
teamd_log_err("Team alloc failed.");
|
||||||
|
diff --git a/teamd/teamd.h b/teamd/teamd.h
|
||||||
|
index 622c365..7cd3266 100644
|
||||||
|
--- a/teamd/teamd.h
|
||||||
|
+++ b/teamd/teamd.h
|
||||||
|
@@ -160,6 +160,8 @@ struct teamd_context {
|
||||||
|
int pipe_r;
|
||||||
|
int pipe_w;
|
||||||
|
} workq;
|
||||||
|
+
|
||||||
|
+ bool reentrant;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct teamd_port {
|
||||||
|
diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
|
||||||
|
index 137da57..8b4a457 100644
|
||||||
|
--- a/teamd/teamd_per_port.c
|
||||||
|
+++ b/teamd/teamd_per_port.c
|
||||||
|
@@ -250,6 +250,10 @@ static int port_priv_change_handler_func(struct team_handle *th, void *priv,
|
||||||
|
struct port_obj *port_obj;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
+ if (ctx->reentrant) {
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ ctx->reentrant = true;
|
||||||
|
team_for_each_port(port, th) {
|
||||||
|
uint32_t ifindex = team_get_port_ifindex(port);
|
||||||
|
|
||||||
|
@@ -258,17 +262,22 @@ static int port_priv_change_handler_func(struct team_handle *th, void *priv,
|
||||||
|
if (team_is_port_removed(port))
|
||||||
|
continue;
|
||||||
|
err = port_obj_create(ctx, &port_obj, ifindex, port);
|
||||||
|
- if (err)
|
||||||
|
+ if (err) {
|
||||||
|
+ ctx->reentrant = false;
|
||||||
|
return err;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
if (team_is_port_changed(port)) {
|
||||||
|
err = teamd_event_port_changed(ctx, _port(port_obj));
|
||||||
|
- if (err)
|
||||||
|
+ if (err) {
|
||||||
|
+ ctx->reentrant = false;
|
||||||
|
return err;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
if (team_is_port_removed(port))
|
||||||
|
port_obj_remove(ctx, port_obj);
|
||||||
|
}
|
||||||
|
+ ctx->reentrant = false;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
@ -6,3 +6,4 @@
|
|||||||
0006-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
|
0006-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
|
||||||
0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch
|
0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch
|
||||||
0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch
|
0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch
|
||||||
|
0009-teamd-prevent-private-change-handler-reentrance.patch
|
||||||
|
@ -246,7 +246,7 @@ def parse_dpg(dpg, hname):
|
|||||||
# Give a warning if trying to attach ACL to a LAG member interface, correct way is to attach ACL to the LAG interface
|
# Give a warning if trying to attach ACL to a LAG member interface, correct way is to attach ACL to the LAG interface
|
||||||
if port_alias_map[member] in intfs_inpc:
|
if port_alias_map[member] in intfs_inpc:
|
||||||
print >> sys.stderr, "Warning: ACL " + aclname + " is attached to a LAG member interface " + port_alias_map[member] + ", instead of LAG interface"
|
print >> sys.stderr, "Warning: ACL " + aclname + " is attached to a LAG member interface " + port_alias_map[member] + ", instead of LAG interface"
|
||||||
elif member.lower() == 'erspan':
|
elif member.lower().startswith('erspan'):
|
||||||
is_mirror = True;
|
is_mirror = True;
|
||||||
# Erspan session will be attached to all front panel ports,
|
# Erspan session will be attached to all front panel ports,
|
||||||
# if panel ports is a member port of LAG, should add the LAG
|
# if panel ports is a member port of LAG, should add the LAG
|
||||||
|
@ -269,6 +269,16 @@
|
|||||||
</IPInterfaces>
|
</IPInterfaces>
|
||||||
<DataAcls/>
|
<DataAcls/>
|
||||||
<AclInterfaces>
|
<AclInterfaces>
|
||||||
|
<AclInterface>
|
||||||
|
<AttachTo>ERSPAN</AttachTo>
|
||||||
|
<InAcl>everflow</InAcl>
|
||||||
|
<Type>Everflow</Type>
|
||||||
|
</AclInterface>
|
||||||
|
<AclInterface>
|
||||||
|
<AttachTo>ERSPANv6</AttachTo>
|
||||||
|
<InAcl>everflowV6</InAcl>
|
||||||
|
<Type>Everflow</Type>
|
||||||
|
</AclInterface>
|
||||||
<AclInterface>
|
<AclInterface>
|
||||||
<AttachTo>PortChannel01;PortChannel02;PortChannel03;PortChannel04</AttachTo>
|
<AttachTo>PortChannel01;PortChannel02;PortChannel03;PortChannel04</AttachTo>
|
||||||
<InAcl>DataAcl</InAcl>
|
<InAcl>DataAcl</InAcl>
|
||||||
|
@ -81,11 +81,13 @@ class TestCfgGen(TestCase):
|
|||||||
self.assertEqual(output.strip(), "Warning: Ignoring Control Plane ACL NTP_ACL without type\n"
|
self.assertEqual(output.strip(), "Warning: Ignoring Control Plane ACL NTP_ACL without type\n"
|
||||||
"Warning: ignore interface 'fortyGigE0/2' as it is not in the port_config.ini\n"
|
"Warning: ignore interface 'fortyGigE0/2' as it is not in the port_config.ini\n"
|
||||||
"Warning: ignore interface 'fortyGigE0/2' in DEVICE_NEIGHBOR as it is not in the port_config.ini\n"
|
"Warning: ignore interface 'fortyGigE0/2' in DEVICE_NEIGHBOR as it is not in the port_config.ini\n"
|
||||||
"{'SSH_ACL': {'services': ['SSH'], 'type': 'CTRLPLANE', 'policy_desc': 'SSH_ACL'},"
|
"{'DATAACL': {'type': 'L3', 'policy_desc': 'DATAACL', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04']}, "
|
||||||
" 'SNMP_ACL': {'services': ['SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'SNMP_ACL'},"
|
"'NTP_ACL': {'services': ['NTP'], 'type': 'CTRLPLANE', 'policy_desc': 'NTP_ACL'}, "
|
||||||
" 'DATAACL': {'type': 'L3', 'policy_desc': 'DATAACL', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04']},"
|
"'EVERFLOW': {'type': 'MIRROR', 'policy_desc': 'EVERFLOW', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet24', 'Ethernet40', 'Ethernet20', 'Ethernet44', 'Ethernet48', 'Ethernet28', 'Ethernet96', 'Ethernet92', 'Ethernet76', 'Ethernet72', 'Ethernet52', 'Ethernet80', 'Ethernet56', 'Ethernet32', 'Ethernet16', 'Ethernet36', 'Ethernet12', 'Ethernet60', 'Ethernet8', 'Ethernet4', 'Ethernet0', 'Ethernet64', 'Ethernet68', 'Ethernet84', 'Ethernet88', 'Ethernet108', 'Ethernet104', 'Ethernet100', 'Ethernet24', 'Ethernet40', 'Ethernet20', 'Ethernet44', 'Ethernet48', 'Ethernet28', 'Ethernet96', 'Ethernet92', 'Ethernet76', 'Ethernet72', 'Ethernet52', 'Ethernet80', 'Ethernet56', 'Ethernet32', 'Ethernet16', 'Ethernet36', 'Ethernet12', 'Ethernet60', 'Ethernet8', 'Ethernet4', 'Ethernet0', 'Ethernet64', 'Ethernet68', 'Ethernet84', 'Ethernet88', 'Ethernet108', 'Ethernet104', 'Ethernet100']}, "
|
||||||
" 'NTP_ACL': {'services': ['NTP'], 'type': 'CTRLPLANE', 'policy_desc': 'NTP_ACL'},"
|
"'ROUTER_PROTECT': {'services': ['SSH', 'SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'ROUTER_PROTECT'}, "
|
||||||
" 'ROUTER_PROTECT': {'services': ['SSH', 'SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'ROUTER_PROTECT'}}")
|
"'SNMP_ACL': {'services': ['SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'SNMP_ACL'}, "
|
||||||
|
"'SSH_ACL': {'services': ['SSH'], 'type': 'CTRLPLANE', 'policy_desc': 'SSH_ACL'}, "
|
||||||
|
"'EVERFLOWV6': {'type': 'MIRROR', 'policy_desc': 'EVERFLOWV6', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet24', 'Ethernet40', 'Ethernet20', 'Ethernet44', 'Ethernet48', 'Ethernet28', 'Ethernet96', 'Ethernet92', 'Ethernet76', 'Ethernet72', 'Ethernet52', 'Ethernet80', 'Ethernet56', 'Ethernet32', 'Ethernet16', 'Ethernet36', 'Ethernet12', 'Ethernet60', 'Ethernet8', 'Ethernet4', 'Ethernet0', 'Ethernet64', 'Ethernet68', 'Ethernet84', 'Ethernet88', 'Ethernet108', 'Ethernet104', 'Ethernet100', 'Ethernet24', 'Ethernet40', 'Ethernet20', 'Ethernet44', 'Ethernet48', 'Ethernet28', 'Ethernet96', 'Ethernet92', 'Ethernet76', 'Ethernet72', 'Ethernet52', 'Ethernet80', 'Ethernet56', 'Ethernet32', 'Ethernet16', 'Ethernet36', 'Ethernet12', 'Ethernet60', 'Ethernet8', 'Ethernet4', 'Ethernet0', 'Ethernet64', 'Ethernet68', 'Ethernet84', 'Ethernet88', 'Ethernet108', 'Ethernet104', 'Ethernet100']}}")
|
||||||
|
|
||||||
def test_minigraph_everflow(self):
|
def test_minigraph_everflow(self):
|
||||||
argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v MIRROR_SESSION'
|
argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v MIRROR_SESSION'
|
||||||
|
Reference in New Issue
Block a user