mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:13:08 +00:00
Merge pull request #3359 from qlyoung/true-atomics
Restrict atomics to 32-bits only
This commit is contained in:
commit
fb88590c77
@ -1007,7 +1007,7 @@ struct peer {
|
|||||||
struct thread *t_process_packet;
|
struct thread *t_process_packet;
|
||||||
|
|
||||||
/* Thread flags. */
|
/* Thread flags. */
|
||||||
_Atomic uint16_t thread_flags;
|
_Atomic uint32_t thread_flags;
|
||||||
#define PEER_THREAD_WRITES_ON (1 << 0)
|
#define PEER_THREAD_WRITES_ON (1 << 0)
|
||||||
#define PEER_THREAD_READS_ON (1 << 1)
|
#define PEER_THREAD_READS_ON (1 << 1)
|
||||||
#define PEER_THREAD_KEEPALIVES_ON (1 << 2)
|
#define PEER_THREAD_KEEPALIVES_ON (1 << 2)
|
||||||
|
@ -125,7 +125,7 @@ struct cpu_thread_history {
|
|||||||
_Atomic unsigned long total, max;
|
_Atomic unsigned long total, max;
|
||||||
} real;
|
} real;
|
||||||
struct time_stats cpu;
|
struct time_stats cpu;
|
||||||
_Atomic uint8_t types;
|
_Atomic uint32_t types;
|
||||||
const char *funcname;
|
const char *funcname;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6367,6 +6367,13 @@ sub process {
|
|||||||
ERROR("NONSTANDARD_INTEGRAL_TYPES",
|
ERROR("NONSTANDARD_INTEGRAL_TYPES",
|
||||||
"Please, no nonstandard integer types in new code.\n" . $herecurr)
|
"Please, no nonstandard integer types in new code.\n" . $herecurr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check for usage of non-32 bit atomics
|
||||||
|
if ($line =~ /_Atomic [u]?int(?!32)[0-9]+_t/) {
|
||||||
|
WARN("NON_32BIT_ATOMIC",
|
||||||
|
"Please, only use 32 bit atomics.\n" . $herecurr);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# If we have no input at all, then there is nothing to report on
|
# If we have no input at all, then there is nothing to report on
|
||||||
|
@ -135,8 +135,8 @@ struct zebra_dplane_provider {
|
|||||||
|
|
||||||
dplane_provider_fini_fp dp_fini;
|
dplane_provider_fini_fp dp_fini;
|
||||||
|
|
||||||
_Atomic uint64_t dp_in_counter;
|
_Atomic uint32_t dp_in_counter;
|
||||||
_Atomic uint64_t dp_error_counter;
|
_Atomic uint32_t dp_error_counter;
|
||||||
|
|
||||||
/* Embedded list linkage */
|
/* Embedded list linkage */
|
||||||
TAILQ_ENTRY(zebra_dplane_provider) dp_q_providers;
|
TAILQ_ENTRY(zebra_dplane_provider) dp_q_providers;
|
||||||
@ -171,10 +171,10 @@ static struct zebra_dplane_globals {
|
|||||||
/* Limit number of pending, unprocessed updates */
|
/* Limit number of pending, unprocessed updates */
|
||||||
_Atomic uint32_t dg_max_queued_updates;
|
_Atomic uint32_t dg_max_queued_updates;
|
||||||
|
|
||||||
_Atomic uint64_t dg_routes_in;
|
_Atomic uint32_t dg_routes_in;
|
||||||
_Atomic uint32_t dg_routes_queued;
|
_Atomic uint32_t dg_routes_queued;
|
||||||
_Atomic uint32_t dg_routes_queued_max;
|
_Atomic uint32_t dg_routes_queued_max;
|
||||||
_Atomic uint64_t dg_route_errors;
|
_Atomic uint32_t dg_route_errors;
|
||||||
|
|
||||||
/* Event-delivery context 'master' for the dplane */
|
/* Event-delivery context 'master' for the dplane */
|
||||||
struct thread_master *dg_master;
|
struct thread_master *dg_master;
|
||||||
|
@ -875,7 +875,7 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client)
|
|||||||
char cbuf[ZEBRA_TIME_BUF], rbuf[ZEBRA_TIME_BUF];
|
char cbuf[ZEBRA_TIME_BUF], rbuf[ZEBRA_TIME_BUF];
|
||||||
char wbuf[ZEBRA_TIME_BUF], nhbuf[ZEBRA_TIME_BUF], mbuf[ZEBRA_TIME_BUF];
|
char wbuf[ZEBRA_TIME_BUF], nhbuf[ZEBRA_TIME_BUF], mbuf[ZEBRA_TIME_BUF];
|
||||||
time_t connect_time, last_read_time, last_write_time;
|
time_t connect_time, last_read_time, last_write_time;
|
||||||
uint16_t last_read_cmd, last_write_cmd;
|
uint32_t last_read_cmd, last_write_cmd;
|
||||||
|
|
||||||
vty_out(vty, "Client: %s", zebra_route_string(client->proto));
|
vty_out(vty, "Client: %s", zebra_route_string(client->proto));
|
||||||
if (client->instance)
|
if (client->instance)
|
||||||
|
@ -157,9 +157,9 @@ struct zserv {
|
|||||||
/* monotime of last message sent */
|
/* monotime of last message sent */
|
||||||
_Atomic uint32_t last_write_time;
|
_Atomic uint32_t last_write_time;
|
||||||
/* command code of last message read */
|
/* command code of last message read */
|
||||||
_Atomic uint16_t last_read_cmd;
|
_Atomic uint32_t last_read_cmd;
|
||||||
/* command code of last message written */
|
/* command code of last message written */
|
||||||
_Atomic uint16_t last_write_cmd;
|
_Atomic uint32_t last_write_cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ZAPI_HANDLER_ARGS \
|
#define ZAPI_HANDLER_ARGS \
|
||||||
|
Loading…
Reference in New Issue
Block a user