* [PATCH] scsi_transport_iscsi.c contexts
@ 2005-04-27 23:55 Nicholas A. Bellinger
2005-04-28 3:11 ` Mike Christie
0 siblings, 1 reply; 7+ messages in thread
From: Nicholas A. Bellinger @ 2005-04-27 23:55 UTC (permalink / raw)
To: Mike Christie; +Cc: linux-scsi, James Bottomley
[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]
This patch against 2.6.12-rc3 is the first step for scsi_transport_iscsi
getting iSCSI Keys defined in RFC 3720 Section 12 and other values not
defined in this section as keys, but need to be exported out via sysfs
into the correct connection/session contexts.
Currently, scsi_transport_iscsi.[c,h] assume that all values are on a
per session basis. These changes have been tested with the upcoming
iSCSI transport class enabled release of iscsi-initiator-core
(1.6.2.0-rc2), and should hopefully be 'breakage-free' with sfnet.
Comments?
--
Nicholas A. Bellinger <nick@pyxtechnologies.com>
-----------------------------------------------------------------------
Pretty straight forward changes to:
drivers/scsi/scsi_transport_iscsi.c
Added a connection_attrib[] member to iscsi_internal.
Made max_recv_data_segment_len, header_digest, data_digest, ip_address
and port per connection.
Added of_marker, if_marker, of_markint and if_markint from RFC 3720
Appendix A. Also per connection.
Also moved around the various CPP macros for creating the class device
functions. This should be much more reable now.
include/scsi/scsi_transport_iscsi.h
Added a struct iscsi_connection_class.
Added struct iscsi_connection_class to struct iscsi_session_class.
Split out the connection/session accessor macros.
Some reorginization of struct iscsi_function_template.
[-- Attachment #2: scsi_transport_iscsi_contexts.patch --]
[-- Type: text/x-patch, Size: 25086 bytes --]
diff -urN linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c
--- linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 15:02:03.000000000 -0700
+++ linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 17:36:20.000000000 -0700
@@ -3,6 +3,8 @@
*
* Copyright (C) IBM Corporation, 2004
* Copyright (C) Mike Christie, 2004
+ * Copyright (C) PyX Technologies, 2005
+ * Copyright (C) Nicholas A. Bellinger <nab@kernel.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +27,8 @@
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_iscsi.h>
-#define ISCSI_SESSION_ATTRS 20
+#define ISCSI_CONNECTION_ATTRS 9
+#define ISCSI_SESSION_ATTRS 15
#define ISCSI_HOST_ATTRS 2
struct iscsi_internal {
@@ -34,6 +37,7 @@
/*
* We do not have any private or other attrs.
*/
+ struct class_device_attribute *connection_attrs[ISCSI_CONNECTION_ATTRS + 1];
struct class_device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
struct class_device_attribute *host_attrs[ISCSI_HOST_ATTRS + 1];
};
@@ -51,68 +55,119 @@
NULL,
NULL,
NULL);
+
/*
- * iSCSI target and session attrs
+ * Format specification attributes
*/
-#define iscsi_session_show_fn(field, format) \
+#define iscsi_show_fn(type, field, format) \
\
static ssize_t \
-show_session_##field(struct class_device *cdev, char *buf) \
+iscsi_show_##type##_##field(struct class_device *cdev, char *buf) \
{ \
struct scsi_target *starget = transport_class_to_starget(cdev); \
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
\
if (i->fnt->get_##field) \
- i->fnt->get_##field(starget); \
- return snprintf(buf, 20, format"\n", iscsi_##field(starget)); \
+ i->fnt->get_##field(starget); \
+ return snprintf(buf, 20, format"\n", iscsi_##field(starget)); \
}
+#define iscsi_connection_rd_attr(field, format) \
+ iscsi_show_fn(connection, field, format) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_connection_##field, NULL);
+
#define iscsi_session_rd_attr(field, format) \
- iscsi_session_show_fn(field, format) \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_session_##field, NULL);
+ iscsi_show_fn(session, field, format) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_session_##field, NULL);
-iscsi_session_rd_attr(tpgt, "%hu");
-iscsi_session_rd_attr(tsih, "%2x");
-iscsi_session_rd_attr(max_recv_data_segment_len, "%u");
-iscsi_session_rd_attr(max_burst_len, "%u");
-iscsi_session_rd_attr(first_burst_len, "%u");
-iscsi_session_rd_attr(def_time2wait, "%hu");
-iscsi_session_rd_attr(def_time2retain, "%hu");
-iscsi_session_rd_attr(max_outstanding_r2t, "%hu");
-iscsi_session_rd_attr(erl, "%d");
+/*
+ * Boolean attributes
+ */
+#define iscsi_show_bool_fn(type, field) \
+ \
+static ssize_t \
+iscsi_show_##type##_bool_##field(struct class_device *cdev, char *buf) \
+{ \
+ struct scsi_target *starget = transport_class_to_starget(cdev); \
+ struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
+ struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
+ \
+ if (i->fnt->get_##field) \
+ i->fnt->get_##field(starget); \
+ \
+ if (iscsi_##field(starget)) \
+ return sprintf(buf, "Yes\n"); \
+ return sprintf(buf, "No\n"); \
+}
+
+#define iscsi_connection_rd_bool_attr(field) \
+ iscsi_show_bool_fn(connection, field) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_connection_bool_##field, NULL);
+#define iscsi_session_rd_bool_attr(field) \
+ iscsi_show_bool_fn(session, field) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_session_bool_##field, NULL);
-#define iscsi_session_show_bool_fn(field) \
+/*
+ * This is used for iSCSI names. Normally, we follow
+ * the transport class convention of having the lld
+ * set the field, but in these cases the value is
+ * too large.
+ */
+#define iscsi_show_str_fn(type, field) \
\
static ssize_t \
-show_session_bool_##field(struct class_device *cdev, char *buf) \
-{ \
- struct scsi_target *starget = transport_class_to_starget(cdev); \
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
- struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
- \
- if (i->fnt->get_##field) \
- i->fnt->get_##field(starget); \
- \
- if (iscsi_##field(starget)) \
- return sprintf(buf, "Yes\n"); \
- return sprintf(buf, "No\n"); \
+iscsi_show_##type##_str_##field(struct class_device *cdev, char *buf) \
+{ \
+ ssize_t ret = 0; \
+ struct scsi_target *starget = transport_class_to_starget(cdev); \
+ struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
+ struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
+ \
+ if (i->fnt->get_##field) \
+ ret = i->fnt->get_##field(starget, buf, PAGE_SIZE); \
+ return ret; \
}
-#define iscsi_session_rd_bool_attr(field) \
- iscsi_session_show_bool_fn(field) \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_session_bool_##field, NULL);
+#define iscsi_connection_rd_str_attr(field) \
+ iscsi_show_str_fn(connection, field) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_connection_str_##field, NULL);
-iscsi_session_rd_bool_attr(initial_r2t);
-iscsi_session_rd_bool_attr(immediate_data);
-iscsi_session_rd_bool_attr(data_pdu_in_order);
-iscsi_session_rd_bool_attr(data_sequence_in_order);
+#define iscsi_session_rd_str_attr(field) \
+ iscsi_show_str_fn(session, field) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_session_str_##field, NULL);
-#define iscsi_session_show_digest_fn(field) \
+/*
+ * Again, this is used for iSCSI names. Normally, we follow
+ * the transport class convention of having the lld set
+ * the field, but in these cases the value is too large.
+ */
+#define iscsi_host_show_str_fn(field) \
+ \
+static ssize_t \
+iscsi_show_host_str_##field(struct class_device *cdev, char *buf) \
+{ \
+ int ret = 0; \
+ struct Scsi_Host *shost = transport_class_to_shost(cdev); \
+ struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
+ \
+ if (i->fnt->get_##field) \
+ ret = i->fnt->get_##field(shost, buf, PAGE_SIZE); \
+ return ret; \
+}
+
+#define iscsi_host_rd_str_attr(field) \
+ iscsi_host_show_str_fn(field) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_host_str_##field, NULL);
+
+/*
+ * Special case for Digests
+ */
+#define iscsi_show_connection_digest_fn(field) \
\
static ssize_t \
-show_##field(struct class_device *cdev, char *buf) \
+iscsi_show_connection_##field(struct class_device *cdev, char *buf) \
{ \
struct scsi_target *starget = transport_class_to_starget(cdev); \
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
@@ -126,121 +181,93 @@
return sprintf(buf, "None\n"); \
}
-#define iscsi_session_rd_digest_attr(field) \
- iscsi_session_show_digest_fn(field) \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
-
-iscsi_session_rd_digest_attr(header_digest);
-iscsi_session_rd_digest_attr(data_digest);
-
-static ssize_t
-show_port(struct class_device *cdev, char *buf)
-{
- struct scsi_target *starget = transport_class_to_starget(cdev);
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
- struct iscsi_internal *i = to_iscsi_internal(shost->transportt);
-
- if (i->fnt->get_port)
- i->fnt->get_port(starget);
-
- return snprintf(buf, 20, "%hu\n", ntohs(iscsi_port(starget)));
-}
-static CLASS_DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
-
-static ssize_t
-show_ip_address(struct class_device *cdev, char *buf)
-{
- struct scsi_target *starget = transport_class_to_starget(cdev);
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
- struct iscsi_internal *i = to_iscsi_internal(shost->transportt);
-
- if (i->fnt->get_ip_address)
- i->fnt->get_ip_address(starget);
-
- if (iscsi_addr_type(starget) == AF_INET)
- return sprintf(buf, "%u.%u.%u.%u\n",
- NIPQUAD(iscsi_sin_addr(starget)));
- else if(iscsi_addr_type(starget) == AF_INET6)
- return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
- NIP6(iscsi_sin6_addr(starget)));
- return -EINVAL;
-}
-static CLASS_DEVICE_ATTR(ip_address, S_IRUGO, show_ip_address, NULL);
-
-static ssize_t
-show_isid(struct class_device *cdev, char *buf)
-{
- struct scsi_target *starget = transport_class_to_starget(cdev);
- struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
- struct iscsi_internal *i = to_iscsi_internal(shost->transportt);
-
- if (i->fnt->get_isid)
- i->fnt->get_isid(starget);
-
- return sprintf(buf, "%02x%02x%02x%02x%02x%02x\n",
- iscsi_isid(starget)[0], iscsi_isid(starget)[1],
- iscsi_isid(starget)[2], iscsi_isid(starget)[3],
- iscsi_isid(starget)[4], iscsi_isid(starget)[5]);
-}
-static CLASS_DEVICE_ATTR(isid, S_IRUGO, show_isid, NULL);
+#define iscsi_connection_rd_digest_attr(field) \
+ iscsi_show_connection_digest_fn(field) \
+static CLASS_DEVICE_ATTR(field, S_IRUGO, iscsi_show_connection_##field, NULL);
/*
- * This is used for iSCSI names. Normally, we follow
- * the transport class convention of having the lld
- * set the field, but in these cases the value is
- * too large.
+ * Special case for iSCSI Port
*/
-#define iscsi_session_show_str_fn(field) \
+#define iscsi_show_connection_port_fn() \
\
static ssize_t \
-show_session_str_##field(struct class_device *cdev, char *buf) \
+iscsi_show_connection_port(struct class_device *cdev, char *buf) \
{ \
- ssize_t ret = 0; \
struct scsi_target *starget = transport_class_to_starget(cdev); \
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
\
- if (i->fnt->get_##field) \
- ret = i->fnt->get_##field(starget, buf, PAGE_SIZE); \
- return ret; \
+ if (i->fnt->get_port) \
+ i->fnt->get_port(starget); \
+ \
+ return snprintf(buf, 20, "%hu\n", ntohs(iscsi_port(starget))); \
}
-#define iscsi_session_rd_str_attr(field) \
- iscsi_session_show_str_fn(field) \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_session_str_##field, NULL);
-
-iscsi_session_rd_str_attr(target_name);
-iscsi_session_rd_str_attr(target_alias);
+#define iscsi_connection_rd_port() \
+ iscsi_show_connection_port_fn() \
+static CLASS_DEVICE_ATTR(port, S_IRUGO, iscsi_show_connection_port, NULL);
/*
- * iSCSI host attrs
+ * Special case for iSCSI IP Address - Connection Only
*/
+#define iscsi_show_connection_ip_address_fn() \
+ \
+static ssize_t \
+iscsi_show_connection_ip_address(struct class_device *cdev, char *buf) \
+{ \
+ struct scsi_target *starget = transport_class_to_starget(cdev); \
+ struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
+ struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
+ \
+ if (i->fnt->get_ip_address) \
+ i->fnt->get_ip_address(starget); \
+ \
+ if (iscsi_addr_type(starget) == AF_INET) \
+ return sprintf(buf, "%u.%u.%u.%u\n", \
+ NIPQUAD(iscsi_sin_addr(starget))); \
+ else if(iscsi_addr_type(starget) == AF_INET6) \
+ return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", \
+ NIP6(iscsi_sin6_addr(starget))); \
+ return -EINVAL; \
+}
+
+#define iscsi_connection_rd_ip_address() \
+ iscsi_show_connection_ip_address_fn() \
+static CLASS_DEVICE_ATTR(ip_address, S_IRUGO, iscsi_show_connection_ip_address, NULL);
/*
- * Again, this is used for iSCSI names. Normally, we follow
- * the transport class convention of having the lld set
- * the field, but in these cases the value is too large.
+ * Special case for iSCSI Initiator ISID - Session Wide
*/
-#define iscsi_host_show_str_fn(field) \
+#define iscsi_show_session_isid_fn() \
\
static ssize_t \
-show_host_str_##field(struct class_device *cdev, char *buf) \
+iscsi_show_session_isid(struct class_device *cdev, char *buf) \
{ \
- int ret = 0; \
- struct Scsi_Host *shost = transport_class_to_shost(cdev); \
+ struct scsi_target *starget = transport_class_to_starget(cdev); \
+ struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
struct iscsi_internal *i = to_iscsi_internal(shost->transportt); \
\
- if (i->fnt->get_##field) \
- ret = i->fnt->get_##field(shost, buf, PAGE_SIZE); \
- return ret; \
+ if (i->fnt->get_isid) \
+ i->fnt->get_isid(starget); \
+ \
+ return sprintf(buf, "%02x%02x%02x%02x%02x%02x\n", \
+ iscsi_isid(starget)[0], iscsi_isid(starget)[1], \
+ iscsi_isid(starget)[2], iscsi_isid(starget)[3], \
+ iscsi_isid(starget)[4], iscsi_isid(starget)[5]); \
}
-#define iscsi_host_rd_str_attr(field) \
- iscsi_host_show_str_fn(field) \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_host_str_##field, NULL);
+#define iscsi_session_rd_isid() \
+ iscsi_show_session_isid_fn() \
+static CLASS_DEVICE_ATTR(isid, S_IRUGO, iscsi_show_session_isid, NULL);
-iscsi_host_rd_str_attr(initiator_name);
-iscsi_host_rd_str_attr(initiator_alias);
+/*
+ * Used in iscsi_register_transport()
+ */
+#define SETUP_CONNECTION_RD_ATTR(field) \
+ if (i->fnt->show_##field) { \
+ i->connection_attrs[count] = &class_device_attr_##field; \
+ count++; \
+ }
#define SETUP_SESSION_RD_ATTR(field) \
if (i->fnt->show_##field) { \
@@ -254,6 +281,48 @@
count++; \
}
+/*
+ * iSCSI keys - RFC 3720 Section 12 - Connection Only
+ */
+iscsi_connection_rd_attr(max_recv_data_segment_len, "%u");
+iscsi_connection_rd_ip_address();
+iscsi_connection_rd_port();
+iscsi_connection_rd_digest_attr(header_digest);
+iscsi_connection_rd_digest_attr(data_digest);
+
+/*
+ * iSCSI Keys - RFC 3720 Appendix A - Connection Only
+ */
+iscsi_connection_rd_attr(of_markint, "%hu");
+iscsi_connection_rd_attr(if_markint, "%hu");
+iscsi_connection_rd_bool_attr(of_marker);
+iscsi_connection_rd_bool_attr(if_marker);
+
+/*
+ * iSCSI Keys - RFC 3270 Section 12 - Session Wide
+ */
+iscsi_session_rd_isid();
+iscsi_session_rd_attr(tpgt, "%hu");
+iscsi_session_rd_attr(tsih, "%2x"); /* Not actually negoitated, returned in login PDU */
+iscsi_session_rd_attr(max_burst_len, "%u");
+iscsi_session_rd_attr(first_burst_len, "%u");
+iscsi_session_rd_attr(def_time2wait, "%hu");
+iscsi_session_rd_attr(def_time2retain, "%hu");
+iscsi_session_rd_attr(max_outstanding_r2t, "%hu");
+iscsi_session_rd_attr(erl, "%d");
+iscsi_session_rd_bool_attr(initial_r2t);
+iscsi_session_rd_bool_attr(immediate_data);
+iscsi_session_rd_bool_attr(data_pdu_in_order);
+iscsi_session_rd_bool_attr(data_sequence_in_order);
+iscsi_session_rd_str_attr(target_name);
+iscsi_session_rd_str_attr(target_alias);
+
+/*
+ * Still Session Wide - Defines as Host Attribute due to length limitiations.
+ */
+iscsi_host_rd_str_attr(initiator_name);
+iscsi_host_rd_str_attr(initiator_alias);
+
static int iscsi_host_match(struct attribute_container *cont,
struct device *dev)
{
@@ -311,18 +380,27 @@
transport_container_register(&i->t.target_attrs);
i->t.target_size = sizeof(struct iscsi_class_session);
- SETUP_SESSION_RD_ATTR(tsih);
+ SETUP_CONNECTION_RD_ATTR(max_recv_data_segment_len);
+ SETUP_CONNECTION_RD_ATTR(header_digest);
+ SETUP_CONNECTION_RD_ATTR(data_digest);
+ SETUP_CONNECTION_RD_ATTR(of_marker);
+ SETUP_CONNECTION_RD_ATTR(if_marker);
+ SETUP_CONNECTION_RD_ATTR(of_markint);
+ SETUP_CONNECTION_RD_ATTR(if_markint);
+ SETUP_CONNECTION_RD_ATTR(ip_address);
+ SETUP_CONNECTION_RD_ATTR(port);
+
+ BUG_ON(count > ISCSI_CONNECTION_ATTRS);
+ i->connection_attrs[count] = NULL;
+
+ count = 0;
SETUP_SESSION_RD_ATTR(isid);
- SETUP_SESSION_RD_ATTR(header_digest);
- SETUP_SESSION_RD_ATTR(data_digest);
+ SETUP_SESSION_RD_ATTR(tsih);
SETUP_SESSION_RD_ATTR(target_name);
SETUP_SESSION_RD_ATTR(target_alias);
- SETUP_SESSION_RD_ATTR(port);
SETUP_SESSION_RD_ATTR(tpgt);
- SETUP_SESSION_RD_ATTR(ip_address);
SETUP_SESSION_RD_ATTR(initial_r2t);
SETUP_SESSION_RD_ATTR(immediate_data);
- SETUP_SESSION_RD_ATTR(max_recv_data_segment_len);
SETUP_SESSION_RD_ATTR(max_burst_len);
SETUP_SESSION_RD_ATTR(first_burst_len);
SETUP_SESSION_RD_ATTR(def_time2wait);
diff -urN linux-2.6.12-rc3/include/scsi/scsi_transport_iscsi.h linux-2.6.12-rc3-iscsi/include/scsi/scsi_transport_iscsi.h
--- linux-2.6.12-rc3/include/scsi/scsi_transport_iscsi.h 2005-03-01 23:37:47.000000000 -0800
+++ linux-2.6.12-rc3-iscsi/include/scsi/scsi_transport_iscsi.h 2005-04-27 17:45:23.000000000 -0700
@@ -3,6 +3,7 @@
*
* Copyright (C) IBM Corporation, 2004
* Copyright (C) Mike Christie, 2004
+ * Copyright (C) Nicholas A. Bellinger, 2005 <nab@kernel.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,21 +28,55 @@
struct scsi_transport_template;
-struct iscsi_class_session {
- uint8_t isid[6];
- uint16_t tsih;
+struct iscsi_class_connection {
+ uint32_t max_recv_data_segment_len;
int header_digest; /* 1 CRC32, 0 None */
int data_digest; /* 1 CRC32, 0 None */
- uint16_t tpgt;
+ int of_marker; /* 1 Yes, 0 No */
+ int if_marker; /* 1 Yes, 0 No */
+ uint32_t of_markint;
+ uint32_t if_markint;
union {
struct in6_addr sin6_addr;
struct in_addr sin_addr;
} u;
sa_family_t addr_type; /* must be AF_INET or AF_INET6 */
uint16_t port; /* must be in network byte order */
+};
+
+/*
+ * connection accessor macros
+ */
+#define iscsi_max_recv_data_segment_len(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->max_recv_data_segment_len)
+#define iscsi_header_digest(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->header_digest)
+#define iscsi_data_digest(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->data_digest)
+#define iscsi_of_marker(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->of_marker)
+#define iscsi_if_marker(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->if_marker)
+#define iscsi_of_markint(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->of_markint)
+#define iscsi_if_markint(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->if_markint)
+#define iscsi_addr_type(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->addr_type)
+#define iscsi_sin_addr(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->u.sin_addr)
+#define iscsi_sin6_addr(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->u.sin6_addr)
+#define iscsi_port(x) \
+ (((struct iscsi_class_connection *)&(x)->starget_data)->port)
+
+struct iscsi_class_session {
+ struct iscsi_class_connection conn; /* Only a Single Connection */
+ uint8_t isid[6];
+ uint16_t tsih;
+ uint16_t tpgt;
int initial_r2t; /* 1 Yes, 0 No */
int immediate_data; /* 1 Yes, 0 No */
- uint32_t max_recv_data_segment_len;
uint32_t max_burst_len;
uint32_t first_burst_len;
uint16_t def_time2wait;
@@ -53,32 +88,18 @@
};
/*
- * accessor macros
+ * session accessor macros
*/
#define iscsi_isid(x) \
(((struct iscsi_class_session *)&(x)->starget_data)->isid)
#define iscsi_tsih(x) \
(((struct iscsi_class_session *)&(x)->starget_data)->tsih)
-#define iscsi_header_digest(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->header_digest)
-#define iscsi_data_digest(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->data_digest)
-#define iscsi_port(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->port)
-#define iscsi_addr_type(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->addr_type)
-#define iscsi_sin_addr(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->u.sin_addr)
-#define iscsi_sin6_addr(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->u.sin6_addr)
#define iscsi_tpgt(x) \
(((struct iscsi_class_session *)&(x)->starget_data)->tpgt)
#define iscsi_initial_r2t(x) \
(((struct iscsi_class_session *)&(x)->starget_data)->initial_r2t)
#define iscsi_immediate_data(x) \
(((struct iscsi_class_session *)&(x)->starget_data)->immediate_data)
-#define iscsi_max_recv_data_segment_len(x) \
- (((struct iscsi_class_session *)&(x)->starget_data)->max_recv_data_segment_len)
#define iscsi_max_burst_len(x) \
(((struct iscsi_class_session *)&(x)->starget_data)->max_burst_len)
#define iscsi_first_burst_len(x) \
@@ -101,19 +122,28 @@
*/
struct iscsi_function_template {
/*
- * target attrs
+ * target attrs - connection context
*/
- void (*get_isid)(struct scsi_target *);
- void (*get_tsih)(struct scsi_target *);
+ void (*get_max_recv_data_segment_len)(struct scsi_target *);
void (*get_header_digest)(struct scsi_target *);
void (*get_data_digest)(struct scsi_target *);
- void (*get_port)(struct scsi_target *);
- void (*get_tpgt)(struct scsi_target *);
+ void (*get_of_marker)(struct scsi_target *);
+ void (*get_if_marker)(struct scsi_target *);
+ void (*get_if_markint)(struct scsi_target *);
+ void (*get_of_markint)(struct scsi_target *);
/*
* In get_ip_address the lld must set the address and
* the address type
*/
void (*get_ip_address)(struct scsi_target *);
+ void (*get_port)(struct scsi_target *);
+
+ /*
+ * target attrs - session context
+ */
+ void (*get_isid)(struct scsi_target *);
+ void (*get_tsih)(struct scsi_target *);
+ void (*get_tpgt)(struct scsi_target *);
/*
* The lld should snprintf the name or alias to the buffer
*/
@@ -121,7 +151,6 @@
ssize_t (*get_target_alias)(struct scsi_target *, char *, ssize_t);
void (*get_initial_r2t)(struct scsi_target *);
void (*get_immediate_data)(struct scsi_target *);
- void (*get_max_recv_data_segment_len)(struct scsi_target *);
void (*get_max_burst_len)(struct scsi_target *);
void (*get_first_burst_len)(struct scsi_target *);
void (*get_def_time2wait)(struct scsi_target *);
@@ -132,10 +161,9 @@
void (*get_erl)(struct scsi_target *);
/*
- * host atts
- */
-
- /*
+ * host attrs - In this case the initiator_name and initiator_isid
+ * make up the SCSI Initiator Port side of the Nexus.
+ *
* The lld should snprintf the name or alias to the buffer
*/
ssize_t (*get_initiator_alias)(struct Scsi_Host *, char *, ssize_t);
@@ -148,18 +176,28 @@
* since we only use the values for sysfs but this is how
* fc does it too.
*/
- unsigned long show_isid:1;
- unsigned long show_tsih:1;
+ /*
+ * Connection Only.
+ */
+ unsigned long show_max_recv_data_segment_len:1;
unsigned long show_header_digest:1;
unsigned long show_data_digest:1;
+ unsigned long show_of_marker:1;
+ unsigned long show_if_marker:1;
+ unsigned long show_of_markint:1;
+ unsigned long show_if_markint:1;
unsigned long show_port:1;
+ /*
+ * Session Wide
+ */
+ unsigned long show_isid:1;
+ unsigned long show_tsih:1;
unsigned long show_tpgt:1;
unsigned long show_ip_address:1;
unsigned long show_target_name:1;
unsigned long show_target_alias:1;
unsigned long show_initial_r2t:1;
unsigned long show_immediate_data:1;
- unsigned long show_max_recv_data_segment_len:1;
unsigned long show_max_burst_len:1;
unsigned long show_first_burst_len:1;
unsigned long show_def_time2wait:1;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi_transport_iscsi.c contexts
2005-04-27 23:55 [PATCH] scsi_transport_iscsi.c contexts Nicholas A. Bellinger
@ 2005-04-28 3:11 ` Mike Christie
2005-04-29 19:45 ` Nicholas A. Bellinger
0 siblings, 1 reply; 7+ messages in thread
From: Mike Christie @ 2005-04-28 3:11 UTC (permalink / raw)
To: Nicholas A. Bellinger; +Cc: linux-scsi, James Bottomley
Nicholas A. Bellinger wrote:
> This patch against 2.6.12-rc3 is the first step for scsi_transport_iscsi
> getting iSCSI Keys defined in RFC 3720 Section 12 and other values not
> defined in this section as keys, but need to be exported out via sysfs
> into the correct connection/session contexts.
>
> Currently, scsi_transport_iscsi.[c,h] assume that all values are on a
> per session basis. These changes have been tested with the upcoming
> iSCSI transport class enabled release of iscsi-initiator-core
> (1.6.2.0-rc2), and should hopefully be 'breakage-free' with sfnet.
>
> Comments?
>
>
>
> ------------------------------------------------------------------------
>
> diff -urN linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c
> --- linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 15:02:03.000000000 -0700
> +++ linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 17:36:20.000000000 -0700
> @@ -3,6 +3,8 @@
> *
> * Copyright (C) IBM Corporation, 2004
> * Copyright (C) Mike Christie, 2004
> + * Copyright (C) PyX Technologies, 2005
> + * Copyright (C) Nicholas A. Bellinger <nab@kernel.org>
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -25,7 +27,8 @@
> #include <scsi/scsi_transport.h>
> #include <scsi/scsi_transport_iscsi.h>
>
> -#define ISCSI_SESSION_ATTRS 20
> +#define ISCSI_CONNECTION_ATTRS 9
> +#define ISCSI_SESSION_ATTRS 15
> #define ISCSI_HOST_ATTRS 2
>
> struct iscsi_internal {
> @@ -34,6 +37,7 @@
> /*
> * We do not have any private or other attrs.
> */
> + struct class_device_attribute *connection_attrs[ISCSI_CONNECTION_ATTRS + 1];
How are these attrs getting set up? By the LLD? Patch does not work for me;
nothing shows up btw.
The reason all the settings are stuck on the session was becuase we couldn't
come to an agreement on the layout. We wanted to do something like this:
/sys/class/iscsi_session/iscsi_connection
or even
/sys/class/iscsi_session
/sys/class/iscsi_connection
with some symlinks to glue them together for the latter (I could probably do a better
picture but you get the idea right). It depends on if people allowed us to stick kobjects
in structs to make the dirs (could use a attribute group too I guess) or if they wanted
seperate devices. It might make some sense to figure out the layout while seperating
things out.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi_transport_iscsi.c contexts
2005-04-28 3:11 ` Mike Christie
@ 2005-04-29 19:45 ` Nicholas A. Bellinger
2005-04-29 21:20 ` Mike Christie
0 siblings, 1 reply; 7+ messages in thread
From: Nicholas A. Bellinger @ 2005-04-29 19:45 UTC (permalink / raw)
To: Mike Christie; +Cc: linux-scsi, James Bottomley, iscsi-initiator-core-devel
On Wed, 2005-04-27 at 20:11 -0700, Mike Christie wrote:
> Nicholas A. Bellinger wrote:
> > This patch against 2.6.12-rc3 is the first step for scsi_transport_iscsi
> > getting iSCSI Keys defined in RFC 3720 Section 12 and other values not
> > defined in this section as keys, but need to be exported out via sysfs
> > into the correct connection/session contexts.
> >
> > Currently, scsi_transport_iscsi.[c,h] assume that all values are on a
> > per session basis. These changes have been tested with the upcoming
> > iSCSI transport class enabled release of iscsi-initiator-core
> > (1.6.2.0-rc2), and should hopefully be 'breakage-free' with sfnet.
> >
> > Comments?
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > diff -urN linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c
> > --- linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 15:02:03.000000000 -0700
> > +++ linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 17:36:20.000000000 -0700
> > @@ -3,6 +3,8 @@
> > *
> > * Copyright (C) IBM Corporation, 2004
> > * Copyright (C) Mike Christie, 2004
> > + * Copyright (C) PyX Technologies, 2005
> > + * Copyright (C) Nicholas A. Bellinger <nab@kernel.org>
> > *
> > * This program is free software; you can redistribute it and/or modify
> > * it under the terms of the GNU General Public License as published by
> > @@ -25,7 +27,8 @@
> > #include <scsi/scsi_transport.h>
> > #include <scsi/scsi_transport_iscsi.h>
> >
> > -#define ISCSI_SESSION_ATTRS 20
> > +#define ISCSI_CONNECTION_ATTRS 9
> > +#define ISCSI_SESSION_ATTRS 15
> > #define ISCSI_HOST_ATTRS 2
> >
> > struct iscsi_internal {
> > @@ -34,6 +37,7 @@
> > /*
> > * We do not have any private or other attrs.
> > */
> > + struct class_device_attribute *connection_attrs[ISCSI_CONNECTION_ATTRS + 1];
>
> How are these attrs getting set up? By the LLD? Patch does not work for me;
> nothing shows up btw.
>
Whoops, I forgot to mention that the includes of the local
scsi_transport_scsi.h in linux-iscsi-4.0.1.11 need to be changed from
"scsi_transport_iscsi.h" to <scsi/scsi_transport_iscsi.h>. I assume
this was failing because of the changes to struct
iscsi_function_template in the patch.
> The reason all the settings are stuck on the session was becuase we couldn't
> come to an agreement on the layout. We wanted to do something like this:
>
> /sys/class/iscsi_session/iscsi_connection
>
> or even
>
> /sys/class/iscsi_session
> /sys/class/iscsi_connection
>
I am still thinking on this one. First and foremost I think that we
need to get move towards a single class for iSCSI Initiators instead of
what is currently registered (/sys/class/iscsi_transport
and /sys/class/iscsi_host). Let me keep working on this some more and I
will draft up a prosposal in the near future. Any futher input is
welcomed. :-)
> with some symlinks to glue them together for the latter (I could probably do a better
> picture but you get the idea right). It depends on if people allowed us to stick kobjects
> in structs to make the dirs (could use a attribute group too I guess) or if they wanted
> seperate devices. It might make some sense to figure out the layout while seperating
> things out.
>
The other thing I think we should considering is only registering
iscsi_session and iscsi_connection classes to the iscsi_host (or
whaterver the class is going to be called) when those entities actually
exist within the said iSCSI stack, and unregistering them once they go
away. iscsi-initiator-core already does something along these lines in
iscsi_initiator_sysfs.c, and anchors everything released to a specific
Scsi Host to a 'iSCSI Channel'.
--
Nicholas A. Bellinger <nick@pyxtechnologies.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi_transport_iscsi.c contexts
2005-04-29 19:45 ` Nicholas A. Bellinger
@ 2005-04-29 21:20 ` Mike Christie
2005-04-29 22:13 ` Nicholas A. Bellinger
0 siblings, 1 reply; 7+ messages in thread
From: Mike Christie @ 2005-04-29 21:20 UTC (permalink / raw)
To: Nicholas A. Bellinger
Cc: linux-scsi, James Bottomley, iscsi-initiator-core-devel
Nicholas A. Bellinger wrote:
> On Wed, 2005-04-27 at 20:11 -0700, Mike Christie wrote:
>
>>Nicholas A. Bellinger wrote:
>>
>>>This patch against 2.6.12-rc3 is the first step for scsi_transport_iscsi
>>>getting iSCSI Keys defined in RFC 3720 Section 12 and other values not
>>>defined in this section as keys, but need to be exported out via sysfs
>>>into the correct connection/session contexts.
>>>
>>>Currently, scsi_transport_iscsi.[c,h] assume that all values are on a
>>>per session basis. These changes have been tested with the upcoming
>>>iSCSI transport class enabled release of iscsi-initiator-core
>>>(1.6.2.0-rc2), and should hopefully be 'breakage-free' with sfnet.
>>>
>>>Comments?
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>diff -urN linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c
>>>--- linux-2.6.12-rc3/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 15:02:03.000000000 -0700
>>>+++ linux-2.6.12-rc3-iscsi/drivers/scsi/scsi_transport_iscsi.c 2005-04-27 17:36:20.000000000 -0700
>>>@@ -3,6 +3,8 @@
>>> *
>>> * Copyright (C) IBM Corporation, 2004
>>> * Copyright (C) Mike Christie, 2004
>>>+ * Copyright (C) PyX Technologies, 2005
>>>+ * Copyright (C) Nicholas A. Bellinger <nab@kernel.org>
>>> *
>>> * This program is free software; you can redistribute it and/or modify
>>> * it under the terms of the GNU General Public License as published by
>>>@@ -25,7 +27,8 @@
>>> #include <scsi/scsi_transport.h>
>>> #include <scsi/scsi_transport_iscsi.h>
>>>
>>>-#define ISCSI_SESSION_ATTRS 20
>>>+#define ISCSI_CONNECTION_ATTRS 9
>>>+#define ISCSI_SESSION_ATTRS 15
>>> #define ISCSI_HOST_ATTRS 2
>>>
>>> struct iscsi_internal {
>>>@@ -34,6 +37,7 @@
>>> /*
>>> * We do not have any private or other attrs.
>>> */
>>>+ struct class_device_attribute *connection_attrs[ISCSI_CONNECTION_ATTRS + 1];
>>
>>How are these attrs getting set up? By the LLD? Patch does not work for me;
>>nothing shows up btw.
>>
>
>
> Whoops, I forgot to mention that the includes of the local
> scsi_transport_scsi.h in linux-iscsi-4.0.1.11 need to be changed from
> "scsi_transport_iscsi.h" to <scsi/scsi_transport_iscsi.h>. I assume
> this was failing because of the changes to struct
> iscsi_function_template in the patch.
>
>
>>The reason all the settings are stuck on the session was becuase we couldn't
>>come to an agreement on the layout. We wanted to do something like this:
>>
>>/sys/class/iscsi_session/iscsi_connection
>>
>>or even
>>
>>/sys/class/iscsi_session
>>/sys/class/iscsi_connection
>>
>
>
> I am still thinking on this one. First and foremost I think that we
> need to get move towards a single class for iSCSI Initiators instead of
> what is currently registered (/sys/class/iscsi_transport
> and /sys/class/iscsi_host). Let me keep working on this some more and I
> will draft up a prosposal in the near future. Any futher input is
> welcomed. :-)
>
get everyone to agree (or force them) on how to set the initiarname and alias
and the iscsi_host can be chopped. the iscsi_host is only there becuase sfnet
used a /etc file and I think you can set the initiatorname on some HW cards
from a BIOS/OF prompt (or you will not have control over it) so if they ever
end up on the same box and wanted to konw what each one ended up as you could.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi_transport_iscsi.c contexts
2005-04-29 21:20 ` Mike Christie
@ 2005-04-29 22:13 ` Nicholas A. Bellinger
2005-04-30 1:44 ` Mike Christie
0 siblings, 1 reply; 7+ messages in thread
From: Nicholas A. Bellinger @ 2005-04-29 22:13 UTC (permalink / raw)
To: Mike Christie; +Cc: linux-scsi, James Bottomley, iscsi-initiator-core-devel
On Fri, 2005-04-29 at 14:20 -0700, Mike Christie wrote:
> >>The reason all the settings are stuck on the session was becuase we couldn't
> >>come to an agreement on the layout. We wanted to do something like this:
> >>
> >>/sys/class/iscsi_session/iscsi_connection
> >>
> >>or even
> >>
> >>/sys/class/iscsi_session
> >>/sys/class/iscsi_connection
> >>
> >
> >
> > I am still thinking on this one. First and foremost I think that we
> > need to get move towards a single class for iSCSI Initiators instead of
> > what is currently registered (/sys/class/iscsi_transport
> > and /sys/class/iscsi_host). Let me keep working on this some more and I
> > will draft up a prosposal in the near future. Any futher input is
> > welcomed. :-)
> >
>
> get everyone to agree (or force them) on how to set the initiarname and alias
> and the iscsi_host can be chopped. the iscsi_host is only there becuase sfnet
> used a /etc file and I think you can set the initiatorname on some HW cards
> from a BIOS/OF prompt (or you will not have control over it) so if they ever
> end up on the same box and wanted to konw what each one ended up as you could.
>
Ok, one possible solution is when the iSCSI Template structure gets
registered with the iSCSI Transport, the LLD can tell the transport what
values are already defined. I think this point really goes back to
previous points about different class attributes need to be dynamicly
registered within the iSCSI Stack when certain events occur.
Considering the following:
1) iscsi_attach_transport() is called when the iSCSI Stack is loaded:
/sys/class/iscsi_transport/
a) Initiator[Name,Alias] is not set.
The stack will set this value later.
b) Initiator[Name,Alais] is set.
Assume that ->get_initiator_[name,alias]() will return
values from hardware
2) struct iscsi_channel_class *iscsi_attach_channel(struct
scsi_transport_template)
/sys/class/iscsi_transport/iscsi_$CHANNEL_ID.
Note that for management purposes that $CHANNEL_ID needs to be a
value that does not change. ie: not the SCSI Host ID.
This registers ALL of the sysfs attributes for both session and
connection contexts. These values are read/write as these are
values that are used as the defaults when sessions/connections
are started on said iSCSI Channel.
3) struct iscsi_session_class *iscsi_attach_session(struct
iscsi_channel_class)
/sys/class/iscsi_transport/iscsi_$CHANNEL_ID/
This contains the read only attributes that where negoitated
after successful session establishment. Note that some of these
values need to be write as well. (InitiatorAlias can be changed
after the session is up)
4) struct iscsi_connection_class *iscsi_attach_connection(struct
iscsi_session_class *, unsigned short cid)
/sys/class/iscsi_transport/iscsi_$CHANNEL_ID/session/connection_$CID
This contains the read only attributes that where negoitated
after successful connection establishment. Note that some of
these values need to be write as well.
(MaxRecvDataSegmentLength can be changed after the connection
up).
Of course the names would probable get changed around a bit, but I think you get the idea.
--
Nicholas A. Bellinger <nick@pyxtechnologies.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi_transport_iscsi.c contexts
2005-04-29 22:13 ` Nicholas A. Bellinger
@ 2005-04-30 1:44 ` Mike Christie
2005-04-30 2:30 ` Mike Christie
0 siblings, 1 reply; 7+ messages in thread
From: Mike Christie @ 2005-04-30 1:44 UTC (permalink / raw)
To: Nicholas A. Bellinger
Cc: linux-scsi, James Bottomley, iscsi-initiator-core-devel,
open-iscsi
Nicholas A. Bellinger wrote:
> On Fri, 2005-04-29 at 14:20 -0700, Mike Christie wrote:
>
>>>>The reason all the settings are stuck on the session was becuase we couldn't
>>>>come to an agreement on the layout. We wanted to do something like this:
>>>>
>>>>/sys/class/iscsi_session/iscsi_connection
>>>>
>>>>or even
>>>>
>>>>/sys/class/iscsi_session
>>>>/sys/class/iscsi_connection
>>>>
>>>
>>>
>>>I am still thinking on this one. First and foremost I think that we
>>>need to get move towards a single class for iSCSI Initiators instead of
>>>what is currently registered (/sys/class/iscsi_transport
>>>and /sys/class/iscsi_host). Let me keep working on this some more and I
>>>will draft up a prosposal in the near future. Any futher input is
>>>welcomed. :-)
>>>
>>
>>get everyone to agree (or force them) on how to set the initiarname and alias
>>and the iscsi_host can be chopped. the iscsi_host is only there becuase sfnet
>>used a /etc file and I think you can set the initiatorname on some HW cards
>>from a BIOS/OF prompt (or you will not have control over it) so if they ever
>>end up on the same box and wanted to konw what each one ended up as you could.
>>
>
>
> Ok, one possible solution is when the iSCSI Template structure gets
> registered with the iSCSI Transport, the LLD can tell the transport what
> values are already defined. I think this point really goes back to
> previous points about different class attributes need to be dynamicly
> registered within the iSCSI Stack when certain events occur.
I am not arguing with that. We sent a patch to break the session
stuff from the target (sfnet did not need the channel abstraction) and
from there to add a connection beneath it is a matter of getting hold
of the correct kobject to stick things under (when you use the
transport class/container stuff it is not as simple as before though).
We are also not using sysfs for creation anymore though. Maybe we need
to discuss that point too. We are using netlinks for this so
open-iscsi/linux-iscsi/whatever-name-it-is-called-today:) and pyx have some
confliting points.
As far as filesystem based creation stuff goes it also seems our sysfs
masters may prefer configfs for things like software iscsi, dm or bonding
where userspace is driving the device creation and not the kernel. Do
the scsi maintainers care about this?
>
> Considering the following:
>
> 1) iscsi_attach_transport() is called when the iSCSI Stack is loaded:
>
> /sys/class/iscsi_transport/
>
> a) Initiator[Name,Alias] is not set.
>
> The stack will set this value later.
>
> b) Initiator[Name,Alais] is set.
>
> Assume that ->get_initiator_[name,alias]() will return
> values from hardware
>
this is unrelated to sysfs or netlinks, but will this be able
to support two stacks running at the same time with different
initiator names? It looks like it will be shared across
drivers so it would need
/sys/class/iscsi_transport%SOME_STACK_ENUM
I am jsut wondering becuase whether we should use one name for all drivers
vs each driver using its own has come up several times on the sfnet list.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scsi_transport_iscsi.c contexts
2005-04-30 1:44 ` Mike Christie
@ 2005-04-30 2:30 ` Mike Christie
0 siblings, 0 replies; 7+ messages in thread
From: Mike Christie @ 2005-04-30 2:30 UTC (permalink / raw)
To: Nicholas A. Bellinger
Cc: linux-scsi, James Bottomley, iscsi-initiator-core-devel,
open-iscsi
Mike Christie wrote:
> Nicholas A. Bellinger wrote:
>
>> On Fri, 2005-04-29 at 14:20 -0700, Mike Christie wrote:
>>
>>>>> The reason all the settings are stuck on the session was becuase we
>>>>> couldn't
>>>>> come to an agreement on the layout. We wanted to do something like
>>>>> this:
>>>>>
>>>>> /sys/class/iscsi_session/iscsi_connection
>>>>>
>>>>> or even
>>>>>
>>>>> /sys/class/iscsi_session
>>>>> /sys/class/iscsi_connection
>>>>>
>>>>
>>>>
>>>> I am still thinking on this one. First and foremost I think that we
>>>> need to get move towards a single class for iSCSI Initiators instead of
>>>> what is currently registered (/sys/class/iscsi_transport
>>>> and /sys/class/iscsi_host). Let me keep working on this some more
>>>> and I
>>>> will draft up a prosposal in the near future. Any futher input is
>>>> welcomed. :-)
>>>>
>>>
>>> get everyone to agree (or force them) on how to set the initiarname
>>> and alias
>>> and the iscsi_host can be chopped. the iscsi_host is only there
>>> becuase sfnet
>>> used a /etc file and I think you can set the initiatorname on some HW
>>> cards
>>> from a BIOS/OF prompt (or you will not have control over it) so if
>>> they ever
>>> end up on the same box and wanted to konw what each one ended up as
>>> you could.
>>>
>>
>>
>> Ok, one possible solution is when the iSCSI Template structure gets
>> registered with the iSCSI Transport, the LLD can tell the transport what
>> values are already defined. I think this point really goes back to
>> previous points about different class attributes need to be dynamicly
>> registered within the iSCSI Stack when certain events occur.
>
>
> I am not arguing with that. We sent a patch to break the session
> stuff from the target (sfnet did not need the channel abstraction) and
> from there to add a connection beneath it is a matter of getting hold
> of the correct kobject to stick things under (when you use the
> transport class/container stuff it is not as simple as before though).
>
> We are also not using sysfs for creation anymore though. Maybe we need
> to discuss that point too. We are using netlinks for this so
> open-iscsi/linux-iscsi/whatever-name-it-is-called-today:) and pyx have some
> confliting points.
>
> As far as filesystem based creation stuff goes it also seems our sysfs
> masters may prefer configfs for things like software iscsi, dm or bonding
> where userspace is driving the device creation and not the kernel. Do
> the scsi maintainers care about this?
>
One clarifcation for that last paragraph. I mean configfs for just the
creation part. And sysfs would still be used to export info to userspace.
Or netlink for all or parts or some other fun combo :)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-04-30 2:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-27 23:55 [PATCH] scsi_transport_iscsi.c contexts Nicholas A. Bellinger
2005-04-28 3:11 ` Mike Christie
2005-04-29 19:45 ` Nicholas A. Bellinger
2005-04-29 21:20 ` Mike Christie
2005-04-29 22:13 ` Nicholas A. Bellinger
2005-04-30 1:44 ` Mike Christie
2005-04-30 2:30 ` Mike Christie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox