]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib, tests, zebra: Remove unused workqueue error function
authorDonald Sharp <sharpd@nvidia.com>
Wed, 14 Dec 2022 19:05:11 +0000 (14:05 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 15 Dec 2022 16:15:33 +0000 (11:15 -0500)
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>
lib/workqueue.c
lib/workqueue.h
tests/lib/test_heavy_wq.c
zebra/zebra_mpls.c
zebra/zebra_rib.c

index c703de90b376100fc2997daa60edea7da86f1f7a..a5338ba78bd639559c2c301d83877bd114174446 100644 (file)
@@ -272,9 +272,6 @@ void work_queue_run(struct thread *thread)
 
                /* dont run items which are past their allowed 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);
                        continue;
                }
@@ -317,10 +314,6 @@ void work_queue_run(struct thread *thread)
                case WQ_RETRY_NOW:
                /* a RETRY_NOW that gets here has exceeded max_tries, same as
                 * ERROR */
-               case WQ_ERROR: {
-                       if (wq->spec.errorfunc)
-                               wq->spec.errorfunc(wq, item);
-               }
                /* fallthru */
                case WQ_SUCCESS:
                default: {
index 27fb1383eb47be43a180278226fd5faf92aeb31f..7866032fc00e2678220055bf8a60f1b85495d82e 100644 (file)
@@ -41,7 +41,6 @@ DECLARE_MTYPE(WORK_QUEUE);
 /* action value, for use by item processor and item error handlers */
 typedef enum {
        WQ_SUCCESS = 0,
-       WQ_ERROR,        /* Error, run error handler if provided */
        WQ_RETRY_NOW,     /* retry immediately */
        WQ_RETRY_LATER,   /* retry later, cease 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 *);
 
-               /* error handling function, optional */
-               void (*errorfunc)(struct work_queue *,
-                                 struct work_queue_item *);
-
                /* callback to delete user specific item data */
                void (*del_item_data)(struct work_queue *, void *);
 
index 00aa7b80dd0e65aa7431918f47a6ef98f9243165..be47ef4bbce90e0543a065895945c293aea03cc7 100644 (file)
@@ -70,11 +70,6 @@ static void heavy_wq_add(struct vty *vty, const char *str, int i)
        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)
 {
        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->spec.workfunc = &slow_func;
-       heavy_wq->spec.errorfunc = &slow_func_err;
        heavy_wq->spec.del_item_data = &slow_func_del;
        heavy_wq->spec.max_retries = 3;
        heavy_wq->spec.hold = 1000;
index 9756d9ba08ad57ef7931f37c9580ec28c6852653..fe3f77f3c74f30e1db98b8cc81decc371b87cf41 100644 (file)
@@ -1754,7 +1754,6 @@ static void mpls_processq_init(void)
 
        zrouter.lsp_process_q->spec.workfunc = &lsp_process;
        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.max_retries = 0;
        zrouter.lsp_process_q->spec.hold = 10;
index b86780276b7a3be6fe84017dca10d46c3ce23f7f..fda21b2016cff367cb6393fdc15176d616d5f362 100644 (file)
@@ -3743,7 +3743,6 @@ static void rib_queue_init(void)
 
        /* fill in the work queue spec */
        zrouter.ribq->spec.workfunc = &meta_queue_process;
-       zrouter.ribq->spec.errorfunc = NULL;
        zrouter.ribq->spec.completion_func = NULL;
        /* XXX: TODO: These should be runtime configurable via vty */
        zrouter.ribq->spec.max_retries = 3;