summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-12 12:40:18 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-12 14:45:27 +0200
commitbc2ce4aaa8d1e4d56776ee35352c5e2caa09a0e5 (patch)
tree95c9224efba38da51c3464810a7007f8d70a4e3d /nest
parent080cbd1219ba86dd44712d0d24ceae884b34ec4b (diff)
Removing the rte_modify API
For BGP LLGR purposes, there was an API allowing a protocol to directly modify their stale routes in table before flushing them. This API was called by the table prune routine which violates the future locking requirements. Instead of this, BGP now requests a special route export and reimports these routes into the table, allowing for asynchronous execution without locking the table on export.
Diffstat (limited to 'nest')
-rw-r--r--nest/proto.c1
-rw-r--r--nest/protocol.h1
-rw-r--r--nest/rt-table.c51
-rw-r--r--nest/rt.h1
4 files changed, 0 insertions, 54 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 061205c1..72e479d7 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -438,7 +438,6 @@ channel_start_import(struct channel *c)
.dump_req = channel_dump_import_req,
.log_state_change = channel_import_log_state_change,
.preimport = channel_preimport,
- .rte_modify = c->proto->rte_modify,
};
ASSERT(c->channel_state == CS_UP);
diff --git a/nest/protocol.h b/nest/protocol.h
index 3ccd364a..026d42ab 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -189,7 +189,6 @@ struct proto {
int (*rte_recalculate)(struct rtable *, struct network *, struct rte *, struct rte *, struct rte *);
int (*rte_better)(struct rte *, struct rte *);
int (*rte_mergable)(struct rte *, struct rte *);
- struct rte *(*rte_modify)(struct rte *, struct linpool *);
void (*rte_insert)(struct network *, struct rte *);
void (*rte_remove)(struct network *, struct rte *);
u32 (*rte_igp_metric)(const struct rte *);
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 2ba28e33..50ddc141 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1322,8 +1322,6 @@ rte_recalculate(struct rt_import_hook *c, net *net, rte *new, struct rte_src *sr
if (new && rte_same(old, &new_stored->rte))
{
/* No changes, ignore the new route and refresh the old one */
-
- old->flags &= ~REF_MODIFY;
old->stale_cycle = new->stale_cycle;
if (!rte_is_filtered(new))
@@ -1673,24 +1671,6 @@ rte_discard(net *net, rte *old) /* Non-filtered route deletion, used during garb
rte_update_unlock();
}
-/* Modify existing route by protocol hook, used for long-lived graceful restart */
-static inline void
-rte_modify(net *net, rte *old)
-{
- rte_update_lock();
-
- rte *new = old->sender->req->rte_modify(old, rte_update_pool);
- if (new != old)
- {
- if (new)
- new->flags = old->flags & ~REF_MODIFY;
-
- rte_recalculate(old->sender, net, new, old->src);
- }
-
- rte_update_unlock();
-}
-
/* Check rtable for best route to given net whether it would be exported do p */
int
rt_examine(rtable *t, net_addr *a, struct channel *c, const struct filter *filter)
@@ -1977,29 +1957,6 @@ rt_refresh_end(struct rt_import_request *req)
log(L_TRACE "%s: route refresh end [%u]", req->name, hook->stale_valid);
}
-void
-rt_modify_stale(rtable *t, struct rt_import_request *req)
-{
- int prune = 0;
- struct rt_import_hook *s = req->hook;
-
- FIB_WALK(&t->fib, net, n)
- {
- for (struct rte_storage *e = n->routes; e; e = e->next)
- if ((e->rte.sender == s) &&
- !(e->rte.flags & REF_FILTERED) &&
- (e->rte.stale_cycle + 1 == s->stale_set))
- {
- e->rte.flags |= REF_MODIFY;
- prune = 1;
- }
- }
- FIB_WALK_END;
-
- if (prune)
- rt_schedule_prune(t);
-}
-
/**
* rte_dump - dump a route
* @e: &rte to be dumped
@@ -2501,14 +2458,6 @@ again:
goto rescan;
}
-
- if (e->rte.flags & REF_MODIFY)
- {
- rte_modify(n, &e->rte);
- limit--;
-
- goto rescan;
- }
}
if (!n->routes) /* Orphaned FIB entry */
diff --git a/nest/rt.h b/nest/rt.h
index b9ae7d10..4a7a087f 100644
--- a/nest/rt.h
+++ b/nest/rt.h
@@ -181,7 +181,6 @@ struct rt_import_request {
/* Preimport is called when the @new route is just-to-be inserted, replacing @old.
* Return a route (may be different or modified in-place) to continue or NULL to withdraw. */
int (*preimport)(struct rt_import_request *req, struct rte *new, struct rte *old);
- struct rte *(*rte_modify)(struct rte *, struct linpool *);
};
struct rt_import_hook {