Line | Count | Source |
1 | | // SPDX-License-Identifier: GPL-2.0-or-later |
2 | | /* |
3 | | * Quagga Work Queues. |
4 | | * |
5 | | * Copyright (C) 2005 Sun Microsystems, Inc. |
6 | | */ |
7 | | |
8 | | #ifndef _QUAGGA_WORK_QUEUE_H |
9 | | #define _QUAGGA_WORK_QUEUE_H |
10 | | |
11 | | #include "memory.h" |
12 | | #include "queue.h" |
13 | | |
14 | | #ifdef __cplusplus |
15 | | extern "C" { |
16 | | #endif |
17 | | |
18 | | DECLARE_MTYPE(WORK_QUEUE); |
19 | | |
20 | | /* Hold time for the initial schedule of a queue run, in millisec */ |
21 | 5 | #define WORK_QUEUE_DEFAULT_HOLD 50 |
22 | | |
23 | | /* Retry for queue that is 'blocked' or 'retry later' */ |
24 | 5 | #define WORK_QUEUE_DEFAULT_RETRY 0 |
25 | | |
26 | | /* action value, for use by item processor and item error handlers */ |
27 | | typedef enum { |
28 | | WQ_SUCCESS = 0, |
29 | | WQ_RETRY_NOW, /* retry immediately */ |
30 | | WQ_RETRY_LATER, /* retry later, cease processing work queue */ |
31 | | WQ_REQUEUE, /* requeue item, continue processing work queue */ |
32 | | WQ_QUEUE_BLOCKED, /* Queue cant be processed at this time. |
33 | | * Similar to WQ_RETRY_LATER, but doesn't penalise |
34 | | * the particular item.. */ |
35 | | } wq_item_status; |
36 | | |
37 | | /* A single work queue item, unsurprisingly */ |
38 | | struct work_queue_item { |
39 | | STAILQ_ENTRY(work_queue_item) wq; |
40 | | void *data; /* opaque data */ |
41 | | unsigned short ran; /* # of times item has been run */ |
42 | | }; |
43 | | |
44 | | #define WQ_UNPLUGGED (1 << 0) /* available for draining */ |
45 | | |
46 | | struct work_queue { |
47 | | /* Everything but the specification struct is private |
48 | | * the following may be read |
49 | | */ |
50 | | struct event_loop *master; /* thread master */ |
51 | | struct event *thread; /* thread, if one is active */ |
52 | | char *name; /* work queue name */ |
53 | | |
54 | | /* Specification for this work queue. |
55 | | * Public, must be set before use by caller. May be modified at will. |
56 | | */ |
57 | | struct { |
58 | | /* optional opaque user data, global to the queue. */ |
59 | | void *data; |
60 | | |
61 | | /* work function to process items with: |
62 | | * First argument is the workqueue queue. |
63 | | * Second argument is the item data |
64 | | */ |
65 | | wq_item_status (*workfunc)(struct work_queue *, void *); |
66 | | |
67 | | /* callback to delete user specific item data */ |
68 | | void (*del_item_data)(struct work_queue *, void *); |
69 | | |
70 | | /* completion callback, called when queue is emptied, optional |
71 | | */ |
72 | | void (*completion_func)(struct work_queue *); |
73 | | |
74 | | /* max number of retries to make for item that errors */ |
75 | | unsigned int max_retries; |
76 | | |
77 | | unsigned int hold; /* hold time for first run, in ms */ |
78 | | |
79 | | unsigned long |
80 | | yield; /* yield time in us for associated thread */ |
81 | | |
82 | | uint32_t retry; /* Optional retry timeout if queue is blocked */ |
83 | | } spec; |
84 | | |
85 | | /* remaining fields should be opaque to users */ |
86 | | STAILQ_HEAD(work_queue_items, work_queue_item) |
87 | | items; /* queue item list */ |
88 | | int item_count; /* queued items */ |
89 | | unsigned long runs; /* runs count */ |
90 | | unsigned long yields; /* yields count */ |
91 | | |
92 | | struct { |
93 | | unsigned int best; |
94 | | unsigned int granularity; |
95 | | unsigned long total; |
96 | | } cycles; /* cycle counts */ |
97 | | |
98 | | /* private state */ |
99 | | uint16_t flags; /* user set flag */ |
100 | | }; |
101 | | |
102 | | /* User API */ |
103 | | |
104 | | static inline int work_queue_item_count(struct work_queue *wq) |
105 | 0 | { |
106 | 0 | return wq->item_count; |
107 | 0 | } Unexecuted instantiation: command.c:work_queue_item_count Unexecuted instantiation: workqueue.c:work_queue_item_count Unexecuted instantiation: connected.c:work_queue_item_count Unexecuted instantiation: if_netlink.c:work_queue_item_count Unexecuted instantiation: interface.c:work_queue_item_count Unexecuted instantiation: ioctl.c:work_queue_item_count Unexecuted instantiation: kernel_netlink.c:work_queue_item_count Unexecuted instantiation: label_manager.c:work_queue_item_count Unexecuted instantiation: main.c:work_queue_item_count Unexecuted instantiation: netconf_netlink.c:work_queue_item_count Unexecuted instantiation: redistribute.c:work_queue_item_count Unexecuted instantiation: router-id.c:work_queue_item_count Unexecuted instantiation: rt_netlink.c:work_queue_item_count Unexecuted instantiation: rtadv.c:work_queue_item_count Unexecuted instantiation: rtread_netlink.c:work_queue_item_count Unexecuted instantiation: rule_netlink.c:work_queue_item_count Unexecuted instantiation: table_manager.c:work_queue_item_count Unexecuted instantiation: tc_netlink.c:work_queue_item_count Unexecuted instantiation: zapi_msg.c:work_queue_item_count Unexecuted instantiation: zebra_affinitymap.c:work_queue_item_count Unexecuted instantiation: zebra_dplane.c:work_queue_item_count Unexecuted instantiation: zebra_gr.c:work_queue_item_count Unexecuted instantiation: zebra_l2.c:work_queue_item_count Unexecuted instantiation: zebra_l2_bridge_if.c:work_queue_item_count Unexecuted instantiation: zebra_evpn.c:work_queue_item_count Unexecuted instantiation: zebra_evpn_mac.c:work_queue_item_count Unexecuted instantiation: zebra_evpn_neigh.c:work_queue_item_count Unexecuted instantiation: zebra_mlag.c:work_queue_item_count Unexecuted instantiation: zebra_mlag_vty.c:work_queue_item_count Unexecuted instantiation: zebra_mpls.c:work_queue_item_count Unexecuted instantiation: zebra_mpls_netlink.c:work_queue_item_count Unexecuted instantiation: zebra_mpls_null.c:work_queue_item_count Unexecuted instantiation: zebra_mpls_vty.c:work_queue_item_count Unexecuted instantiation: zebra_srv6.c:work_queue_item_count Unexecuted instantiation: zebra_srv6_vty.c:work_queue_item_count Unexecuted instantiation: zebra_mroute.c:work_queue_item_count Unexecuted instantiation: zebra_nb.c:work_queue_item_count Unexecuted instantiation: zebra_nb_config.c:work_queue_item_count Unexecuted instantiation: zebra_nb_rpcs.c:work_queue_item_count Unexecuted instantiation: zebra_nb_state.c:work_queue_item_count Unexecuted instantiation: zebra_netns_id.c:work_queue_item_count Unexecuted instantiation: zebra_netns_notify.c:work_queue_item_count Unexecuted instantiation: zebra_nhg.c:work_queue_item_count Unexecuted instantiation: zebra_ns.c:work_queue_item_count Unexecuted instantiation: zebra_opaque.c:work_queue_item_count Unexecuted instantiation: zebra_pbr.c:work_queue_item_count Unexecuted instantiation: zebra_ptm.c:work_queue_item_count Unexecuted instantiation: zebra_ptm_redistribute.c:work_queue_item_count Unexecuted instantiation: zebra_pw.c:work_queue_item_count Unexecuted instantiation: zebra_rib.c:work_queue_item_count Unexecuted instantiation: zebra_router.c:work_queue_item_count Unexecuted instantiation: zebra_rnh.c:work_queue_item_count Unexecuted instantiation: zebra_routemap.c:work_queue_item_count Unexecuted instantiation: zebra_script.c:work_queue_item_count Unexecuted instantiation: zebra_srte.c:work_queue_item_count Unexecuted instantiation: zebra_tc.c:work_queue_item_count Unexecuted instantiation: zebra_vrf.c:work_queue_item_count Unexecuted instantiation: zebra_vty.c:work_queue_item_count Unexecuted instantiation: zebra_vxlan.c:work_queue_item_count Unexecuted instantiation: zebra_vxlan_if.c:work_queue_item_count Unexecuted instantiation: zebra_evpn_mh.c:work_queue_item_count Unexecuted instantiation: zebra_neigh.c:work_queue_item_count Unexecuted instantiation: zserv.c:work_queue_item_count Unexecuted instantiation: debug_nl.c:work_queue_item_count Unexecuted instantiation: bgp_fsm.c:work_queue_item_count Unexecuted instantiation: bgp_labelpool.c:work_queue_item_count Unexecuted instantiation: bgp_route.c:work_queue_item_count Unexecuted instantiation: bgp_updgrp.c:work_queue_item_count Unexecuted instantiation: bgp_updgrp_packet.c:work_queue_item_count Unexecuted instantiation: bgpd.c:work_queue_item_count Unexecuted instantiation: bgp_rfapi_cfg.c:work_queue_item_count Unexecuted instantiation: rfapi_import.c:work_queue_item_count Unexecuted instantiation: rfapi.c:work_queue_item_count Unexecuted instantiation: rfapi_ap.c:work_queue_item_count Unexecuted instantiation: rfapi_encap_tlv.c:work_queue_item_count Unexecuted instantiation: rfapi_nve_addr.c:work_queue_item_count Unexecuted instantiation: rfapi_monitor.c:work_queue_item_count Unexecuted instantiation: rfapi_rib.c:work_queue_item_count Unexecuted instantiation: rfapi_vty.c:work_queue_item_count Unexecuted instantiation: vnc_export_bgp.c:work_queue_item_count Unexecuted instantiation: vnc_export_table.c:work_queue_item_count Unexecuted instantiation: vnc_import_bgp.c:work_queue_item_count Unexecuted instantiation: vnc_zebra.c:work_queue_item_count |
108 | | |
109 | | static inline bool work_queue_empty(struct work_queue *wq) |
110 | 0 | { |
111 | 0 | return (wq->item_count == 0) ? true : false; |
112 | 0 | } Unexecuted instantiation: command.c:work_queue_empty Unexecuted instantiation: workqueue.c:work_queue_empty Unexecuted instantiation: connected.c:work_queue_empty Unexecuted instantiation: if_netlink.c:work_queue_empty Unexecuted instantiation: interface.c:work_queue_empty Unexecuted instantiation: ioctl.c:work_queue_empty Unexecuted instantiation: kernel_netlink.c:work_queue_empty Unexecuted instantiation: label_manager.c:work_queue_empty Unexecuted instantiation: main.c:work_queue_empty Unexecuted instantiation: netconf_netlink.c:work_queue_empty Unexecuted instantiation: redistribute.c:work_queue_empty Unexecuted instantiation: router-id.c:work_queue_empty Unexecuted instantiation: rt_netlink.c:work_queue_empty Unexecuted instantiation: rtadv.c:work_queue_empty Unexecuted instantiation: rtread_netlink.c:work_queue_empty Unexecuted instantiation: rule_netlink.c:work_queue_empty Unexecuted instantiation: table_manager.c:work_queue_empty Unexecuted instantiation: tc_netlink.c:work_queue_empty Unexecuted instantiation: zapi_msg.c:work_queue_empty Unexecuted instantiation: zebra_affinitymap.c:work_queue_empty Unexecuted instantiation: zebra_dplane.c:work_queue_empty Unexecuted instantiation: zebra_gr.c:work_queue_empty Unexecuted instantiation: zebra_l2.c:work_queue_empty Unexecuted instantiation: zebra_l2_bridge_if.c:work_queue_empty Unexecuted instantiation: zebra_evpn.c:work_queue_empty Unexecuted instantiation: zebra_evpn_mac.c:work_queue_empty Unexecuted instantiation: zebra_evpn_neigh.c:work_queue_empty Unexecuted instantiation: zebra_mlag.c:work_queue_empty Unexecuted instantiation: zebra_mlag_vty.c:work_queue_empty Unexecuted instantiation: zebra_mpls.c:work_queue_empty Unexecuted instantiation: zebra_mpls_netlink.c:work_queue_empty Unexecuted instantiation: zebra_mpls_null.c:work_queue_empty Unexecuted instantiation: zebra_mpls_vty.c:work_queue_empty Unexecuted instantiation: zebra_srv6.c:work_queue_empty Unexecuted instantiation: zebra_srv6_vty.c:work_queue_empty Unexecuted instantiation: zebra_mroute.c:work_queue_empty Unexecuted instantiation: zebra_nb.c:work_queue_empty Unexecuted instantiation: zebra_nb_config.c:work_queue_empty Unexecuted instantiation: zebra_nb_rpcs.c:work_queue_empty Unexecuted instantiation: zebra_nb_state.c:work_queue_empty Unexecuted instantiation: zebra_netns_id.c:work_queue_empty Unexecuted instantiation: zebra_netns_notify.c:work_queue_empty Unexecuted instantiation: zebra_nhg.c:work_queue_empty Unexecuted instantiation: zebra_ns.c:work_queue_empty Unexecuted instantiation: zebra_opaque.c:work_queue_empty Unexecuted instantiation: zebra_pbr.c:work_queue_empty Unexecuted instantiation: zebra_ptm.c:work_queue_empty Unexecuted instantiation: zebra_ptm_redistribute.c:work_queue_empty Unexecuted instantiation: zebra_pw.c:work_queue_empty Unexecuted instantiation: zebra_rib.c:work_queue_empty Unexecuted instantiation: zebra_router.c:work_queue_empty Unexecuted instantiation: zebra_rnh.c:work_queue_empty Unexecuted instantiation: zebra_routemap.c:work_queue_empty Unexecuted instantiation: zebra_script.c:work_queue_empty Unexecuted instantiation: zebra_srte.c:work_queue_empty Unexecuted instantiation: zebra_tc.c:work_queue_empty Unexecuted instantiation: zebra_vrf.c:work_queue_empty Unexecuted instantiation: zebra_vty.c:work_queue_empty Unexecuted instantiation: zebra_vxlan.c:work_queue_empty Unexecuted instantiation: zebra_vxlan_if.c:work_queue_empty Unexecuted instantiation: zebra_evpn_mh.c:work_queue_empty Unexecuted instantiation: zebra_neigh.c:work_queue_empty Unexecuted instantiation: zserv.c:work_queue_empty Unexecuted instantiation: debug_nl.c:work_queue_empty Unexecuted instantiation: bgp_fsm.c:work_queue_empty Unexecuted instantiation: bgp_labelpool.c:work_queue_empty Unexecuted instantiation: bgp_route.c:work_queue_empty Unexecuted instantiation: bgp_updgrp.c:work_queue_empty Unexecuted instantiation: bgp_updgrp_packet.c:work_queue_empty Unexecuted instantiation: bgpd.c:work_queue_empty Unexecuted instantiation: bgp_rfapi_cfg.c:work_queue_empty Unexecuted instantiation: rfapi_import.c:work_queue_empty Unexecuted instantiation: rfapi.c:work_queue_empty Unexecuted instantiation: rfapi_ap.c:work_queue_empty Unexecuted instantiation: rfapi_encap_tlv.c:work_queue_empty Unexecuted instantiation: rfapi_nve_addr.c:work_queue_empty Unexecuted instantiation: rfapi_monitor.c:work_queue_empty Unexecuted instantiation: rfapi_rib.c:work_queue_empty Unexecuted instantiation: rfapi_vty.c:work_queue_empty Unexecuted instantiation: vnc_export_bgp.c:work_queue_empty Unexecuted instantiation: vnc_export_table.c:work_queue_empty Unexecuted instantiation: vnc_import_bgp.c:work_queue_empty Unexecuted instantiation: vnc_zebra.c:work_queue_empty |
113 | | |
114 | | static inline struct work_queue_item * |
115 | | work_queue_last_item(struct work_queue *wq) |
116 | 0 | { |
117 | 0 | return STAILQ_LAST(&wq->items, work_queue_item, wq); |
118 | 0 | } Unexecuted instantiation: command.c:work_queue_last_item Unexecuted instantiation: workqueue.c:work_queue_last_item Unexecuted instantiation: connected.c:work_queue_last_item Unexecuted instantiation: if_netlink.c:work_queue_last_item Unexecuted instantiation: interface.c:work_queue_last_item Unexecuted instantiation: ioctl.c:work_queue_last_item Unexecuted instantiation: kernel_netlink.c:work_queue_last_item Unexecuted instantiation: label_manager.c:work_queue_last_item Unexecuted instantiation: main.c:work_queue_last_item Unexecuted instantiation: netconf_netlink.c:work_queue_last_item Unexecuted instantiation: redistribute.c:work_queue_last_item Unexecuted instantiation: router-id.c:work_queue_last_item Unexecuted instantiation: rt_netlink.c:work_queue_last_item Unexecuted instantiation: rtadv.c:work_queue_last_item Unexecuted instantiation: rtread_netlink.c:work_queue_last_item Unexecuted instantiation: rule_netlink.c:work_queue_last_item Unexecuted instantiation: table_manager.c:work_queue_last_item Unexecuted instantiation: tc_netlink.c:work_queue_last_item Unexecuted instantiation: zapi_msg.c:work_queue_last_item Unexecuted instantiation: zebra_affinitymap.c:work_queue_last_item Unexecuted instantiation: zebra_dplane.c:work_queue_last_item Unexecuted instantiation: zebra_gr.c:work_queue_last_item Unexecuted instantiation: zebra_l2.c:work_queue_last_item Unexecuted instantiation: zebra_l2_bridge_if.c:work_queue_last_item Unexecuted instantiation: zebra_evpn.c:work_queue_last_item Unexecuted instantiation: zebra_evpn_mac.c:work_queue_last_item Unexecuted instantiation: zebra_evpn_neigh.c:work_queue_last_item Unexecuted instantiation: zebra_mlag.c:work_queue_last_item Unexecuted instantiation: zebra_mlag_vty.c:work_queue_last_item Unexecuted instantiation: zebra_mpls.c:work_queue_last_item Unexecuted instantiation: zebra_mpls_netlink.c:work_queue_last_item Unexecuted instantiation: zebra_mpls_null.c:work_queue_last_item Unexecuted instantiation: zebra_mpls_vty.c:work_queue_last_item Unexecuted instantiation: zebra_srv6.c:work_queue_last_item Unexecuted instantiation: zebra_srv6_vty.c:work_queue_last_item Unexecuted instantiation: zebra_mroute.c:work_queue_last_item Unexecuted instantiation: zebra_nb.c:work_queue_last_item Unexecuted instantiation: zebra_nb_config.c:work_queue_last_item Unexecuted instantiation: zebra_nb_rpcs.c:work_queue_last_item Unexecuted instantiation: zebra_nb_state.c:work_queue_last_item Unexecuted instantiation: zebra_netns_id.c:work_queue_last_item Unexecuted instantiation: zebra_netns_notify.c:work_queue_last_item Unexecuted instantiation: zebra_nhg.c:work_queue_last_item Unexecuted instantiation: zebra_ns.c:work_queue_last_item Unexecuted instantiation: zebra_opaque.c:work_queue_last_item Unexecuted instantiation: zebra_pbr.c:work_queue_last_item Unexecuted instantiation: zebra_ptm.c:work_queue_last_item Unexecuted instantiation: zebra_ptm_redistribute.c:work_queue_last_item Unexecuted instantiation: zebra_pw.c:work_queue_last_item Unexecuted instantiation: zebra_rib.c:work_queue_last_item Unexecuted instantiation: zebra_router.c:work_queue_last_item Unexecuted instantiation: zebra_rnh.c:work_queue_last_item Unexecuted instantiation: zebra_routemap.c:work_queue_last_item Unexecuted instantiation: zebra_script.c:work_queue_last_item Unexecuted instantiation: zebra_srte.c:work_queue_last_item Unexecuted instantiation: zebra_tc.c:work_queue_last_item Unexecuted instantiation: zebra_vrf.c:work_queue_last_item Unexecuted instantiation: zebra_vty.c:work_queue_last_item Unexecuted instantiation: zebra_vxlan.c:work_queue_last_item Unexecuted instantiation: zebra_vxlan_if.c:work_queue_last_item Unexecuted instantiation: zebra_evpn_mh.c:work_queue_last_item Unexecuted instantiation: zebra_neigh.c:work_queue_last_item Unexecuted instantiation: zserv.c:work_queue_last_item Unexecuted instantiation: debug_nl.c:work_queue_last_item Unexecuted instantiation: bgp_fsm.c:work_queue_last_item Unexecuted instantiation: bgp_labelpool.c:work_queue_last_item Unexecuted instantiation: bgp_route.c:work_queue_last_item Unexecuted instantiation: bgp_updgrp.c:work_queue_last_item Unexecuted instantiation: bgp_updgrp_packet.c:work_queue_last_item Unexecuted instantiation: bgpd.c:work_queue_last_item Unexecuted instantiation: bgp_rfapi_cfg.c:work_queue_last_item Unexecuted instantiation: rfapi_import.c:work_queue_last_item Unexecuted instantiation: rfapi.c:work_queue_last_item Unexecuted instantiation: rfapi_ap.c:work_queue_last_item Unexecuted instantiation: rfapi_encap_tlv.c:work_queue_last_item Unexecuted instantiation: rfapi_nve_addr.c:work_queue_last_item Unexecuted instantiation: rfapi_monitor.c:work_queue_last_item Unexecuted instantiation: rfapi_rib.c:work_queue_last_item Unexecuted instantiation: rfapi_vty.c:work_queue_last_item Unexecuted instantiation: vnc_export_bgp.c:work_queue_last_item Unexecuted instantiation: vnc_export_table.c:work_queue_last_item Unexecuted instantiation: vnc_import_bgp.c:work_queue_last_item Unexecuted instantiation: vnc_zebra.c:work_queue_last_item |
119 | | |
120 | | static inline void work_queue_item_enqueue(struct work_queue *wq, |
121 | | struct work_queue_item *item) |
122 | 0 | { |
123 | 0 | STAILQ_INSERT_TAIL(&wq->items, item, wq); |
124 | 0 | wq->item_count++; |
125 | 0 | } Unexecuted instantiation: command.c:work_queue_item_enqueue Unexecuted instantiation: workqueue.c:work_queue_item_enqueue Unexecuted instantiation: connected.c:work_queue_item_enqueue Unexecuted instantiation: if_netlink.c:work_queue_item_enqueue Unexecuted instantiation: interface.c:work_queue_item_enqueue Unexecuted instantiation: ioctl.c:work_queue_item_enqueue Unexecuted instantiation: kernel_netlink.c:work_queue_item_enqueue Unexecuted instantiation: label_manager.c:work_queue_item_enqueue Unexecuted instantiation: main.c:work_queue_item_enqueue Unexecuted instantiation: netconf_netlink.c:work_queue_item_enqueue Unexecuted instantiation: redistribute.c:work_queue_item_enqueue Unexecuted instantiation: router-id.c:work_queue_item_enqueue Unexecuted instantiation: rt_netlink.c:work_queue_item_enqueue Unexecuted instantiation: rtadv.c:work_queue_item_enqueue Unexecuted instantiation: rtread_netlink.c:work_queue_item_enqueue Unexecuted instantiation: rule_netlink.c:work_queue_item_enqueue Unexecuted instantiation: table_manager.c:work_queue_item_enqueue Unexecuted instantiation: tc_netlink.c:work_queue_item_enqueue Unexecuted instantiation: zapi_msg.c:work_queue_item_enqueue Unexecuted instantiation: zebra_affinitymap.c:work_queue_item_enqueue Unexecuted instantiation: zebra_dplane.c:work_queue_item_enqueue Unexecuted instantiation: zebra_gr.c:work_queue_item_enqueue Unexecuted instantiation: zebra_l2.c:work_queue_item_enqueue Unexecuted instantiation: zebra_l2_bridge_if.c:work_queue_item_enqueue Unexecuted instantiation: zebra_evpn.c:work_queue_item_enqueue Unexecuted instantiation: zebra_evpn_mac.c:work_queue_item_enqueue Unexecuted instantiation: zebra_evpn_neigh.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mlag.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mlag_vty.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mpls.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mpls_netlink.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mpls_null.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mpls_vty.c:work_queue_item_enqueue Unexecuted instantiation: zebra_srv6.c:work_queue_item_enqueue Unexecuted instantiation: zebra_srv6_vty.c:work_queue_item_enqueue Unexecuted instantiation: zebra_mroute.c:work_queue_item_enqueue Unexecuted instantiation: zebra_nb.c:work_queue_item_enqueue Unexecuted instantiation: zebra_nb_config.c:work_queue_item_enqueue Unexecuted instantiation: zebra_nb_rpcs.c:work_queue_item_enqueue Unexecuted instantiation: zebra_nb_state.c:work_queue_item_enqueue Unexecuted instantiation: zebra_netns_id.c:work_queue_item_enqueue Unexecuted instantiation: zebra_netns_notify.c:work_queue_item_enqueue Unexecuted instantiation: zebra_nhg.c:work_queue_item_enqueue Unexecuted instantiation: zebra_ns.c:work_queue_item_enqueue Unexecuted instantiation: zebra_opaque.c:work_queue_item_enqueue Unexecuted instantiation: zebra_pbr.c:work_queue_item_enqueue Unexecuted instantiation: zebra_ptm.c:work_queue_item_enqueue Unexecuted instantiation: zebra_ptm_redistribute.c:work_queue_item_enqueue Unexecuted instantiation: zebra_pw.c:work_queue_item_enqueue Unexecuted instantiation: zebra_rib.c:work_queue_item_enqueue Unexecuted instantiation: zebra_router.c:work_queue_item_enqueue Unexecuted instantiation: zebra_rnh.c:work_queue_item_enqueue Unexecuted instantiation: zebra_routemap.c:work_queue_item_enqueue Unexecuted instantiation: zebra_script.c:work_queue_item_enqueue Unexecuted instantiation: zebra_srte.c:work_queue_item_enqueue Unexecuted instantiation: zebra_tc.c:work_queue_item_enqueue Unexecuted instantiation: zebra_vrf.c:work_queue_item_enqueue Unexecuted instantiation: zebra_vty.c:work_queue_item_enqueue Unexecuted instantiation: zebra_vxlan.c:work_queue_item_enqueue Unexecuted instantiation: zebra_vxlan_if.c:work_queue_item_enqueue Unexecuted instantiation: zebra_evpn_mh.c:work_queue_item_enqueue Unexecuted instantiation: zebra_neigh.c:work_queue_item_enqueue Unexecuted instantiation: zserv.c:work_queue_item_enqueue Unexecuted instantiation: debug_nl.c:work_queue_item_enqueue Unexecuted instantiation: bgp_fsm.c:work_queue_item_enqueue Unexecuted instantiation: bgp_labelpool.c:work_queue_item_enqueue Unexecuted instantiation: bgp_route.c:work_queue_item_enqueue Unexecuted instantiation: bgp_updgrp.c:work_queue_item_enqueue Unexecuted instantiation: bgp_updgrp_packet.c:work_queue_item_enqueue Unexecuted instantiation: bgpd.c:work_queue_item_enqueue Unexecuted instantiation: bgp_rfapi_cfg.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_import.c:work_queue_item_enqueue Unexecuted instantiation: rfapi.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_ap.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_encap_tlv.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_nve_addr.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_monitor.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_rib.c:work_queue_item_enqueue Unexecuted instantiation: rfapi_vty.c:work_queue_item_enqueue Unexecuted instantiation: vnc_export_bgp.c:work_queue_item_enqueue Unexecuted instantiation: vnc_export_table.c:work_queue_item_enqueue Unexecuted instantiation: vnc_import_bgp.c:work_queue_item_enqueue Unexecuted instantiation: vnc_zebra.c:work_queue_item_enqueue |
126 | | |
127 | | static inline void work_queue_item_dequeue(struct work_queue *wq, |
128 | | struct work_queue_item *item) |
129 | 0 | { |
130 | 0 | assert(wq->item_count > 0); |
131 | |
|
132 | 0 | wq->item_count--; |
133 | | STAILQ_REMOVE(&wq->items, item, work_queue_item, wq); |
134 | 0 | } Unexecuted instantiation: command.c:work_queue_item_dequeue Unexecuted instantiation: workqueue.c:work_queue_item_dequeue Unexecuted instantiation: connected.c:work_queue_item_dequeue Unexecuted instantiation: if_netlink.c:work_queue_item_dequeue Unexecuted instantiation: interface.c:work_queue_item_dequeue Unexecuted instantiation: ioctl.c:work_queue_item_dequeue Unexecuted instantiation: kernel_netlink.c:work_queue_item_dequeue Unexecuted instantiation: label_manager.c:work_queue_item_dequeue Unexecuted instantiation: main.c:work_queue_item_dequeue Unexecuted instantiation: netconf_netlink.c:work_queue_item_dequeue Unexecuted instantiation: redistribute.c:work_queue_item_dequeue Unexecuted instantiation: router-id.c:work_queue_item_dequeue Unexecuted instantiation: rt_netlink.c:work_queue_item_dequeue Unexecuted instantiation: rtadv.c:work_queue_item_dequeue Unexecuted instantiation: rtread_netlink.c:work_queue_item_dequeue Unexecuted instantiation: rule_netlink.c:work_queue_item_dequeue Unexecuted instantiation: table_manager.c:work_queue_item_dequeue Unexecuted instantiation: tc_netlink.c:work_queue_item_dequeue Unexecuted instantiation: zapi_msg.c:work_queue_item_dequeue Unexecuted instantiation: zebra_affinitymap.c:work_queue_item_dequeue Unexecuted instantiation: zebra_dplane.c:work_queue_item_dequeue Unexecuted instantiation: zebra_gr.c:work_queue_item_dequeue Unexecuted instantiation: zebra_l2.c:work_queue_item_dequeue Unexecuted instantiation: zebra_l2_bridge_if.c:work_queue_item_dequeue Unexecuted instantiation: zebra_evpn.c:work_queue_item_dequeue Unexecuted instantiation: zebra_evpn_mac.c:work_queue_item_dequeue Unexecuted instantiation: zebra_evpn_neigh.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mlag.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mlag_vty.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mpls.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mpls_netlink.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mpls_null.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mpls_vty.c:work_queue_item_dequeue Unexecuted instantiation: zebra_srv6.c:work_queue_item_dequeue Unexecuted instantiation: zebra_srv6_vty.c:work_queue_item_dequeue Unexecuted instantiation: zebra_mroute.c:work_queue_item_dequeue Unexecuted instantiation: zebra_nb.c:work_queue_item_dequeue Unexecuted instantiation: zebra_nb_config.c:work_queue_item_dequeue Unexecuted instantiation: zebra_nb_rpcs.c:work_queue_item_dequeue Unexecuted instantiation: zebra_nb_state.c:work_queue_item_dequeue Unexecuted instantiation: zebra_netns_id.c:work_queue_item_dequeue Unexecuted instantiation: zebra_netns_notify.c:work_queue_item_dequeue Unexecuted instantiation: zebra_nhg.c:work_queue_item_dequeue Unexecuted instantiation: zebra_ns.c:work_queue_item_dequeue Unexecuted instantiation: zebra_opaque.c:work_queue_item_dequeue Unexecuted instantiation: zebra_pbr.c:work_queue_item_dequeue Unexecuted instantiation: zebra_ptm.c:work_queue_item_dequeue Unexecuted instantiation: zebra_ptm_redistribute.c:work_queue_item_dequeue Unexecuted instantiation: zebra_pw.c:work_queue_item_dequeue Unexecuted instantiation: zebra_rib.c:work_queue_item_dequeue Unexecuted instantiation: zebra_router.c:work_queue_item_dequeue Unexecuted instantiation: zebra_rnh.c:work_queue_item_dequeue Unexecuted instantiation: zebra_routemap.c:work_queue_item_dequeue Unexecuted instantiation: zebra_script.c:work_queue_item_dequeue Unexecuted instantiation: zebra_srte.c:work_queue_item_dequeue Unexecuted instantiation: zebra_tc.c:work_queue_item_dequeue Unexecuted instantiation: zebra_vrf.c:work_queue_item_dequeue Unexecuted instantiation: zebra_vty.c:work_queue_item_dequeue Unexecuted instantiation: zebra_vxlan.c:work_queue_item_dequeue Unexecuted instantiation: zebra_vxlan_if.c:work_queue_item_dequeue Unexecuted instantiation: zebra_evpn_mh.c:work_queue_item_dequeue Unexecuted instantiation: zebra_neigh.c:work_queue_item_dequeue Unexecuted instantiation: zserv.c:work_queue_item_dequeue Unexecuted instantiation: debug_nl.c:work_queue_item_dequeue Unexecuted instantiation: bgp_fsm.c:work_queue_item_dequeue Unexecuted instantiation: bgp_labelpool.c:work_queue_item_dequeue Unexecuted instantiation: bgp_route.c:work_queue_item_dequeue Unexecuted instantiation: bgp_updgrp.c:work_queue_item_dequeue Unexecuted instantiation: bgp_updgrp_packet.c:work_queue_item_dequeue Unexecuted instantiation: bgpd.c:work_queue_item_dequeue Unexecuted instantiation: bgp_rfapi_cfg.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_import.c:work_queue_item_dequeue Unexecuted instantiation: rfapi.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_ap.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_encap_tlv.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_nve_addr.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_monitor.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_rib.c:work_queue_item_dequeue Unexecuted instantiation: rfapi_vty.c:work_queue_item_dequeue Unexecuted instantiation: vnc_export_bgp.c:work_queue_item_dequeue Unexecuted instantiation: vnc_export_table.c:work_queue_item_dequeue Unexecuted instantiation: vnc_import_bgp.c:work_queue_item_dequeue Unexecuted instantiation: vnc_zebra.c:work_queue_item_dequeue |
135 | | |
136 | | /* create a new work queue, of given name. |
137 | | * user must fill in the spec of the returned work queue before adding |
138 | | * anything to it |
139 | | */ |
140 | | extern struct work_queue *work_queue_new(struct event_loop *m, |
141 | | const char *queue_name); |
142 | | |
143 | | /* destroy work queue */ |
144 | | /* |
145 | | * The usage of work_queue_free is being transitioned to pass |
146 | | * in the double pointer to remove use after free's. |
147 | | */ |
148 | | extern void work_queue_free_and_null(struct work_queue **wqp); |
149 | | |
150 | | /* Add the supplied data as an item onto the workqueue */ |
151 | | extern void work_queue_add(struct work_queue *wq, void *item); |
152 | | |
153 | | /* plug the queue, ie prevent it from being drained / processed */ |
154 | | extern void work_queue_plug(struct work_queue *wq); |
155 | | /* unplug the queue, allow it to be drained again */ |
156 | | extern void work_queue_unplug(struct work_queue *wq); |
157 | | |
158 | | bool work_queue_is_scheduled(struct work_queue *wq); |
159 | | |
160 | | /* Helpers, exported for thread.c and command.c */ |
161 | | extern void work_queue_run(struct event *thread); |
162 | | |
163 | | extern void workqueue_cmd_init(void); |
164 | | |
165 | | #ifdef __cplusplus |
166 | | } |
167 | | #endif |
168 | | |
169 | | #endif /* _QUAGGA_WORK_QUEUE_H */ |