[stgt] [PATCH 04/12] Define and use define_rdma_enabled for thread per target

Chandra Seetharaman sekharan at us.ibm.com
Mon Sep 27 23:06:55 CEST 2010


Define a new variable iscsi_rdma_enabled, which is enabled when iSCSI
RDMA is defined.

Disallow thread per target feature if RDMA is defined or signalfd feature
is not available.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
Signed-off-by: Chandra Seetharaman <sekharan at us.ibm.com>

---
 usr/iscsi/iscsi_rdma.c |    2 ++
 usr/iscsi/iscsid.c     |    7 +++++++
 usr/iscsi/iscsid.h     |    2 ++
 usr/iscsi/transport.h  |    2 ++
 4 files changed, 13 insertions(+)

Index: tgt-102236c/usr/iscsi/transport.h
===================================================================
--- tgt-102236c.orig/usr/iscsi/transport.h
+++ tgt-102236c/usr/iscsi/transport.h
@@ -4,6 +4,8 @@
 #include <sys/socket.h>
 #include "list.h"
 
+extern int iscsi_rdma_enabled;
+
 struct iscsi_connection;
 struct iscsi_task;
 
Index: tgt-102236c/usr/iscsi/iscsid.h
===================================================================
--- tgt-102236c.orig/usr/iscsi/iscsid.h
+++ tgt-102236c/usr/iscsi/iscsid.h
@@ -320,6 +320,8 @@ int iscsi_target_update(int mode, int op
 int target_redirected(struct iscsi_target *target,
 	struct iscsi_connection *conn, char *buf, int *reason);
 
+int iscsi_pthread_per_target(void);
+
 /* param.c */
 int param_index_by_name(char *name, struct iscsi_key *keys);
 
Index: tgt-102236c/usr/iscsi/iscsi_rdma.c
===================================================================
--- tgt-102236c.orig/usr/iscsi/iscsi_rdma.c
+++ tgt-102236c/usr/iscsi/iscsi_rdma.c
@@ -1194,6 +1194,8 @@ static int iscsi_rdma_init(void)
 	INIT_LIST_HEAD(&iser_conn_list);
 	INIT_LIST_HEAD(&temp_conn);
 
+	iscsi_rdma_enabled = 1;
+
 	return ret;
 }
 
Index: tgt-102236c/usr/iscsi/iscsid.c
===================================================================
--- tgt-102236c.orig/usr/iscsi/iscsid.c
+++ tgt-102236c/usr/iscsi/iscsid.c
@@ -74,6 +74,13 @@ enum {
 	IOSTATE_TX_END,
 };
 
+int iscsi_rdma_enabled;
+
+int iscsi_pthread_per_target(void)
+{
+	return sig_fd >= 0 && !iscsi_rdma_enabled;
+}
+
 void conn_read_pdu(struct iscsi_connection *conn)
 {
 	conn->rx_iostate = IOSTATE_RX_BHS;
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list