mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 07:15:19 +00:00
Merge pull request #14081 from donaldsharp/bgp_ringbuf_cleanup
Bgp ringbuf cleanup
This commit is contained in:
commit
0095023cc4
@ -218,7 +218,6 @@ static void bgp_process_reads(struct event *thread)
|
|||||||
bool fatal = false; /* whether fatal error occurred */
|
bool fatal = false; /* whether fatal error occurred */
|
||||||
bool added_pkt = false; /* whether we pushed onto ->ibuf */
|
bool added_pkt = false; /* whether we pushed onto ->ibuf */
|
||||||
int code = 0; /* FSM code if error occurred */
|
int code = 0; /* FSM code if error occurred */
|
||||||
bool ibuf_full = false; /* Is peer fifo IN Buffer full */
|
|
||||||
static bool ibuf_full_logged; /* Have we logged full already */
|
static bool ibuf_full_logged; /* Have we logged full already */
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
@ -265,7 +264,6 @@ static void bgp_process_reads(struct event *thread)
|
|||||||
fatal = true;
|
fatal = true;
|
||||||
break;
|
break;
|
||||||
case -ENOMEM:
|
case -ENOMEM:
|
||||||
ibuf_full = true;
|
|
||||||
if (!ibuf_full_logged) {
|
if (!ibuf_full_logged) {
|
||||||
if (bgp_debug_neighbor_events(peer))
|
if (bgp_debug_neighbor_events(peer))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
@ -288,10 +286,6 @@ done:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ringbuf should be fully drained unless ibuf is full */
|
|
||||||
if (!ibuf_full)
|
|
||||||
assert(ringbuf_space(peer->ibuf_work) >= peer->max_packet_size);
|
|
||||||
|
|
||||||
event_add_read(fpt->master, bgp_process_reads, peer, peer->fd,
|
event_add_read(fpt->master, bgp_process_reads, peer, peer->fd,
|
||||||
&peer->t_read);
|
&peer->t_read);
|
||||||
if (added_pkt)
|
if (added_pkt)
|
||||||
|
@ -1416,7 +1416,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