FreeBSD kernel CXGBE device code
t4_sched.c File Reference
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ratelimit.h"
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/sbuf.h>
#include <sys/taskqueue.h>
#include <sys/sysctl.h>
#include "common/common.h"
#include "common/t4_regs.h"
#include "common/t4_regs_values.h"
#include "common/t4_msg.h"
Include dependency graph for t4_sched.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
static int in_range (int val, int lo, int hi)
 
static int set_sched_class_config (struct adapter *sc, int minmax)
 
static int set_sched_class_params (struct adapter *sc, struct t4_sched_class_params *p, int sleep_ok)
 
static void update_tx_sched (void *context, int pending)
 
int t4_set_sched_class (struct adapter *sc, struct t4_sched_params *p)
 
static int bind_txq_to_traffic_class (struct adapter *sc, struct sge_txq *txq, int idx)
 
int t4_set_sched_queue (struct adapter *sc, struct t4_sched_queue *p)
 
int t4_init_tx_sched (struct adapter *sc)
 
int t4_free_tx_sched (struct adapter *sc)
 
void t4_update_tx_sched (struct adapter *sc)
 
int t4_reserve_cl_rl_kbps (struct adapter *sc, int port_id, u_int maxrate, int *tc_idx)
 
void t4_release_cl_rl (struct adapter *sc, int port_id, int tc_idx)
 
int sysctl_tc (SYSCTL_HANDLER_ARGS)
 
int sysctl_tc_params (SYSCTL_HANDLER_ARGS)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ bind_txq_to_traffic_class()

◆ in_range()

static int in_range ( int  val,
int  lo,
int  hi 
)
static

Definition at line 48 of file t4_sched.c.

Referenced by set_sched_class_params(), sysctl_tc(), and t4_set_sched_queue().

Here is the caller graph for this function:

◆ set_sched_class_config()

static int set_sched_class_config ( struct adapter sc,
int  minmax 
)
static

Definition at line 55 of file t4_sched.c.

References begin_synchronized_op(), end_synchronized_op(), FW_SCHED_TYPE_PKTSCHED, hw_off_limits(), INTR_OK, SLEEP_OK, and t4_sched_config().

Referenced by t4_set_sched_class().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_sched_class_params()

static int set_sched_class_params ( struct adapter sc,
struct t4_sched_class_params p,
int  sleep_ok 
)
static

Definition at line 75 of file t4_sched.c.

References begin_synchronized_op(), CF_USER, CH_ERR, adapter::chan_map, t4_sched_class_params::channel, adapter::chip_params, t4_sched_class_params::cl, tx_sched_params::cl_rl, CS_HW_CONFIGURED, CS_HW_UPDATE_IN_PROGRESS, CS_UNINITIALIZED, end_synchronized_op(), tx_cl_rl_params::flags, FW_SCHED_PARAMS_LEVEL_CH_RL, FW_SCHED_PARAMS_LEVEL_CL_RL, FW_SCHED_PARAMS_LEVEL_CL_WRR, FW_SCHED_PARAMS_MODE_CLASS, FW_SCHED_PARAMS_MODE_FLOW, FW_SCHED_PARAMS_RATE_ABS, FW_SCHED_PARAMS_RATE_REL, FW_SCHED_PARAMS_UNIT_BITRATE, FW_SCHED_PARAMS_UNIT_PKTRATE, FW_SCHED_TYPE_PKTSCHED, HOLD_LOCK, hw_off_limits(), vi_info::ifp, in_range(), INTR_OK, t4_sched_class_params::level, LOCK_HELD, tx_cl_rl_params::maxrate, t4_sched_class_params::maxrate, t4_sched_class_params::minrate, tx_cl_rl_params::mode, t4_sched_class_params::mode, chip_params::nchan, adapter_params::nsched_cls, adapter::params, tx_cl_rl_params::pktsize, t4_sched_class_params::pktsize, adapter::port, port_top_speed(), tx_cl_rl_params::ratemode, t4_sched_class_params::ratemode, tx_cl_rl_params::rateunit, t4_sched_class_params::rateunit, tx_cl_rl_params::refcount, SCHED_CLASS_LEVEL_CH_RL, SCHED_CLASS_LEVEL_CL_RL, SCHED_CLASS_LEVEL_CL_WRR, SCHED_CLASS_MODE_CLASS, SCHED_CLASS_MODE_FLOW, SCHED_CLASS_RATEMODE_ABS, SCHED_CLASS_RATEMODE_REL, SCHED_CLASS_RATEUNIT_BITS, SCHED_CLASS_RATEUNIT_PKTS, port_info::sched_params, SLEEP_OK, tx_cl_rl_params::state, t4_sched_params(), adapter::tc_lock, port_info::tx_chan, port_info::vi, and t4_sched_class_params::weight.

Referenced by t4_set_sched_class().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_tc()

int sysctl_tc ( SYSCTL_HANDLER_ARGS  )

Definition at line 592 of file t4_sched.c.

References vi_info::adapter, bind_txq_to_traffic_class(), vi_info::first_txq, adapter::flags, in_range(), IS_VF, adapter_params::nsched_cls, vi_info::ntxq, adapter::params, adapter::sge, tc_idx, sge_txq::tc_idx, and sge::txq.

Referenced by add_txq_sysctls().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_tc_params()

◆ t4_free_tx_sched()

int t4_free_tx_sched ( struct adapter sc)

Definition at line 472 of file t4_sched.c.

References for_each_port, adapter::port, port_info::sched_params, adapter::tc_lock, and adapter::tc_task.

Referenced by t4_detach_common().

Here is the caller graph for this function:

◆ t4_init_tx_sched()

int t4_init_tx_sched ( struct adapter sc)

Definition at line 454 of file t4_sched.c.

References for_each_port, adapter_params::nsched_cls, adapter::params, adapter::port, port_info::sched_params, adapter::tc_lock, adapter::tc_task, and update_tx_sched().

Referenced by t4_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ t4_release_cl_rl()

void t4_release_cl_rl ( struct adapter sc,
int  port_id,
int  tc_idx 
)

◆ t4_reserve_cl_rl_kbps()

◆ t4_set_sched_class()

int t4_set_sched_class ( struct adapter sc,
struct t4_sched_params p 
)

◆ t4_set_sched_queue()

int t4_set_sched_queue ( struct adapter sc,
struct t4_sched_queue p 
)

◆ t4_update_tx_sched()

void t4_update_tx_sched ( struct adapter sc)

Definition at line 490 of file t4_sched.c.

References adapter::tc_task.

Referenced by t4_reserve_cl_rl_kbps().

Here is the caller graph for this function:

◆ update_tx_sched()