bgpd: move t_pmax_restart to peer_connection

The t_pmax_restart event pointer belongs in the peer_connection
pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-08-26 22:20:16 -04:00
parent 981dd86920
commit 513c8c4f74
5 changed files with 11 additions and 11 deletions

View File

@ -478,7 +478,7 @@ void bgp_timer_set(struct peer *peer)
FOREACH_AFI_SAFI (afi, safi)
EVENT_OFF(peer->t_llgr_stale[afi][safi]);
EVENT_OFF(peer->t_pmax_restart);
EVENT_OFF(peer->connection->t_pmax_restart);
EVENT_OFF(peer->t_refresh_stalepath);
/* fallthru */
case Clearing:

View File

@ -3727,7 +3727,6 @@ static void bgp_maximum_prefix_restart_timer(struct event *thread)
struct peer *peer;
peer = EVENT_ARG(thread);
peer->t_pmax_restart = NULL;
if (bgp_debug_neighbor_events(peer))
zlog_debug(
@ -3839,7 +3838,7 @@ bool bgp_maximum_prefix_overflow(struct peer *peer, afi_t afi, safi_t safi,
"%pBP Maximum-prefix restart timer started for %d secs",
peer, peer->v_pmax_restart);
BGP_TIMER_ON(peer->t_pmax_restart,
BGP_TIMER_ON(peer->connection->t_pmax_restart,
bgp_maximum_prefix_restart_timer,
peer->v_pmax_restart);
}

View File

@ -14972,21 +14972,22 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
vty_out(vty,
" Peer had exceeded the max. no. of prefixes configured.\n");
if (p->t_pmax_restart) {
if (p->connection->t_pmax_restart) {
if (use_json) {
json_object_boolean_true_add(
json_neigh, "reducePrefixNumFrom");
json_object_int_add(json_neigh,
"restartInTimerMsec",
event_timer_remain_second(
p->t_pmax_restart) *
p->connection
->t_pmax_restart) *
1000);
} else
vty_out(vty,
" Reduce the no. of prefix from %s, will restart in %ld seconds\n",
p->host,
event_timer_remain_second(
p->t_pmax_restart));
p->connection->t_pmax_restart));
} else {
if (use_json)
json_object_boolean_true_add(

View File

@ -4601,8 +4601,8 @@ static void peer_flag_modify_action(struct peer *peer, uint64_t flag)
UNSET_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW);
if (peer->t_pmax_restart) {
EVENT_OFF(peer->t_pmax_restart);
if (peer->connection->t_pmax_restart) {
EVENT_OFF(peer->connection->t_pmax_restart);
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"%pBP Maximum-prefix restart timer canceled",
@ -7537,8 +7537,8 @@ static bool peer_maximum_prefix_clear_overflow(struct peer *peer)
return false;
UNSET_FLAG(peer->sflags, PEER_STATUS_PREFIX_OVERFLOW);
if (peer->t_pmax_restart) {
EVENT_OFF(peer->t_pmax_restart);
if (peer->connection->t_pmax_restart) {
EVENT_OFF(peer->connection->t_pmax_restart);
if (bgp_debug_neighbor_events(peer))
zlog_debug(
"%pBP Maximum-prefix restart timer cancelled",

View File

@ -1150,6 +1150,7 @@ struct peer_connection {
struct event *t_gr_stale;
struct event *t_generate_updgrp_packets;
struct event *t_pmax_restart;
struct event *t_routeadv;
struct event *t_process_packet;
@ -1561,7 +1562,6 @@ struct peer {
_Atomic uint32_t v_gr_restart;
/* Threads. */
struct event *t_pmax_restart;
struct event *t_llgr_stale[AFI_MAX][SAFI_MAX];
struct event *t_revalidate_all[AFI_MAX][SAFI_MAX];
struct event *t_refresh_stalepath;