Mediates bandwidth requests made to the QoS Resource Reservation Kernel Module, enforcing system-level security policy and QoS behaviour configured through the use of level, group and user rules. More...
Data Structures | |
struct | qsup_level_rule_t |
Level rule: applies to all servers within level. More... | |
struct | qsup_group_rule_t |
Group rule: applies to all users in the group. More... | |
struct | qsup_user_rule_t |
User rule: applies to one user only. More... | |
struct | qsup_server_t |
QoS Sup related data for each server. More... | |
Files | |
file | qsup.h |
QoS Supervisor kernel-interface. | |
file | qsup_gw.h |
Common defines and structures for the US to KS gateway. | |
file | qsup_gw_ks.h |
QSUP UserSpace to KernelSpace gateway common interface. | |
Defines | |
#define | QSUP_DEFAULT_SRV_UID 0 |
UID of the user authorized to create the default server. | |
#define | QSUP_DEFAULT_SRV_GID 0 |
GID of the group authorized to create the default server. | |
Typedefs | |
typedef struct qsup_level_rule_t | qsup_level_rule_t |
Level rule: applies to all servers within level. | |
typedef struct qsup_group_rule_t | qsup_group_rule_t |
Group rule: applies to all users in the group. | |
typedef struct qsup_user_rule_t | qsup_user_rule_t |
User rule: applies to one user only. | |
typedef struct qsup_server_t | qsup_server_t |
QoS Sup related data for each server. | |
Functions | |
qos_rv | qsup_init (void) |
Initialize the QSUP subsystem just after module load into the kernel. | |
qos_rv | qsup_cleanup (void) |
Cleanup the QSUP subsystem before unloading the module from kernel. | |
qos_rv | qsup_add_level_rule (int level, qos_bw_t max_bw) |
Add a level rule to the QSUP. | |
qos_rv | qsup_add_group_constraints (int gid, qsup_constraints_t *constr) |
Add a group rule to the QSUP. | |
qos_rv | qsup_add_user_constraints (int uid, qsup_constraints_t *constr) |
Add a user rule to the QSUP. | |
qos_rv | qsup_create_server (qsup_server_t **p_srv, int uid, int gid, qres_params_t *param) |
Create a new qsup_server_t structure. | |
qos_rv | qsup_init_server (qsup_server_t *srv, int uid, int gid, qres_params_t *param) |
Initialize a new qsup_server_t structure. | |
qos_rv | qsup_destroy_server (qsup_server_t *srv) |
Destroy a qsup_server_t and free associated resources. | |
qos_rv | qsup_cleanup_server (qsup_server_t *srv) |
qos_rv | qsup_set_required_bw (qsup_server_t *srv, qos_bw_t server_req) |
Sets the required bandwidth for the specified server. | |
qos_bw_t | qsup_get_required_bw (qsup_server_t *srv) |
Gets the required bandwidth for the specified server. | |
qos_bw_t | qsup_get_guaranteed_bw (qsup_server_t *srv) |
Gets the minimum granted bandwidth for the specified server. | |
qos_bw_t | qsup_get_approved_bw (qsup_server_t *srv) |
Returns the bandwidth approved for the specified server. | |
qos_bw_t | qsup_get_max_gua_bw (int uid, int gid) |
Returns the maximum guaranteed bandwidth for the specified user. | |
qos_rv | qsup_get_avail_gua_bw (int uid, int gid, qos_bw_t *p_avail_bw) |
Returns in *p_avail_bw the available guaranteed bw for the specified user. | |
qos_rv | qsup_get_avail_bw (int uid, int gid, qos_bw_t *p_avail_bw) |
Returns in *p_avail_bw the available bw for the specified user. | |
void | qsup_dump (void) |
Dumps into the log system the QSUP server complete state. | |
qsup_constraints_t * | qsup_find_constr (int uid, int gid) |
Find the constraints in force for the supplied uid/gid pair. | |
qos_rv | qsup_reserve_spare (qos_bw_t spare_bw) |
Set the spare bandwidth for admission control purposes. | |
static int | qsup_authorize_op (qsup_iparams_t *iparams) |
Check authorizations for requested operation. | |
qos_rv | qsup_gw_ks (qsup_op_t op, void __user *up_iparams, unsigned long size) |
Main US-to-KS gateway function. | |
qos_rv | qsup_init_ks (void) |
Initialize QSUP. | |
qos_rv | qsup_cleanup_ks (void) |
Cleanup QSUP module. | |
qos_rv | qsup_init_default_server (qsup_server_t *default_qsup, qres_time_t Q, qres_time_t Q_min, qres_time_t P) |
Initialize the QSUP default server. |
Mediates bandwidth requests made to the QoS Resource Reservation Kernel Module, enforcing system-level security policy and QoS behaviour configured through the use of level, group and user rules.
Such rules may be configured through the use of the QoS Supervisor Library interface.
#define QSUP_DEFAULT_SRV_GID 0 |
GID of the group authorized to create the default server.
Definition at line 22 of file qsup_gw_ks.h.
Referenced by qos_func_define().
#define QSUP_DEFAULT_SRV_UID 0 |
UID of the user authorized to create the default server.
Definition at line 20 of file qsup_gw_ks.h.
Referenced by qos_func_define().
typedef struct qsup_group_rule_t qsup_group_rule_t |
Group rule: applies to all users in the group.
typedef struct qsup_level_rule_t qsup_level_rule_t |
Level rule: applies to all servers within level.
typedef struct qsup_server_t qsup_server_t |
QoS Sup related data for each server.
typedef struct qsup_user_rule_t qsup_user_rule_t |
User rule: applies to one user only.
qos_rv qsup_add_group_constraints | ( | int | gid, | |
qsup_constraints_t * | constr | |||
) |
Add a group rule to the QSUP.
Definition at line 139 of file qsup.c.
References qsup_group_rule_t::constr, qsup_group_rule_t::gid, qsup_group_rule_t::next, num_group_rules, qos_create, QOS_E_NO_MEMORY, and QOS_OK.
Referenced by main(), and qsup_gw_ks().
qos_rv qsup_add_user_constraints | ( | int | uid, | |
qsup_constraints_t * | constr | |||
) |
Add a user rule to the QSUP.
Definition at line 153 of file qsup.c.
References qsup_user_rule_t::constr, qsup_user_rule_t::next, num_user_rules, QOS_E_NO_MEMORY, qos_malloc(), QOS_OK, and qsup_user_rule_t::uid.
Referenced by main().
static int qsup_authorize_op | ( | qsup_iparams_t * | iparams | ) | [inline, static] |
Check authorizations for requested operation.
Operations on QSUP rules may only be done by root.
iparams | Ptr to the iparams struct, in kernel-space. |
Definition at line 32 of file qsup_gw_ks.h.
References kal_get_current_uid().
Referenced by qsup_gw_ks().
qos_rv qsup_cleanup | ( | void | ) |
qos_rv qsup_cleanup_ks | ( | void | ) |
qos_rv qsup_cleanup_server | ( | qsup_server_t * | srv | ) |
Definition at line 405 of file qsup.c.
References qsup_server_t::gua_bw, qsup_server_t::next, prof_end, prof_func, prof_return, prof_vars, QOS_E_INCONSISTENT_STATE, QOS_E_INVALID_PARAM, QOS_OK, qsup_set_required_bw(), qsup_server_t::req_bw, and tot_gua_bw.
Referenced by qos_func_define(), and qsup_destroy_server().
qos_rv qsup_create_server | ( | qsup_server_t ** | p_srv, | |
int | uid, | |||
int | gid, | |||
qres_params_t * | param | |||
) |
Create a new qsup_server_t structure.
Definition at line 389 of file qsup.c.
References qos_create, QOS_E_NO_MEMORY, qos_free(), qos_log_err, QOS_OK, qos_strerror(), and qsup_init_server().
Referenced by main().
qos_rv qsup_destroy_server | ( | qsup_server_t * | srv | ) |
Destroy a qsup_server_t and free associated resources.
Definition at line 440 of file qsup.c.
References qos_free(), and qsup_cleanup_server().
Referenced by main().
void qsup_dump | ( | void | ) |
Dumps into the log system the QSUP server complete state.
Definition at line 554 of file qsup.c.
References bw2Q(), coeff_apply, qsup_server_t::level, MAX_NUM_LEVELS, qsup_server_t::next, qsup_user_t::next, qos_log_debug, QRES_TIME_FMT, qsup_get_approved_bw(), qsup_server_t::req_bw, qsup_server_t::server_id, srv, qsup_user_t::uid, and qsup_user_t::user_coeff.
Referenced by main(), and rres_read_qsup().
qsup_constraints_t* qsup_find_constr | ( | int | uid, | |
int | gid | |||
) |
Find the constraints in force for the supplied uid/gid pair.
Definition at line 226 of file qsup.c.
References qsup_group_rule_t::constr, qsup_user_rule_t::constr, qsup_group_rule_t::gid, qsup_group_rule_t::next, qsup_user_rule_t::next, and qsup_user_rule_t::uid.
Referenced by qsup_get_avail_bw(), qsup_get_avail_gua_bw(), qsup_get_max_gua_bw(), qsup_gw_ks(), and qsup_init_server().
qos_bw_t qsup_get_approved_bw | ( | qsup_server_t * | srv | ) |
Returns the bandwidth approved for the specified server.
Definition at line 577 of file qsup.c.
References coeff_apply, qsup_server_t::p_level_coeff, qsup_server_t::p_user_coeff, prof_func, prof_return, prof_vars, qsup_server_t::req_bw, and qsup_server_t::used_gua_bw.
Referenced by _qres_get_bandwidth(), main(), qos_func_define(), and qsup_dump().
Returns in *p_avail_bw the available bw for the specified user.
Definition at line 303 of file qsup.c.
References get_user_info(), qsup_constraints_t::max_bw, qos_chk_go_msg, QOS_OK, qsup_find_constr(), and qsup_user_t::user_req.
Returns in *p_avail_bw the available guaranteed bw for the specified user.
Definition at line 288 of file qsup.c.
References get_user_info(), qsup_constraints_t::max_min_bw, qos_chk_go_msg, QOS_OK, qsup_find_constr(), and qsup_user_t::user_gua.
Referenced by qsup_gw_ks().
qos_bw_t qsup_get_guaranteed_bw | ( | qsup_server_t * | srv | ) |
Gets the minimum granted bandwidth for the specified server.
Definition at line 550 of file qsup.c.
References qsup_server_t::gua_bw.
qos_bw_t qsup_get_max_gua_bw | ( | int | uid, | |
int | gid | |||
) |
Returns the maximum guaranteed bandwidth for the specified user.
Definition at line 282 of file qsup.c.
References qsup_constraints_t::max_min_bw, and qsup_find_constr().
qos_bw_t qsup_get_required_bw | ( | qsup_server_t * | srv | ) |
Gets the required bandwidth for the specified server.
Definition at line 546 of file qsup.c.
References qsup_server_t::req_bw.
Main US-to-KS gateway function.
Copies parameters from US to KS, checks if requested operation is allowed by the calling process, distinguishes among various kinds of requests, calling appropriate per-request functions. If needed, copies return parameters back from KS to US.
Copies parameters from US to KS, checks if requested operation is allowed by the calling process, distinguishes among various kinds of requests, calling appropriate per-request functions. If needed, copies return parameters back from KS to US.
Definition at line 48 of file qsup_gw_ks.c.
References qsup_iparams_t::avail, qsup_iparams_t::found_rule, qsup_iparams_t::group_rule, qsup_iparams_t::level_rule, QOS_E_INTERNAL_ERROR, QOS_E_INVALID_PARAM, QOS_E_UNAUTHORIZED, qos_log_debug, qos_log_err, QOS_OK, qsup_add_group_constraints(), qsup_add_level_rule(), qsup_authorize_op(), qsup_find_constr(), qsup_get_avail_gua_bw(), QSUP_OP_ADD_GROUP_RULE, QSUP_OP_ADD_LEVEL_RULE, QSUP_OP_ADD_USER_RULE, QSUP_OP_FIND_CONSTR, QSUP_OP_GET_AVAIL_GUA_BW, QSUP_OP_RESERVE_SPARE, qsup_reserve_spare(), rres_get_spinlock(), qsup_iparams_t::spare_bw, qsup_iparams_t::u, and qsup_iparams_t::user_rule.
Referenced by qsup_device_ioctl().
qos_rv qsup_init | ( | void | ) |
qos_rv qsup_init_default_server | ( | qsup_server_t * | default_qsup, | |
qres_time_t | Q, | |||
qres_time_t | Q_min, | |||
qres_time_t | P | |||
) |
Initialize the QSUP default server.
qos_rv qsup_init_ks | ( | void | ) |
Initialize QSUP.
Definition at line 25 of file qsup_gw_ks.c.
References qos_chk_ok_ret, qos_log_debug, QOS_OK, and qsup_init().
Referenced by qres_init_module(), and qsup_init_module().
qos_rv qsup_init_server | ( | qsup_server_t * | srv, | |
int | uid, | |||
int | gid, | |||
qres_params_t * | param | |||
) |
Initialize a new qsup_server_t structure.
< Guaranteed minimum not used yet
Update sum of guaranteed bw to all servers
Definition at line 319 of file qsup.c.
References qres_params_t::flags, qsup_constraints_t::flags_mask, get_user_info(), qsup_server_t::gid, qsup_server_t::gua_bw, qsup_constraints_t::level, qsup_server_t::level, qsup_level_t::level_coeff, qsup_level_t::level_gua, qsup_level_t::level_max, qsup_level_t::level_req, qsup_level_t::level_sum, qsup_constraints_t::max_bw, qsup_server_t::max_level_bw, qsup_constraints_t::max_min_bw, qsup_server_t::max_user_bw, qsup_server_t::next, next_server_id, qres_params_t::P, qsup_server_t::p_level_coeff, qsup_server_t::p_level_gua, qsup_server_t::p_level_req, qsup_server_t::p_level_sum, qsup_server_t::p_user_coeff, qsup_server_t::p_user_gua, qsup_server_t::p_user_req, qres_params_t::Q_min, qos_chk_ok_ret, QOS_E_SYSTEM_OVERLOAD, QOS_E_UNAUTHORIZED, qos_log_debug, qos_log_err, QOS_OK, qsup_find_constr(), r2bw_ceil(), qsup_server_t::req_bw, qsup_server_t::server_id, spare_bw, tot_gua_bw, U_LUB, qsup_server_t::uid, qsup_server_t::used_gua_bw, qsup_user_t::user_coeff, qsup_user_t::user_gua, qsup_user_t::user_req, qsup_user_t::user_used_gua, qsup_constraints_t::weight, and qsup_server_t::weight.
Referenced by qos_func_define(), and qsup_create_server().
qos_rv qsup_set_required_bw | ( | qsup_server_t * | srv, | |
qos_bw_t | server_req | |||
) |
Sets the required bandwidth for the specified server.
Definition at line 447 of file qsup.c.
References bw_min(), coeff_compute, qsup_server_t::gua_bw, qsup_level_t::level_coeff, qsup_level_t::level_gua, qsup_level_t::level_max, qsup_level_t::level_req, qsup_level_t::level_sum, MAX_NUM_LEVELS, qsup_server_t::max_user_bw, qsup_server_t::p_level_gua, qsup_server_t::p_level_req, qsup_server_t::p_user_coeff, qsup_server_t::p_user_gua, qsup_server_t::p_user_req, prof_end, prof_func, prof_vars, QOS_BW_FMT, qos_log_debug, QOS_OK, QSUP_COEFF_ONE, qsup_server_t::req_bw, qsup_server_t::server_id, tot_used_gua_bw, U_LUB, and qsup_server_t::used_gua_bw.
Referenced by main(), qos_func_define(), and qsup_cleanup_server().