diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-01-01 07:25:05 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-01-01 07:25:05 +0000 |
commit | 31e6d12cb50c690f187f9c916b295b83cdba6cf2 (patch) | |
tree | fa651377cc9fd6f640192bc432c77710d69f7410 /usr.sbin/bgpd/rde.h | |
parent | eb661ac72ec345a0e3f2e79371b3b81a4a10b51a (diff) |
Instead of processing all imsg when reading them store peer specific
messages on a per peer queue. This queue is later processed one at a
time resulting in a fairer processing of work and avoiding big table
dumps to delay processing of other updates.
OK denis@ benno@
Diffstat (limited to 'usr.sbin/bgpd/rde.h')
-rw-r--r-- | usr.sbin/bgpd/rde.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index d01097b02d4..42089e83c73 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.227 2019/10/30 05:27:50 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.228 2020/01/01 07:25:04 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -76,10 +76,12 @@ LIST_HEAD(attr_list, attr); LIST_HEAD(aspath_head, rde_aspath); RB_HEAD(prefix_tree, prefix); RB_HEAD(prefix_index, prefix); +struct iq; struct rde_peer { LIST_ENTRY(rde_peer) hash_l; /* hash list over all peers */ LIST_ENTRY(rde_peer) peer_l; /* list of all peers */ + SIMPLEQ_HEAD(, iq) imsg_queue; struct peer_config conf; struct bgpd_addr remote_addr; struct bgpd_addr local_v4_addr; @@ -369,6 +371,13 @@ int rde_decisionflags(void); int rde_as4byte(struct rde_peer *); struct rde_peer *peer_get(u_int32_t); +/* rde_peer.c */ +void peer_imsg_push(struct rde_peer *, struct imsg *); +int peer_imsg_pop(struct rde_peer *, struct imsg *); +void peer_imsg_queued(struct rde_peer *, void *); +void peer_imsg_flush(struct rde_peer *); + + /* rde_attr.c */ int attr_write(void *, u_int16_t, u_int8_t, u_int8_t, void *, u_int16_t); |