-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[teamd] do not process lacpdu before the port ifinfo is set
Port libteam patch which fixes the race condition we observed during warm reboot. Remove early patches: 0006, 0008, 0009. Signed-off-by: Ying Xie <ying.xie@microsoft.com>
- Loading branch information
Showing
5 changed files
with
48 additions
and
173 deletions.
There are no files selected for viewing
45 changes: 0 additions & 45 deletions
45
src/libteam/0006-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
src/libteam/0008-teamd-register-change-handler-for-TEAM_IFINFO_CHANGE.patch
This file was deleted.
Oops, something went wrong.
90 changes: 0 additions & 90 deletions
90
src/libteam/0009-teamd-prevent-private-change-handler-reentrance.patch
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/libteam/0012-teamd-do-not-process-lacpdu-before-the-port-ifinfo-i.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From 28ccb37eb388e7e3d214a9b05011f8421f0d65ac Mon Sep 17 00:00:00 2001 | ||
From: Ying Xie <ying.xie@microsoft.com> | ||
Date: Fri, 26 Apr 2019 23:30:38 +0000 | ||
Subject: [PATCH] teamd: do not process lacpdu before the port ifinfo is set | ||
|
||
Now the port ifinfo will be set in obj_input_newlink when a RTM_NEWLINK | ||
event is received. | ||
|
||
But when a port is being added, if a lacpdu gets received on this port | ||
before the RTM_NEWLINK event, lacpdu_recv will process the packet with | ||
incorrect port ifinfo. | ||
|
||
In Patrick's case, as ifinfo->master_ifindex was 0, it would skip this | ||
port in teamd_for_each_tdport, which caused lacp_port->agg_lead not to | ||
be updated in lacp_switch_agg_lead. Later the lacp_port actor would go | ||
to a unexpected state. | ||
|
||
This patch is to avoid it by checking teamd_port_present in lacpdu_recv | ||
so that it would not process lacpdu before the port ifinfo is set. | ||
|
||
Reported-by: Patrick Talbert <ptalbert@redhat.com> | ||
Tested-by: Patrick Talbert <ptalbert@redhat.com> | ||
Signed-off-by: Xin Long <lucien.xin@gmail.com> | ||
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | ||
Signed-off-by: Jiri Pirko <jiri@mellanox.com> | ||
--- | ||
teamd/teamd_runner_lacp.c | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c | ||
index 78f05dd..c8ae541 100644 | ||
--- a/teamd/teamd_runner_lacp.c | ||
+++ b/teamd/teamd_runner_lacp.c | ||
@@ -1132,6 +1132,9 @@ static int lacpdu_process(struct lacp_port *lacp_port, struct lacpdu* lacpdu) | ||
{ | ||
int err; | ||
|
||
+ if (!teamd_port_present(lacp_port->ctx, lacp_port->tdport)) | ||
+ return 0; | ||
+ | ||
if (!lacpdu_check(lacpdu)) { | ||
teamd_log_warn("malformed LACP PDU came."); | ||
return 0; | ||
-- | ||
2.7.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters