Go to the source code of this file.
Data Structures | |
| struct | tok_t |
| Declare token object. More... | |
| struct | tokarray_t |
| Declare token array object. More... | |
| struct | tokmatch_t |
| Declare token match structure. More... | |
Macros | |
| #define | HAL_QTOP_DEBUG 0 |
| #define | TOKEN_LEN 32 |
| #define | P(x) case x: return #x; |
| #define | P(x) case x: return #x; |
Enumerations | |
| enum | tok_type_e { TOK_LPAREN = 1, TOK_RPAREN, TOK_COLON, TOK_EQUALS, TOK_QUEUE, TOK_ATTR_NAME, TOK_NUMBER, TOK_NUMBER_VALUE, TOK_NUMBER_LIST } |
| return string given a QTOP entry More... | |
| enum | tok_subtype_e { TOK_SUB_EQ = 100, TOK_SUB_CQ, TOK_SUB_RQ, TOK_SUB_MQ, TOK_SUB_WQ, TOK_SUB_LEN, TOK_SUB_CLASS, TOK_SUB_ULP, TOK_SUB_FILTER, TOK_SUB_RQ_POLICY, TOK_SUB_NVMEQ } |
| Declare token sub-types. More... | |
Functions | |
| ocs_hal_rtn_e | ocs_hal_init_queues (ocs_hal_t *hal, ocs_hal_qtop_t *qtop) |
| Initialize queues. More... | |
| hal_eq_t * | hal_new_eq (ocs_hal_t *hal, uint32_t entry_count) |
| Allocate a new EQ object. More... | |
| hal_cq_t * | hal_new_cq (hal_eq_t *eq, uint32_t entry_count) |
| Allocate a new CQ object. More... | |
| uint32_t | hal_new_cq_set (hal_eq_t *eqs[], hal_cq_t *cqs[], uint32_t num_cqs, uint32_t entry_count) |
| Allocate a new CQ Set of objects. More... | |
| hal_mq_t * | hal_new_mq (hal_cq_t *cq, uint32_t entry_count) |
| Allocate a new MQ object. More... | |
| hal_wq_t * | hal_new_wq (hal_cq_t *cq, uint32_t entry_count, uint32_t class, uint32_t ulp) |
| Allocate a new WQ object. More... | |
| hal_rq_t * | hal_new_rq (hal_cq_t *cq, uint32_t entry_count, uint32_t ulp) |
| Allocate a hal_rq_t object. More... | |
| uint32_t | hal_new_rq_set (hal_cq_t *cqs[], hal_rq_t *rqs[], uint32_t num_rq_pairs, uint32_t entry_count, uint32_t ulp) |
| Allocate a hal_rq_t object SET. More... | |
| void | hal_del_eq (hal_eq_t *eq) |
| Free an EQ object. More... | |
| void | hal_del_cq (hal_cq_t *cq) |
| Free a CQ object. More... | |
| void | hal_del_mq (hal_mq_t *mq) |
| Free a MQ object. More... | |
| void | hal_del_wq (hal_wq_t *wq) |
| Free a WQ object. More... | |
| void | hal_del_rq (hal_rq_t *rq) |
| Free an RQ object. More... | |
| void | hal_queue_dump (ocs_hal_t *hal) |
| Display HAL queue objects. More... | |
| void | hal_queue_teardown (ocs_hal_t *hal) |
| Teardown HAL queue objects. More... | |
| hal_wq_t * | ocs_hal_queue_next_wq (ocs_hal_t *hal, ocs_hal_io_t *io) |
| Allocate a WQ to an IO object. More... | |
| uint32_t | ocs_hal_qtop_eq_count (ocs_hal_t *hal) |
| Return count of EQs for a queue topology object. More... | |
| static ocs_hal_qtop_entry_e | subtype2qtop (tok_subtype_e q) |
| convert queue subtype to QTOP entry More... | |
| static int32_t | idstart (int c) |
| test if character is ID start character More... | |
| static int32_t | idchar (int c) |
| test if character is an ID character More... | |
| static const char * | tokenize (const char *s, tok_t *tok) |
| Scan string and return next token. More... | |
| static const char * | token_type2s (tok_type_e type) |
| convert token type to string More... | |
| static const char * | token_subtype2s (tok_subtype_e subtype) |
| convert token sub-type to string More... | |
| static void | tok_syntax (ocs_hal_t *hal, tokarray_t *tokarray) |
| Generate syntax error message. More... | |
| static uint32_t | tok_getnumber (ocs_hal_t *hal, ocs_hal_qtop_t *qtop, tok_t *tok) |
| parse a number More... | |
| static int32_t | parse_topology (ocs_hal_t *hal, tokarray_t *tokarray, ocs_hal_qtop_t *qtop) |
| parse an array of tokens More... | |
| ocs_hal_qtop_t * | ocs_hal_qtop_parse (ocs_hal_t *hal, const char *qtop_string) |
| Parse queue topology string. More... | |
| void | ocs_hal_qtop_free (ocs_hal_qtop_t *qtop) |
| free queue topology object More... | |
Variables | |
| static tokmatch_t | cmatches [] |
| Declare single character matches. More... | |
| static tokmatch_t | smatches [] |
| Declare identifier match strings. More... | |
| #define HAL_QTOP_DEBUG 0 |
Definition at line 42 of file ocs_hal_queues.c.
| #define P | ( | x | ) | case x: return #x; |
| #define P | ( | x | ) | case x: return #x; |
| #define TOKEN_LEN 32 |
Definition at line 1102 of file ocs_hal_queues.c.
| enum tok_subtype_e |
Declare token sub-types.
| Enumerator | |
|---|---|
| TOK_SUB_EQ | |
| TOK_SUB_CQ | |
| TOK_SUB_RQ | |
| TOK_SUB_MQ | |
| TOK_SUB_WQ | |
| TOK_SUB_LEN | |
| TOK_SUB_CLASS | |
| TOK_SUB_ULP | |
| TOK_SUB_FILTER | |
| TOK_SUB_RQ_POLICY | |
| TOK_SUB_NVMEQ | |
Definition at line 1148 of file ocs_hal_queues.c.
| enum tok_type_e |
return string given a QTOP entry
| entry | QTOP entry |
| Enumerator | |
|---|---|
| TOK_LPAREN | |
| TOK_RPAREN | |
| TOK_COLON | |
| TOK_EQUALS | |
| TOK_QUEUE | |
| TOK_ATTR_NAME | |
| TOK_NUMBER | |
| TOK_NUMBER_VALUE | |
| TOK_NUMBER_LIST | |
Definition at line 1133 of file ocs_hal_queues.c.
| void hal_del_cq | ( | hal_cq_t * | cq | ) |
Free a CQ object.
The CQ object and any child queue objects are freed
| cq | pointer to CQ object |
Definition at line 863 of file ocs_hal_queues.c.
| void hal_del_eq | ( | hal_eq_t * | eq | ) |
Free an EQ object.
The EQ object and any child queue objects are freed
| eq | pointer to EQ object |
Definition at line 837 of file ocs_hal_queues.c.
| void hal_del_mq | ( | hal_mq_t * | mq | ) |
Free a MQ object.
The MQ object is freed
| mq | pointer to MQ object |
Definition at line 900 of file ocs_hal_queues.c.
| void hal_del_rq | ( | hal_rq_t * | rq | ) |
Free an RQ object.
The RQ object is freed
| rq | pointer to RQ object |
Definition at line 938 of file ocs_hal_queues.c.
| void hal_del_wq | ( | hal_wq_t * | wq | ) |
Free a WQ object.
The WQ object is freed
| wq | pointer to WQ object |
Definition at line 919 of file ocs_hal_queues.c.
| hal_cq_t* hal_new_cq | ( | hal_eq_t * | eq, |
| uint32_t | entry_count | ||
| ) |
Allocate a new CQ object.
A new CQ object is instantiated
| eq | pointer to parent EQ object |
| entry_count | number of entries in the CQ |
Definition at line 477 of file ocs_hal_queues.c.
| uint32_t hal_new_cq_set | ( | hal_eq_t * | eqs[], |
| hal_cq_t * | cqs[], | ||
| uint32_t | num_cqs, | ||
| uint32_t | entry_count | ||
| ) |
Allocate a new CQ Set of objects.
| eqs | pointer to a set of EQ objects. |
| cqs | pointer to a set of CQ objects to be returned. |
| num_cqs | number of CQ queues in the set. |
| entry_count | number of entries in the CQ. |
Definition at line 518 of file ocs_hal_queues.c.
| hal_eq_t* hal_new_eq | ( | ocs_hal_t * | hal, |
| uint32_t | entry_count | ||
| ) |
Allocate a new EQ object.
A new EQ object is instantiated
| hal | pointer to HAL object |
| entry_count | number of entries in the EQ |
Definition at line 433 of file ocs_hal_queues.c.
| hal_mq_t* hal_new_mq | ( | hal_cq_t * | cq, |
| uint32_t | entry_count | ||
| ) |
Allocate a new MQ object.
A new MQ object is instantiated
| cq | pointer to parent CQ object |
| entry_count | number of entries in the MQ |
Definition at line 581 of file ocs_hal_queues.c.
| hal_rq_t* hal_new_rq | ( | hal_cq_t * | cq, |
| uint32_t | entry_count, | ||
| uint32_t | ulp | ||
| ) |
Allocate a hal_rq_t object.
Allocate an RQ object, which encapsulates 2 SLI queues (for rq pair)
| cq | pointer to parent CQ object |
| entry_count | number of entries in the RQs |
| ulp | ULP index for this RQ |
Definition at line 668 of file ocs_hal_queues.c.
| uint32_t hal_new_rq_set | ( | hal_cq_t * | cqs[], |
| hal_rq_t * | rqs[], | ||
| uint32_t | num_rq_pairs, | ||
| uint32_t | entry_count, | ||
| uint32_t | ulp | ||
| ) |
Allocate a hal_rq_t object SET.
Allocate an RQ object SET, where each element in set encapsulates 2 SLI queues (for rq pair)
| cqs | pointers to be associated with RQs. |
| rqs | RQ pointers to be returned on success. |
| num_rq_pairs | number of rq pairs in the Set. |
| entry_count | number of entries in the RQs |
| ulp | ULP index for this RQ |
Definition at line 747 of file ocs_hal_queues.c.
| hal_wq_t* hal_new_wq | ( | hal_cq_t * | cq, |
| uint32_t | entry_count, | ||
| uint32_t | class, | ||
| uint32_t | ulp | ||
| ) |
Allocate a new WQ object.
A new WQ object is instantiated
| cq | pointer to parent CQ object |
| entry_count | number of entries in the WQ |
| class | WQ class |
| ulp | index of chute |
Definition at line 623 of file ocs_hal_queues.c.
| void hal_queue_dump | ( | ocs_hal_t * | hal | ) |
Display HAL queue objects.
The HAL queue objects are displayed using ocs_log
| hal | pointer to HAL object |
Definition at line 967 of file ocs_hal_queues.c.
| void hal_queue_teardown | ( | ocs_hal_t * | hal | ) |
Teardown HAL queue objects.
The HAL queue objects are freed
| hal | pointer to HAL object |
Definition at line 1012 of file ocs_hal_queues.c.
|
static |
test if character is an ID character
| c | character to test |
Definition at line 1233 of file ocs_hal_queues.c.
|
static |
test if character is ID start character
| c | character to test |
Definition at line 1220 of file ocs_hal_queues.c.
| ocs_hal_rtn_e ocs_hal_init_queues | ( | ocs_hal_t * | hal, |
| ocs_hal_qtop_t * | qtop | ||
| ) |
Initialize queues.
Given the parsed queue topology spec, the SLI queues are created and initialized
| hal | pointer to HAL object |
| qtop | pointer to queue topology |
Definition at line 56 of file ocs_hal_queues.c.
| uint32_t ocs_hal_qtop_eq_count | ( | ocs_hal_t * | hal | ) |
Return count of EQs for a queue topology object.
The EQ count for in the HALs queue topology (hal->qtop) object is returned
| hal | pointer to HAL object |
Definition at line 1097 of file ocs_hal_queues.c.
| void ocs_hal_qtop_free | ( | ocs_hal_qtop_t * | qtop | ) |
free queue topology object
| qtop | pointer to QTOP object |
Definition at line 1765 of file ocs_hal_queues.c.
| ocs_hal_qtop_t* ocs_hal_qtop_parse | ( | ocs_hal_t * | hal, |
| const char * | qtop_string | ||
| ) |
Parse queue topology string.
The queue topology object is allocated, and filled with the results of parsing the passed in queue topology string
| hal | pointer to HAL object |
| qtop_string | input queue topology string |
Definition at line 1687 of file ocs_hal_queues.c.
| hal_wq_t* ocs_hal_queue_next_wq | ( | ocs_hal_t * | hal, |
| ocs_hal_io_t * | io | ||
| ) |
Allocate a WQ to an IO object.
The next work queue index is used to assign a WQ to an IO.
If wq_steering is OCS_HAL_WQ_STEERING_CLASS, a WQ from io->wq_class is selected.
If wq_steering is OCS_HAL_WQ_STEERING_REQUEST, then a WQ from the EQ that the IO request came in on is selected.
If wq_steering is OCS_HAL_WQ_STEERING_CPU, then a WQ associted with the CPU the request is made on is selected.
| hal | pointer to HAL object |
| io | pointer to IO object |
Definition at line 1053 of file ocs_hal_queues.c.
|
static |
parse an array of tokens
The tokens are semantically parsed, to generate QTOP entries.
| hal | pointer to HAL object |
| tokarray | array array of tokens |
| qtop | ouptut QTOP object |
Definition at line 1509 of file ocs_hal_queues.c.
|
static |
convert queue subtype to QTOP entry
| q | queue subtype |
Definition at line 1170 of file ocs_hal_queues.c.
|
static |
parse a number
Parses tokens of type TOK_NUMBER and TOK_NUMBER_VALUE, returning a numeric value
| hal | pointer to HAL object |
| qtop | pointer to QTOP object |
| tok | pointer to token to parse |
Definition at line 1456 of file ocs_hal_queues.c.
|
static |
Generate syntax error message.
A syntax error message is found, the input tokens are dumped up to and including the token that failed as indicated by the current iterator index.
| hal | pointer to HAL object |
| tokarray | pointer to token array object |
Definition at line 1431 of file ocs_hal_queues.c.
|
static |
convert token sub-type to string
| subtype | token sub-type |
Definition at line 1399 of file ocs_hal_queues.c.
|
static |
convert token type to string
| type | token type |
Definition at line 1373 of file ocs_hal_queues.c.
|
static |
Scan string and return next token.
The string is scanned and the next token is returned
| s | input string to scan |
| tok | pointer to place scanned token |
Definition at line 1276 of file ocs_hal_queues.c.
|
static |
Declare single character matches.
Definition at line 1241 of file ocs_hal_queues.c.
|
static |
Declare identifier match strings.
Definition at line 1251 of file ocs_hal_queues.c.