mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 07:56:29 +00:00
zebra: Allow user to specify work-queue processing hold time
Allow the user to modify the work-queue processing hold time from 10ms to a value from (0-10000). Make the command hidden as that it's a semi-dangerous command and it could cause issues. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
41e7fb8030
commit
3a30f50f3f
@ -57,12 +57,6 @@ DEFINE_HOOK(rib_update, (struct route_node * rn, const char *reason),
|
|||||||
/* Should we allow non Quagga processes to delete our routes */
|
/* Should we allow non Quagga processes to delete our routes */
|
||||||
extern int allow_delete;
|
extern int allow_delete;
|
||||||
|
|
||||||
/* Hold time for RIB process, should be very minimal.
|
|
||||||
* it is useful to able to set it otherwise for testing, hence exported
|
|
||||||
* as global here for test-rig code.
|
|
||||||
*/
|
|
||||||
int rib_process_hold_time = 10;
|
|
||||||
|
|
||||||
/* Each route type's string and default distance value. */
|
/* Each route type's string and default distance value. */
|
||||||
static const struct {
|
static const struct {
|
||||||
int key;
|
int key;
|
||||||
@ -1899,7 +1893,7 @@ static void rib_queue_init(struct zebra_t *zebra)
|
|||||||
zebra->ribq->spec.completion_func = &meta_queue_process_complete;
|
zebra->ribq->spec.completion_func = &meta_queue_process_complete;
|
||||||
/* XXX: TODO: These should be runtime configurable via vty */
|
/* XXX: TODO: These should be runtime configurable via vty */
|
||||||
zebra->ribq->spec.max_retries = 3;
|
zebra->ribq->spec.max_retries = 3;
|
||||||
zebra->ribq->spec.hold = rib_process_hold_time;
|
zebra->ribq->spec.hold = ZEBRA_RIB_PROCESS_HOLD_TIME;
|
||||||
|
|
||||||
if (!(zebra->mq = meta_queue_new())) {
|
if (!(zebra->mq = meta_queue_new())) {
|
||||||
zlog_err("%s: could not initialise meta queue!", __func__);
|
zlog_err("%s: could not initialise meta queue!", __func__);
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "lib/json.h"
|
#include "lib/json.h"
|
||||||
#include "zebra/zebra_vxlan.h"
|
#include "zebra/zebra_vxlan.h"
|
||||||
#include "zebra/zebra_vty_clippy.c"
|
#include "zebra/zebra_vty_clippy.c"
|
||||||
|
#include "zebra/zserv.h"
|
||||||
|
|
||||||
extern int allow_delete;
|
extern int allow_delete;
|
||||||
|
|
||||||
@ -2695,6 +2696,32 @@ DEFUN (ip_zebra_import_table_distance,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFUN_HIDDEN (zebra_workqueue_timer,
|
||||||
|
zebra_workqueue_timer_cmd,
|
||||||
|
"zebra work-queue (0-10000)",
|
||||||
|
ZEBRA_STR
|
||||||
|
"Work Queue\n"
|
||||||
|
"Time in milliseconds\n")
|
||||||
|
{
|
||||||
|
uint32_t timer = strtoul(argv[2]->arg, NULL, 10);
|
||||||
|
zebrad.ribq->spec.hold = timer;
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFUN_HIDDEN (no_zebra_workqueue_timer,
|
||||||
|
no_zebra_workqueue_timer_cmd,
|
||||||
|
"no zebra work-queue [(0-10000)]",
|
||||||
|
NO_STR
|
||||||
|
ZEBRA_STR
|
||||||
|
"Work Queue\n"
|
||||||
|
"Time in milliseconds\n")
|
||||||
|
{
|
||||||
|
zebrad.ribq->spec.hold = ZEBRA_RIB_PROCESS_HOLD_TIME;
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFUN (no_ip_zebra_import_table,
|
DEFUN (no_ip_zebra_import_table,
|
||||||
no_ip_zebra_import_table_cmd,
|
no_ip_zebra_import_table_cmd,
|
||||||
"no ip import-table (1-252) [distance (1-255)] [route-map NAME]",
|
"no ip import-table (1-252) [distance (1-255)] [route-map NAME]",
|
||||||
@ -2740,6 +2767,9 @@ static int config_write_protocol(struct vty *vty)
|
|||||||
if (zebra_rnh_ipv6_default_route)
|
if (zebra_rnh_ipv6_default_route)
|
||||||
vty_out(vty, "ipv6 nht resolve-via-default\n");
|
vty_out(vty, "ipv6 nht resolve-via-default\n");
|
||||||
|
|
||||||
|
if (zebrad.ribq->spec.hold != ZEBRA_RIB_PROCESS_HOLD_TIME)
|
||||||
|
vty_out(vty, "zebra work-queue %u\n", zebrad.ribq->spec.hold);
|
||||||
|
|
||||||
enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get();
|
enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get();
|
||||||
|
|
||||||
if (ipv4_multicast_mode != MCAST_NO_CONFIG)
|
if (ipv4_multicast_mode != MCAST_NO_CONFIG)
|
||||||
@ -2781,6 +2811,8 @@ void zebra_vty_init(void)
|
|||||||
install_element(CONFIG_NODE, &ip_route_cmd);
|
install_element(CONFIG_NODE, &ip_route_cmd);
|
||||||
install_element(CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
|
install_element(CONFIG_NODE, &ip_zebra_import_table_distance_cmd);
|
||||||
install_element(CONFIG_NODE, &no_ip_zebra_import_table_cmd);
|
install_element(CONFIG_NODE, &no_ip_zebra_import_table_cmd);
|
||||||
|
install_element(CONFIG_NODE, &zebra_workqueue_timer_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_zebra_workqueue_timer_cmd);
|
||||||
|
|
||||||
install_element(VIEW_NODE, &show_vrf_cmd);
|
install_element(VIEW_NODE, &show_vrf_cmd);
|
||||||
install_element(VIEW_NODE, &show_ip_route_cmd);
|
install_element(VIEW_NODE, &show_ip_route_cmd);
|
||||||
|
@ -132,6 +132,7 @@ struct zebra_t {
|
|||||||
u_int32_t rtm_table_default;
|
u_int32_t rtm_table_default;
|
||||||
|
|
||||||
/* rib work queue */
|
/* rib work queue */
|
||||||
|
#define ZEBRA_RIB_PROCESS_HOLD_TIME 10
|
||||||
struct work_queue *ribq;
|
struct work_queue *ribq;
|
||||||
struct meta_queue *mq;
|
struct meta_queue *mq;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user