From 32ad73102df830325f783339b06be820549d7537 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 28 Mar 2019 09:57:06 -0700 Subject: [PATCH] [teamd] retry creating team_port after interface info changed (#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 --- ...hange-handler-for-TEAM_IFINFO_CHANGE.patch | 34 +++++++++++++++++++ src/libteam/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 src/libteam/0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch diff --git a/src/libteam/0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch b/src/libteam/0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch new file mode 100644 index 000000000000..a603f91f62fe --- /dev/null +++ b/src/libteam/0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch @@ -0,0 +1,34 @@ +From 7dff9798c2c92eb75b0120737efb81febcdb80c1 Mon Sep 17 00:00:00 2001 +From: Ying Xie +Date: Sun, 24 Mar 2019 21:49:59 +0000 +Subject: [PATCH] [teamd] register change handler for TEAM_IFINFO_CHANGE as + well + +There has been a race condition in the libnal/teamd interation, causing +TEAM_PORT_CHANGE to report a port with empty device name. Which then +causes the teamd unable to add the lag members into the lag. + +Registering to the TEAM_IFINFO_CHANGE would give teamd another chance to +add member again. + +Signed-off-by: Ying Xie +--- + teamd/teamd_per_port.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c +index 09d1dc7..137da57 100644 +--- a/teamd/teamd_per_port.c ++++ b/teamd/teamd_per_port.c +@@ -274,7 +274,7 @@ static int port_priv_change_handler_func(struct team_handle *th, void *priv, + + static const struct team_change_handler port_priv_change_handler = { + .func = port_priv_change_handler_func, +- .type_mask = TEAM_PORT_CHANGE, ++ .type_mask = TEAM_PORT_CHANGE | TEAM_IFINFO_CHANGE, + }; + + int teamd_per_port_init(struct teamd_context *ctx) +-- +2.7.4 + diff --git a/src/libteam/series b/src/libteam/series index 8ac5ac8085e7..51b43ca14885 100644 --- a/src/libteam/series +++ b/src/libteam/series @@ -5,3 +5,4 @@ 0005-libteam-Add-warm_reboot-mode.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 +0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch