Tor  0.4.6.0-alpha-dev
Macros | Functions | Variables
scheduler_kist.c File Reference

Implements the KIST cell scheduler. More...

#include "core/or/or.h"
#include "lib/buf/buffers.h"
#include "app/config/config.h"
#include "core/mainloop/connection.h"
#include "feature/nodelist/networkstatus.h"
#include "core/or/channel.h"
#include "core/or/channeltls.h"
#include "core/or/scheduler.h"
#include "lib/math/fp.h"
#include "core/or/or_connection_st.h"

Go to the source code of this file.

Functions

static uint32_t socket_table_ent_hash (const socket_table_ent_t *ent)
 
static unsigned socket_table_ent_eq (const socket_table_ent_t *a, const socket_table_ent_t *b)
 
typedef HT_HEAD (HT_PROTOTYPE(socket_table_s, HT_PROTOTYPE(socket_table_ent_t)
 
static uint32_t outbuf_table_ent_hash (const outbuf_table_ent_t *ent)
 
static unsigned outbuf_table_ent_eq (const outbuf_table_ent_t *a, const outbuf_table_ent_t *b)
 
 HT_PROTOTYPE (outbuf_table_s, outbuf_table_ent_t, node, outbuf_table_ent_hash, outbuf_table_ent_eq)
 
 HT_GENERATE2 (outbuf_table_s, outbuf_table_ent_t, node, outbuf_table_ent_hash, outbuf_table_ent_eq, 0.6, tor_reallocarray, tor_free_)
 
static size_t channel_outbuf_length (channel_t *chan)
 
static int each_channel_write_to_kernel (outbuf_table_ent_t *ent, void *data)
 
static int free_outbuf_info_by_ent (outbuf_table_ent_t *ent, void *data)
 
static int free_socket_info_by_ent (socket_table_ent_t *ent, void *data)
 
static void free_all_socket_info (void)
 
static socket_table_ent_t * socket_table_search (socket_table_t *table, const channel_t *chan)
 
static void free_socket_info_by_chan (socket_table_t *table, const channel_t *chan)
 
void update_socket_info_impl (socket_table_ent_t *ent)
 
static void init_socket_info (socket_table_t *table, const channel_t *chan)
 
static void outbuf_table_add (outbuf_table_t *table, channel_t *chan)
 
static void outbuf_table_remove (outbuf_table_t *table, channel_t *chan)
 
static void set_scheduler_run_interval (void)
 
static int socket_can_write (socket_table_t *table, const channel_t *chan)
 
static void update_socket_info (socket_table_t *table, const channel_t *chan)
 
static void update_socket_written (socket_table_t *table, channel_t *chan, size_t bytes)
 
int channel_should_write_to_kernel (outbuf_table_t *table, channel_t *chan)
 
void channel_write_to_kernel (channel_t *chan)
 
static int have_work (void)
 
static void kist_free_all (void)
 
static void kist_on_channel_free_fn (const channel_t *chan)
 
static void kist_scheduler_on_new_consensus (void)
 
static void kist_scheduler_on_new_options (void)
 
static void kist_scheduler_init (void)
 
static void kist_scheduler_schedule (void)
 
static void kist_scheduler_run (void)
 
scheduler_tget_kist_scheduler (void)
 
int kist_scheduler_run_interval (void)
 
void scheduler_kist_set_lite_mode (void)
 
void scheduler_kist_set_full_mode (void)
 
int scheduler_can_use_kist (void)
 

Variables

 outbuf_table_ent_t
 
static monotime_t scheduler_last_run
 
static double sock_buf_size_factor = 1.0
 
STATIC int sched_run_interval = KIST_SCHED_RUN_INTERVAL_DEFAULT
 
static unsigned int kist_lite_mode = 1
 
static scheduler_t kist_scheduler
 

Detailed Description

Implements the KIST cell scheduler.

Definition in file scheduler_kist.c.

Variable Documentation

◆ kist_scheduler

scheduler_t kist_scheduler
static
Initial value:
= {
.type = SCHEDULER_KIST,
.free_all = kist_free_all,
.on_channel_free = kist_on_channel_free_fn,
.init = kist_scheduler_init,
.on_new_consensus = kist_scheduler_on_new_consensus,
.schedule = kist_scheduler_schedule,
.run = kist_scheduler_run,
.on_new_options = kist_scheduler_on_new_options,
}

Definition at line 764 of file scheduler_kist.c.