Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iscsi_target_tq.h
Go to the documentation of this file.
1 #ifndef ISCSI_THREAD_QUEUE_H
2 #define ISCSI_THREAD_QUEUE_H
3 
4 /*
5  * Defines for thread sets.
6  */
9 extern void iscsi_deallocate_thread_sets(void);
10 extern void iscsi_activate_thread_set(struct iscsi_conn *, struct iscsi_thread_set *);
11 extern struct iscsi_thread_set *iscsi_get_thread_set(void);
12 extern void iscsi_set_thread_clear(struct iscsi_conn *, u8);
13 extern void iscsi_set_thread_set_signal(struct iscsi_conn *, u8);
14 extern int iscsi_release_thread_set(struct iscsi_conn *);
17 extern int iscsi_thread_set_init(void);
18 extern void iscsi_thread_set_free(void);
19 
20 extern int iscsi_target_tx_thread(void *);
21 extern int iscsi_target_rx_thread(void *);
22 
23 #define TARGET_THREAD_SET_COUNT 4
24 
25 #define ISCSI_RX_THREAD 1
26 #define ISCSI_TX_THREAD 2
27 #define ISCSI_RX_THREAD_NAME "iscsi_trx"
28 #define ISCSI_TX_THREAD_NAME "iscsi_ttx"
29 #define ISCSI_BLOCK_RX_THREAD 0x1
30 #define ISCSI_BLOCK_TX_THREAD 0x2
31 #define ISCSI_CLEAR_RX_THREAD 0x1
32 #define ISCSI_CLEAR_TX_THREAD 0x2
33 #define ISCSI_SIGNAL_RX_THREAD 0x1
34 #define ISCSI_SIGNAL_TX_THREAD 0x2
35 
36 /* struct iscsi_thread_set->status */
37 #define ISCSI_THREAD_SET_FREE 1
38 #define ISCSI_THREAD_SET_ACTIVE 2
39 #define ISCSI_THREAD_SET_DIE 3
40 #define ISCSI_THREAD_SET_RESET 4
41 #define ISCSI_THREAD_SET_DEALLOCATE_THREADS 5
42 
43 /* By default allow a maximum of 32K iSCSI connections */
44 #define ISCSI_TS_BITMAP_BITS 32768
45 
47  /* flags used for blocking and restarting sets */
49  /* flag for creating threads */
51  /* flag for delaying readding to inactive list */
53  /* status for thread set */
54  int status;
55  /* which threads have had signals sent */
57  /* flag for which threads exited first */
59  /* Active threads in the thread set */
61  /* Unique thread ID */
63  /* pointer to connection if set is active */
64  struct iscsi_conn *conn;
65  /* used for controlling ts state accesses */
67  /* Used for rx side post startup */
69  /* Used for tx side post startup */
71  /* used for restarting thread queue */
73  /* used for restarting thread queue */
75  /* used for normal unused blocking */
77  /* used for normal unused blocking */
79  /* OS descriptor for rx thread */
81  /* OS descriptor for tx thread */
83  /* struct iscsi_thread_set in list list head*/
85 };
86 
87 #endif /*** ISCSI_THREAD_QUEUE_H ***/