mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 01:15:12 +00:00
Merge pull request #1655 from LabNConsulting/working/master/consistent_count
bgpd: update last_update whenever obuf sent
This commit is contained in:
commit
5c6580957d
@ -375,14 +375,10 @@ static uint16_t bgp_write(struct peer *peer)
|
|||||||
int num;
|
int num;
|
||||||
int update_last_write = 0;
|
int update_last_write = 0;
|
||||||
unsigned int count = 0;
|
unsigned int count = 0;
|
||||||
uint32_t oc;
|
uint32_t uo = 0;
|
||||||
uint32_t uo;
|
|
||||||
uint16_t status = 0;
|
uint16_t status = 0;
|
||||||
uint32_t wpkt_quanta_old;
|
uint32_t wpkt_quanta_old;
|
||||||
|
|
||||||
// save current # updates sent
|
|
||||||
oc = atomic_load_explicit(&peer->update_out, memory_order_relaxed);
|
|
||||||
|
|
||||||
// cache current write quanta
|
// cache current write quanta
|
||||||
wpkt_quanta_old =
|
wpkt_quanta_old =
|
||||||
atomic_load_explicit(&peer->bgp->wpkt_quanta, memory_order_relaxed);
|
atomic_load_explicit(&peer->bgp->wpkt_quanta, memory_order_relaxed);
|
||||||
@ -419,6 +415,7 @@ static uint16_t bgp_write(struct peer *peer)
|
|||||||
case BGP_MSG_UPDATE:
|
case BGP_MSG_UPDATE:
|
||||||
atomic_fetch_add_explicit(&peer->update_out, 1,
|
atomic_fetch_add_explicit(&peer->update_out, 1,
|
||||||
memory_order_relaxed);
|
memory_order_relaxed);
|
||||||
|
uo++;
|
||||||
break;
|
break;
|
||||||
case BGP_MSG_NOTIFY:
|
case BGP_MSG_NOTIFY:
|
||||||
atomic_fetch_add_explicit(&peer->notify_out, 1,
|
atomic_fetch_add_explicit(&peer->notify_out, 1,
|
||||||
@ -457,9 +454,12 @@ static uint16_t bgp_write(struct peer *peer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
done : {
|
done : {
|
||||||
/* Update last_update if UPDATEs were written. */
|
/*
|
||||||
uo = atomic_load_explicit(&peer->update_out, memory_order_relaxed);
|
* Update last_update if UPDATEs were written.
|
||||||
if (uo > oc)
|
* Note: that these are only updated at end,
|
||||||
|
* not per message (i.e., per loop)
|
||||||
|
*/
|
||||||
|
if (uo)
|
||||||
atomic_store_explicit(&peer->last_update, bgp_clock(),
|
atomic_store_explicit(&peer->last_update, bgp_clock(),
|
||||||
memory_order_relaxed);
|
memory_order_relaxed);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user