From f45c5190393a903d4538eee91f9b84f3c84a4b3b Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 10 Jun 2024 14:10:51 +0200 Subject: [PATCH] BGP: splitting TX by time, not number of messages sent --- proto/bgp/packets.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 35e59e1a1..f2a8e1f6b 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -3181,12 +3181,9 @@ bgp_kick_tx(void *vconn) struct bgp_conn *conn = vconn; DBG("BGP: kicking TX\n"); - uint max = 1024; - while (--max && (bgp_fire_tx(conn) > 0)) - ; - - if (!max && !ev_active(conn->tx_ev)) - proto_send_event(&conn->bgp->p, conn->tx_ev); + while (bgp_fire_tx(conn) > 0) + MAYBE_DEFER_TASK(proto_event_list(&conn->bgp->p), conn->tx_ev, + "BGP TX for %s", conn->bgp->p.name); } void @@ -3201,12 +3198,9 @@ bgp_tx(sock *sk) bgp_start_timer(conn->bgp, conn->send_hold_timer, conn->send_hold_time); DBG("BGP: TX hook\n"); - uint max = 1024; - while (--max && (bgp_fire_tx(conn) > 0)) - ; - - if (!max && !ev_active(conn->tx_ev)) - proto_send_event(&conn->bgp->p, conn->tx_ev); + while (bgp_fire_tx(conn) > 0) + MAYBE_DEFER_TASK(proto_event_list(&conn->bgp->p), conn->tx_ev, + "BGP TX for %s", conn->bgp->p.name); } -- 2.47.2