]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Remove peer->scratch
authorDonald Sharp <sharpd@nvidia.com>
Fri, 21 Jul 2023 16:14:59 +0000 (12:14 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 21 Jul 2023 20:15:17 +0000 (20:15 +0000)
This was only ever being allocated and de-allocated.
Let's save 65k per peer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit b157af0ac12f4d39e635ad814d4a42d670f4c328)

bgpd/bgpd.c
bgpd/bgpd.h

index 10a73f3e7c7a5361da82afc8d061c4c4a827b273..49c23ae8613cc270402db3ab149e632a35471919 100644 (file)
@@ -1432,8 +1432,6 @@ struct peer *peer_new(struct bgp *bgp)
        peer->ibuf_work =
                ringbuf_new(BGP_MAX_PACKET_SIZE * BGP_READ_PACKET_MAX);
 
-       peer->scratch = stream_new(BGP_MAX_PACKET_SIZE);
-
        bgp_sync_init(peer);
 
        /* Get service port number.  */
@@ -2616,11 +2614,6 @@ int peer_delete(struct peer *peer)
                peer->obuf_work = NULL;
        }
 
-       if (peer->scratch) {
-               stream_free(peer->scratch);
-               peer->scratch = NULL;
-       }
-
        /* Local and remote addresses. */
        if (peer->su_local) {
                sockunion_free(peer->su_local);
index 9cb1d51088cfc456f344b17b8068f84d382e3751..09d6128f53cf1af4caa8c70881b0fe1abc098beb 100644 (file)
@@ -1158,12 +1158,6 @@ struct peer {
 
        struct stream *curr; // the current packet being parsed
 
-       /* We use a separate stream to encode MP_REACH_NLRI for efficient
-        * NLRI packing. peer->obuf_work stores all the other attributes. The
-        * actual packet is then constructed by concatenating the two.
-        */
-       struct stream *scratch;
-
        /* the doppelganger peer structure, due to dual TCP conn setup */
        struct peer *doppelganger;