mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 12:18:12 +00:00
lib, tests, zebra: Remove unused workqueue error function
The wq->spec.errorfunc is never used in the code. It's been in the code base since 2005 and I also do not remember ever seeing it being called. No workqueue process function ever returns error. Since it's not used let's just remove it from the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
9a5602b8ed
commit
074c80b705
@ -272,9 +272,6 @@ void work_queue_run(struct thread *thread)
|
|||||||
|
|
||||||
/* dont run items which are past their allowed retries */
|
/* dont run items which are past their allowed retries */
|
||||||
if (item->ran > wq->spec.max_retries) {
|
if (item->ran > wq->spec.max_retries) {
|
||||||
/* run error handler, if any */
|
|
||||||
if (wq->spec.errorfunc)
|
|
||||||
wq->spec.errorfunc(wq, item);
|
|
||||||
work_queue_item_remove(wq, item);
|
work_queue_item_remove(wq, item);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -317,10 +314,6 @@ void work_queue_run(struct thread *thread)
|
|||||||
case WQ_RETRY_NOW:
|
case WQ_RETRY_NOW:
|
||||||
/* a RETRY_NOW that gets here has exceeded max_tries, same as
|
/* a RETRY_NOW that gets here has exceeded max_tries, same as
|
||||||
* ERROR */
|
* ERROR */
|
||||||
case WQ_ERROR: {
|
|
||||||
if (wq->spec.errorfunc)
|
|
||||||
wq->spec.errorfunc(wq, item);
|
|
||||||
}
|
|
||||||
/* fallthru */
|
/* fallthru */
|
||||||
case WQ_SUCCESS:
|
case WQ_SUCCESS:
|
||||||
default: {
|
default: {
|
||||||
|
@ -41,7 +41,6 @@ DECLARE_MTYPE(WORK_QUEUE);
|
|||||||
/* action value, for use by item processor and item error handlers */
|
/* action value, for use by item processor and item error handlers */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
WQ_SUCCESS = 0,
|
WQ_SUCCESS = 0,
|
||||||
WQ_ERROR, /* Error, run error handler if provided */
|
|
||||||
WQ_RETRY_NOW, /* retry immediately */
|
WQ_RETRY_NOW, /* retry immediately */
|
||||||
WQ_RETRY_LATER, /* retry later, cease processing work queue */
|
WQ_RETRY_LATER, /* retry later, cease processing work queue */
|
||||||
WQ_REQUEUE, /* requeue item, continue processing work queue */
|
WQ_REQUEUE, /* requeue item, continue processing work queue */
|
||||||
@ -80,10 +79,6 @@ struct work_queue {
|
|||||||
*/
|
*/
|
||||||
wq_item_status (*workfunc)(struct work_queue *, void *);
|
wq_item_status (*workfunc)(struct work_queue *, void *);
|
||||||
|
|
||||||
/* error handling function, optional */
|
|
||||||
void (*errorfunc)(struct work_queue *,
|
|
||||||
struct work_queue_item *);
|
|
||||||
|
|
||||||
/* callback to delete user specific item data */
|
/* callback to delete user specific item data */
|
||||||
void (*del_item_data)(struct work_queue *, void *);
|
void (*del_item_data)(struct work_queue *, void *);
|
||||||
|
|
||||||
|
@ -70,11 +70,6 @@ static void heavy_wq_add(struct vty *vty, const char *str, int i)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void slow_func_err(struct work_queue *wq, struct work_queue_item *item)
|
|
||||||
{
|
|
||||||
printf("%s: running error function\n", __func__);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void slow_func_del(struct work_queue *wq, void *data)
|
static void slow_func_del(struct work_queue *wq, void *data)
|
||||||
{
|
{
|
||||||
struct heavy_wq_node *hn = data;
|
struct heavy_wq_node *hn = data;
|
||||||
@ -143,7 +138,6 @@ static int heavy_wq_init(void)
|
|||||||
heavy_wq = work_queue_new(master, "heavy_work_queue");
|
heavy_wq = work_queue_new(master, "heavy_work_queue");
|
||||||
|
|
||||||
heavy_wq->spec.workfunc = &slow_func;
|
heavy_wq->spec.workfunc = &slow_func;
|
||||||
heavy_wq->spec.errorfunc = &slow_func_err;
|
|
||||||
heavy_wq->spec.del_item_data = &slow_func_del;
|
heavy_wq->spec.del_item_data = &slow_func_del;
|
||||||
heavy_wq->spec.max_retries = 3;
|
heavy_wq->spec.max_retries = 3;
|
||||||
heavy_wq->spec.hold = 1000;
|
heavy_wq->spec.hold = 1000;
|
||||||
|
@ -1754,7 +1754,6 @@ static void mpls_processq_init(void)
|
|||||||
|
|
||||||
zrouter.lsp_process_q->spec.workfunc = &lsp_process;
|
zrouter.lsp_process_q->spec.workfunc = &lsp_process;
|
||||||
zrouter.lsp_process_q->spec.del_item_data = &lsp_processq_del;
|
zrouter.lsp_process_q->spec.del_item_data = &lsp_processq_del;
|
||||||
zrouter.lsp_process_q->spec.errorfunc = NULL;
|
|
||||||
zrouter.lsp_process_q->spec.completion_func = &lsp_processq_complete;
|
zrouter.lsp_process_q->spec.completion_func = &lsp_processq_complete;
|
||||||
zrouter.lsp_process_q->spec.max_retries = 0;
|
zrouter.lsp_process_q->spec.max_retries = 0;
|
||||||
zrouter.lsp_process_q->spec.hold = 10;
|
zrouter.lsp_process_q->spec.hold = 10;
|
||||||
|
@ -3743,7 +3743,6 @@ static void rib_queue_init(void)
|
|||||||
|
|
||||||
/* fill in the work queue spec */
|
/* fill in the work queue spec */
|
||||||
zrouter.ribq->spec.workfunc = &meta_queue_process;
|
zrouter.ribq->spec.workfunc = &meta_queue_process;
|
||||||
zrouter.ribq->spec.errorfunc = NULL;
|
|
||||||
zrouter.ribq->spec.completion_func = NULL;
|
zrouter.ribq->spec.completion_func = NULL;
|
||||||
/* XXX: TODO: These should be runtime configurable via vty */
|
/* XXX: TODO: These should be runtime configurable via vty */
|
||||||
zrouter.ribq->spec.max_retries = 3;
|
zrouter.ribq->spec.max_retries = 3;
|
||||||
|
Loading…
Reference in New Issue
Block a user