1
- From 5d418847bf6fa86f049e18c1b57028c71e40a9c4 Mon Sep 17 00:00:00 2001
1
+ From 113d482704198685fba09cd2597fd93ca9d297c5 Mon Sep 17 00:00:00 2001
2
2
From: Pavel Shirshov <
[email protected] >
3
- Date: Thu, 19 Sep 2019 14:49:17 -0700
3
+ Date: Tue, 1 Oct 2019 09:23:23 -0700
4
4
Subject: [PATCH 1/1] [libteam]: Reimplement Warm-Reboot procedure
5
5
6
6
---
7
7
libteam/ifinfo.c | 6 +-
8
- teamd/teamd.c | 57 + +++-
8
+ teamd/teamd.c | 51 +++-
9
9
teamd/teamd.h | 6 +
10
10
teamd/teamd_events.c | 13 ++
11
+ teamd/teamd_per_port.c | 6 +
11
12
teamd/teamd_runner_lacp.c | 474 +++++++++++++++++++++++++++++++++++---
12
- 5 files changed, 509 insertions(+), 47 deletions(-)
13
+ 6 files changed, 512 insertions(+), 44 deletions(-)
13
14
14
15
diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c
15
- index a15788b..e48193e 100644
16
+ index 46d56a2..b86d34c 100644
16
17
--- a/libteam/ifinfo.c
17
18
+++ b/libteam/ifinfo.c
18
19
@@ -109,15 +109,13 @@ static void update_hwaddr(struct team_ifinfo *ifinfo, struct rtnl_link *link)
@@ -34,7 +35,7 @@ index a15788b..e48193e 100644
34
35
}
35
36
}
36
37
diff --git a/teamd/teamd.c b/teamd/teamd.c
37
- index 9dc85b5..679da49 100644
38
+ index 9dc85b5..17221a9 100644
38
39
--- a/teamd/teamd.c
39
40
+++ b/teamd/teamd.c
40
41
@@ -117,7 +117,9 @@ static void print_help(const struct teamd_context *ctx) {
@@ -90,7 +91,7 @@ index 9dc85b5..679da49 100644
90
91
if (optind < argc) {
91
92
fprintf(stderr, "Too many arguments\n");
92
93
return -1;
93
- @@ -390,12 +410,21 @@ static int teamd_run_loop_run(struct teamd_context *ctx)
94
+ @@ -390,9 +410,18 @@ static int teamd_run_loop_run(struct teamd_context *ctx)
94
95
if (err != -1) {
95
96
switch(ctrl_byte) {
96
97
case 'q':
@@ -99,9 +100,6 @@ index 9dc85b5..679da49 100644
99
100
if (quit_in_progress)
100
101
return -EBUSY;
101
102
- teamd_refresh_ports(ctx);
102
- - err = teamd_flush_ports(ctx);
103
- - if (err)
104
- - return err;
105
103
+ if (ctrl_byte == 'w' || ctrl_byte == 'f') {
106
104
+ ctx->keep_ports = true;
107
105
+ ctx->no_quit_destroy = true;
@@ -110,12 +108,9 @@ index 9dc85b5..679da49 100644
110
108
+ teamd_ports_flush_data(ctx);
111
109
+ }
112
110
+
113
- + err = teamd_flush_ports(ctx);
114
- + if (err)
115
- + return err;
116
- quit_in_progress = true;
117
- continue;
118
- case 'r':
111
+ err = teamd_flush_ports(ctx);
112
+ if (err)
113
+ return err;
119
114
@@ -434,6 +463,12 @@ void teamd_run_loop_quit(struct teamd_context *ctx, int err)
120
115
teamd_run_loop_sent_ctrl_byte(ctx, 'q');
121
116
}
@@ -207,6 +202,23 @@ index 221803e..bd4dcc1 100644
207
202
int teamd_event_port_added(struct teamd_context *ctx,
208
203
struct teamd_port *tdport)
209
204
{
205
+ diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
206
+ index f98a90d..a87e809 100644
207
+ --- a/teamd/teamd_per_port.c
208
+ +++ b/teamd/teamd_per_port.c
209
+ @@ -350,6 +350,12 @@ static int teamd_port_remove(struct teamd_context *ctx,
210
+ {
211
+ int err;
212
+
213
+ + if (ctx->keep_ports) {
214
+ + teamd_log_dbg("%s: Keeping port (found ifindex \"%d\").",
215
+ + tdport->ifname, tdport->ifindex);
216
+ + return 0;
217
+ + }
218
+ +
219
+ teamd_log_dbg("%s: Removing port (found ifindex \"%d\").",
220
+ tdport->ifname, tdport->ifindex);
221
+ err = team_port_remove(ctx->th, tdport->ifindex);
210
222
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
211
223
index 4016b15..81be5b7 100644
212
224
--- a/teamd/teamd_runner_lacp.c
0 commit comments