Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_io.h File Reference

Go to the source code of this file.

Detailed Description

OCS linux driver IO declarations

Definition in file ocs_io.h.

Data Structures

struct  els_loopback_io_evt_t
 
struct  ocs_io_t
 
struct  ocs_io_cb_arg_t
 common IO callback argument More...
 

Macros

#define io_error_log(io, fmt,...)
 
#define SCSI_CMD_BUF_LENGTH   48
 FCP IO context. More...
 
#define SCSI_RSP_BUF_LENGTH   sizeof(fcp_rsp_iu_t)
 

Enumerations

enum  ocs_io_type_e {
  OCS_IO_TYPE_IO = 0, OCS_IO_TYPE_ELS, OCS_IO_TYPE_CT, OCS_IO_TYPE_CT_RESP,
  OCS_IO_TYPE_BLS_RESP, OCS_IO_TYPE_ABORT, OCS_IO_TYPE_MAX
}
 OCS IO types. More...
 

Functions

static int32_t ocs_io_busy (ocs_io_t *io)
 Test if IO object is busy. More...
 
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...
 
void ocs_ddump_io (ocs_textbuf_t *textbuf, ocs_io_t *io)
 Generate IO context ddump data. More...
 

Macro Details

#define io_error_log (   io,
  fmt,
  ... 
)
Value:
do { \
if (OCS_LOG_ENABLE_IO_ERRORS(io->ocs)) \
ocs_log_warn(io->ocs, fmt, ##__VA_ARGS__); \
} while (0)
#define OCS_LOG_ENABLE_IO_ERRORS(ocs)
Definition: ocs_debug.h:76
const char const char * fmt
Definition: ocs_ddump.h:54

Definition at line 41 of file ocs_io.h.

#define SCSI_CMD_BUF_LENGTH   48

FCP IO context.

This structure is used for transport and backend IO requests and responses.

Definition at line 53 of file ocs_io.h.

#define SCSI_RSP_BUF_LENGTH   sizeof(fcp_rsp_iu_t)

Definition at line 54 of file ocs_io.h.

Enumeration Details

OCS IO types.

Enumerator
OCS_IO_TYPE_IO 
OCS_IO_TYPE_ELS 
OCS_IO_TYPE_CT 
OCS_IO_TYPE_CT_RESP 
OCS_IO_TYPE_BLS_RESP 
OCS_IO_TYPE_ABORT 
OCS_IO_TYPE_MAX 

must be last

Definition at line 59 of file ocs_io.h.

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.

static int32_t ocs_io_busy ( ocs_io_t *  io)
inlinestatic

Test if IO object is busy.

Return True if IO object is busy. Busy is defined as the IO object not being on the free list

Parameters
ioPointer to IO object
Returns
returns True if IO is busy

Definition at line 191 of file ocs_io.h.

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.