CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2025/12/10 05:36:51

Modified files:
        usr.sbin/bgpd  : bgpd.h rde.c rde.h rde_adjout.c rde_peer.c 
                         rde_update.c 

Log message:
Implement a per-peer pending prefix queue and lookup table and
a pending attribute queue and lookup table.

Withdraws just end up in the peer pending withdraw prefix queue.
For updates the prefix is queued on a pending attribute entry, which
itself is queued on the peer pending update queue.
For updates this allows to aggregate multiple prefixes into a single
UPDATE message.

All prefixes are also stored in the per-peer lookup table and this table
is checked before adding an entry. If the object already exists the prefix
is first dequeued and the requeued at the tail of its queue.
pend_prefix_add() is therefor a bit fiddly.

Similar all attrs are added to the per-peer attribute lookup table and this
is used to locate the update queue where the prefix is queued on.
Once queued an attr is not requeued to ensure updates are sent in FIFO order.

If the attr pointer in struct pend_prefix is NULL then it is a withdraw.
The pend_attr include the aid so prefixes end up on the right queue. This
allows to use a single attr lookup table instead of a table per aid.
If the attrs pointer is NULL the pend_attr is actually the End-of-RIB
marker.

This replaces the red-black tree contraption used right now. Which is a
big preformance bottleneck.
OK tb@

Reply via email to