Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_iscsi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  * Defines the iSCSI interface functions to the os specific code. Contains many
36  * of the iSCSI configuration parameters and structures.
37  * This code should be OS independant.
38  */
39 
40 #ifndef _OCS_ISCSI_H
41 #define _OCS_ISCSI_H
42 
43 #include "ocs_os.h"
44 #include "ocs_hal.h"
45 #include "ocs_ioctl.h"
46 
47 /* Used to test the network configuration APIs */
48 //#define OCS_TEST_HAL_APIS
49 //#define OCS_SET_MAC_ADDRESS
50 
51 /*
52  * Define parameters for LUN mappings.
53  */
54 #define ISCSI_LUN_ADDRESS_METHOD_SHIFT 6
55 #define ISCSI_LUN_ADDRESS_METHOD_MASK 0xc0
56 #define ISCSI_LUN_ADDR_METHOD_PERIPHERAL 0x0
57 #define ISCSI_LUN_ADDR_METHOD_FLAT 0x1
58 #define ISCSI_LUN_ADDR_METHOD_LOGICAL 0x2
59 #define ISCSI_LUN_ADDR_METHOD_EXTENDED 0x3
60 
61 #define ISCSI_LUN_ADDR_SIMPLE_MAX 0xff
62 #define ISCSI_LUN_ADDR_FLAT_MAX 0x3fff
63 
64 /*
65  * Functions to do the serial number arithmetic on cmdSn, etc.
66  */
67 #define LOW_THRESH 0x10000000
68 #define HIGH_THRESH 0xefffffff
69 
70 /* checks whether a > b when they are wrapped around
71  usually a is max_cmdsn and b is exp_cmdsn
72 */
73 #define GT_WRAPPED(a_cmd_sn, b_cmd_sn) (((b_cmd_sn) > HIGH_THRESH) && \
74  ((a_cmd_sn) < LOW_THRESH))
75 
76 /* checks whether a > b in normal scenario
77  usually a is max_cmdsn and b is exp_cmdsn
78 */
79 #define GT_NOTWRAPPED(a,b) (((a) > (b)) && (((a) < HIGH_THRESH) || \
80  ((b) > LOW_THRESH)))
81 
82 /* Considers both wrap and non-wrap scenarios and returns true
83  return TRUE
84  when cmdsn a is greater than cmdsn b
85  usually a is max_cmdsn and b is exp_cmdsn
86 */
87 #define GT_WRAP(a,b) (GT_NOTWRAPPED((a), (b)) || GT_WRAPPED((a), (b)))
88 
89 /*
90  Consider both equal to and greater than cases
91  return TRUE
92  when cmdsn a is equal to cmdsn b or cmdsn a is greater than cmdsn b
93 */
94 #define GTE_WRAP(a,b) ( ( (a)==(b) ) || GT_WRAP((a),(b)) )
95 
96 /**
97  * @brief iSCSI PDU processing return codes
98  */
99 typedef enum {
106 
107 /**
108  * @brief iSCSI object memory tracker
109  *
110  * Structure used to group allocation of objects into chucks and then pull them
111  * out. This is done because DMA memory allocations is done in pages
112  * which causes wasted space. By grouping the structures together, we attempt
113  * to consoldiate as many per page as possible. This structure will allocate
114  * tracking SGLs that are used to free the memory later as well as enumerate
115  * the individual structures at initialization.
116  */
117 typedef struct ocs_iscsi_mem_tracker_s {
118  uint32_t num_objs;
119  ocs_dma_t *pages;
120  uint32_t num_pages;
121  uint32_t obj_per_page;
122  uint32_t obj_size;
123  uint32_t obj_size_padded;
125 
126 
127 /**
128  * @brief The types of requests that may be retried.
129  */
130 typedef enum {
142 
143 /**
144  * @brief object to queue login requests waiting for buffers
145  */
146 typedef struct ocs_iscsi_lgn_retry_s {
148  ocs_cxn_t *cxn;
151  uint8_t immediate;
152  uint8_t reason;
153  uint64_t lun;
154  uint32_t itt;
155  uint32_t ttt;
156  uint16_t param1;
157  uint16_t param2;
158  uint16_t param3;
159  char virt_buffer[64];
161  uint32_t hdr_len;
163  uint32_t data_len;
165 
166 /**
167  * @brief Structure used to hold the response entries of set_route_table
168  * command.
169  */
170 typedef struct {
175 
176 typedef struct {
177  uint32_t entry_count;
180 
181 #define OCS_CNFG_CTX_COMPL_TIMEOUT (3 * 1000000)
182 
183 /**
184  * @brief The types of mailbox operations we want to wait for
185  */
186 typedef enum {
202  OCS_CNFG_CTX_MAX /* Must remain last */
204 
205 /**
206  * @brief structure used to signal when a mailbox command callback is complete
207  * and passes the status and any other parameters back to the caller.
208  */
209 typedef struct {
210  struct ocs_iscsi_s *iscsi;
211  ocs_atomic_t in_use;
212  ocs_sem_t sem;
213 
214  int32_t status;
215  uint32_t ext_status;
216 
217  /* Fields for iSNS send */
218  void *isns_pkt; /* Used to copy the response on callback */
219  uint32_t isns_pkt_len;
220  uint32_t isns_buff_len;
221 
222  /* parameters for specific commands */
224  uint32_t num_ips;
229 
230 /**
231  * @brief Template for a function to be called when the link
232  * state changes.
233  */
234 typedef void (*ocs_link_state_cb_t)(ocs_t*, ocs_link_state_e);
235 
236 #define OCS_ISCSI_MAX_LINK_STATE_CALLBACKS 2
237 
238 /*
239  * ocs_iscsi_cluster_tgt_info_s
240  * iSCSI cluster target info
241  */
242 #define OCS_CLUST_TARGET_KEY_RETCNT (9999)
243 typedef struct ocs_iscsi_cluster_tgt_info_s {
245  char tgt_name[OCS_MAX_ISCSI_NAME];
246  char tgt_addr[32];
248 /*
249  * iSCSI cluster target list is transferred in text response with
250  * a special ttt OCS_CLUST_TARGET_TTT.
251  */
252 #define OCS_CLUST_TARGET_TTT (0xFFFFFF00)
253 
254 /*
255  * ocs_iscsi_cluster_sendtargets_s
256  * iSCSI cluster target info is for the targets within
257  * the same network entity. Target will send this list of items
258  * to initiator during send targets discovery phase.
259  */
260 typedef struct ocs_iscsi_cluster_sendtargets_s {
261  ocs_list_t list;
262  ocs_atomic_t cnt;
263  /*
264  * iscsi cluster targets are send in text response in multiples
265  * of 8K size. ctgt_next holds the item from where the subsequent
266  * transfer starts within the clisttgt_list.
267  */
269  bool st_last;
270  bool send_en;
272 
273 /**
274  * @brief Stores information needed IP addresses for targets
275  */
276 typedef struct ocs_iscsi_tgt_ip_s
277 {
281  uint16_t tcp_port;
282  uint16_t esi_port;
283  uint32_t ip_added:1,
284  listening:1,
285  esi_listening:1;
287 
288 #define OCS_MAX_IP 256
289 
290 /**
291  * @brief iSCSI object
292  */
293 typedef struct ocs_iscsi_s {
294  ocs_os_handle_t os;
296 
297  uint32_t device_instance;
298  uint32_t num_tgts;
299  uint32_t num_cxns;
300  uint32_t num_ios;
301 
302  ocs_timer_t idle_timer;
303  uint32_t pf_num; /* function number retrieved from the SLI IF */
304 
309 
310  /* fields for ocs_cxn */
313 
314  /* fields for ocs_session */
315  ocs_lock_t sess_queue_lock;
316  ocs_list_t sess_free;
317  ocs_list_t sess_busy;
318  ocs_session_t *sess_mem;
319 
320  /* fields for management API */
322 
323  /* Fields managed by ocs_login.c */
324  ocs_lock_t lgn_queue_lock;
326  ocs_list_t login_retry_free;
327  ocs_list_t login_retry_busy;
328  uint8_t chap_ident;
329 
330  /* Fields for managing IP addresses */
331  uint32_t num_ips;
333 
334 #ifdef OCS_TEST_HAL_APIS
335  ocs_hal_portal_t iface_vlan_1;
336 #endif
337 
338  /* for transport layer API */
340  ocs_lock_t link_state_cb_lock;
342 
343  /* for isns ESI timer */
344  ocs_timer_t isns_timer;
346  uint32_t isns_reg_period;
347 
349 } ocs_iscsi_t;
350 
351 /* Initialization and Configuration */
352 int32_t ocs_iscsi_interrupts_required(ocs_os_handle_t, ocs_hal_t *);
353 int32_t ocs_iscsi_initialize(ocs_os_handle_t, ocs_iscsi_t *, ocs_hal_t *, uint32_t);
358 
359 /* Utility functions */
362 
363 int32_t ocs_iscsi_inet_pton4(const char * src, ocs_ip_address_t *ip);
364 int32_t ocs_iscsi_inet_pton6(const char *src, ocs_ip_address_t *ip);
370  ocs_ip_address_t *ip,
371  ocs_ip_address_t *subnet);
373  ocs_ip_address_t *ip,
374  ocs_ip_address_t *subnet);
375 void format_ip_address(ocs_ip_type_e ip_type, uint8_t *address, char* buffer, int size);
376 void format_mac_address(uint8_t *address, char *buffer, int size);
377 int32_t parse_mac_address(const char *src, uint8_t *dest);
378 
379 int32_t ocs_iscsi_send_tmf_resp(ocs_io_t *io, uint8_t response,
380  ocs_scsi_io_cb_t cb, void *arg);
381 
382 int32_t ocs_scsi_io_dispatch(ocs_io_t *io, void *cb);
383 void ocs_scsi_pending_cleanup(ocs_node_t *node);
384 
385 void ocs_target_io_aborted_nop_cmpl(ocs_cxn_t *cxn);
386 int32_t ocs_iscsi_add_ip_to_tbl(ocs_t *ocs,
387  char *desc,
389  ocs_hal_portal_t portal);
390 int32_t ocs_iscsi_remove_ip_from_tbl(ocs_t *ocs,
392  ocs_hal_portal_t portal);
393 int32_t
394 ocs_iscsi_is_ip_in_tbl(ocs_t *ocs,
395  ocs_ip_address_subnet_t *ipsub);
396 
397 /* Target function to process PDUs - called by session code */
399  ocs_cxn_t *cxn,
400  ocs_hal_rq_buffer_t *hdr,
401  uint32_t hdr_len,
402  ocs_hal_rq_buffer_t *data,
403  uint32_t data_len,
404  uint8_t code,
405  uint8_t *reject_reason);
406 
407 
408 /* Functions for using memory trackers */
411  ocs_iscsi_mem_tracker_t *tracker);
412 int32_t ocs_iscsi_tracker_alloc(ocs_iscsi_t *iscsi,
413  ocs_iscsi_mem_tracker_t *tracker,
414  uint8_t zero,
415  uint32_t object_size,
416  uint32_t alignment,
417  uint32_t num_objects);
419  uint32_t obj_offset);
420 int32_t ocs_iscsi_portal_read_vlan_ids(ocs_t *ocs, void *arg_out,
421  uint32_t arg_out_length);
422 int32_t ocs_iscsi_portal_del_vlan(ocs_t *ocs, ocs_hal_portal_t iface);
423 int32_t ocs_iscsi_route_table_del_entry(ocs_t *ocs,
425  ocs_ip_address_t *gateway);
426 int32_t ocs_iscsi_route_table_read(ocs_t *ocs, ocs_route_table_t *route_table);
427 int32_t ocs_iscsi_route_table_add_entry(ocs_t *ocs,
429  ocs_ip_address_t *gateway);
431 extern bool ocs_scsi_check_cxn_wq_full(ocs_t *ocs, ocs_cxn_t *cxn);
432 
433 #endif /* !_OCS_ISCSI_H */
434 
435 /* vim: set noexpandtab textwidth=120: */
ocs_atomic_t in_use
Definition: ocs_iscsi.h:211
#define OCS_ISCSI_ROUTE_TABLE_ENTRIES_MAX
Definition: ocs_ioctl.h:285
Stores information needed IP addresses for targets.
Definition: ocs_iscsi.h:276
int32_t ocs_iscsi_remove_ip_from_tbl(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_hal_portal_t portal)
Remove an IP address from the table.
Definition: ocs_iscsi.c:2696
ocs_link_state_e
enum identifying the link state.
Definition: ocs_iscsi_api.h:66
ocs_hal_portal_t iface
Definition: ocs_iscsi.h:223
uint32_t isns_pkt_len
Definition: ocs_iscsi.h:219
int32_t ocs_iscsi_register_link_state_callback(ocs_t *ocs, ocs_link_state_cb_t cb)
Register to receive link state change notifications.
Definition: ocs_iscsi.c:3324
ocs_list_t ocs_list_link_t
Definition: ocs_list.h:84
bool shutting_down
Definition: ocs_iscsi.h:305
ocs_list_t sess_free
Definition: ocs_iscsi.h:316
ocs_lock_t lgn_queue_lock
Definition: ocs_iscsi.h:324
ocs_pdu_process_rtn_e
iSCSI PDU processing return codes
Definition: ocs_iscsi.h:99
ocs_iscsi_mem_tracker_t cxn_login_data
Definition: ocs_iscsi.h:312
ocs_config_ctx_e
The types of mailbox operations we want to wait for.
Definition: ocs_iscsi.h:186
void(* ocs_link_state_cb_t)(ocs_t *, ocs_link_state_e)
Template for a function to be called when the link state changes.
Definition: ocs_iscsi.h:234
ocs_hal_t * hal
Definition: ocs_iscsi.h:295
void ocs_iscsi_cluster_tgts_free(ocs_iscsi_t *iscsi)
iscsi cluster targets free
Definition: ocs_iscsi.c:2211
uint32_t ext_status
Definition: ocs_iscsi.h:215
void ocs_scsi_pending_cleanup(ocs_node_t *node)
Clean up any IOs on the pending list when a connection goes down.
Definition: ocs_scsi.c:598
int32_t parse_mac_address(const char *src, uint8_t *dest)
Parse a string into a MAC address.
Definition: ocs_iscsi.c:737
ocs_list_link_t link
Definition: ocs_iscsi.h:147
ocs_config_ctx_t * ctx
Definition: ocs_iscsi.h:321
Structure used to hold the response entries of set_route_table command.
Definition: ocs_iscsi.h:170
uint32_t num_ips
Definition: ocs_iscsi.h:224
#define OCS_ISCSI_MAX_LINK_STATE_CALLBACKS
Definition: ocs_iscsi.h:236
ocs_hal_rq_buffer_t * data
Definition: ocs_iscsi.h:162
ocs_hal_ip_type_e
enum identifying the types of IP addresses.
Definition: ocs_hal.h:244
ocs_hal_portal_t portal
Definition: ocs_iscsi.h:278
bool has_ue_occurred
Definition: ocs_iscsi.h:308
ocs_iscsi_mem_tracker_t cxn_login_hdr
Definition: ocs_iscsi.h:311
ocs_iscsi_cluster_tgt_t * ctgt_next
Definition: ocs_iscsi.h:268
ocs_pdu_process_rtn_e ocs_iscsi_tgt_process_cmd_sn(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code, uint8_t *reject_reason)
Function to process unsolicited PDUs for a target.
Definition: ocs_iscsi.c:4042
void format_mac_address(uint8_t *address, char *buffer, int size)
Format a MAC address into a string.
Definition: ocs_iscsi.c:711
void ocs_iscsi_ipsub_combine(ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *ip, ocs_ip_address_t *subnet)
Combines an iSCSI IP address and subnet into the combined structure.
Definition: ocs_iscsi.c:414
ocs_hal_ip_address_t subnet
Definition: ocs_iscsi.h:172
bool ocs_scsi_check_cxn_wq_full(ocs_t *ocs, ocs_cxn_t *cxn)
Check Connection WQ&#39;s full status.
Definition: ocs_scsi.c:2374
HAL object.
Definition: ocs_hal.h:724
ocs_session_t * sess_mem
Definition: ocs_iscsi.h:318
void ocs_iscsi_cxn_req_invalidate(ocs_iscsi_t *iscsi)
Definition: ocs_iscsi.c:4456
int32_t ocs_scsi_io_dispatch(ocs_io_t *io, void *cb)
Attempt to dispatch an IO.
Definition: ocs_scsi.c:475
uint32_t ocs_hal_portal_t
Definition: ocs_common.h:204
ocs_timer_t idle_timer
Definition: ocs_iscsi.h:302
void ocs_iscsi_convert_to_hal_ip(ocs_ip_address_t *ip, ocs_hal_ip_address_t *hal_ip)
Convert an iSCSI IP address to the HAL IP address.
Definition: ocs_iscsi.c:359
void ocs_iscsi_uninitialize(ocs_iscsi_t *iscsi)
Indicate that HAL is not initialized.
Definition: ocs_iscsi.c:1904
uint32_t isns_reg_period
Definition: ocs_iscsi.h:346
int32_t ocs_iscsi_route_table_read(ocs_t *ocs, ocs_route_table_t *route_table)
Definition: ocs_iscsi.c:2371
uint32_t num_ios
Definition: ocs_iscsi.h:300
ocs_ip_type_e ocs_iscsi_convert_to_ip_type(ocs_hal_ip_type_e ip_type)
Convert an HAL IP type to the iSCSI API value.
Definition: ocs_iscsi.c:327
uint16_t esi_port
Definition: ocs_iscsi.h:282
void ocs_target_io_aborted_nop_cmpl(ocs_cxn_t *cxn)
This function is called whenever a target NOP completes.
Definition: ocs_scsi.c:120
int32_t(* ocs_hal_unsol_cb_t)(void *, ocs_cxn_t *, ocs_hal_rq_buffer_t *, uint32_t, ocs_hal_rq_buffer_t *, uint32_t, uint8_t)
HAL unsolicited callback.
Definition: ocs_hal.h:719
int32_t ocs_iscsi_is_ip_in_tbl(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub)
Checks if an IP address/subnet is present in the table.
Definition: ocs_iscsi.c:2742
int32_t status
Definition: ocs_iscsi.h:214
ocs_list_t sess_busy
Definition: ocs_iscsi.h:317
void ocs_iscsi_tracker_init(ocs_iscsi_mem_tracker_t *tracker)
Initialize the memory tracker.
Definition: ocs_iscsi.c:4275
ocs_hal_ip_address_t ip_addr
Definition: ocs_iscsi.h:171
iSCSI object
Definition: ocs_iscsi.h:293
uint32_t num_cxns
Definition: ocs_iscsi.h:299
structure used to signal when a mailbox command callback is complete and passes the status and any ot...
Definition: ocs_iscsi.h:209
Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue...
Definition: ocs_hal.h:694
ocs_route_table_t route_table
Definition: ocs_iscsi.h:227
ocs_os_handle_t os
Definition: ocs_iscsi.h:294
uint16_t tcp_port
Definition: ocs_iscsi.h:281
int32_t(* ocs_scsi_io_cb_t)(ocs_io_t *io, ocs_scsi_io_status_e status, uint32_t flags, void *arg)
Definition: ocs_scsi.h:125
void ocs_iscsi_rx_buffers_free(ocs_iscsi_t *iscsi, ocs_hal_rq_buffer_t *header, ocs_hal_rq_buffer_t *payload)
Add a receive buffer pair to the Receive Queue, if an error is received, then queue the buffer...
Definition: ocs_iscsi.c:4447
int32_t ocs_iscsi_portal_del_vlan(ocs_t *ocs, ocs_hal_portal_t iface)
Delete iface handle and VLAN from portal_list.
Definition: ocs_iscsi.c:3011
int32_t ocs_iscsi_initialize(ocs_os_handle_t os, ocs_iscsi_t *iscsi, ocs_hal_t *hal, uint32_t device_instance)
Initialize the iSCSI device by setting up the chip.
Definition: ocs_iscsi.c:1505
int32_t ocs_iscsi_teardown(ocs_iscsi_t *iscsi)
Shut down the device.
Definition: ocs_iscsi.c:1921
int32_t ocs_iscsi_portal_read_vlan_ids(ocs_t *ocs, void *arg_out, uint32_t arg_out_length)
Read VLAN IDs to provided buffer.
Definition: ocs_iscsi.c:3041
ocs_list_t login_retry_busy
Definition: ocs_iscsi.h:327
uint32_t pf_num
Definition: ocs_iscsi.h:303
ocs_dma_t * ocs_iscsi_tracker_calc(ocs_iscsi_mem_tracker_t *tracker, uint32_t obj_offset)
Helper to return the pointers for a specific object in the group.
Definition: ocs_iscsi.c:4429
structure wrapping an IP address and subnet together with their type.
Definition: ocs_iscsi_api.h:82
ocs_hal_rq_buffer_t * hdr
Definition: ocs_iscsi.h:160
void format_ip_address(ocs_ip_type_e ip_type, uint8_t *address, char *buffer, int size)
Format an IP address into a string.
Definition: ocs_iscsi.c:460
structure wrapping an IP address together with it&#39;s type.
Definition: ocs_hal.h:259
ocs_iscsi_cluster_sendtargets_t clusttgt
Definition: ocs_iscsi.h:348
uint32_t num_tgts
Definition: ocs_iscsi.h:298
void ocs_iscsi_ipsub_split(ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *ip, ocs_ip_address_t *subnet)
Splits an iSCSI IP address and subnet from the combined structure.
Definition: ocs_iscsi.c:431
ocs_hal_unsol_cb_t unsol_ini
Definition: ocs_iscsi.h:339
ocs_ip_type_e
enum identifying the types of IP addresses.
Definition: ocs_iscsi_api.h:46
bool is_hal_initialized
Definition: ocs_iscsi.h:306
uint8_t chap_ident
Definition: ocs_iscsi.h:328
int32_t ocs_iscsi_interrupts_required(ocs_os_handle_t os, ocs_hal_t *hal)
Returns the number of interrupts needed for this adapter.
Definition: ocs_iscsi.c:1459
uint32_t device_instance
Definition: ocs_iscsi.h:297
ocs_sem_t sem
Definition: ocs_iscsi.h:212
ocs_hal_ip_type_e ocs_iscsi_convert_to_hal_ip_type(ocs_ip_type_e ip_type)
Convert an iSCSI IP type to the HAL value.
Definition: ocs_iscsi.c:296
ocs_iscsi_retry_type_e
The types of requests that may be retried.
Definition: ocs_iscsi.h:130
int32_t ocs_iscsi_route_table_del_entry(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway)
Deletes an entry from a routing table.
Definition: ocs_iscsi.c:2276
ocs_hal_ip_address_t gateway
Definition: ocs_iscsi.h:173
ocs_lock_t sess_queue_lock
Definition: ocs_iscsi.h:315
int32_t ocs_iscsi_inet_pton4(const char *src, ocs_ip_address_t *ip)
Converts an IPv4 address from a string to the IP structure.
Definition: ocs_iscsi.c:513
ocs_ip_address_t ip
Definition: ocs_iscsi.h:279
ocs_lock_t link_state_cb_lock
Definition: ocs_iscsi.h:340
ocs_iscsi_lgn_retry_t * lgn_retry
Definition: ocs_iscsi.h:325
void ocs_iscsi_unregister_link_state_callback(ocs_t *ocs, ocs_link_state_cb_t cb)
Unregister a link state change callback.
Definition: ocs_iscsi.c:3360
ocs_ip_address_t subnet
Definition: ocs_iscsi.h:280
#define OCS_MAX_ISCSI_NAME
Definition: ocs_common.h:240
iSCSI object memory tracker
Definition: ocs_iscsi.h:117
ocs_iscsi_tgt_ip_t * ip_info
Definition: ocs_iscsi.h:332
int32_t ocs_iscsi_inet_pton6(const char *src, ocs_ip_address_t *ip)
Converts an IPv6 address from a string to the IP structure.
Definition: ocs_iscsi.c:574
ocs_list_t login_retry_free
Definition: ocs_iscsi.h:326
ocs_list_link_t link
Definition: ocs_iscsi.h:244
struct ocs_iscsi_s * iscsi
Definition: ocs_iscsi.h:210
structure wrapping an IP address together with it&#39;s type.
Definition: ocs_iscsi_api.h:74
int32_t ocs_iscsi_add_ip_to_tbl(ocs_t *ocs, char *desc, ocs_ip_address_subnet_t *ipsub, ocs_hal_portal_t portal)
Adds an IP address to the table.
Definition: ocs_iscsi.c:2622
uint32_t isns_buff_len
Definition: ocs_iscsi.h:220
ocs_ip_address_t isns_ip
Definition: ocs_iscsi.h:345
int32_t ocs_iscsi_tracker_alloc(ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker, uint8_t zero, uint32_t object_size, uint32_t alignment, uint32_t num_objects)
Allocate a group of objects uses pages to minimize waste.
Definition: ocs_iscsi.c:4331
object to queue login requests waiting for buffers
Definition: ocs_iscsi.h:146
void ocs_iscsi_convert_to_ip(ocs_ip_address_t *ip, ocs_hal_ip_address_t *hal_ip)
Convert an iSCSI IP address to the HAL IP address.
Definition: ocs_iscsi.c:372
bool is_init_complete
Definition: ocs_iscsi.h:307
int32_t ocs_iscsi_send_tmf_resp(ocs_io_t *io, uint8_t response, ocs_scsi_io_cb_t cb, void *arg)
send TMF response data
Definition: ocs_scsi.c:1320
ocs_iscsi_retry_type_e type
Definition: ocs_iscsi.h:149
int32_t ocs_iscsi_route_table_add_entry(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway)
Adds an entry to a routing table.
Definition: ocs_iscsi.c:2328
void ocs_iscsi_tracker_free(ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker)
Free the memory associated with a memory tracker.
Definition: ocs_iscsi.c:4293
uint32_t num_ips
Definition: ocs_iscsi.h:331
ocs_timer_t isns_timer
Definition: ocs_iscsi.h:344