Skip to content

Commit 203ae39

Browse files
yxiecatiantianlv
authored andcommitted
[teamd] retry creating team_port after interface info changed (sonic-net#2699)
Race condition has been noticed after warm reboot: sometimes when port_changed notification was received, the link message didn't have the device name. Without device name, creating team port would fail. Registering to the interface information change notification, so later when device name becomes available, retry creating team port. Signed-off-by: Ying Xie <[email protected]>
1 parent 6d2313c commit 203ae39

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From 7dff9798c2c92eb75b0120737efb81febcdb80c1 Mon Sep 17 00:00:00 2001
2+
From: Ying Xie <[email protected]>
3+
Date: Sun, 24 Mar 2019 21:49:59 +0000
4+
Subject: [PATCH] [teamd] register change handler for TEAM_IFINFO_CHANGE as
5+
well
6+
7+
There has been a race condition in the libnal/teamd interation, causing
8+
TEAM_PORT_CHANGE to report a port with empty device name. Which then
9+
causes the teamd unable to add the lag members into the lag.
10+
11+
Registering to the TEAM_IFINFO_CHANGE would give teamd another chance to
12+
add member again.
13+
14+
Signed-off-by: Ying Xie <[email protected]>
15+
---
16+
teamd/teamd_per_port.c | 2 +-
17+
1 file changed, 1 insertion(+), 1 deletion(-)
18+
19+
diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
20+
index 09d1dc7..137da57 100644
21+
--- a/teamd/teamd_per_port.c
22+
+++ b/teamd/teamd_per_port.c
23+
@@ -274,7 +274,7 @@ static int port_priv_change_handler_func(struct team_handle *th, void *priv,
24+
25+
static const struct team_change_handler port_priv_change_handler = {
26+
.func = port_priv_change_handler_func,
27+
- .type_mask = TEAM_PORT_CHANGE,
28+
+ .type_mask = TEAM_PORT_CHANGE | TEAM_IFINFO_CHANGE,
29+
};
30+
31+
int teamd_per_port_init(struct teamd_context *ctx)
32+
--
33+
2.7.4
34+

src/libteam/series

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
0005-libteam-Add-warm_reboot-mode.patch
66
0006-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
77
0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch
8+
0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch

0 commit comments

Comments
 (0)