Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_io.c File Reference
#include "ocs.h"
#include "ocs_scsi_fc.h"
#include "ocs_pool.h"

Go to the source code of this file.

Detailed Description

Provide IO object allocation.

Definition in file ocs_io.c.

Data Structures

struct  ocs_io_pool_t
 IO pool. More...
 

Functions

void ocs_mgmt_io_list (ocs_textbuf_t *textbuf, void *io)
 
void ocs_mgmt_io_get_all (ocs_textbuf_t *textbuf, void *io)
 
int ocs_mgmt_io_get (ocs_textbuf_t *textbuf, char *parent, char *name, void *io)
 
ocs_io_pool_t * ocs_io_pool_create (ocs_t *ocs, uint32_t num_io, uint32_t num_sgl)
 Create a pool of IO objects. More...
 
int32_t ocs_io_pool_free (ocs_io_pool_t *io_pool)
 Free IO objects pool. More...
 
uint32_t ocs_io_pool_allocated (ocs_io_pool_t *io_pool)
 
ocs_io_t * ocs_io_pool_io_alloc (ocs_io_pool_t *io_pool)
 Allocate an object used to track an IO. More...
 
void ocs_io_pool_io_free (ocs_io_pool_t *io_pool, ocs_io_t *io)
 Free an object used to track an IO. More...
 
ocs_io_t * ocs_io_find_tgt_io (ocs_t *ocs, ocs_node_t *node, uint16_t ox_id, uint16_t rx_id)
 Find an I/O given it's node and ox_id. More...
 
ocs_io_t * ocs_io_find_init_els_io (ocs_t *ocs, ocs_node_t *node, uint16_t ox_id)
 Find an els I/O given it's node and ox_id. More...
 
ocs_io_t * ocs_io_get_instance (ocs_t *ocs, uint32_t index)
 Return IO context given the instance index. More...
 
void ocs_ddump_io (ocs_textbuf_t *textbuf, ocs_io_t *io)
 Generate IO context ddump data. More...
 

Variables

static ocs_mgmt_functions_t io_mgmt_functions
 

Function Details

void ocs_ddump_io ( ocs_textbuf_t *  textbuf,
ocs_io_t *  io 
)

Generate IO context ddump data.

The ddump data for an IO context is generated.

Parameters
textbufPointer to text buffer.
ioPointer to IO context.
Returns
None.

Definition at line 385 of file ocs_io.c.

ocs_io_t* ocs_io_find_init_els_io ( ocs_t *  ocs,
ocs_node_t *  node,
uint16_t  ox_id 
)

Find an els I/O given it's node and ox_id.

Parameters
ocsDriver instance's software context.
nodePointer to node.
ox_idOX_ID to find.

Definition at line 339 of file ocs_io.c.

uint32_t ocs_io_pool_allocated ( ocs_io_pool_t *  io_pool)

Definition at line 225 of file ocs_io.c.

ocs_io_pool_t* ocs_io_pool_create ( ocs_t *  ocs,
uint32_t  num_io,
uint32_t  num_sgl 
)

Create a pool of IO objects.

Description
This function allocates memory in larger chucks called "slabs" which are a fixed size. It calculates the number of IO objects that fit within each "slab" and determines the number of "slabs" required to allocate the number of IOs requested. Each of the slabs is allocated and then it grabs each IO object within the slab and adds it to the free list. Individual command, response and SGL DMA buffers are allocated for each IO.
      "Slabs"
 +----------------+
 |                |
+-------------—+ | | IO | | +-------------—+ | | ... | | +-------------—+__+ | IO | +-------------—+
Parameters
ocsDriver instance's software context.
num_ioNumber of IO contexts to allocate.
num_sglNumber of SGL entries to allocate for each IO.
Returns
Returns a pointer to a new ocs_io_pool_t on success, or NULL on failure.

Definition at line 101 of file ocs_io.c.

int32_t ocs_io_pool_free ( ocs_io_pool_t *  io_pool)

Free IO objects pool.

Description
The pool of IO objects are freed.
Parameters
io_poolPointer to IO pool object.
Returns
Returns 0 on success, or a negative error code value on failure.

Definition at line 185 of file ocs_io.c.

int ocs_mgmt_io_get ( ocs_textbuf_t *  textbuf,
char *  parent,
char *  name,
void *  io 
)

Definition at line 450 of file ocs_io.c.

void ocs_mgmt_io_get_all ( ocs_textbuf_t *  textbuf,
void *  io 
)

Definition at line 497 of file ocs_io.c.

void ocs_mgmt_io_list ( ocs_textbuf_t *  textbuf,
void *  io 
)

Definition at line 436 of file ocs_io.c.

Variable Details

ocs_mgmt_functions_t io_mgmt_functions
static
Initial value:
= {
.get_list_handler = ocs_mgmt_io_list,
.get_handler = ocs_mgmt_io_get,
.get_all_handler = ocs_mgmt_io_get_all,
}
void ocs_mgmt_io_get_all(ocs_textbuf_t *textbuf, void *io)
Definition: ocs_io.c:497
void ocs_mgmt_io_list(ocs_textbuf_t *textbuf, void *io)
Definition: ocs_io.c:436
int ocs_mgmt_io_get(ocs_textbuf_t *textbuf, char *parent, char *name, void *io)
Definition: ocs_io.c:450

Definition at line 50 of file ocs_io.c.