iPXE
|
Retry timers. More...
#include <stddef.h>
#include <ipxe/timer.h>
#include <ipxe/list.h>
#include <ipxe/process.h>
#include <ipxe/init.h>
#include <ipxe/retry.h>
Go to the source code of this file.
Macros | |
#define | MIN_TIMEOUT 7 |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static | LIST_HEAD (timers) |
List of running timers. More... | |
void | start_timer_fixed (struct retry_timer *timer, unsigned long timeout) |
Start timer with a specified timeout. More... | |
void | start_timer (struct retry_timer *timer) |
Start timer. More... | |
void | stop_timer (struct retry_timer *timer) |
Stop timer. More... | |
static void | timer_expired (struct retry_timer *timer) |
Handle expired timer. More... | |
void | retry_poll (void) |
Poll the retry timer list. More... | |
static void | retry_step (struct process *process __unused) |
Single-step the retry timer list. More... | |
PERMANENT_PROCESS (retry_process, retry_step) | |
Retry timer process. More... | |
Retry timers.
A retry timer is a binary exponential backoff timer. It can be used to build automatic retransmission into network protocols.
This implementation of the timer is designed to satisfy RFC 2988 and therefore be usable as a TCP retransmission timer.
Definition in file retry.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
List of running timers.
void start_timer_fixed | ( | struct retry_timer * | timer, |
unsigned long | timeout | ||
) |
Start timer with a specified timeout.
timer | Retry timer |
timeout | Timeout, in ticks |
This starts the timer running with the specified timeout value. If stop_timer() is not called before the timer expires, the timer will be stopped and the timer's callback function will be called.
Definition at line 64 of file retry.c.
References currticks(), DBGC2, list_add, ref_get, and timeout().
Referenced by dhcp_defer(), eapol_eap_rx(), eapol_expired(), efi_watchdog_expired(), exanic_expired(), exanic_open(), fc_link_err(), fc_link_expired(), fc_xchg_rx(), fc_xchg_tx(), fcoe_expired(), fragment_reassemble(), gve_open(), gve_watchdog(), http_transfer_complete(), ipair_rx_pair_error(), iphone_expired(), ipv6conf_expired(), netdev_link_block(), peerblk_open(), peerblk_raw_open(), peerblk_raw_rx(), peerblk_retrieval_open(), peerblk_retrieval_rx(), peerdisc_expired(), pinger_expired(), pool_add(), sandev_command(), slam_mc_socket_deliver(), slam_open(), start_timer(), start_timer_nodelay(), tcp_keepalive_expired(), tcp_rx(), tcp_rx_ack(), xcm_keepalive(), xcm_reopen(), xsigo_discover(), xsigo_ib_open(), and xsigo_xcm_complete().
void start_timer | ( | struct retry_timer * | timer | ) |
Start timer.
timer | Retry timer |
This starts the timer running with the current timeout value (rounded up to the minimum timeout value). If stop_timer() is not called before the timer expires, the timer will be stopped and the timer's callback function will be called.
Definition at line 93 of file retry.c.
References DEFAULT_MIN_TIMEOUT, min, MIN_TIMEOUT, start_timer_fixed(), and timeout().
Referenced by aoecmd_tx(), dhcp_tx(), dhcpv6_timer_expired(), dns_send_packet(), ib_mi_timer_expired(), ipv6conf_expired(), neighbour_expired(), ntp_expired(), slam_master_timer_expired(), slam_slave_timer_expired(), slam_socket_deliver(), tcp_xmit_sack(), tftp_send_packet(), xcm_close(), and xcm_reopen().
void stop_timer | ( | struct retry_timer * | timer | ) |
Stop timer.
timer | Retry timer |
This stops the timer and updates the timer's timeout value.
Definition at line 117 of file retry.c.
References currticks(), DBGC, DBGC2, list_del, and ref_put.
Referenced by aoecmd_close(), dhcp_finished(), dhcp_set_state(), dhcpv6_finished(), dns_done(), dns_xfer_deliver(), eapol_eap_rx(), eapol_notify(), efi_watchdog_stop(), exanic_close(), fc_link_stop(), fc_link_up(), fc_xchg_close(), fcoe_close(), fcoe_expired(), fcoe_reset(), fragment_reassemble(), gve_close(), http_close(), ib_destroy_madx(), ipair_close(), iphone_close(), ipv6conf_done(), ipv6conf_rx_router_advertisement(), neighbour_destroy(), neighbour_discovered(), netdev_close(), netdev_link_err(), netdev_link_unblock(), ntp_close(), peerblk_reset(), peerblk_retrieval_close(), peerdisc_destroy(), pinger_close(), pool_del(), sandev_command_close(), slam_finished(), slam_mc_socket_deliver(), slam_socket_deliver(), tcp_close(), tcp_rx(), tcp_rx_ack(), tftp_done(), tftp_send_packet(), xcm_close(), xcm_destroy(), xcm_reopen(), xsigo_ib_notify(), and xsigo_ib_remove().
|
static |
Handle expired timer.
timer | Retry timer |
Definition at line 166 of file retry.c.
References assert(), currticks(), DBGC, DBGC2, DEFAULT_MAX_TIMEOUT, list_del, max, and ref_put.
Referenced by retry_poll().
void retry_poll | ( | void | ) |
Poll the retry timer list.
Definition at line 197 of file retry.c.
References currticks(), retry_timer::list, list_for_each_entry, timer, and timer_expired().
Referenced by eoib_poll(), ipoib_poll(), and retry_step().
Single-step the retry timer list.
process | Retry timer process |
Definition at line 221 of file retry.c.
References retry_poll().
PERMANENT_PROCESS | ( | retry_process | , |
retry_step | |||
) |
Retry timer process.