]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: splitting TX by time, not number of messages sent
authorMaria Matejka <mq@ucw.cz>
Mon, 10 Jun 2024 12:10:51 +0000 (14:10 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 12 Jun 2024 12:48:33 +0000 (14:48 +0200)
proto/bgp/packets.c

index 35e59e1a124c09ea4f297ad970371cc1bc62bc0a..f2a8e1f6b37f588c7b03a46db1572f31ea4ce114 100644 (file)
@@ -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);
 }