C H A P T E R 7 |
Fastpath Manager API |
This chapter describes the Fastpath Manager API. Topics include:
The Fastpath Manager API provides a means to register tasks that must be run periodically. For example, the user can use this API to check whether a link is up or to perform other health checks. The Fastpath Manager is included as part of the command-line interface (cli) library. The user can find the header file declaring the API (lwrte_fastpath_mgr.h) in the include directory for that library.
The Fastpath Manager is run on a dedicated thread, and in a logical domain environment usually polls the IPC channels, in particular the global control channel. The granularity of the interval length for checking tasks that can be registered with the framework is one millisecond. However, the user must be aware that there is no pre-emption, so the actual granularity depends on the length and number of tasks that are registered.
Initialization for the Fastpath Manager framework. This function must be called in the init routine of applications to use the framework.
Implements the periodic execution of scheduled tasks. This function must run on its own strand.
void fastpath_mgr_process(boolean_t poll_ipc)
poll_ipc - Indication whether the IPC channels are polled in this thread.
This interface is used to register functions that periodically check for a condition.
fastpath_mgr_register_event_handler(status_check_ft check_fun,
event_cb_ft event_cb, void *args,
int interval);
check_fun - Function that performs check. Must return 0 if the check passed.
event_cb - Optional handler for events. If present, this function is called when the check_fun returns a value other than 0. That value is passed to the event_cb to identify the event.
args - Argument passed to checking and callback functions.
interval - Frequency of call to check_fun (in milliseconds).
Handle in case of success. This handle is needed to unregister the task.
Unregisters functions from the Fastpath Manager.
Note - This function may be called by the event callback registered through fastpath_mgr_register_event_handler(), but must not be called by the checking function registered in that call. |
int fastpath_mgr_unregister_event_handler(fastpath_mgr_handle_t hdl)
hdl - Handle obtained from fastpath_mgr_register_event_handler().
Runs all check functions whose interval have expired. This function is an alternative entry point into the Fastpath Manager that checks whether there are any registered functions that should be run at the time of the call. If this entry point is used, the user must make ensure that this function is run with a sufficient frequency.
void fastpath_mgr_check(boolean_t poll_ipc)
poll_ipc - Indication whether ipc_poll() is called in the function.
Copyright © 2010, Oracle and/or its affiliates. All rights reserved.