summaryrefslogtreecommitdiff
path: root/proto/perf
diff options
context:
space:
mode:
authorMaria Matejka <mq@jmq.cz>2020-01-28 11:42:46 +0100
committerMaria Matejka <mq@ucw.cz>2021-11-09 19:20:41 +0100
commit69d1ffde4c724882398b3b630ea1199f12c0c288 (patch)
treea7567e07bcd0aa3f9365da83ed2ac23a10e869b6 /proto/perf
parent60880b539b8886f76961125d89a265c6e1112b7a (diff)
Split route data structure to storage (ro) / manipulation (rw) structures.
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.
Diffstat (limited to 'proto/perf')
-rw-r--r--proto/perf/perf.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/proto/perf/perf.c b/proto/perf/perf.c
index 52784c14..8b2cb69f 100644
--- a/proto/perf/perf.c
+++ b/proto/perf/perf.c
@@ -160,18 +160,17 @@ perf_loop(void *data)
clock_gettime(CLOCK_MONOTONIC, &ts_generated);
- for (uint i=0; i<N; i++) {
- rte *e = rte_get_temp(p->data[i].a, p->p.main_source);
- e->pflags = 0;
-
- rte_update(P, &(p->data[i].net), e);
+ for (uint i=0; i<N; i++)
+ {
+ rte e0 = { .attrs = p->data[i].a, .src = P->main_source, };
+ rte_update(P->main_channel, &(p->data[i].net), &e0, P->main_source);
}
clock_gettime(CLOCK_MONOTONIC, &ts_update);
if (!p->keep)
for (uint i=0; i<N; i++)
- rte_update(P, &(p->data[i].net), NULL);
+ rte_update(P->main_channel, &(p->data[i].net), NULL, P->main_source);
clock_gettime(CLOCK_MONOTONIC, &ts_withdraw);
@@ -204,7 +203,7 @@ perf_loop(void *data)
}
static void
-perf_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net UNUSED, struct rte *new UNUSED, struct rte *old UNUSED)
+perf_rt_notify(struct proto *P, struct channel *c UNUSED, const net_addr *net UNUSED, struct rte *new UNUSED, const struct rte *old UNUSED)
{
struct perf_proto *p = (struct perf_proto *) P;
p->exp++;