mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 07:15:33 +00:00
bgpd: Reduce size of ibuf_work ringbuf
The ringbuf is 650k in size. This is obscenely large and
in practical experimentation FRR never even approaches
that size at all. Let's reduce this to 1.5 max packet sizes.
If a BGP_MAX_PACKET_SIZE packet is ever received having a bit
of extra space ensures that we can read at least 1 packet.
This also will significantly reduce memory usage when the
operator has a lot of peers.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit fe1c72a573
)
This commit is contained in:
parent
e0d98cbb88
commit
91e95112e8
@ -1414,7 +1414,7 @@ struct peer *peer_new(struct bgp *bgp)
|
|||||||
pthread_mutex_init(&peer->io_mtx, NULL);
|
pthread_mutex_init(&peer->io_mtx, NULL);
|
||||||
|
|
||||||
peer->ibuf_work =
|
peer->ibuf_work =
|
||||||
ringbuf_new(BGP_MAX_PACKET_SIZE * BGP_READ_PACKET_MAX);
|
ringbuf_new(BGP_MAX_PACKET_SIZE + BGP_MAX_PACKET_SIZE/2);
|
||||||
|
|
||||||
/* Get service port number. */
|
/* Get service port number. */
|
||||||
sp = getservbyname("bgp", "tcp");
|
sp = getservbyname("bgp", "tcp");
|
||||||
|
Loading…
Reference in New Issue
Block a user