On 2026-07-20 23:44, Trupti wrote:
Hello ,


Issue is reproducible on the ppc64el forky machine.

I am currently investigating the issue and will provide an update soon.



Thanks,
Trupti


Hi,

The build failure on ppc64el is caused by a name collision between grout's own vec_add macro in main/vec.h and the GCC AltiVec built-in intrinsic of the same name. On ppc64el, GCC reserves vec_add as a SIMD vector instruction, so when grout uses it as a dynamic array
helper the compiler rejects it with

error: invalid parameter combination for AltiVec intrinsic '__builtin_vec_add'.

The fix renames grout's vec_add to vec_add_end and vec_insert to vec_insert_at across the source tree (24 files). Both names are safe and do not conflict with any AltiVec built-in.


After applying this fix grout package builds successfully on ppc64el machine:


make[1]: Leaving directory '/home/debian/FTBFS/grout_build/grout-0.16.1'
   dh_md5sums -O--buildsystem=meson\+ninja
   dh_builddeb -O--buildsystem=meson\+ninja
dpkg-deb: building package 'grout-dbgsym' in '../grout-dbgsym_0.16.1-1.1_ppc64el.deb'. dpkg-deb: building package 'grout-headers' in '../grout-headers_0.16.1-1.1_all.deb'.
dpkg-deb: building package 'grout' in '../grout_0.16.1-1.1_ppc64el.deb'.
dpkg-deb: building package 'grout-frr-dbgsym' in '../grout-frr-dbgsym_0.16.1-1.1_ppc64el.deb'. dpkg-deb: building package 'grout-frr' in '../grout-frr_0.16.1-1.1_ppc64el.deb'.
 dpkg-genbuildinfo -O../grout_0.16.1-1.1_ppc64el.buildinfo
 dpkg-genchanges -O../grout_0.16.1-1.1_ppc64el.changes
dpkg-genchanges: info: not including original source code in upload
 dpkg-source --after-build .
dpkg-buildpackage: info: binary and diff upload (original source NOT included)
Now running lintian grout_0.16.1-1.1_ppc64el.changes ...
W: grout source: incomplete-creative-commons-license cc-by-sa-4.0 [debian/copyright:108]
Finished running lintian.


Patch is attached for review.


Thanks,
Trupti
Index: grout-0.16.1/main/vec.h
===================================================================
--- grout-0.16.1.orig/main/vec.h
+++ grout-0.16.1/main/vec.h
@@ -177,13 +177,13 @@ static inline char **__strvec_free(vec c
 #define vec_maybe_grow(v, n) ((v) = __vec_grow((v), sizeof(*(v)), (n), 0))
 
 // add an item at the end of a vector
-#define vec_add(v, x) (vec_maybe_grow(v, 1), (v)[__vec_hdr(v)->len++] = (x))
+#define vec_add_end(v, x) (vec_maybe_grow(v, 1), (v)[__vec_hdr(v)->len++] = (x))
 
 // append all items of a vector at the end of another vector
 #define vec_extend(v, v2) ((v) = __vec_extend(v, v2, sizeof(*(v))))
 
 // add an item at a specific index in a vector
-#define vec_insert(v, i, x) ((v) = __vec_shift_range(v, sizeof(*(v)), (i), 1), (v)[i] = (x))
+#define vec_insert_at(v, i, x) ((v) = __vec_shift_range(v, sizeof(*(v)), (i), 1), (v)[i] = (x))
 
 // remove the last item from a vector and return it
 #define vec_pop(v) (assert(vec_len(v) > 0), (v)[--__vec_hdr(v)->len])
Index: grout-0.16.1/modules/infra/api/affinity.c
===================================================================
--- grout-0.16.1.orig/modules/infra/api/affinity.c
+++ grout-0.16.1/modules/infra/api/affinity.c
@@ -49,7 +49,7 @@ static struct api_out affinity_set(const
 	if (CPU_COUNT(&req->datapath_cpus) > 0) {
 		struct iface *iface = NULL;
 		while ((iface = iface_next(GR_IFACE_TYPE_PORT, iface)) != NULL)
-			vec_add(ports, iface_info_port(iface));
+			vec_add_end(ports, iface_info_port(iface));
 
 		ret = worker_queue_distribute(&req->datapath_cpus, ports);
 		if (ret < 0)
Index: grout-0.16.1/modules/infra/api/stats.c
===================================================================
--- grout-0.16.1.orig/modules/infra/api/stats.c
+++ grout-0.16.1/modules/infra/api/stats.c
@@ -90,7 +90,7 @@ static struct api_out stats_get(const vo
 					iface->name,
 					names[i].name
 				);
-				vec_add(stats, stat);
+				vec_add_end(stats, stat);
 			}
 free_xstat:
 			free(xstats);
@@ -114,7 +114,7 @@ free_xstat:
 				);
 				stat.batches = rx_burst_histogram[s];
 				stat.packets = stat.batches * s;
-				vec_add(stats, stat);
+				vec_add_end(stats, stat);
 			}
 		}
 	}
@@ -237,7 +237,7 @@ static struct api_out iface_stats_get(co
 			}
 		}
 
-		vec_add(stats_vec, s);
+		vec_add_end(stats_vec, s);
 	}
 
 	size_t n_stats = vec_len(stats_vec);
Index: grout-0.16.1/modules/infra/control/bond.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/bond.c
+++ grout-0.16.1/modules/infra/control/bond.c
@@ -257,7 +257,7 @@ void bond_update_active_members(struct i
 			member = bond->members[i].iface;
 			if (i == active_member) {
 				speed = member->speed;
-				vec_add(active_ids, i);
+				vec_add_end(active_ids, i);
 				LOG(INFO,
 				    "bond %s active member is now %s",
 				    iface->name,
@@ -301,7 +301,7 @@ void bond_update_active_members(struct i
 				    "bond %s member %s active",
 				    iface->name,
 				    member->iface->name);
-				vec_add(active_ids, i);
+				vec_add_end(active_ids, i);
 				if (member->iface->speed != RTE_ETH_SPEED_NUM_UNKNOWN)
 					speed += member->iface->speed;
 			}
Index: grout-0.16.1/main/api.c
===================================================================
--- grout-0.16.1.orig/main/api.c
+++ grout-0.16.1/main/api.c
@@ -149,7 +149,7 @@ static struct api_out subscribe(const vo
 				return api_out(0, 0, NULL); // already subscribed
 			}
 		}
-		vec_add(all_events_subs, sub);
+		vec_add_end(all_events_subs, sub);
 		return api_out(0, 0, NULL);
 	}
 
@@ -168,7 +168,7 @@ static struct api_out subscribe(const vo
 			return api_out(0, 0, NULL); // already subscribed
 		}
 	}
-	vec_add(subs->ev_subs[ev], sub);
+	vec_add_end(subs->ev_subs[ev], sub);
 
 	return api_out(0, 0, NULL);
 }
Index: grout-0.16.1/main/dpdk.c
===================================================================
--- grout-0.16.1.orig/main/dpdk.c
+++ grout-0.16.1/main/dpdk.c
@@ -133,22 +133,22 @@ int dpdk_init(void) {
 	if (ret != 0)
 		goto end;
 
-	vec_add(eal_args, "");
-	vec_add(eal_args, "-l");
-	vec_add(eal_args, main_lcore);
-	vec_add(eal_args, "--no-telemetry");
+	vec_add_end(eal_args, "");
+	vec_add_end(eal_args, "-l");
+	vec_add_end(eal_args, main_lcore);
+	vec_add_end(eal_args, "--no-telemetry");
 #ifdef RTE_BUS_PCI
-	vec_add(eal_args, "-a");
-	vec_add(eal_args, "pci:0000:00:00.0");
+	vec_add_end(eal_args, "-a");
+	vec_add_end(eal_args, "pci:0000:00:00.0");
 #endif
 #ifdef RTE_BUS_FSLMC
-	vec_add(eal_args, "-a");
-	vec_add(eal_args, "fslmc:dpni.65535");
+	vec_add_end(eal_args, "-a");
+	vec_add_end(eal_args, "fslmc:dpni.65535");
 #endif
 
 	if (gr_config.test_mode) {
-		vec_add(eal_args, "--no-shconf");
-		vec_add(eal_args, "--no-huge");
+		vec_add_end(eal_args, "--no-shconf");
+		vec_add_end(eal_args, "--no-huge");
 		// Add default -m unless the user overrides it via EAL args.
 		bool has_m = false;
 		vec_foreach (arg, gr_config.eal_extra_args) {
@@ -158,21 +158,21 @@ int dpdk_init(void) {
 			}
 		}
 		if (!has_m) {
-			vec_add(eal_args, "-m");
+			vec_add_end(eal_args, "-m");
 			if (gr_config.max_mtu > 2048)
-				vec_add(eal_args, "4096");
+				vec_add_end(eal_args, "4096");
 			else
-				vec_add(eal_args, "2048");
+				vec_add_end(eal_args, "2048");
 		}
 	} else {
-		vec_add(eal_args, "--in-memory");
+		vec_add_end(eal_args, "--in-memory");
 	}
 
 	if (rte_vfio_noiommu_is_enabled())
-		vec_add(eal_args, "--iova-mode=pa");
+		vec_add_end(eal_args, "--iova-mode=pa");
 
 	vec_foreach (arg, gr_config.eal_extra_args)
-		vec_add(eal_args, arg);
+		vec_add_end(eal_args, arg);
 
 	LOG(INFO, "%s", rte_version());
 
Index: grout-0.16.1/main/event.c
===================================================================
--- grout-0.16.1.orig/main/event.c
+++ grout-0.16.1/main/event.c
@@ -35,7 +35,7 @@ void event_subscribe(uint32_t ev_type, e
 		if (subs == NULL)
 			ABORT("calloc(event_sub_callbacks)");
 	}
-	vec_add(subs->callbacks[ev], callback);
+	vec_add_end(subs->callbacks[ev], callback);
 }
 
 static void notify_subscribers(void *obj, uintptr_t ev_type, const struct control_queue_drain *) {
Index: grout-0.16.1/main/main.c
===================================================================
--- grout-0.16.1.orig/main/main.c
+++ grout-0.16.1/main/main.c
@@ -268,7 +268,7 @@ static int parse_args(int argc, char **a
 	}
 
 	for (c = optind; c < argc; c++)
-		vec_add(gr_config.eal_extra_args, argv[c]);
+		vec_add_end(gr_config.eal_extra_args, argv[c]);
 
 	return 0;
 }
Index: grout-0.16.1/main/metrics.c
===================================================================
--- grout-0.16.1.orig/main/metrics.c
+++ grout-0.16.1/main/metrics.c
@@ -64,7 +64,7 @@ static void emit_help_type(struct metric
 
 	evbuffer_add_printf(w->buf, "# HELP grout_%s %s\n", m->name, m->help);
 	evbuffer_add_printf(w->buf, "# TYPE grout_%s %s\n", m->name, type_str);
-	vec_add(w->emitted, m);
+	vec_add_end(w->emitted, m);
 }
 
 static void append_labels_va(struct metrics_ctx *ctx, va_list ap) {
Index: grout-0.16.1/main/module.c
===================================================================
--- grout-0.16.1.orig/main/module.c
+++ grout-0.16.1/main/module.c
@@ -102,7 +102,7 @@ void modules_init(struct event_base *ev_
 	const struct module *mod;
 
 	STAILQ_FOREACH (mod, &modules, next)
-		vec_add(mods, mod);
+		vec_add_end(mods, mod);
 
 	if (mods == NULL)
 		ABORT("failed to alloc module array");
@@ -125,7 +125,7 @@ void modules_fini(struct event_base *ev_
 	const struct module *mod;
 
 	STAILQ_FOREACH (mod, &modules, next)
-		vec_add(mods, mod);
+		vec_add_end(mods, mod);
 
 	if (mods == NULL)
 		ABORT("failed to alloc module array");
Index: grout-0.16.1/main/unix.c
===================================================================
--- grout-0.16.1.orig/main/unix.c
+++ grout-0.16.1/main/unix.c
@@ -66,7 +66,7 @@ int unix_listen(const char *path) {
 		return errno_log(errno, "bind");
 	}
 
-	vec_add(socket_paths, strdup(path));
+	vec_add_end(socket_paths, strdup(path));
 
 	if (listen(fd, SOCKET_LISTEN_BACKLOG) < 0) {
 		close(fd);
Index: grout-0.16.1/main/vec_test.c
===================================================================
--- grout-0.16.1.orig/main/vec_test.c
+++ grout-0.16.1/main/vec_test.c
@@ -10,7 +10,7 @@ static void int_vec(void **) {
 	assert_int_equal(vec_len(v), 0);
 
 	for (int i = 0; i < 5; i++)
-		vec_add(v, i);
+		vec_add_end(v, i);
 
 	assert_int_equal(vec_len(v), 5);
 
@@ -22,12 +22,12 @@ static void int_vec(void **) {
 	for (int i = 0; i < 4; i++)
 		assert_int_equal(v[i], i + 1);
 
-	vec_insert(v, 0, 0);
+	vec_insert_at(v, 0, 0);
 	assert_int_equal(vec_len(v), 5);
 	for (int i = 0; i < 5; i++)
 		assert_int_equal(v[i], i);
 
-	vec_insert(v, 1, 42);
+	vec_insert_at(v, 1, 42);
 	assert_int_equal(vec_len(v), 6);
 	assert_int_equal(v[0], 0);
 	assert_int_equal(v[1], 42);
@@ -55,9 +55,9 @@ static void str_vec(void **) {
 
 	assert_int_equal(vec_len(v), 0);
 
-	vec_add(v, "foo");
-	vec_add(v, "bar");
-	vec_add(v, "baz");
+	vec_add_end(v, "foo");
+	vec_add_end(v, "bar");
+	vec_add_end(v, "baz");
 
 	assert_int_equal(vec_len(v), 3);
 	assert_string_equal(v[0], "foo");
@@ -70,7 +70,7 @@ static void str_vec(void **) {
 	assert_string_equal(v[0], "foo");
 	assert_string_equal(v[1], "baz");
 
-	vec_insert(v, 2, "bar");
+	vec_insert_at(v, 2, "bar");
 	assert_int_equal(vec_len(v), 3);
 	assert_string_equal(v[0], "foo");
 	assert_string_equal(v[1], "baz");
@@ -87,9 +87,9 @@ static void str_vec(void **) {
 static void dyn_str_vec(void **) {
 	vec char **v = NULL;
 
-	vec_add(v, strdup("foo"));
-	vec_add(v, strdup("bar"));
-	vec_add(v, strdup("baz"));
+	vec_add_end(v, strdup("foo"));
+	vec_add_end(v, strdup("bar"));
+	vec_add_end(v, strdup("baz"));
 
 	strvec_free(v);
 }
@@ -98,13 +98,13 @@ static void ext_vec(void **) {
 	vec const char **vec1 = NULL;
 	vec const char **vec2 = NULL;
 
-	vec_add(vec1, "foo1");
-	vec_add(vec1, "bar1");
-	vec_add(vec1, "baz1");
-
-	vec_add(vec2, "foo2");
-	vec_add(vec2, "bar2");
-	vec_add(vec2, "baz2");
+	vec_add_end(vec1, "foo1");
+	vec_add_end(vec1, "bar1");
+	vec_add_end(vec1, "baz1");
+
+	vec_add_end(vec2, "foo2");
+	vec_add_end(vec2, "bar2");
+	vec_add_end(vec2, "baz2");
 
 	assert_int_equal(vec_len(vec1), 3);
 	assert_int_equal(vec_len(vec2), 3);
Index: grout-0.16.1/modules/infra/control/graph.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/graph.c
+++ grout-0.16.1/modules/infra/control/graph.c
@@ -123,8 +123,8 @@ worker_graph_new(struct worker *worker,
 		if (!qmap->enabled)
 			continue;
 		char *name = astrcat(NULL, RX_NODE_FMT, qmap->port_id, qmap->queue_id);
-		vec_add(rx_nodes, name);
-		vec_add(graph_nodes, name);
+		vec_add_end(rx_nodes, name);
+		vec_add_end(graph_nodes, name);
 	}
 
 	vec_extend(graph_nodes, base_node_names);
@@ -331,13 +331,13 @@ static vec rte_node_t *worker_graph_node
 			name = ensure_queue_node(
 				port_rx_node, RX_NODE_FMT, port->port_id, rxq, old_rx
 			);
-			vec_add(rx_node_names, name);
+			vec_add_end(rx_node_names, name);
 		}
 		for (uint16_t txq = 0; txq < port->n_txq; txq++) {
 			name = ensure_queue_node(
 				port_tx_node, TX_NODE_FMT, port->port_id, txq, old_tx
 			);
-			vec_add(tx_node_names, name);
+			vec_add_end(tx_node_names, name);
 		}
 	}
 
@@ -358,9 +358,9 @@ static vec rte_node_t *worker_graph_node
 
 	// store all unused node_ids in a list to be returned to the caller
 	vec_foreach (name, old_rx)
-		vec_add(unused_nodes, rte_node_from_name(name));
+		vec_add_end(unused_nodes, rte_node_from_name(name));
 	vec_foreach (name, old_tx)
-		vec_add(unused_nodes, rte_node_from_name(name));
+		vec_add_end(unused_nodes, rte_node_from_name(name));
 	strvec_free(old_rx);
 	strvec_free(old_tx);
 
@@ -572,7 +572,7 @@ static struct api_out graph_dump(const v
 				if (strcmp(e, edge) == 0)
 					goto skip; // skip duplicate edges
 			}
-			vec_add(seen_edges, edge);
+			vec_add_end(seen_edges, edge);
 
 			if (fprintf(f, "\t\"%s\" -> \"%s\"%s;\n", name, edge, node_attrs) < 0)
 				goto err;
@@ -630,7 +630,7 @@ static struct api_out graph_conf_set(con
 
 	while ((iface = iface_next(GR_IFACE_TYPE_PORT, iface)) != NULL) {
 		struct iface_info_port *port = iface_info_port(iface);
-		vec_add(ports, port);
+		vec_add_end(ports, port);
 	}
 
 	LOG(NOTICE,
@@ -673,7 +673,7 @@ static void graph_init(struct event_base
 		else if (strcmp(reg->name, TX_NODE_BASE) == 0)
 			port_tx_node = reg->id;
 		else
-			vec_add(base_node_names, reg->name);
+			vec_add_end(base_node_names, reg->name);
 
 		if (strcmp(reg->name, "port_output") == 0)
 			port_output_node = reg->id;
Index: grout-0.16.1/modules/infra/control/iface.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/iface.c
+++ grout-0.16.1/modules/infra/control/iface.c
@@ -64,7 +64,7 @@ static vec struct reserved_name *reserve
 
 void iface_name_reserve(const char *name, bool prefix) {
 	struct reserved_name r = {.name = name, .prefix = prefix};
-	vec_add(reserved_names, r);
+	vec_add_end(reserved_names, r);
 }
 
 static bool iface_name_is_reserved(const char *name) {
@@ -491,7 +491,7 @@ void iface_add_subinterface(struct iface
 		if (s == sub)
 			return;
 	}
-	vec_add(parent->subinterfaces, sub);
+	vec_add_end(parent->subinterfaces, sub);
 }
 
 void iface_del_subinterface(struct iface *parent, struct iface *sub) {
@@ -560,7 +560,7 @@ int iface_add_eth_addr(struct iface *ifa
 	new_m = (struct iface_mac) {.refcnt = 1, .mac = *mac, .hardware = false};
 	ret = type->add_eth_addr(iface, &new_m);
 	if (ret == 0)
-		vec_add(iface->macs, new_m);
+		vec_add_end(iface->macs, new_m);
 	return ret;
 }
 
Index: grout-0.16.1/modules/infra/control/netlink.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/netlink.c
+++ grout-0.16.1/modules/infra/control/netlink.c
@@ -387,7 +387,7 @@ static int rule_flush_cb(const struct nl
 	if (table != GR_CP_RT_TABLE || oifname == NULL)
 		return MNL_CB_OK;
 	snprintf(e.oifname, IFNAMSIZ, "%s", oifname);
-	vec_add(*rules, e);
+	vec_add_end(*rules, e);
 	return MNL_CB_OK;
 }
 
@@ -411,7 +411,7 @@ static int route_flush_cb(const struct n
 
 	if (table != GR_CP_RT_TABLE)
 		return MNL_CB_OK;
-	vec_add(*routes, e);
+	vec_add_end(*routes, e);
 	return MNL_CB_OK;
 }
 
Index: grout-0.16.1/modules/infra/control/port.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/port.c
+++ grout-0.16.1/modules/infra/control/port.c
@@ -334,11 +334,11 @@ static int iface_port_reconfig(
 			struct iface_info_port *port = iface_info_port(i);
 			if (port == p)
 				found = true;
-			vec_add(ports, port);
+			vec_add_end(ports, port);
 		}
 		if (!found) {
 			// port is being created, not present in the global list yet
-			vec_add(ports, p);
+			vec_add_end(ports, p);
 		}
 		ret = worker_queue_distribute(&gr_config.datapath_cpus, ports);
 		vec_free(ports);
@@ -531,7 +531,7 @@ static int iface_port_fini(struct iface
 		while ((i = iface_next(GR_IFACE_TYPE_PORT, i)) != NULL) {
 			struct iface_info_port *p = iface_info_port(i);
 			if (p != port)
-				vec_add(ports, p);
+				vec_add_end(ports, p);
 		}
 		ret = worker_queue_distribute(&gr_config.datapath_cpus, ports);
 		vec_free(ports);
@@ -901,7 +901,7 @@ static int intr_reset_cb(
 	// Queue the port IDs in a vector protected by a mutex so that they are all
 	// processed in port_reset_cb().
 	pthread_mutex_lock(&reset_ports_lock);
-	vec_add(reset_ports, port_id);
+	vec_add_end(reset_ports, port_id);
 	pthread_mutex_unlock(&reset_ports_lock);
 	// This callback may be executed from any dataplane or DPDK thread.
 	// In order to serialize the reset of the port, propagate the callback
Index: grout-0.16.1/modules/infra/control/worker.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/worker.c
+++ grout-0.16.1/modules/infra/control/worker.c
@@ -169,7 +169,7 @@ int port_unplug(struct iface_info_port *
 	while ((iface = iface_next(GR_IFACE_TYPE_PORT, iface)) != NULL) {
 		struct iface_info_port *port = iface_info_port(iface);
 		if (port->port_id != p->port_id)
-			vec_add(ports, port);
+			vec_add_end(ports, port);
 	}
 
 	ret = worker_graph_reload_all(ports);
@@ -211,10 +211,10 @@ int port_plug(struct iface_info_port *p)
 		struct iface_info_port *port = iface_info_port(iface);
 		if (port->port_id == p->port_id)
 			found = true;
-		vec_add(ports, port);
+		vec_add_end(ports, port);
 	}
 	if (!found)
-		vec_add(ports, p);
+		vec_add_end(ports, p);
 
 	int ret = worker_graph_reload_all(ports);
 	vec_free(ports);
@@ -241,7 +241,7 @@ static void worker_txq_distribute(vec st
 				.queue_id = txq_idx % port->n_txq,
 				.enabled = port->started,
 			};
-			vec_add(worker->txqs, txq);
+			vec_add_end(worker->txqs, txq);
 			txq_idx++;
 		}
 	}
@@ -294,13 +294,13 @@ move:
 		.queue_id = rxq_id,
 		.enabled = true,
 	};
-	vec_add(dst_worker->rxqs, rx_qmap);
+	vec_add_end(dst_worker->rxqs, rx_qmap);
 
 	// reassign TX queues and reload all graphs
 	vec struct iface_info_port **ports = NULL;
 	struct iface *iface = NULL;
 	while ((iface = iface_next(GR_IFACE_TYPE_PORT, iface)) != NULL)
-		vec_add(ports, iface_info_port(iface));
+		vec_add_end(ports, iface_info_port(iface));
 
 	worker_txq_distribute(ports);
 
@@ -356,7 +356,7 @@ int worker_queue_distribute(const cpu_se
 					goto end;
 				}
 			}
-			vec_add(cpus, cpu);
+			vec_add_end(cpus, cpu);
 		}
 	}
 
@@ -413,7 +413,7 @@ int worker_queue_distribute(const cpu_se
 				.queue_id = rxq,
 				.enabled = port->started,
 			};
-			vec_add(worker->rxqs, q);
+			vec_add_end(worker->rxqs, q);
 
 			if (++i >= vec_len(cpus))
 				i = 0;
@@ -475,7 +475,7 @@ vec struct gr_stat *worker_dump_stats(ui
 					.topo_order = n->topo_order,
 				};
 				gr_strcpy(stat.name, sizeof(stat.name), name);
-				vec_add(stats, stat);
+				vec_add_end(stats, stat);
 			}
 			for (uint8_t x = 0; x < n->nb_xstats; x++) {
 				snprintf(
@@ -496,7 +496,7 @@ vec struct gr_stat *worker_dump_stats(ui
 						.topo_order = n->topo_order,
 					};
 					gr_strcpy(stat.name, sizeof(stat.name), xname);
-					vec_add(stats, stat);
+					vec_add_end(stats, stat);
 				}
 			}
 
@@ -517,7 +517,7 @@ vec struct gr_stat *worker_dump_stats(ui
 				.topo_order = UINT64_MAX,
 			};
 			gr_strcpy(stat.name, sizeof(stat.name), "idle");
-			vec_add(stats, stat);
+			vec_add_end(stats, stat);
 		}
 		loop_cycles += w_stats->loop_cycles - w_stats->sleep_cycles;
 		n_loops += w_stats->n_loops;
@@ -530,7 +530,7 @@ vec struct gr_stat *worker_dump_stats(ui
 		.topo_order = UINT64_MAX - 1,
 	};
 	gr_strcpy(stat.name, sizeof(stat.name), "overhead");
-	vec_add(stats, stat);
+	vec_add_end(stats, stat);
 
 	return stats;
 }
Index: grout-0.16.1/modules/infra/control/worker_test.c
===================================================================
--- grout-0.16.1.orig/modules/infra/control/worker_test.c
+++ grout-0.16.1/modules/infra/control/worker_test.c
@@ -203,27 +203,27 @@ static int setup(void **) {
 		ifaces[i] = iface;
 	}
 	STAILQ_INSERT_TAIL(&workers, &w1, next);
-	vec_add(w1.rxqs, q(0, 0));
-	vec_add(w1.rxqs, q(0, 1));
-	vec_add(w1.rxqs, q(1, 0));
-
-	vec_add(w1.txqs, q(0, 0));
-	vec_add(w1.txqs, q(1, 0));
-	vec_add(w1.txqs, q(2, 0));
+	vec_add_end(w1.rxqs, q(0, 0));
+	vec_add_end(w1.rxqs, q(0, 1));
+	vec_add_end(w1.rxqs, q(1, 0));
+
+	vec_add_end(w1.txqs, q(0, 0));
+	vec_add_end(w1.txqs, q(1, 0));
+	vec_add_end(w1.txqs, q(2, 0));
 
 	STAILQ_INSERT_TAIL(&workers, &w2, next);
-	vec_add(w2.rxqs, q(1, 1));
-	vec_add(w2.rxqs, q(2, 0));
-	vec_add(w2.rxqs, q(2, 1));
-
-	vec_add(w2.txqs, q(0, 1));
-	vec_add(w2.txqs, q(1, 1));
-	vec_add(w2.txqs, q(2, 1));
+	vec_add_end(w2.rxqs, q(1, 1));
+	vec_add_end(w2.rxqs, q(2, 0));
+	vec_add_end(w2.rxqs, q(2, 1));
+
+	vec_add_end(w2.txqs, q(0, 1));
+	vec_add_end(w2.txqs, q(1, 1));
+	vec_add_end(w2.txqs, q(2, 1));
 
 	STAILQ_INSERT_TAIL(&workers, &w3, next);
-	vec_add(w3.txqs, q(0, 2));
-	vec_add(w3.txqs, q(1, 2));
-	vec_add(w3.txqs, q(2, 2));
+	vec_add_end(w3.txqs, q(0, 2));
+	vec_add_end(w3.txqs, q(1, 2));
+	vec_add_end(w3.txqs, q(2, 2));
 
 	return 0;
 }
@@ -381,7 +381,7 @@ static void queue_distribute_reduce(void
 	CPU_SET(5, &affinity);
 	vec struct iface_info_port **ports = NULL;
 	for (unsigned i = 0; i < ARRAY_DIM(ifaces); i++)
-		vec_add(ports, iface_info_port(ifaces[i]));
+		vec_add_end(ports, iface_info_port(ifaces[i]));
 
 	will_return(__wrap_rte_zmalloc, &w4);
 	will_return(__wrap_rte_zmalloc, &w5);
@@ -418,7 +418,7 @@ static void queue_distribute_increase(vo
 	CPU_SET(5, &affinity);
 	vec struct iface_info_port **ports = NULL;
 	for (unsigned i = 0; i < ARRAY_DIM(ifaces); i++)
-		vec_add(ports, iface_info_port(ifaces[i]));
+		vec_add_end(ports, iface_info_port(ifaces[i]));
 
 	will_return(__wrap_rte_zmalloc, &w1);
 	will_return(__wrap_rte_zmalloc, &w2);
Index: grout-0.16.1/modules/infra/datapath/main_loop.c
===================================================================
--- grout-0.16.1.orig/modules/infra/datapath/main_loop.c
+++ grout-0.16.1/modules/infra/datapath/main_loop.c
@@ -142,7 +142,7 @@ static int stats_reload(const struct rte
 	rte_graph_off_t off;
 	rte_node_t count;
 	rte_graph_foreach_node (count, off, graph, node)
-		vec_add(nodes, node);
+		vec_add_end(nodes, node);
 
 	// sort by name first to ensure stable topo_sort
 	qsort(nodes, count, sizeof(void *), node_name_cmp);
Index: grout-0.16.1/modules/ip/control/address.c
===================================================================
--- grout-0.16.1.orig/modules/ip/control/address.c
+++ grout-0.16.1/modules/ip/control/address.c
@@ -105,13 +105,13 @@ int addr4_add(uint16_t iface_id, ip4_add
 		return ret;
 	}
 
-	// vec_add may realloc() and free the old vector
+	// vec_add_end may realloc() and free the old vector
 	// Duplicate the whole vector and append to the clone.
 	vec struct nexthop **nhs_copy = NULL;
 	vec struct nexthop **nhs_old = ifaddrs->nh;
 	vec_cap_set(nhs_copy, vec_len(nhs_old) + 1); // avoid malloc+realloc
 	vec_extend(nhs_copy, nhs_old);
-	vec_add(nhs_copy, nh);
+	vec_add_end(nhs_copy, nh);
 	ifaddrs->nh = nhs_copy;
 	if (nhs_old != NULL) {
 		// Once all datapath workers have seen the new clone, free the old one.
Index: grout-0.16.1/modules/ip/control/route.c
===================================================================
--- grout-0.16.1.orig/modules/ip/control/route.c
+++ grout-0.16.1/modules/ip/control/route.c
@@ -545,7 +545,7 @@ static int rib4_cleanup_cb(
 			.depth = depth,
 			.type = nh->type,
 		};
-		vec_add(ctx->entries, entry);
+		vec_add_end(ctx->entries, entry);
 	}
 	return 0;
 }
Index: grout-0.16.1/modules/ip6/control/address.c
===================================================================
--- grout-0.16.1.orig/modules/ip6/control/address.c
+++ grout-0.16.1/modules/ip6/control/address.c
@@ -130,13 +130,13 @@ static int mcast6_addr_add(const struct
 		nexthop_incref(nh);
 	}
 
-	// vec_add may realloc() and free the old vector
+	// vec_add_end may realloc() and free the old vector
 	// Duplicate the whole vector and append to the clone.
 	vec struct nexthop **nhs_copy = NULL;
 	vec struct nexthop **nhs_old = maddrs->nh;
 	vec_cap_set(nhs_copy, vec_len(nhs_old) + 1); // avoid malloc+realloc
 	vec_extend(nhs_copy, nhs_old);
-	vec_add(nhs_copy, nh);
+	vec_add_end(nhs_copy, nh);
 	maddrs->nh = nhs_copy;
 	if (nhs_old != NULL) {
 		// Once all datapath workers have seen the new clone, free the old one.
@@ -233,13 +233,13 @@ iface6_addr_add(const struct iface *ifac
 	if (iface->cp_id != 0 && netlink_add_addr6(iface->cp_id, ip) < 0)
 		LOG(WARNING, "add addr " IP6_F " on linux has failed (%s)", ip, strerror(errno));
 
-	// vec_add may realloc() and free the old vector
+	// vec_add_end may realloc() and free the old vector
 	// Duplicate the whole vector and append to the clone.
 	vec struct nexthop **nhs_copy = NULL;
 	vec struct nexthop **nhs_old = addrs->nh;
 	vec_cap_set(nhs_copy, vec_len(nhs_old) + 1); // avoid malloc+realloc
 	vec_extend(nhs_copy, nhs_old);
-	vec_add(nhs_copy, nh);
+	vec_add_end(nhs_copy, nh);
 	addrs->nh = nhs_copy;
 	if (nhs_old != NULL) {
 		// Once all datapath workers have seen the new clone, free the old one.
Index: grout-0.16.1/modules/ip6/control/route.c
===================================================================
--- grout-0.16.1.orig/modules/ip6/control/route.c
+++ grout-0.16.1/modules/ip6/control/route.c
@@ -588,7 +588,7 @@ static int rib6_cleanup_cb(
 			.depth = depth,
 			.type = nh->type,
 		};
-		vec_add(ctx->entries, entry);
+		vec_add_end(ctx->entries, entry);
 	}
 	return 0;
 }
Index: grout-0.16.1/modules/policy/control/snat44_dynamic.c
===================================================================
--- grout-0.16.1.orig/modules/policy/control/snat44_dynamic.c
+++ grout-0.16.1/modules/policy/control/snat44_dynamic.c
@@ -88,7 +88,7 @@ vec struct gr_snat44_policy *snat44_dyna
 	const struct snat44_policy *p;
 
 	STAILQ_FOREACH (p, &policies, next)
-		vec_add(list, p->base);
+		vec_add_end(list, p->base);
 
 	return list;
 }

Reply via email to