Commit 073900bd authored by Nicholas Bellinger's avatar Nicholas Bellinger

iscsi-target: Drop legacy iscsi_target_tq.c logic

Now that iscsi_conn allocates new [rx,tx] threads using kthread.h
primitives on the fly, and kthread_stop() is called directly during
connection shutdown, it's time to go ahead and drop iscsi_target_tq.c
legacy code.

The use of multiple struct completion in iscsi_activate_thread_set()
has been proven to cause issues during repeated iser login/logout.
Tested-by: default avatarSagi Grimberg <sagig@mellanox.com>
Cc: Slava Shwartsman <valyushash@gmail.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 88dcd2da
iscsi_target_mod-y += iscsi_target_parameters.o \ iscsi_target_mod-y += iscsi_target_parameters.o \
iscsi_target_seq_pdu_list.o \ iscsi_target_seq_pdu_list.o \
iscsi_target_tq.o \
iscsi_target_auth.o \ iscsi_target_auth.o \
iscsi_target_datain_values.o \ iscsi_target_datain_values.o \
iscsi_target_device.o \ iscsi_target_device.o \
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <target/iscsi/iscsi_target_core.h> #include <target/iscsi/iscsi_target_core.h>
#include "iscsi_target_parameters.h" #include "iscsi_target_parameters.h"
#include "iscsi_target_seq_pdu_list.h" #include "iscsi_target_seq_pdu_list.h"
#include "iscsi_target_tq.h"
#include "iscsi_target_configfs.h" #include "iscsi_target_configfs.h"
#include "iscsi_target_datain_values.h" #include "iscsi_target_datain_values.h"
#include "iscsi_target_erl0.h" #include "iscsi_target_erl0.h"
...@@ -4360,8 +4359,6 @@ int iscsit_close_connection( ...@@ -4360,8 +4359,6 @@ int iscsit_close_connection(
iscsit_put_transport(conn->conn_transport); iscsit_put_transport(conn->conn_transport);
conn->thread_set = NULL;
pr_debug("Moving to TARG_CONN_STATE_FREE.\n"); pr_debug("Moving to TARG_CONN_STATE_FREE.\n");
conn->conn_state = TARG_CONN_STATE_FREE; conn->conn_state = TARG_CONN_STATE_FREE;
kfree(conn); kfree(conn);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <target/iscsi/iscsi_target_core.h> #include <target/iscsi/iscsi_target_core.h>
#include <target/iscsi/iscsi_transport.h> #include <target/iscsi/iscsi_transport.h>
#include "iscsi_target_seq_pdu_list.h" #include "iscsi_target_seq_pdu_list.h"
#include "iscsi_target_tq.h"
#include "iscsi_target_erl0.h" #include "iscsi_target_erl0.h"
#include "iscsi_target_erl1.h" #include "iscsi_target_erl1.h"
#include "iscsi_target_erl2.h" #include "iscsi_target_erl2.h"
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <target/iscsi/iscsi_target_core.h> #include <target/iscsi/iscsi_target_core.h>
#include <target/iscsi/iscsi_target_stat.h> #include <target/iscsi/iscsi_target_stat.h>
#include "iscsi_target_tq.h"
#include "iscsi_target_device.h" #include "iscsi_target_device.h"
#include "iscsi_target_nego.h" #include "iscsi_target_nego.h"
#include "iscsi_target_erl0.h" #include "iscsi_target_erl0.h"
......
This diff is collapsed.
#ifndef ISCSI_THREAD_QUEUE_H
#define ISCSI_THREAD_QUEUE_H
/*
* Defines for thread sets.
*/
extern int iscsi_thread_set_force_reinstatement(struct iscsi_conn *);
extern int iscsi_allocate_thread_sets(u32);
extern void iscsi_deallocate_thread_sets(void);
extern void iscsi_activate_thread_set(struct iscsi_conn *, struct iscsi_thread_set *);
extern struct iscsi_thread_set *iscsi_get_thread_set(void);
extern void iscsi_set_thread_clear(struct iscsi_conn *, u8);
extern void iscsi_set_thread_set_signal(struct iscsi_conn *, u8);
extern int iscsi_release_thread_set(struct iscsi_conn *);
extern struct iscsi_conn *iscsi_rx_thread_pre_handler(struct iscsi_thread_set *);
extern struct iscsi_conn *iscsi_tx_thread_pre_handler(struct iscsi_thread_set *);
extern int iscsi_thread_set_init(void);
extern void iscsi_thread_set_free(void);
extern int iscsi_target_tx_thread(void *);
extern int iscsi_target_rx_thread(void *);
#define TARGET_THREAD_SET_COUNT 4
#define ISCSI_RX_THREAD 1
#define ISCSI_TX_THREAD 2
#define ISCSI_RX_THREAD_NAME "iscsi_trx"
#define ISCSI_TX_THREAD_NAME "iscsi_ttx"
#define ISCSI_BLOCK_RX_THREAD 0x1
#define ISCSI_BLOCK_TX_THREAD 0x2
#define ISCSI_CLEAR_RX_THREAD 0x1
#define ISCSI_CLEAR_TX_THREAD 0x2
#define ISCSI_SIGNAL_RX_THREAD 0x1
#define ISCSI_SIGNAL_TX_THREAD 0x2
/* struct iscsi_thread_set->status */
#define ISCSI_THREAD_SET_FREE 1
#define ISCSI_THREAD_SET_ACTIVE 2
#define ISCSI_THREAD_SET_DIE 3
#define ISCSI_THREAD_SET_RESET 4
#define ISCSI_THREAD_SET_DEALLOCATE_THREADS 5
/* By default allow a maximum of 32K iSCSI connections */
#define ISCSI_TS_BITMAP_BITS 32768
struct iscsi_thread_set {
/* flags used for blocking and restarting sets */
int blocked_threads;
/* flag for creating threads */
int create_threads;
/* flag for delaying readding to inactive list */
int delay_inactive;
/* status for thread set */
int status;
/* which threads have had signals sent */
int signal_sent;
/* flag for which threads exited first */
int thread_clear;
/* Active threads in the thread set */
int thread_count;
/* Unique thread ID */
u32 thread_id;
/* pointer to connection if set is active */
struct iscsi_conn *conn;
/* used for controlling ts state accesses */
spinlock_t ts_state_lock;
/* used for restarting thread queue */
struct completion rx_restart_comp;
/* used for restarting thread queue */
struct completion tx_restart_comp;
/* used for normal unused blocking */
struct completion rx_start_comp;
/* used for normal unused blocking */
struct completion tx_start_comp;
/* OS descriptor for rx thread */
struct task_struct *rx_thread;
/* OS descriptor for tx thread */
struct task_struct *tx_thread;
/* struct iscsi_thread_set in list list head*/
struct list_head ts_list;
struct semaphore ts_activate_sem;
};
#endif /*** ISCSI_THREAD_QUEUE_H ***/
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "iscsi_target_erl1.h" #include "iscsi_target_erl1.h"
#include "iscsi_target_erl2.h" #include "iscsi_target_erl2.h"
#include "iscsi_target_tpg.h" #include "iscsi_target_tpg.h"
#include "iscsi_target_tq.h"
#include "iscsi_target_util.h" #include "iscsi_target_util.h"
#include "iscsi_target.h" #include "iscsi_target.h"
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#define ISCSIT_MIN_TAGS 16 #define ISCSIT_MIN_TAGS 16
#define ISCSIT_EXTRA_TAGS 8 #define ISCSIT_EXTRA_TAGS 8
#define ISCSIT_TCP_BACKLOG 256 #define ISCSIT_TCP_BACKLOG 256
#define ISCSI_RX_THREAD_NAME "iscsi_trx"
#define ISCSI_TX_THREAD_NAME "iscsi_ttx"
/* struct iscsi_node_attrib sanity values */ /* struct iscsi_node_attrib sanity values */
#define NA_DATAOUT_TIMEOUT 3 #define NA_DATAOUT_TIMEOUT 3
...@@ -600,8 +602,6 @@ struct iscsi_conn { ...@@ -600,8 +602,6 @@ struct iscsi_conn {
struct iscsi_tpg_np *tpg_np; struct iscsi_tpg_np *tpg_np;
/* Pointer to parent session */ /* Pointer to parent session */
struct iscsi_session *sess; struct iscsi_session *sess;
/* Pointer to thread_set in use for this conn's threads */
struct iscsi_thread_set *thread_set;
int bitmap_id; int bitmap_id;
int rx_thread_active; int rx_thread_active;
struct task_struct *rx_thread; struct task_struct *rx_thread;
...@@ -877,8 +877,6 @@ struct iscsit_global { ...@@ -877,8 +877,6 @@ struct iscsit_global {
u32 auth_id; u32 auth_id;
u32 inactive_ts; u32 inactive_ts;
#define ISCSIT_BITMAP_BITS 262144 #define ISCSIT_BITMAP_BITS 262144
/* Thread Set bitmap count */
int ts_bitmap_count;
/* Thread Set bitmap pointer */ /* Thread Set bitmap pointer */
unsigned long *ts_bitmap; unsigned long *ts_bitmap;
spinlock_t ts_bitmap_lock; spinlock_t ts_bitmap_lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment