From bdc17624059c1722e5208523cb06fe9b0ed7acb2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 21 Jul 2023 13:10:03 -0400 Subject: bgpd: Replace peer->ibuf_scratch The peer->ibuf_scratch was allocating 65535 * 10 bytes for scratch space to hold data incoming from a read from a peer. When you have 4k peers this is 262,1400,000 or 262 mb of data. Which is crazy large. Especially since the i/o pthread is reading per peer without any chance of having the data interfere with other reads. Signed-off-by: Donald Sharp --- bgpd/bgpd.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'bgpd/bgpd.h') diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index a9d77f862f..5c42abef5e 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1163,9 +1163,6 @@ struct peer { struct stream_fifo *ibuf; // packets waiting to be processed struct stream_fifo *obuf; // packets waiting to be written - /* used as a block to deposit raw wire data to */ - uint8_t ibuf_scratch[BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE - * BGP_READ_PACKET_MAX]; struct ringbuf *ibuf_work; // WiP buffer used by bgp_read() only struct stream *curr; // the current packet being parsed -- cgit v1.2.3