Merge ~fnordahl/ubuntu/+source/ovn:ubuntu/impish into ~ubuntu-server-dev/ubuntu/+source/ovn:ubuntu/impish
- Git
- lp:~fnordahl/ubuntu/+source/ovn
- ubuntu/impish
- Merge into ubuntu/impish
Proposed by
Frode Nordahl
Status: | Needs review |
---|---|
Proposed branch: | ~fnordahl/ubuntu/+source/ovn:ubuntu/impish |
Merge into: | ~ubuntu-server-dev/ubuntu/+source/ovn:ubuntu/impish |
Diff against target: |
312 lines (+273/-4) 4 files modified
debian/changelog (+9/-3) debian/control (+1/-1) debian/patches/lp-1980212-treewide-bump-ovs-and-fix-problematic-loops.patch (+262/-0) debian/patches/series (+1/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Page | Pending | ||
Review via email: mp+426283@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
James Page (james-page) : | # |
Revision history for this message
Frode Nordahl (fnordahl) : | # |
Unmerged commits
- 76bee9e... by Frode Nordahl
-
Adapt to changes made in previous OVS point release
- d/control: Update required openvswitch build requirement.
- d/p/lp-1980213- treewide- bump-ovs- and-fix- problematic- loops.patch Signed-off-by: Frode Nordahl <email address hidden>
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index 0fd75c7..c483f3c 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,10 +1,16 @@ |
6 | ovn (21.09.0-0ubuntu2) UNRELEASED; urgency=medium |
7 | |
8 | + [ Frode Nordahl ] |
9 | + * Adapt to changes made in previous OVS point release (LP: #1980212): |
10 | + - d/control: Update required openvswitch build requirement. |
11 | + - d/p/lp-1980212-treewide-bump-ovs-and-fix-problematic-loops.patch |
12 | + |
13 | + [ James Page ] |
14 | * d/p/deliver-multicast-traffic-to-localport-ports.patch: Cherry pick |
15 | - potential fix for issue with metadata access with OpenStack (LP: |
16 | - #1951841). |
17 | + potential fix for issue with metadata access with OpenStack |
18 | + (LP: #1951841). |
19 | |
20 | - -- James Page <james.page@ubuntu.com> Mon, 29 Nov 2021 11:52:19 +0000 |
21 | + -- Frode Nordahl <frode.nordahl@canonical.com Tue, 05 Jul 2022 15:42:00 +0200 |
22 | |
23 | ovn (21.09.0-0ubuntu1) impish; urgency=medium |
24 | |
25 | diff --git a/debian/control b/debian/control |
26 | index 3601c28..316ff9f 100644 |
27 | --- a/debian/control |
28 | +++ b/debian/control |
29 | @@ -17,7 +17,7 @@ Build-Depends: |
30 | libtool, |
31 | libunbound-dev, |
32 | openssl, |
33 | - openvswitch-source (>= 2.16.0-0ubuntu2~), |
34 | + openvswitch-source (>= 2.16.4-0ubuntu1~), |
35 | pkg-config, |
36 | procps, |
37 | python3-all-dev, |
38 | diff --git a/debian/patches/lp-1980212-treewide-bump-ovs-and-fix-problematic-loops.patch b/debian/patches/lp-1980212-treewide-bump-ovs-and-fix-problematic-loops.patch |
39 | new file mode 100644 |
40 | index 0000000..043cd24 |
41 | --- /dev/null |
42 | +++ b/debian/patches/lp-1980212-treewide-bump-ovs-and-fix-problematic-loops.patch |
43 | @@ -0,0 +1,262 @@ |
44 | +Origin: backport, https://github.com/ovn-org/ovn/commit/996ed75db776c59098b6539d0c03d43977202885 |
45 | +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/openvswitch/1980212 |
46 | +Last-Update: 2022-07-05 |
47 | + |
48 | +From 56fbcb2efb4d61ed95a2addba40d1f7d4652fffe Mon Sep 17 00:00:00 2001 |
49 | +From: Adrian Moreno <amorenoz@redhat.com> |
50 | +Date: Wed, 20 Apr 2022 07:55:35 +0200 |
51 | +Subject: [PATCH] treewide: bump ovs and fix problematic loops |
52 | + |
53 | +The minimum changes to adapt to new ovs are: |
54 | +- adapt to changes made in inet_parse_active function by passing an |
55 | + extra NULL argument |
56 | + |
57 | +- fix those places where next variable was being used inside *_SAFE |
58 | + iterators since. Now the next variable might not always be safe to use |
59 | + so extra checks are needed. |
60 | + |
61 | +Signed-off-by: Adrian Moreno <amorenoz@redhat.com> |
62 | +Acked-by: Dumitru Ceara <dceara@redhat.com> |
63 | +Signed-off-by: Mark Michelson <mmichels@redhat.com> |
64 | +(cherry picked from commit 996ed75db776c59098b6539d0c03d43977202885) |
65 | +--- |
66 | + .gitmodules | 3 --- |
67 | + controller/ofctrl.c | 7 ++++++- |
68 | + lib/actions.c | 2 +- |
69 | + lib/expr.c | 33 +++++++++++++++++++-------------- |
70 | + lib/ovn-util.c | 2 +- |
71 | + ovs | 1 - |
72 | + utilities/ovn-nbctl.c | 6 +++--- |
73 | + utilities/ovn-trace.c | 8 +++++--- |
74 | + 8 files changed, 35 insertions(+), 27 deletions(-) |
75 | + delete mode 160000 ovs |
76 | + |
77 | +diff --git a/controller/ofctrl.c b/controller/ofctrl.c |
78 | +index 08fcfed8b..d0c15c1ac 100644 |
79 | +--- a/controller/ofctrl.c |
80 | ++++ b/controller/ofctrl.c |
81 | +@@ -899,7 +899,12 @@ link_installed_to_desired(struct installed_flow *i, struct desired_flow *d) |
82 | + break; |
83 | + } |
84 | + } |
85 | +- ovs_list_insert(&f->installed_ref_list_node, &d->installed_ref_list_node); |
86 | ++ if (!f) { |
87 | ++ ovs_list_insert(&i->desired_refs, &d->installed_ref_list_node); |
88 | ++ } else { |
89 | ++ ovs_list_insert(&f->installed_ref_list_node, |
90 | ++ &d->installed_ref_list_node); |
91 | ++ } |
92 | + d->installed_flow = i; |
93 | + return installed_flow_get_active(i) == d; |
94 | + } |
95 | +diff --git a/lib/actions.c b/lib/actions.c |
96 | +index 7cf6be308..f61f6cd50 100644 |
97 | +--- a/lib/actions.c |
98 | ++++ b/lib/actions.c |
99 | +@@ -2291,7 +2291,7 @@ validate_empty_lb_backends(struct action_context *ctx, |
100 | + |
101 | + switch (o->option->code) { |
102 | + case EMPTY_LB_VIP: |
103 | +- if (!inet_parse_active(c->string, 0, &ss, false)) { |
104 | ++ if (!inet_parse_active(c->string, 0, &ss, false, NULL)) { |
105 | + lexer_error(ctx->lexer, "Invalid load balancer VIP '%s'", |
106 | + c->string); |
107 | + return; |
108 | +diff --git a/lib/expr.c b/lib/expr.c |
109 | +index e3f6bb892..30ed25c6e 100644 |
110 | +--- a/lib/expr.c |
111 | ++++ b/lib/expr.c |
112 | +@@ -203,16 +203,17 @@ expr_combine(enum expr_type type, struct expr *a, struct expr *b) |
113 | + } |
114 | + |
115 | + static void |
116 | +-expr_insert_andor(struct expr *andor, struct expr *before, struct expr *new) |
117 | ++expr_insert_andor(struct expr *andor, struct ovs_list *before, |
118 | ++ struct expr *new) |
119 | + { |
120 | + if (new->type == andor->type) { |
121 | + if (andor->type == EXPR_T_AND) { |
122 | + /* Conjunction junction, what's your function? */ |
123 | + } |
124 | +- ovs_list_splice(&before->node, new->andor.next, &new->andor); |
125 | +- free(new); |
126 | ++ ovs_list_splice(before, new->andor.next, &new->andor); |
127 | ++ expr_destroy(new); |
128 | + } else { |
129 | +- ovs_list_insert(&before->node, &new->node); |
130 | ++ ovs_list_insert(before, &new->node); |
131 | + } |
132 | + } |
133 | + |
134 | +@@ -1955,7 +1956,8 @@ expr_annotate__(struct expr *expr, const struct shash *symtab, |
135 | + expr_destroy(expr); |
136 | + return NULL; |
137 | + } |
138 | +- expr_insert_andor(expr, next, new_sub); |
139 | ++ expr_insert_andor(expr, next ? &next->node : &expr->andor, |
140 | ++ new_sub); |
141 | + } |
142 | + *errorp = NULL; |
143 | + return expr; |
144 | +@@ -2155,7 +2157,7 @@ expr_evaluate_condition(struct expr *expr, |
145 | + struct expr *e = expr_evaluate_condition(sub, is_chassis_resident, |
146 | + c_aux); |
147 | + e = expr_fix(e); |
148 | +- expr_insert_andor(expr, next, e); |
149 | ++ expr_insert_andor(expr, next ? &next->node : &expr->andor, e); |
150 | + } |
151 | + return expr_fix(expr); |
152 | + |
153 | +@@ -2188,7 +2190,8 @@ expr_simplify(struct expr *expr) |
154 | + case EXPR_T_OR: |
155 | + LIST_FOR_EACH_SAFE (sub, next, node, &expr->andor) { |
156 | + ovs_list_remove(&sub->node); |
157 | +- expr_insert_andor(expr, next, expr_simplify(sub)); |
158 | ++ expr_insert_andor(expr, next ? &next->node : &expr->andor, |
159 | ++ expr_simplify(sub)); |
160 | + } |
161 | + return expr_fix(expr); |
162 | + |
163 | +@@ -2298,12 +2301,13 @@ crush_and_string(struct expr *expr, const struct expr_symbol *symbol) |
164 | + * EXPR_T_OR with EXPR_T_CMP subexpressions. */ |
165 | + struct expr *sub, *next = NULL; |
166 | + LIST_FOR_EACH_SAFE (sub, next, node, &expr->andor) { |
167 | ++ struct ovs_list *next_list = next ? &next->node : &expr->andor; |
168 | + ovs_list_remove(&sub->node); |
169 | + struct expr *new = crush_cmps(sub, symbol); |
170 | + switch (new->type) { |
171 | + case EXPR_T_CMP: |
172 | + if (!singleton) { |
173 | +- ovs_list_insert(&next->node, &new->node); |
174 | ++ ovs_list_insert(next_list, &new->node); |
175 | + singleton = new; |
176 | + } else { |
177 | + bool match = !strcmp(new->cmp.string, singleton->cmp.string); |
178 | +@@ -2317,7 +2321,7 @@ crush_and_string(struct expr *expr, const struct expr_symbol *symbol) |
179 | + case EXPR_T_AND: |
180 | + OVS_NOT_REACHED(); |
181 | + case EXPR_T_OR: |
182 | +- ovs_list_insert(&next->node, &new->node); |
183 | ++ ovs_list_insert(next_list, &new->node); |
184 | + break; |
185 | + case EXPR_T_BOOLEAN: |
186 | + if (!new->boolean) { |
187 | +@@ -2413,7 +2417,7 @@ crush_and_numeric(struct expr *expr, const struct expr_symbol *symbol) |
188 | + case EXPR_T_AND: |
189 | + OVS_NOT_REACHED(); |
190 | + case EXPR_T_OR: |
191 | +- ovs_list_insert(&next->node, &new->node); |
192 | ++ ovs_list_insert(next ? &next->node : &expr->andor, &new->node); |
193 | + break; |
194 | + case EXPR_T_BOOLEAN: |
195 | + if (!new->boolean) { |
196 | +@@ -2579,7 +2583,8 @@ crush_or(struct expr *expr, const struct expr_symbol *symbol) |
197 | + * is now a disjunction of cmps over the same symbol. */ |
198 | + LIST_FOR_EACH_SAFE (sub, next, node, &expr->andor) { |
199 | + ovs_list_remove(&sub->node); |
200 | +- expr_insert_andor(expr, next, crush_cmps(sub, symbol)); |
201 | ++ expr_insert_andor(expr, next ? &next->node : &expr->andor, |
202 | ++ crush_cmps(sub, symbol)); |
203 | + } |
204 | + expr = expr_fix(expr); |
205 | + if (expr->type != EXPR_T_OR) { |
206 | +@@ -2737,8 +2742,7 @@ expr_normalize_and(struct expr *expr) |
207 | + |
208 | + struct expr *a, *b; |
209 | + LIST_FOR_EACH_SAFE (a, b, node, &expr->andor) { |
210 | +- if (&b->node == &expr->andor |
211 | +- || a->type != EXPR_T_CMP || b->type != EXPR_T_CMP |
212 | ++ if (!b || a->type != EXPR_T_CMP || b->type != EXPR_T_CMP |
213 | + || a->cmp.symbol != b->cmp.symbol) { |
214 | + continue; |
215 | + } else if (a->cmp.symbol->width |
216 | +@@ -2815,7 +2819,8 @@ expr_normalize_or(struct expr *expr) |
217 | + } |
218 | + free(new); |
219 | + } else { |
220 | +- expr_insert_andor(expr, next, new); |
221 | ++ expr_insert_andor(expr, next ? &next->node : &expr->andor, |
222 | ++ new); |
223 | + } |
224 | + } else { |
225 | + ovs_assert(sub->type == EXPR_T_CMP || |
226 | +diff --git a/lib/ovn-util.c b/lib/ovn-util.c |
227 | +index 683ca37d9..ab55f5d8e 100644 |
228 | +--- a/lib/ovn-util.c |
229 | ++++ b/lib/ovn-util.c |
230 | +@@ -746,7 +746,7 @@ ip_address_and_port_from_lb_key(const char *key, char **ip_address, |
231 | + uint16_t *port, int *addr_family) |
232 | + { |
233 | + struct sockaddr_storage ss; |
234 | +- if (!inet_parse_active(key, 0, &ss, false)) { |
235 | ++ if (!inet_parse_active(key, 0, &ss, false, NULL)) { |
236 | + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1); |
237 | + VLOG_WARN_RL(&rl, "bad ip address or port for load balancer key %s", |
238 | + key); |
239 | +diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c |
240 | +index e34bb65f7..ccbf72c2d 100644 |
241 | +--- a/utilities/ovn-nbctl.c |
242 | ++++ b/utilities/ovn-nbctl.c |
243 | +@@ -2794,7 +2794,7 @@ nbctl_lb_add(struct ctl_context *ctx) |
244 | + } |
245 | + |
246 | + struct sockaddr_storage ss_vip; |
247 | +- if (!inet_parse_active(lb_vip, 0, &ss_vip, false)) { |
248 | ++ if (!inet_parse_active(lb_vip, 0, &ss_vip, false, NULL)) { |
249 | + ctl_error(ctx, "%s: should be an IP address (or an IP address " |
250 | + "and a port number with : as a separator).", lb_vip); |
251 | + return; |
252 | +@@ -2824,7 +2824,7 @@ nbctl_lb_add(struct ctl_context *ctx) |
253 | + struct sockaddr_storage ss_dst; |
254 | + |
255 | + if (lb_vip_port) { |
256 | +- if (!inet_parse_active(token, -1, &ss_dst, false)) { |
257 | ++ if (!inet_parse_active(token, -1, &ss_dst, false, NULL)) { |
258 | + ctl_error(ctx, "%s: should be an IP address and a port " |
259 | + "number with : as a separator.", token); |
260 | + goto out; |
261 | +@@ -2970,7 +2970,7 @@ lb_info_add_smap(const struct nbrec_load_balancer *lb, |
262 | + const struct smap_node *node = nodes[i]; |
263 | + |
264 | + struct sockaddr_storage ss; |
265 | +- if (!inet_parse_active(node->key, 0, &ss, false)) { |
266 | ++ if (!inet_parse_active(node->key, 0, &ss, false, NULL)) { |
267 | + continue; |
268 | + } |
269 | + |
270 | +diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c |
271 | +index 5d016b757..b6c6e9770 100644 |
272 | +--- a/utilities/ovn-trace.c |
273 | ++++ b/utilities/ovn-trace.c |
274 | +@@ -203,7 +203,7 @@ static void |
275 | + parse_lb_option(const char *s) |
276 | + { |
277 | + struct sockaddr_storage ss; |
278 | +- if (!inet_parse_active(s, 0, &ss, false)) { |
279 | ++ if (!inet_parse_active(s, 0, &ss, false, NULL)) { |
280 | + ovs_fatal(0, "%s: bad address", s); |
281 | + } |
282 | + |
283 | +@@ -1377,7 +1377,8 @@ ovntrace_node_prune_summary(struct ovs_list *nodes) |
284 | + sub->type == OVNTRACE_NODE_TABLE) { |
285 | + /* Replace 'sub' by its children, if any, */ |
286 | + ovs_list_remove(&sub->node); |
287 | +- ovs_list_splice(&next->node, sub->subs.next, &sub->subs); |
288 | ++ ovs_list_splice(next ? &next->node : nodes, sub->subs.next, |
289 | ++ &sub->subs); |
290 | + ovntrace_node_destroy(sub); |
291 | + } |
292 | + } |
293 | +@@ -1421,7 +1422,8 @@ ovntrace_node_prune_hard(struct ovs_list *nodes) |
294 | + sub->type == OVNTRACE_NODE_OUTPUT) { |
295 | + /* Replace 'sub' by its children, if any, */ |
296 | + ovs_list_remove(&sub->node); |
297 | +- ovs_list_splice(&next->node, sub->subs.next, &sub->subs); |
298 | ++ ovs_list_splice(next ? &next->node : nodes, sub->subs.next, |
299 | ++ &sub->subs); |
300 | + ovntrace_node_destroy(sub); |
301 | + } |
302 | + } |
303 | +-- |
304 | +2.36.1 |
305 | + |
306 | diff --git a/debian/patches/series b/debian/patches/series |
307 | index ee7887a..3bf2264 100644 |
308 | --- a/debian/patches/series |
309 | +++ b/debian/patches/series |
310 | @@ -1 +1,2 @@ |
311 | deliver-multicast-traffic-to-localport-ports.patch |
312 | +lp-1980213-treewide-bump-ovs-and-fix-problematic-loops.patch |