This commit is contained in:
mchristi 2011-02-01 04:58:53 +00:00
parent d4d8c366be
commit a3c1930c25
14 changed files with 152462 additions and 448 deletions

View File

@ -1,97 +1,7 @@
diff --git a/Makefile b/Makefile diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c
index db460eb..a4d4ce0 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c 1969-12-31 18:00:00.000000000 -0600
--- a/Makefile +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c 2011-01-31 03:00:37.000000000 -0600
+++ b/Makefile @@ -0,0 +1,580 @@
@@ -32,6 +32,7 @@ user: ;
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
$(MAKE) -C utils
+ $(MAKE) -C libiscsi
@echo
@echo "Compilation complete Output file"
@echo "----------------------------------- ----------------"
@@ -53,6 +54,7 @@ kernel: force
force: ;
clean:
+ $(MAKE) -C libiscsi clean
$(MAKE) -C utils/sysdeps clean
$(MAKE) -C utils/fwparam_ibft clean
$(MAKE) -C utils clean
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
new file mode 100644
index 0000000..4aeb44f
--- /dev/null
+++ b/libiscsi/Makefile
@@ -0,0 +1,62 @@
+# This Makefile will work only with GNU make.
+
+OSNAME=$(shell uname -s)
+OPTFLAGS ?= -O2 -g
+WARNFLAGS ?= -Wall -Wstrict-prototypes
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr -I../utils/open-isns \
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
+LIB = libiscsi.so.0
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
+TESTS += tests/test_login tests/test_logout tests/test_params
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
+TESTS += tests/test_set_auth tests/test_get_auth
+
+COMMON_SRCS = sysdeps.o
+# sources shared between iscsid, iscsiadm and iscsistart
+ISCSI_LIB_SRCS = session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
+
+# sources shared with the userspace utils, note we build these separately
+# to get PIC versions.
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
+
+# Flags for the tests
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
+
+all: lib tests html
+
+lib: $(LIB)
+tests: $(TESTS)
+
+common-objs/%.o: ../utils/sysdeps/%.c
+ mkdir -p common-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+usr-objs/%.o: ../usr/%.c
+ mkdir -p usr-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
+ mkdir -p fw-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
+ $(CC) $(CFLAGS) -L../utils/open-isns -lisns -shared -Wl,-soname,$(LIB) $^ -o $@
+ ln -s -f $(LIB) libiscsi.so
+
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
+ $(CC) $(CFLAGS) -L../utils/open-isns -lisns -c $< -o $@
+
+html: libiscsi.h libiscsi.doxy
+ doxygen libiscsi.doxy
+
+clean:
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
+ .depend *~ html $(TESTS) tests/*~
+
+depend:
+ gcc $(CFLAGS) -M `ls *.c` > .depend
+
+-include .depend ../usr/.depend
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
new file mode 100644
index 0000000..a9eb0a6
--- /dev/null
+++ b/libiscsi/libiscsi.c
@@ -0,0 +1,563 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
+ * + *
@ -131,9 +41,13 @@ index 0000000..a9eb0a6
+#include "iscsi_proto.h" +#include "iscsi_proto.h"
+#include "fw_context.h" +#include "fw_context.h"
+#include "iscsid_req.h" +#include "iscsid_req.h"
+#include "iscsi_err.h"
+ +
+#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; } +#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; }
+ +
+/* UGLY, not thread safe :( */
+static int sysfs_initialized = 0;
+
+struct libiscsi_context { +struct libiscsi_context {
+ char error_str[256]; + char error_str[256];
+ /* For get_parameter_helper() */ + /* For get_parameter_helper() */
@ -160,7 +74,10 @@ index 0000000..a9eb0a6
+ return NULL; + return NULL;
+ +
+ log_init("libiscsi", 1024, libiscsi_log, context); + log_init("libiscsi", 1024, libiscsi_log, context);
+ sysfs_init(); + if (!sysfs_initialized) {
+ sysfs_init();
+ sysfs_initialized = 1;
+ }
+ increase_max_files(); + increase_max_files();
+ if (idbm_init(NULL)) { + if (idbm_init(NULL)) {
+ sysfs_cleanup(); + sysfs_cleanup();
@ -467,7 +384,7 @@ index 0000000..a9eb0a6
+{ +{
+ int rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec); + int rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);
+ if (rc) { + if (rc) {
+ iscsid_handle_error(rc); + iscsi_err_print_msg(rc);
+ rc = ENOTCONN; + rc = ENOTCONN;
+ } + }
+ return rc; + return rc;
@ -501,7 +418,7 @@ index 0000000..a9eb0a6
+ +
+ rc = iscsid_req_by_sid(MGMT_IPC_SESSION_LOGOUT, info->sid); + rc = iscsid_req_by_sid(MGMT_IPC_SESSION_LOGOUT, info->sid);
+ if (rc) { + if (rc) {
+ iscsid_handle_error(rc); + iscsi_err_print_msg(rc);
+ rc = EIO; + rc = EIO;
+ } + }
+ +
@ -623,6 +540,11 @@ index 0000000..a9eb0a6
+{ +{
+ struct boot_context fw_entry; + struct boot_context fw_entry;
+ +
+ if (!sysfs_initialized) {
+ sysfs_init();
+ sysfs_initialized = 1;
+ }
+
+ memset(config, 0, sizeof *config); + memset(config, 0, sizeof *config);
+ memset(&fw_entry, 0, sizeof fw_entry); + memset(&fw_entry, 0, sizeof fw_entry);
+ if (fw_get_entry(&fw_entry)) + if (fw_get_entry(&fw_entry))
@ -645,6 +567,11 @@ index 0000000..a9eb0a6
+{ +{
+ struct boot_context fw_entry; + struct boot_context fw_entry;
+ +
+ if (!sysfs_initialized) {
+ sysfs_init();
+ sysfs_initialized = 1;
+ }
+
+ memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN); + memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN);
+ memset(&fw_entry, 0, sizeof fw_entry); + memset(&fw_entry, 0, sizeof fw_entry);
+ if (fw_get_entry(&fw_entry)) + if (fw_get_entry(&fw_entry))
@ -655,11 +582,9 @@ index 0000000..a9eb0a6
+ +
+ return 0; + return 0;
+} +}
diff --git a/libiscsi/libiscsi.doxy b/libiscsi/libiscsi.doxy diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy 1969-12-31 18:00:00.000000000 -0600
index 0000000..663770f +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/libiscsi.doxy
@@ -0,0 +1,1473 @@ @@ -0,0 +1,1473 @@
+# Doxyfile 1.5.7.1 +# Doxyfile 1.5.7.1
+ +
@ -2134,11 +2059,9 @@ index 0000000..663770f
+# used. If set to NO the values of all tags below this one will be ignored. +# used. If set to NO the values of all tags below this one will be ignored.
+ +
+SEARCHENGINE = NO +SEARCHENGINE = NO
diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h 1969-12-31 18:00:00.000000000 -0600
index 0000000..a7d05a5 +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/libiscsi.h
@@ -0,0 +1,343 @@ @@ -0,0 +1,343 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -2483,11 +2406,74 @@ index 0000000..a7d05a5
+#endif /* __cplusplus */ +#endif /* __cplusplus */
+ +
+#endif +#endif
diff --git a/libiscsi/pylibiscsi.c b/libiscsi/pylibiscsi.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile 1969-12-31 18:00:00.000000000 -0600
index 0000000..454a26a +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile 2011-01-31 03:03:47.000000000 -0600
--- /dev/null @@ -0,0 +1,61 @@
+++ b/libiscsi/pylibiscsi.c +# This Makefile will work only with GNU make.
+
+OSNAME=$(shell uname -s)
+OPTFLAGS ?= -O2 -g
+WARNFLAGS ?= -Wall -Wstrict-prototypes
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
+LIB = libiscsi.so.0
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
+TESTS += tests/test_login tests/test_logout tests/test_params
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
+TESTS += tests/test_set_auth tests/test_get_auth
+
+COMMON_SRCS = sysdeps.o
+# sources shared between iscsid, iscsiadm and iscsistart
+ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
+
+# sources shared with the userspace utils, note we build these separately
+# to get PIC versions.
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
+
+# Flags for the tests
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
+
+all: lib tests html
+
+lib: $(LIB)
+tests: $(TESTS)
+
+common-objs/%.o: ../utils/sysdeps/%.c
+ mkdir -p common-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+usr-objs/%.o: ../usr/%.c
+ mkdir -p usr-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
+ mkdir -p fw-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
+ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@
+ ln -s -f $(LIB) libiscsi.so
+
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
+
+html: libiscsi.h libiscsi.doxy
+ doxygen libiscsi.doxy
+
+clean:
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
+ .depend *~ html $(TESTS) tests/*~
+
+depend:
+ gcc $(CFLAGS) -M `ls *.c` > .depend
+
+-include .depend ../usr/.depend
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c 2011-01-31 02:35:29.000000000 -0600
@@ -0,0 +1,624 @@ @@ -0,0 +1,624 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3113,11 +3099,9 @@ index 0000000..454a26a
+ Py_INCREF(&PyIscsiNode_Type); + Py_INCREF(&PyIscsiNode_Type);
+ PyModule_AddObject(m, "node", (PyObject *) &PyIscsiNode_Type); + PyModule_AddObject(m, "node", (PyObject *) &PyIscsiNode_Type);
+} +}
diff --git a/libiscsi/setup.py b/libiscsi/setup.py diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py 1969-12-31 18:00:00.000000000 -0600
index 0000000..bb4329b +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/setup.py
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
+from distutils.core import setup, Extension +from distutils.core import setup, Extension
+ +
@ -3128,11 +3112,9 @@ index 0000000..bb4329b
+ +
+setup (name = 'PyIscsi',version = '1.0', +setup (name = 'PyIscsi',version = '1.0',
+ description = 'libiscsi python bindings', ext_modules = [module1]) + description = 'libiscsi python bindings', ext_modules = [module1])
diff --git a/libiscsi/tests/test_discovery_firmware.c b/libiscsi/tests/test_discovery_firmware.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..76e852a +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_discovery_firmware.c
@@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3187,11 +3169,9 @@ index 0000000..76e852a
+ +
+ return rc; + return rc;
+} +}
diff --git a/libiscsi/tests/test_discovery_sendtargets.c b/libiscsi/tests/test_discovery_sendtargets.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtargets.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtargets.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..1a3c12e +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_discovery_sendtargets.c
@@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3253,11 +3233,9 @@ index 0000000..1a3c12e
+ +
+ return rc; + return rc;
+} +}
diff --git a/libiscsi/tests/test_get_auth.c b/libiscsi/tests/test_get_auth.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..5e234da +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_get_auth.c
@@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3329,11 +3307,9 @@ index 0000000..5e234da
+ +
+ return rc; + return rc;
+} +}
diff --git a/libiscsi/tests/test_get_initiator_name.c b/libiscsi/tests/test_get_initiator_name.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..997c053 +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_get_initiator_name.c
@@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3373,11 +3349,9 @@ index 0000000..997c053
+ +
+ return 0; + return 0;
+} +}
diff --git a/libiscsi/tests/test_get_network_config.c b/libiscsi/tests/test_get_network_config.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..2dedd61 +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_get_network_config.c
@@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3424,11 +3398,9 @@ index 0000000..2dedd61
+ +
+ return 0; + return 0;
+} +}
diff --git a/libiscsi/tests/test_login.c b/libiscsi/tests/test_login.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..3eb70d6 +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_login.c
@@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3482,11 +3454,9 @@ index 0000000..3eb70d6
+ +
+ return rc; + return rc;
+} +}
diff --git a/libiscsi/tests/test_logout.c b/libiscsi/tests/test_logout.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..b734dca +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_logout.c
@@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3539,11 +3509,9 @@ index 0000000..b734dca
+ +
+ return rc; + return rc;
+} +}
diff --git a/libiscsi/tests/test_params.c b/libiscsi/tests/test_params.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..d3223be +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_params.c
@@ -0,0 +1,103 @@ @@ -0,0 +1,103 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3648,11 +3616,9 @@ index 0000000..d3223be
+ +
+ return rc; + return rc;
+} +}
diff --git a/libiscsi/tests/test_set_auth.c b/libiscsi/tests/test_set_auth.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..a21f888 +++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c 2011-01-31 02:35:29.000000000 -0600
--- /dev/null
+++ b/libiscsi/tests/test_set_auth.c
@@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
+/* +/*
+ * iSCSI Administration library + * iSCSI Administration library
@ -3712,10 +3678,28 @@ index 0000000..a21f888
+ +
+ return rc; + return rc;
+} +}
diff --git a/usr/discovery.c b/usr/discovery.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/Makefile
index 381f825..2233de7 100644 --- open-iscsi-2.0-872-rc4-bnx2i/Makefile 2011-01-31 02:35:12.000000000 -0600
--- a/usr/discovery.c +++ open-iscsi-2.0-872-rc4-bnx2i.work/Makefile 2011-01-31 02:35:29.000000000 -0600
+++ b/usr/discovery.c @@ -32,6 +32,7 @@ user: ;
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
$(MAKE) -C utils
+ $(MAKE) -C libiscsi
@echo
@echo "Compilation complete Output file"
@echo "----------------------------------- ----------------"
@@ -53,6 +54,7 @@ kernel: force
force: ;
clean:
+ $(MAKE) -C libiscsi clean
$(MAKE) -C utils/sysdeps clean
$(MAKE) -C utils/fwparam_ibft clean
$(MAKE) -C utils clean
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c 2011-01-31 02:35:13.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c 2011-01-31 02:57:55.000000000 -0600
@@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include "types.h" #include "types.h"
#include "iscsi_proto.h" #include "iscsi_proto.h"
@ -3724,14 +3708,82 @@ index 381f825..2233de7 100644
#include "log.h" #include "log.h"
#include "idbm.h" #include "idbm.h"
#include "iscsi_settings.h" #include "iscsi_settings.h"
diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h @@ -50,9 +51,11 @@
index 74ef948..713914f 100644 #include "iscsi_timer.h"
--- a/usr/iscsi_ipc.h #include "iscsi_err.h"
+++ b/usr/iscsi_ipc.h /* libisns includes */
@@ -111,4 +111,6 @@ struct iscsi_ipc { +#ifdef ISNS_ENABLE
#include "isns.h"
#include "paths.h"
#include "message.h"
+#endif
#ifdef SLP_ENABLE
#include "iscsi-slp-discovery.h"
@@ -98,6 +101,7 @@ static int request_initiator_name(void)
return 0;
}
+#ifdef ISNS_ENABLE
void discovery_isns_free_servername(void)
{
if (isns_config.ic_server_name)
@@ -371,6 +375,7 @@ retry:
discovery_isns_free_servername();
return rc;
}
+#endif
int discovery_fw(void *data, struct iface_rec *iface,
struct list_head *rec_list)
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c 2011-01-31 02:35:13.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c 2011-01-31 02:47:52.000000000 -0600
@@ -1214,9 +1214,9 @@ int idbm_print_all_discovery(int info_le
* fn should return -1 if it skipped the rec, a ISCSI_ERR error code if
* the operation failed or 0 if fn was run successfully.
*/
-static int idbm_for_each_iface(int *found, void *data,
- idbm_iface_op_fn *fn,
- char *targetname, int tpgt, char *ip, int port)
+int idbm_for_each_iface(int *found, void *data,
+ idbm_iface_op_fn *fn,
+ char *targetname, int tpgt, char *ip, int port)
{
DIR *iface_dirfd;
struct dirent *iface_dent;
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h 2011-01-31 02:35:13.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h 2011-01-31 02:48:39.000000000 -0600
@@ -96,6 +96,9 @@ struct rec_op_data {
node_rec_t *match_rec;
idbm_iface_op_fn *fn;
};
+extern int idbm_for_each_iface(int *found, void *data,
+ idbm_iface_op_fn *fn,
+ char *targetname, int tpgt, char *ip, int port);
extern int idbm_for_each_portal(int *found, void *data,
idbm_portal_op_fn *fn, char *targetname);
extern int idbm_for_each_node(int *found, void *data,
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h 2011-01-31 02:35:13.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h 2011-01-31 02:35:29.000000000 -0600
@@ -131,4 +131,6 @@ struct iscsi_ipc {
int (*recv_pdu_end) (struct iscsi_conn *conn); int (*recv_pdu_end) (struct iscsi_conn *conn);
}; };
+struct iscsi_ipc *ipc; +struct iscsi_ipc *ipc;
+ +
#endif /* ISCSI_IPC_H */ #endif /* ISCSI_IPC_H */
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 02:35:13.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 02:57:55.000000000 -0600
@@ -31,7 +31,7 @@ endif
OPTFLAGS ?= -O2 -g
WARNFLAGS ?= -Wall -Wstrict-prototypes
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../include -I. -I../utils/open-isns \
- -D$(OSNAME) $(IPC_CFLAGS)
+ -D$(OSNAME) $(IPC_CFLAGS) -DISNS_ENABLE
PROGRAMS = iscsid iscsiadm iscsistart
# libc compat files

View File

@ -0,0 +1,19 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8 open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/docs/brcm_iscsiuio.8
--- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8 2011-01-31 19:38:19.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/docs/brcm_iscsiuio.8 2011-01-31 19:38:44.000000000 -0600
@@ -67,6 +67,15 @@ into the background.
.TP
.BI -v
This is to print the version.
+.PP
+.TP
+.BI -p <pidfile>
+Use pidfile (default /var/run/brcm_iscsiuio.pid )
+.PP
+.TP
+.BI -h
+Display this help and exit.
+
.\"
.\" AUTHOR part

View File

@ -0,0 +1,39 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/Makefile 2011-01-31 21:01:06.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/Makefile 2011-01-31 21:01:22.000000000 -0600
@@ -27,7 +27,7 @@ IFACEFILES = etc/iface.example
all: user kernel
user: ;
- cd utils/open-isns; ./configure; $(MAKE)
+ cd utils/open-isns; ./configure --with-security=no; $(MAKE)
$(MAKE) -C utils/sysdeps
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 21:01:06.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 21:01:22.000000000 -0600
@@ -54,10 +54,10 @@ all: $(PROGRAMS)
iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
iscsid.o session_mgmt.o discoveryd.o
- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
+ $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
+ $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
iscsistart.o statics.o
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/Makefile.in open-iscsi-2.0-872-rc4-bnx2i.work/utils/open-isns/Makefile.in
--- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/Makefile.in 2011-01-31 21:01:05.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/utils/open-isns/Makefile.in 2011-01-31 21:01:22.000000000 -0600
@@ -32,7 +32,6 @@ LIBOBJS = server.o \
security.o \
authblock.o \
policy.o \
- pki.o \
register.o \
query.o \
getnext.o \

View File

@ -1,9 +1,9 @@
diff -aup open-iscsi-2.0-872-rc1-bnx2i/usr/Makefile open-iscsi-2.0-872-rc1-bnx2i.work/usr/Makefile diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc1-bnx2i/usr/Makefile 2010-06-18 18:04:51.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 06:23:53.000000000 -0600
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/Makefile 2010-06-18 18:13:33.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 06:23:14.000000000 -0600
@@ -60,7 +60,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_ @@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_
iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
iscsistart.o statics.o iscsistart.o statics.o
- $(CC) $(CFLAGS) -static $^ -o $@ - $(CC) $(CFLAGS) -static $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -o $@

View File

@ -1,6 +1,6 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work/README diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work/README
--- open-iscsi-2.0-872-rc4-bnx2i/README 2010-08-18 03:14:34.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/README 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2010-08-18 03:26:36.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2011-01-31 06:36:18.000000000 -0600
@@ -403,8 +403,9 @@ this the following is not needed for sof @@ -403,8 +403,9 @@ this the following is not needed for sof
Warning!!!!!! Warning!!!!!!
This feature is experimental. The interface may change. When reporting This feature is experimental. The interface may change. When reporting
@ -47,9 +47,9 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work
# iscsiadm -m iface # iscsiadm -m iface
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2010-08-18 03:14:34.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2011-01-31 06:23:53.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2010-08-18 03:55:19.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2011-01-31 06:36:18.000000000 -0600
@@ -850,11 +850,11 @@ session_conn_reopen(iscsi_conn_t *conn, @@ -670,11 +670,11 @@ session_conn_reopen(iscsi_conn_t *conn,
static int iscsi_retry_initial_login(struct iscsi_conn *conn) static int iscsi_retry_initial_login(struct iscsi_conn *conn)
{ {
@ -63,7 +63,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-b
memset(&now, 0, sizeof(now)); memset(&now, 0, sizeof(now));
memset(&timeout, 0, sizeof(timeout)); memset(&timeout, 0, sizeof(timeout));
@@ -864,7 +864,7 @@ static int iscsi_retry_initial_login(str @@ -684,7 +684,7 @@ static int iscsi_retry_initial_login(str
if (gettimeofday(&now, NULL)) { if (gettimeofday(&now, NULL)) {
log_error("Could not get time of day. Dropping down to " log_error("Could not get time of day. Dropping down to "
"max retry check.\n"); "max retry check.\n");
@ -72,7 +72,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-b
} }
timeradd(&conn->initial_connect_time, &timeout, &fail_time); timeradd(&conn->initial_connect_time, &timeout, &fail_time);
@@ -873,9 +873,13 @@ static int iscsi_retry_initial_login(str @@ -693,9 +693,13 @@ static int iscsi_retry_initial_login(str
* then it is time to give up * then it is time to give up
*/ */
if (timercmp(&now, &fail_time, >)) { if (timercmp(&now, &fail_time, >)) {
@ -90,8 +90,8 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-b
} }
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c 2010-08-18 03:14:34.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c 2010-08-18 03:14:58.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c 2011-01-31 06:36:18.000000000 -0600
@@ -259,3 +259,16 @@ int iscsi_match_session(void *data, stru @@ -259,3 +259,16 @@ int iscsi_match_session(void *data, stru
info->persistent_address, info->persistent_address,
info->persistent_port, &info->iface); info->persistent_port, &info->iface);
@ -110,8 +110,8 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-
+ "after changing the sysctl settings)."); + "after changing the sysctl settings).");
+} +}
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h 2010-08-18 03:14:34.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h 2010-08-18 03:14:58.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h 2011-01-31 06:36:18.000000000 -0600
@@ -21,4 +21,6 @@ extern int __iscsi_match_session(struct @@ -21,4 +21,6 @@ extern int __iscsi_match_session(struct
extern char *strstrip(char *s); extern char *strstrip(char *s);
extern char *cfg_get_string_param(char *pathname, const char *key); extern char *cfg_get_string_param(char *pathname, const char *key);
@ -120,18 +120,18 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-
+ +
#endif #endif
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c 2010-08-18 03:14:34.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c 2010-08-18 03:14:58.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c 2011-01-31 06:36:18.000000000 -0600
@@ -41,6 +41,13 @@ static void log_login_msg(struct node_re @@ -42,6 +42,13 @@ static void log_login_msg(struct node_re
rec->name, rec->conn[0].address, rec->name, rec->conn[0].address,
rec->conn[0].port); rec->conn[0].port);
iscsid_handle_error(rc); iscsi_err_print_msg(rc);
+ +
+ /* + /*
+ * If using iface binding with tcp then warn about + * If using iface binding with tcp then warn about
+ * change in kernel behavior. + * change in kernel behavior.
+ */ + */
+ if (rc == MGMT_IPC_ERR_TRANS_TIMEOUT) + if (rc == ISCSI_ERR_TRANS_TIMEOUT)
+ iscsi_warn_on_iface_cfg(rec); + iscsi_warn_on_iface_cfg(rec);
} else } else
log_info("Login to [iface: %s, target: %s, portal: " log_info("Login to [iface: %s, target: %s, portal: "

View File

@ -1,29 +1,16 @@
From cac36706909b91ba3254cd8083291bf6746e831b Mon Sep 17 00:00:00 2001 diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_net_util.c
From: Ales Kozumplik <akozumpl@redhat.com> --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c 2011-01-31 19:24:50.000000000 -0600
Date: Fri, 26 Nov 2010 17:27:42 +0100 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_net_util.c 2011-01-31 19:26:28.000000000 -0600
Subject: [PATCH] Remove the OFFLOAD_BOOT_SUPPORTED #ifdef. @@ -39,12 +39,10 @@ struct iscsi_net_driver {
This effectively makes OFFLOAD_BOOT_SUPPORTED always enabled.
---
usr/iscsi_net_util.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/usr/iscsi_net_util.c b/usr/iscsi_net_util.c
index cbe6f56..992d930 100644
--- a/usr/iscsi_net_util.c
+++ b/usr/iscsi_net_util.c
@@ -39,11 +39,9 @@ struct iscsi_net_driver {
}; };
static struct iscsi_net_driver net_drivers[] = { static struct iscsi_net_driver net_drivers[] = {
-#ifdef OFFLOAD_BOOT_SUPPORTED -#ifdef OFFLOAD_BOOT_SUPPORTED
{"cxgb3", "cxgb3i" }, {"cxgb3", "cxgb3i" },
{"cxgb4", "cxgb4i" },
{"bnx2", "bnx2i" }, {"bnx2", "bnx2i" },
{"bnx2x", "bnx2i"}, {"bnx2x", "bnx2i"},
-#endif -#endif
{NULL, NULL} {NULL, NULL}
}; };
--
1.7.3.2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,15 @@
From c64e0e5f77b12a81615aa96305a0c3e5730481df Mon Sep 17 00:00:00 2001 diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/config.h open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/config.h
From: Ales Kozumplik <akozumpl@redhat.com> --- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/config.h 2011-01-31 19:30:00.000000000 -0600
Date: Thu, 25 Nov 2010 14:00:31 +0100 +++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/config.h 2011-01-31 19:30:05.000000000 -0600
Subject: [PATCH] brcm uio: handle the different iface_rec structures in iscsid and brcm. @@ -22,6 +22,7 @@
Related: rhbz#442980 #include <netdb.h>
---
brcm_iscsi_uio/include/config.h | 3 ++-
brcm_iscsi_uio/include/iscsi_net_util.h | 14 ++++++++++++++
brcm_iscsi_uio/src/unix/iscsid_ipc.c | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 brcm_iscsi_uio/include/iscsi_net_util.h
diff --git a/brcm_iscsi_uio/include/config.h b/brcm_iscsi_uio/include/config.h
index cf6d88b..dfe4355 100644
--- a/brcm_iscsi_uio/include/config.h
+++ b/brcm_iscsi_uio/include/config.h
@@ -25,6 +25,7 @@
//#include "types.h"
//#include "auth.h" /* for the username and password sizes */
#include "list.h" #include "list.h"
+#include "iscsi_net_util.h" +#include "iscsi_net_util.h"
/* ISIDs now have a typed naming authority in them. We use an OUI */ /* ISIDs now have a typed naming authority in them. We use an OUI */
#define DRIVER_ISID_0 0x00 #define DRIVER_ISID_0 0x00
@@ -199,7 +200,7 @@ typedef struct iface_rec { @@ -77,7 +78,7 @@ typedef struct iface_rec {
* TODO: we may have to make this bigger and interconnect * TODO: we may have to make this bigger and interconnect
* specific for infinniband * specific for infinniband
*/ */
@ -32,11 +18,9 @@ index cf6d88b..dfe4355 100644
char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
/* /*
* This is only used for boot now, but the iser guys * This is only used for boot now, but the iser guys
diff --git a/brcm_iscsi_uio/include/iscsi_net_util.h b/brcm_iscsi_uio/include/iscsi_net_util.h diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/iscsi_net_util.h open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/iscsi_net_util.h
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/iscsi_net_util.h 1969-12-31 18:00:00.000000000 -0600
index 0000000..2c45fe5 +++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/iscsi_net_util.h 2011-01-31 19:30:05.000000000 -0600
--- /dev/null
+++ b/brcm_iscsi_uio/include/iscsi_net_util.h
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
+#ifndef __ISCSI_NET_UTIL_h__ +#ifndef __ISCSI_NET_UTIL_h__
+#define __ISCSI_NET_UTIL_h__ +#define __ISCSI_NET_UTIL_h__
@ -52,11 +36,10 @@ index 0000000..2c45fe5
+ +
+#endif +#endif
+#endif +#endif
diff --git a/brcm_iscsi_uio/src/unix/iscsid_ipc.c b/brcm_iscsi_uio/src/unix/iscsid_ipc.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/src/unix/iscsid_ipc.c open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/src/unix/iscsid_ipc.c
index 4c00ef2..67b002a 100644 --- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/src/unix/iscsid_ipc.c 2011-01-31 19:30:00.000000000 -0600
--- a/brcm_iscsi_uio/src/unix/iscsid_ipc.c +++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/src/unix/iscsid_ipc.c 2011-01-31 19:30:05.000000000 -0600
+++ b/brcm_iscsi_uio/src/unix/iscsid_ipc.c @@ -508,7 +508,7 @@ int process_iscsid_broadcast(int s2)
@@ -349,7 +349,7 @@ int process_iscsid_broadcast(int s2)
} }
/* This will be freed by parse_iface_thread() */ /* This will be freed by parse_iface_thread() */
@ -65,6 +48,3 @@ index 4c00ef2..67b002a 100644
if(data == NULL) { if(data == NULL) {
LOG_ERR(PFX "Couldn't allocate memory for iface data"); LOG_ERR(PFX "Couldn't allocate memory for iface data");
return -ENOMEM; return -ENOMEM;
--
1.7.3.2

View File

@ -1,35 +1,201 @@
diff --git a/usr/Makefile b/usr/Makefile diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h
index e9d6bd1..8e505bf 100644 --- open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h 2011-01-31 03:10:47.000000000 -0600
--- a/usr/Makefile +++ open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h 2011-01-31 03:43:51.000000000 -0600
+++ b/usr/Makefile @@ -58,6 +58,8 @@ enum {
@@ -42,7 +42,7 @@ ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o login.o log.o md5.o sha1.o iface.o \ ISCSI_ERR_ISNS_QUERY = 25,
iscsid_req.o $(SYSDEPS_SRCS) /* iSNS registration/deregistration failed */
# core initiator files ISCSI_ERR_ISNS_REG_FAILED = 26,
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o \ + /* Operation failed, but retrying layer may succeed */
- transport.o cxgb3i.o be2iscsi.o + ISCSI_ERR_AGAIN = 27,
+ transport.o cxgb3i.o be2iscsi.o uip_mgmt_ipc.o
# fw boot files
FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o)
diff --git a/usr/initiator.c b/usr/initiator.c /* Always last. Indicates end of error code space */
index 1c9d8b6..8f7a383 100644 ISCSI_MAX_ERR_VAL,
--- a/usr/initiator.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
+++ b/usr/initiator.c --- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile 2011-01-31 03:45:36.000000000 -0600
@@ -13,7 +13,7 @@ TESTS += tests/test_set_auth tests/test_
COMMON_SRCS = sysdeps.o
# sources shared between iscsid, iscsiadm and iscsistart
-ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
+ISCSI_LIB_SRCS = netlink.o uip_mgmt_ipc.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
# sources shared with the userspace utils, note we build these separately
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2011-01-31 06:18:58.000000000 -0600
@@ -45,6 +45,7 @@ @@ -45,6 +45,7 @@
#include "iscsi_sysfs.h" #include "iscsi_sysfs.h"
#include "iscsi_settings.h" #include "iscsi_settings.h"
#include "iface.h" #include "iface.h"
+#include "host.h" +#include "host.h"
#include "sysdeps.h" #include "sysdeps.h"
#include "iscsi_err.h"
#define ISCSI_CONN_ERR_REOPEN_DELAY 3 @@ -554,6 +555,48 @@ static int iscsi_conn_connect(struct isc
@@ -743,6 +744,38 @@ static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask)
return 0; return 0;
} }
+static int __set_net_config(struct iscsi_transport *t, +static void iscsi_uio_poll_login_timedout(void *data)
+ iscsi_session_t *session, +{
+ struct iface_rec *iface) + struct queue_task *qtask = data;
+ struct iscsi_conn *conn = qtask->conn;
+ iscsi_session_t *session = conn->session;
+
+ log_debug(3, "timeout waiting for UIO ...\n");
+ mgmt_ipc_write_rsp(qtask, ISCSI_ERR_TRANS_TIMEOUT);
+ conn_delete_timers(conn);
+ __session_destroy(session);
+}
+
+static int iscsi_sched_uio_poll(queue_task_t *qtask)
+{
+ struct iscsi_conn *conn = qtask->conn;
+ struct iscsi_session *session = conn->session;
+ struct iscsi_transport *t = session->t;
+ struct iscsi_ev_context *ev_context;
+
+ if (!t->template->set_net_config)
+ return 0;
+
+ ev_context = iscsi_ev_context_get(conn, 0);
+ if (!ev_context) {
+ /* while reopening the recv pool should be full */
+ log_error("BUG: __session_conn_reopen could "
+ "not get conn context for recv.");
+ return ENOMEM;
+ }
+
+ ev_context->data = qtask;
+ conn->state = STATE_XPT_WAIT;
+
+ iscsi_sched_ev_context(ev_context, conn, 0, EV_UIO_POLL);
+
+ log_debug(3, "Setting login UIO poll timer %p timeout %d",
+ &conn->login_timer, conn->login_timeout);
+ actor_timer(&conn->login_timer, conn->login_timeout * 1000,
+ iscsi_uio_poll_login_timedout, qtask);
+ return EAGAIN;
+}
+
static void
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
int redirected)
@@ -595,6 +638,11 @@ __session_conn_reopen(iscsi_conn_t *conn
if (!redirected)
session->reopen_cnt++;
+ /* uIP will needs to be re-triggered on the connection re-open */
+ if (iscsi_set_net_config(conn->session->t, conn->session,
+ &conn->session->nrec.iface) != 0)
+ goto queue_reopen;
+
if (iscsi_conn_connect(conn, qtask)) {
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
goto queue_reopen;
@@ -1550,6 +1598,53 @@ cleanup:
session_conn_shutdown(conn, qtask, err);
}
+static void session_conn_uio_poll(void *data)
+{
+ struct iscsi_ev_context *ev_context = data;
+ iscsi_conn_t *conn = ev_context->conn;
+ struct iscsi_session *session = conn->session;
+ queue_task_t *qtask = ev_context->data;
+ int rc;
+
+ log_debug(4, "retrying uio poll");
+ rc = iscsi_set_net_config(session->t, session,
+ &conn->session->nrec.iface);
+ if (rc != 0) {
+ if (rc == ISCSI_ERR_AGAIN) {
+ ev_context->data = qtask;
+ iscsi_sched_ev_context(ev_context, conn, 2,
+ EV_UIO_POLL);
+ return;
+ } else {
+ log_error("session_conn_uio_poll() "
+ "connection failure [0x%x]", rc);
+ actor_delete(&conn->login_timer);
+ iscsi_login_eh(conn, qtask, ISCSI_ERR_INTERNAL);
+ iscsi_ev_context_put(ev_context);
+ return;
+ }
+ }
+
+ iscsi_ev_context_put(ev_context);
+ actor_delete(&conn->login_timer);
+ log_debug(4, "UIO ready trying connect");
+
+ /* uIP is ready try to connect */
+ if (gettimeofday(&conn->initial_connect_time, NULL))
+ log_error("Could not get initial connect time. If "
+ "login errors iscsid may give up the initial "
+ "login early. You should manually login.");
+
+ conn->state = STATE_XPT_WAIT;
+ if (iscsi_conn_connect(conn, qtask)) {
+ int delay = ISCSI_CONN_ERR_REOPEN_DELAY;
+
+ log_debug(4, "Waiting %u seconds before trying to reconnect.\n",
+ delay);
+ queue_delayed_reopen(qtask, delay);
+ }
+}
+
static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
struct iscsi_conn *conn, unsigned long tmo,
int event)
@@ -1586,6 +1681,11 @@ static int iscsi_sched_ev_context(struct
ev_context);
actor_schedule(&ev_context->actor);
break;
+ case EV_UIO_POLL:
+ actor_new(&ev_context->actor, session_conn_uio_poll,
+ ev_context);
+ actor_schedule(&ev_context->actor);
+ break;
case EV_CONN_LOGOUT_TIMER:
actor_timer(&ev_context->actor, tmo * 1000,
iscsi_logout_timedout, ev_context);
@@ -1714,7 +1814,17 @@ session_login_task(node_rec_t *rec, queu
conn = &session->conn[0];
qtask->conn = conn;
- if (iscsi_host_set_net_params(&rec->iface, session)) {
+ rc = iscsi_host_set_net_params(&rec->iface, session);
+ if (rc == ISCSI_ERR_AGAIN) {
+ iscsi_sched_uio_poll(qtask);
+ /*
+ * Cannot block iscsid, so caller is going to internally
+ * retry the operation.
+ */
+ qtask->rsp.command = MGMT_IPC_SESSION_LOGIN;
+ qtask->rsp.err = ISCSI_SUCCESS;
+ return ISCSI_SUCCESS;
+ } else if (rc) {
__session_destroy(session);
return ISCSI_ERR_LOGIN;
}
@@ -1864,6 +1974,7 @@ iscsi_host_send_targets(queue_task_t *qt
struct sockaddr_storage *ss)
{
struct iscsi_transport *t;
+ int rc;
t = iscsi_sysfs_get_transport_by_hba(host_no);
if (!t) {
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c 2011-01-31 04:22:50.000000000 -0600
@@ -555,6 +555,36 @@ TODO handle this
return 0;
}
+int iscsi_set_net_config(struct iscsi_transport *t, iscsi_session_t *session,
+ struct iface_rec *iface)
+{ +{
+ if (t->template->set_net_config) { + if (t->template->set_net_config) {
+ /* uip needs the netdev name */ + /* uip needs the netdev name */
@ -58,37 +224,43 @@ index 1c9d8b6..8f7a383 100644
+ return 0; + return 0;
+} +}
+ +
+ int iscsi_host_set_net_params(struct iface_rec *iface,
static void struct iscsi_session *session)
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop, {
int redirected) @@ -576,6 +606,10 @@ int iscsi_host_set_net_params(struct ifa
@@ -784,6 +817,11 @@ __session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
if (!redirected)
session->reopen_cnt++;
+ /* uIP will needs to be re-triggered on the connection re-open */
+ if (__set_net_config(conn->session->t, conn->session,
+ &conn->session->nrec.iface) != 0)
+ goto queue_reopen;
+
if (iscsi_conn_connect(conn, qtask)) {
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
goto queue_reopen;
@@ -2130,6 +2168,10 @@ static int iface_set_param(struct iscsi_transport *t, struct iface_rec *iface,
return EINVAL; return EINVAL;
} }
+ rc = __set_net_config(t, session, iface); + rc = iscsi_set_net_config(t, session, iface);
+ if (rc != 0) + if (rc != 0)
+ return rc; + return rc;
+ +
rc = __iscsi_host_set_param(t, session->hostno, rc = host_set_param(t, session->hostno,
ISCSI_HOST_PARAM_IPADDRESS, ISCSI_HOST_PARAM_IPADDRESS,
iface->ipaddress, ISCSI_STRING); iface->ipaddress, ISCSI_STRING);
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h
index 5280a0a..6eb8b1d 100644 --- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h 2011-01-31 03:10:47.000000000 -0600
--- a/usr/iscsid_req.c +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h 2011-01-31 03:40:12.000000000 -0600
+++ b/usr/iscsid_req.c @@ -89,6 +89,7 @@ typedef enum iscsi_event_e {
EV_CONN_ERROR,
EV_CONN_LOGOUT_TIMER,
EV_CONN_STOP,
+ EV_UIO_POLL,
} iscsi_event_e;
struct queue_task;
@@ -356,5 +357,8 @@ extern void iscsi_copy_operational_param
extern int iscsi_setup_authentication(struct iscsi_session *session,
struct iscsi_auth_config *auth_cfg);
extern int iscsi_setup_portal(struct iscsi_conn *conn, char *address, int port);
+extern int iscsi_set_net_config(struct iscsi_transport *t,
+ iscsi_session_t *session,
+ struct iface_rec *iface);
#endif /* INITIATOR_H */
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c 2011-01-31 03:45:09.000000000 -0600
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -97,25 +269,24 @@ index 5280a0a..6eb8b1d 100644
#include <sys/un.h> #include <sys/un.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
@@ -31,6 +32,7 @@ @@ -32,6 +33,7 @@
#include "mgmt_ipc.h"
#include "iscsi_util.h" #include "iscsi_util.h"
#include "config.h" #include "config.h"
#include "iscsi_err.h"
+#include "uip_mgmt_ipc.h" +#include "uip_mgmt_ipc.h"
static void iscsid_startup(void) static void iscsid_startup(void)
{ {
@@ -51,7 +53,8 @@ static void iscsid_startup(void) @@ -52,7 +54,7 @@ static void iscsid_startup(void)
#define MAXSLEEP 128 #define MAXSLEEP 128
-static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid) -static int iscsid_connect(int *fd, int start_iscsid)
+static mgmt_ipc_err_e ipc_connect(int *fd, char *unix_sock_name, +static int ipc_connect(int *fd, char *unix_sock_name, int start_iscsid)
+ int start_iscsid)
{ {
int nsec; int nsec;
struct sockaddr_un addr; struct sockaddr_un addr;
@@ -64,8 +67,8 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid) @@ -65,8 +67,8 @@ static int iscsid_connect(int *fd, int s
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_LOCAL; addr.sun_family = AF_LOCAL;
@ -126,23 +297,24 @@ index 5280a0a..6eb8b1d 100644
/* /*
* Trying to connect with exponential backoff * Trying to connect with exponential backoff
*/ */
@@ -93,6 +96,11 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid) @@ -94,6 +96,11 @@ static int iscsid_connect(int *fd, int s
return MGMT_IPC_ERR_ISCSID_NOTCONN; return ISCSI_ERR_ISCSID_NOTCONN;
} }
+static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid) +static int iscsid_connect(int *fd, int start_iscsid)
+{ +{
+ return ipc_connect(fd, ISCSIADM_NAMESPACE, start_iscsid); + return ipc_connect(fd, ISCSIADM_NAMESPACE, start_iscsid);
+} +}
+ +
mgmt_ipc_err_e iscsid_request(int *fd, iscsiadm_req_t *req, int start_iscsid) int iscsid_request(int *fd, iscsiadm_req_t *req, int start_iscsid)
{ {
int err; int err;
@@ -190,6 +198,72 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid) @@ -190,3 +197,81 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd
return err;
return iscsid_req_wait(cmd, fd); return iscsid_req_wait(cmd, fd);
} }
+
+static mgmt_ipc_err_e uip_connect(int *fd) +static int uip_connect(int *fd)
+{ +{
+ return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0); + return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0);
+} +}
@ -161,25 +333,29 @@ index 5280a0a..6eb8b1d 100644
+ return err; + return err;
+ } + }
+ +
+ log_debug(3, "connected to uIP daemon");
+
+ /* Send the data to uIP */ + /* Send the data to uIP */
+ if ((err = write(fd, buf, buf_len)) != buf_len) { + if ((err = write(fd, buf, buf_len)) != buf_len) {
+ log_error("got write error (%d/%d), daemon died?", + log_error("got write error (%d/%d), daemon died?",
+ err, errno); + err, errno);
+ close(fd); + close(fd);
+ return -EIO; + return ISCSI_ERR_ISCSID_COMM_ERR;
+ } + }
+ +
+ log_debug(3, "send iface config to uIP daemon");
+
+ /* Set the socket to a non-blocking read, this way if there are + /* Set the socket to a non-blocking read, this way if there are
+ * problems waiting for uIP, iscsid can bailout early */ + * problems waiting for uIP, iscsid can bailout early */
+ flags = fcntl(fd, F_GETFL, 0); + flags = fcntl(fd, F_GETFL, 0);
+ if (flags == -1) + if (flags == -1)
+ flags = 0; + flags = 0;
+ err = fcntl(fd, F_SETFL, flags | O_NONBLOCK); + err = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+ if(err != 0) { + if(err != 0) {
+ log_error("could not set uip broadcast to non-blocking: %d", + log_error("could not set uip broadcast to non-blocking: %d",
+ errno); + errno);
+ close(fd); + close(fd);
+ return -EIO; + return ISCSI_ERR;
+ } + }
+ +
+#define MAX_UIP_BROADCAST_READ_TRIES 3 +#define MAX_UIP_BROADCAST_READ_TRIES 3
@ -187,8 +363,10 @@ index 5280a0a..6eb8b1d 100644
+ /* Wait for the response */ + /* Wait for the response */
+ err = read(fd, &rsp, sizeof(rsp)); + err = read(fd, &rsp, sizeof(rsp));
+ if (err == sizeof(rsp)) { + if (err == sizeof(rsp)) {
+ log_debug(3, "Broadcasted to uIP with length: %ld\n", + log_debug(3, "Broadcasted to uIP with length: %ld "
+ buf_len); + "cmd: 0x%x rsp: 0x%x\n", buf_len,
+ rsp.command, rsp.err);
+ err = 0;
+ break; + break;
+ } else if((err == -1) && (errno == EAGAIN)) { + } else if((err == -1) && (errno == EAGAIN)) {
+ usleep(250000); + usleep(250000);
@ -196,45 +374,68 @@ index 5280a0a..6eb8b1d 100644
+ } else { + } else {
+ log_error("Could not read response (%d/%d), daemon died?", + log_error("Could not read response (%d/%d), daemon died?",
+ err, errno); + err, errno);
+ err = ISCSI_ERR;
+ break; + break;
+ } + }
+ } + }
+ +
+ if(count == MAX_UIP_BROADCAST_READ_TRIES) + if (count == MAX_UIP_BROADCAST_READ_TRIES) {
+ log_error("Could not broadcast to uIP"); + log_error("Could not broadcast to uIP after %d tries",
+ count);
+ err = ISCSI_ERR_AGAIN;
+ } else if (rsp.err != ISCISD_UIP_MGMT_IPC_DEVICE_UP) {
+ log_debug(3, "Device is not ready\n");
+ err = ISCSI_ERR_AGAIN;
+ }
+ +
+ close(fd); + close(fd);
+ + return err;
+ return 0;
+} +}
+ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h
void iscsid_handle_error(mgmt_ipc_err_e err) --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h 2011-01-31 03:10:47.000000000 -0600
{ +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h 2011-01-31 03:11:02.000000000 -0600
static char *err_msgs[] = { @@ -33,4 +33,6 @@ extern int iscsid_req_by_rec(int cmd, st
diff --git a/usr/iscsid_req.h b/usr/iscsid_req.h
index 3bba2f4..e2cf1c3 100644
--- a/usr/iscsid_req.h
+++ b/usr/iscsid_req.h
@@ -34,4 +34,6 @@ extern int iscsid_req_by_rec(int cmd, struct node_rec *rec);
extern int iscsid_req_by_sid_async(int cmd, int sid, int *fd); extern int iscsid_req_by_sid_async(int cmd, int sid, int *fd);
extern int iscsid_req_by_sid(int cmd, int sid); extern int iscsid_req_by_sid(int cmd, int sid);
+extern int uip_broadcast(void *buf, size_t buf_len); +extern int uip_broadcast(void *buf, size_t buf_len);
+ +
#endif #endif
diff --git a/usr/transport.c b/usr/transport.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c
index c0789bb..aa0395c 100644 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c 2011-01-31 03:10:47.000000000 -0600
--- a/usr/transport.c +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c 2011-01-31 03:44:25.000000000 -0600
+++ b/usr/transport.c @@ -49,6 +49,7 @@ static char *iscsi_err_msgs[] = {
/* 24 */ "iSCSI login failed due to authorization failure",
/* 25 */ "iSNS query failed",
/* 26 */ "iSNS registration failed",
+ /* 27 */ "Retryable failure",
};
char *iscsi_err_to_str(int err)
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 03:23:30.000000000 -0600
@@ -40,7 +40,7 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysde
ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o \
sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o \
iscsi_net_util.o iscsid_req.o transport.o cxgbi.o be2iscsi.o \
- initiator_common.o iscsi_err.o $(IPC_OBJ) $(SYSDEPS_SRCS)
+ initiator_common.o iscsi_err.o uip_mgmt_ipc.o $(IPC_OBJ) $(SYSDEPS_SRCS)
# core initiator files
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c 2011-01-31 03:37:05.000000000 -0600
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
#include "log.h" #include "log.h"
#include "iscsi_util.h" #include "iscsi_util.h"
#include "iscsi_sysfs.h" #include "iscsi_sysfs.h"
+#include "uip_mgmt_ipc.h" +#include "uip_mgmt_ipc.h"
#include "cxgb3i.h" #include "cxgbi.h"
#include "be2iscsi.h" #include "be2iscsi.h"
@@ -58,6 +59,7 @@ struct iscsi_transport_template bnx2i = { @@ -67,6 +68,7 @@ struct iscsi_transport_template bnx2i =
.ep_connect = ktransport_ep_connect, .ep_connect = ktransport_ep_connect,
.ep_poll = ktransport_ep_poll, .ep_poll = ktransport_ep_poll,
.ep_disconnect = ktransport_ep_disconnect, .ep_disconnect = ktransport_ep_disconnect,
@ -242,10 +443,9 @@ index c0789bb..aa0395c 100644
}; };
struct iscsi_transport_template be2iscsi = { struct iscsi_transport_template be2iscsi = {
diff --git a/usr/transport.h b/usr/transport.h diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.h
index 5ceedb3..2ec903c 100644 --- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h 2011-01-31 03:10:47.000000000 -0600
--- a/usr/transport.h +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.h 2011-01-31 03:11:02.000000000 -0600
+++ b/usr/transport.h
@@ -35,6 +35,9 @@ struct iscsi_transport_template { @@ -35,6 +35,9 @@ struct iscsi_transport_template {
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms); int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
void (*ep_disconnect) (struct iscsi_conn *conn); void (*ep_disconnect) (struct iscsi_conn *conn);
@ -256,11 +456,9 @@ index 5ceedb3..2ec903c 100644
}; };
/* represents data path provider */ /* represents data path provider */
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.c
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c 1969-12-31 18:00:00.000000000 -0600
index 0000000..73b1632 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.c 2011-01-31 03:11:02.000000000 -0600
--- /dev/null
+++ b/usr/uip_mgmt_ipc.c
@@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
+/* +/*
+ * uIP iSCSI Daemon/Admin Management IPC + * uIP iSCSI Daemon/Admin Management IPC
@ -303,12 +501,10 @@ index 0000000..73b1632
+ sizeof(iscsid_uip_broadcast_header_t) + + sizeof(iscsid_uip_broadcast_header_t) +
+ sizeof(*iface)); + sizeof(*iface));
+} +}
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.h
new file mode 100644 --- open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h 1969-12-31 18:00:00.000000000 -0600
index 0000000..dd49c0b +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.h 2011-01-31 03:40:12.000000000 -0600
--- /dev/null @@ -0,0 +1,73 @@
+++ b/usr/uip_mgmt_ipc.h
@@ -0,0 +1,71 @@
+/* +/*
+ * uIP iSCSI Daemon/Admin Management IPC + * uIP iSCSI Daemon/Admin Management IPC
+ * + *
@ -366,6 +562,8 @@ index 0000000..dd49c0b
+ ISCISD_UIP_MGMT_IPC_ERR = 1, + ISCISD_UIP_MGMT_IPC_ERR = 1,
+ ISCISD_UIP_MGMT_IPC_ERR_NOT_FOUND = 2, + ISCISD_UIP_MGMT_IPC_ERR_NOT_FOUND = 2,
+ ISCISD_UIP_MGMT_IPC_ERR_NOMEM = 3, + ISCISD_UIP_MGMT_IPC_ERR_NOMEM = 3,
+ ISCISD_UIP_MGMT_IPC_DEVICE_UP = 4,
+ ISCISD_UIP_MGMT_IPC_DEVICE_INITIALIZING = 5,
+} iscsid_uip_mgmt_ipc_err_e; +} iscsid_uip_mgmt_ipc_err_e;
+ +
+/* IPC Response */ +/* IPC Response */
@ -380,6 +578,3 @@ index 0000000..dd49c0b
+ +
+ +
+#endif /* UIP_MGMT_IPC_H */ +#endif /* UIP_MGMT_IPC_H */
--
1.6.6.1

View File

@ -1,16 +1,16 @@
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc3-bnx2i.diff/doc/iscsiadm.8 diff -aurp open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc4-bnx2i.work/doc/iscsiadm.8
--- open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 2010-07-11 03:45:50.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 2011-01-31 02:32:51.000000000 -0600
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/doc/iscsiadm.8 2010-07-11 04:00:35.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/doc/iscsiadm.8 2011-01-31 02:33:29.000000000 -0600
@@ -51,7 +51,7 @@ display help text and exit @@ -57,7 +57,7 @@ scsi layer.
.TP .TP
\fB\-I\fR, \fB\-\-interface\fI[iface]\fR \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
The interface argument specifies the iSCSI interface to use for the operation. The interface argument specifies the iSCSI interface to use for the operation.
-iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware -iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
+iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware +iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware
iSCSI (qla4xxx) the iface config must have the hardware address iSCSI (qla4xxx) the iface config must have the hardware address
(iface.hwaddress = port's MAC address) (iface.hwaddress = port's MAC address)
and the driver/transport_name (iface.transport_name). The iface's name is and the driver/transport_name (iface.transport_name). The iface's name is
@@ -128,7 +128,7 @@ If no other options are specified: for \ @@ -134,7 +134,7 @@ If no other options are specified: for \
of their respective records are displayed; for \fIsession\fR, all active of their respective records are displayed; for \fIsession\fR, all active
sessions and connections are displayed; for \fIfw\fR, all boot firmware sessions and connections are displayed; for \fIfw\fR, all boot firmware
values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
@ -19,7 +19,7 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc3-bn
.TP .TP
\fB\-n\fR, \fB\-\-name=\fIname\fR \fB\-n\fR, \fB\-\-name=\fIname\fR
@@ -336,10 +336,10 @@ The configuration file read by \fBiscsid @@ -488,10 +488,10 @@ The configuration file read by \fBiscsid
The file containing the iSCSI InitiatorName and InitiatorAlias read by The file containing the iSCSI InitiatorName and InitiatorAlias read by
\fBiscsid\fR and \fBiscsiadm\fR on startup. \fBiscsid\fR and \fBiscsiadm\fR on startup.
.TP .TP
@ -32,10 +32,9 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc3-bn
This directory contains the portals. This directory contains the portals.
.SH "SEE ALSO" .SH "SEE ALSO"
Only in open-iscsi-2.0-872-rc3-bnx2i.diff/doc: iscsiadm.8.orig diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work/README
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/README open-iscsi-2.0-872-rc3-bnx2i.diff/README --- open-iscsi-2.0-872-rc4-bnx2i/README 2011-01-31 02:32:57.000000000 -0600
--- open-iscsi-2.0-872-rc3-bnx2i/README 2010-07-11 03:58:50.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2011-01-31 02:33:29.000000000 -0600
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/README 2010-07-11 03:59:00.000000000 -0500
@@ -144,10 +144,10 @@ available on all Linux installations. @@ -144,10 +144,10 @@ available on all Linux installations.
The database contains two tables: The database contains two tables:
@ -175,11 +174,10 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/README open-iscsi-2.0-872-rc3-bnx2i.diff
Note that for iSNS the poll_interval does not have to be set. If not set, Note that for iSNS the poll_interval does not have to be set. If not set,
iscsid will only perform rediscovery when it gets a SCN from the server. iscsid will only perform rediscovery when it gets a SCN from the server.
Only in open-iscsi-2.0-872-rc3-bnx2i.diff/: README.orig diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.c --- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c 2011-01-31 02:32:57.000000000 -0600
--- open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.c 2010-07-11 03:58:50.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c 2011-01-31 02:33:29.000000000 -0600
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.c 2010-07-11 03:59:00.000000000 -0500 @@ -2285,9 +2285,9 @@ free_info:
@@ -2235,9 +2235,9 @@ free_info:
int idbm_init(idbm_get_config_file_fn *fn) int idbm_init(idbm_get_config_file_fn *fn)
{ {
/* make sure root db dir is there */ /* make sure root db dir is there */
@ -192,10 +190,9 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc3-bnx2i.
errno); errno);
return errno; return errno;
} }
Only in open-iscsi-2.0-872-rc3-bnx2i.diff/usr: idbm.c.orig diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.h --- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h 2011-01-31 02:32:51.000000000 -0600
--- open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.h 2010-07-11 03:45:50.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h 2011-01-31 02:33:29.000000000 -0600
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.h 2010-07-11 03:59:00.000000000 -0500
@@ -27,12 +27,15 @@ @@ -27,12 +27,15 @@
#include "initiator.h" #include "initiator.h"
#include "config.h" #include "config.h"
@ -218,9 +215,9 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc3-bnx2i.
#define ST_CONFIG_NAME "st_config" #define ST_CONFIG_NAME "st_config"
#define ISNS_CONFIG_NAME "isns_config" #define ISNS_CONFIG_NAME "isns_config"
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/iface.h open-iscsi-2.0-872-rc3-bnx2i.diff/usr/iface.h diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iface.h
--- open-iscsi-2.0-872-rc3-bnx2i/usr/iface.h 2010-07-11 03:45:50.000000000 -0500 --- open-iscsi-2.0-872-rc4-bnx2i/usr/iface.h 2010-07-11 04:05:58.000000000 -0500
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/iface.h 2010-07-11 03:59:00.000000000 -0500 +++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iface.h 2011-01-31 02:33:29.000000000 -0600
@@ -20,7 +20,9 @@ @@ -20,7 +20,9 @@
#ifndef ISCSI_IFACE_H #ifndef ISCSI_IFACE_H
#define ISCSI_IFACE_H #define ISCSI_IFACE_H

View File

@ -3,54 +3,46 @@
Summary: iSCSI daemon and utility programs Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils Name: iscsi-initiator-utils
Version: 6.2.0.872 Version: 6.2.0.872
Release: 13%{?dist} Release: 14%{?dist}
Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc4-bnx2i.tar.gz Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc4-bnx2i.tar.gz
Source1: iscsid.init Source1: iscsid.init
Source2: iscsidevs.init Source2: iscsidevs.init
Source3: 04-iscsi Source3: 04-iscsi
# Add Red Hat specific info to docs.
Patch0: iscsi-initiator-utils-update-initscripts-and-docs.patch
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
Patch1: iscsi-initiator-utils-use-var-for-config.patch
# Add redhat.com string to default initiator name.
Patch2: iscsi-initiator-utils-use-red-hat-for-name.patch
# Add a lib for use by anaconda.
Patch3: iscsi-initiator-utils-add-libiscsi.patch
# Add bnx2i support.
Patch4: iscsi-initiator-utils-uip-mgmt.patch
# disable isns for libiscsi (libiscsi does not support isns)
Patch5: iscsi-initiator-utils-disable-isns-for-lib.patch
# fix libiscsi get firmware sysfs init
Patch6: iscsi-initiator-utils-fix-lib-sysfs-init.patch
# fix race between uip and iscsid startup
Patch7: iscsi-initiator-utils-fix-uip-init-race.patch
# Don't compile iscsistart as static
Patch8: iscsi-initiator-utils-dont-use-static.patch
# Fix brcm nic state
Patch9: iscsi-initiator-utils-fix-brcm-nic-state.patch
# Fix iface op return value
Patch10: iscsi-initiator-utils-fix-iface-op-ret-val.patch
# Fix brcm VLAN
Patch11: iscsi-initiator-utils-fix-uip-vlan-support.patch
# Fix brcm 10G wrap
Patch12: iscsi-initiator-utils-fix-uip-10G-wrap.patch
# brcm uIP version Bump
Patch13: iscsi-initiator-utils-fix-uip-rhel-version-bump.patch
# Log message and hint when login failed and using iface binding.
Patch14: iscsi-initiator-utils-log-login-failed.patch
# brcm uio: handle the different iface_rec structures in iscsid and brcm.
Patch15: iscsi-initiator-utils-uio-handle-different-iface_rec.patch
# Remove the OFFLOAD_BOOT_SUPPORTED #ifdef.
Patch16: iscsi-initiator-utils-remove-the-offload-boot-supported-ifdef.patch
# libiscsi: reimplement fw discovery so partial devices are used properly.
Patch17: iscsi-initiator-utils-libiscsi-partial-offload-discovery.patch
# sync brcm to 0.6.2.13
Patch0: iscsi-initiator-utils-sync-brcm-0.6.2.13.patch
# sync iscsi tools to upstream commit cc425fd44b24d9fda74395951570460fc919d076
Patch1: iscsi-initiator-utils-sync-iscsi.patch
# Add Red Hat specific info to docs.
Patch2: iscsi-initiator-utils-update-initscripts-and-docs.patch
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
Patch3: iscsi-initiator-utils-use-var-for-config.patch
# Add redhat.com string to default initiator name.
Patch4: iscsi-initiator-utils-use-red-hat-for-name.patch
# Add a lib for use by anaconda.
Patch5: iscsi-initiator-utils-add-libiscsi.patch
# Add bnx2i support.
Patch6: iscsi-initiator-utils-uip-mgmt.patch
# Don't compile iscsistart as static
Patch7: iscsi-initiator-utils-dont-use-static.patch
# Log message and hint when login failed and using iface binding.
Patch8: iscsi-initiator-utils-log-login-failed.patch
# Remove the OFFLOAD_BOOT_SUPPORTED #ifdef.
Patch9: iscsi-initiator-utils-remove-the-offload-boot-supported-ifdef.patch
# libiscsi: reimplement fw discovery so partial devices are used properly.
Patch10: iscsi-initiator-utils-libiscsi-partial-offload-discovery.patch
# brcm uio: handle the different iface_rec structures in iscsid and brcm.
Patch11: iscsi-initiator-utils-uio-handle-different-iface_rec.patch
# Document missing brcm arguments
Patch12: iscsi-initiator-utils-brcm-man.patch
# Don't build unused isns dsa code.
Patch13: iscsi-initiator-utils-disable-dsa-code.patch
Group: System Environment/Daemons Group: System Environment/Daemons
License: GPLv2+ License: GPLv2+
URL: http://www.open-iscsi.org URL: http://www.open-iscsi.org
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: openssl-devel flex bison python-devel doxygen BuildRequires: flex bison python-devel doxygen
Requires(post): chkconfig Requires(post): chkconfig
Requires(preun): chkconfig /sbin/service Requires(preun): chkconfig /sbin/service
@ -72,28 +64,24 @@ developing applications that use %{name}.
%prep %prep
%setup -q -n open-iscsi-2.0-872-rc4-bnx2i %setup -q -n open-iscsi-2.0-872-rc4-bnx2i
%patch0 -p1 -b .update-initscripts-and-docs %patch0 -p1 -b .sync-brcm-0.6.2.13
%patch1 -p1 -b .use-var-for-config %patch1 -p1 -b .sync-iscsi
%patch2 -p1 -b .use-red-hat-for-name %patch2 -p1 -b .update-initscripts-and-docs
%patch3 -p1 -b .add-libiscsi %patch3 -p1 -b .use-var-for-config
%patch4 -p1 -b .uip-mgmt %patch4 -p1 -b .use-red-hat-for-name
%patch5 -p1 -b .disable-isns-for-lib %patch5 -p1 -b .add-libiscsi
%patch6 -p1 -b .fix-lib-sysfs-init %patch6 -p1 -b .uip-mgmt
%patch7 -p1 -b .fix-uip-init-race %patch7 -p1 -b .dont-use-static
%patch8 -p1 -b .dont-use-static %patch8 -p1 -b .log-login-failed
%patch9 -p1 -b .fix-brcm-nic-state %patch9 -p1 -b .remove-the-offload-boot-supported-ifdef
%patch10 -p1 -b .fix-iface-op-ret-val %patch10 -p1 -b .libiscsi-partial-offload
%patch11 -p1 -b .fix-brcm-vlan %patch11 -p1 -b .uio-handle-different-iface_rec
%patch12 -p1 -b .fix-brcm-10G-wrap %patch12 -p1 -b .brcm-man
%patch13 -p1 -b .fix-brcm-version-bump %patch13 -p1 -b .disable-dsa-code
%patch14 -p1 -b .log-login-failed
%patch15 -p1 -b .uio-different-iface
%patch16 -p1 -b .offload-boot-supported
%patch17 -p1 -b .libiscsi-partial-offload
%build %build
cd utils/open-isns cd utils/open-isns
./configure ./configure --with-security=no
make OPTFLAGS="%{optflags}" make OPTFLAGS="%{optflags}"
cd ../../ cd ../../
make OPTFLAGS="%{optflags}" -C utils/sysdeps make OPTFLAGS="%{optflags}" -C utils/sysdeps
@ -208,6 +196,22 @@ fi
%{_includedir}/libiscsi.h %{_includedir}/libiscsi.h
%changelog %changelog
* Mon Jan 31 2011 Mike Christie <akozumpl@redhat.com> 6.2.0.872.14
- 593269 iscsi was built against libcrypto, but was not using the code
so this disabled the building of that code.
- 599539 document brcm_iscsiuio options in man page.
- 599542 document iscsiadm host mode hostno argument.
- 631821 iscsi discovery was not incrementing ITT when multiple text
commands were sent. This prevented discovery from finding all targets.
- 634021 iscsi init script did not shutdown all sessions during system
shutdown/reboot causing the host to hang.
- 658428 iscsi init script should not shutdown sessions when root is
using them and should not fail startup on all iscsiadm login failures.
- 635899 sync brcm_iscsiuio to 0.6.2.13 to add support for IPv6, VLAN,
57711E, and 57712 hardware.
- 640115 fix hang caused due to race in ISCSI_ERR_INVALID_HOST handling.
- 640340 fix iscsiadm exit codes.
* Fri Dec 3 2010 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.13 * Fri Dec 3 2010 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.13
- 442980 libiscsi: reimplement fw discovery so partial devices are used properly. - 442980 libiscsi: reimplement fw discovery so partial devices are used properly.

View File

@ -26,6 +26,7 @@ exec=/sbin/iscsid
prog=iscsid prog=iscsid
config=/etc/iscsi/iscsid.conf config=/etc/iscsi/iscsid.conf
lockfile=/var/lock/subsys/$prog lockfile=/var/lock/subsys/$prog
iscsi_lockfile=/var/lock/subsys/iscsi
# FIXME this has a false positive for root on nfs # FIXME this has a false positive for root on nfs
root_is_iscsi() { root_is_iscsi() {
@ -38,14 +39,17 @@ force_start() {
modprobe -q iscsi_tcp modprobe -q iscsi_tcp
modprobe -q ib_iser modprobe -q ib_iser
modprobe -q cxgb3i modprobe -q cxgb3i
modprobe -q cxgb4i
modprobe -q bnx2i modprobe -q bnx2i
modprobe -q be2iscsi modprobe -q be2iscsi
daemon brcm_iscsiuio daemon brcm_iscsiuio
daemon $prog daemon $prog
retval=$? retval=$?
echo echo
[ $retval -eq 0 ] && touch $lockfile touch $lockfile
return $retval # a force start could imply the iscsi service is started due to how it
# lazy starts. We need to touch the lock file so it is shutdown later
touch $iscsi_lockfile
} }
use_discoveryd() { use_discoveryd() {
@ -82,7 +86,7 @@ stop() {
iscsiadm -k 0 2>/dev/null iscsiadm -k 0 2>/dev/null
fi fi
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|be2iscsi") ) declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|cxgb4i|be2iscsi") )
if [[ -n "${iparams[*]}" ]]; then if [[ -n "${iparams[*]}" ]]; then
# We have active sessions, so don't stop iscsid!! # We have active sessions, so don't stop iscsid!!
echo -n $"Not stopping $prog: iscsi sessions still active" echo -n $"Not stopping $prog: iscsi sessions still active"
@ -104,8 +108,10 @@ stop() {
rmmod cnic 2>/dev/null rmmod cnic 2>/dev/null
rmmod cxgb3i 2>/dev/null rmmod cxgb3i 2>/dev/null
rmmod cxgb4i 2>/dev/null
modprobe -r be2iscsi 2>/dev/null # a bug in kobject netlink code will cause this to oops
# modprobe -r be2iscsi 2>/dev/null
modprobe -r ib_iser 2>/dev/null modprobe -r ib_iser 2>/dev/null
modprobe -r iscsi_tcp 2>/dev/null modprobe -r iscsi_tcp 2>/dev/null

View File

@ -49,15 +49,9 @@ start() {
# nodes marked node.startup=automatic # nodes marked node.startup=automatic
echo -n $"Starting $prog: " echo -n $"Starting $prog: "
$exec -m node --loginall=automatic 2>&1 > /dev/null | grep iscsiadm $exec -m node --loginall=automatic 2>&1 > /dev/null | grep iscsiadm
# Ignore return code, because this command attempts to log into
# <sigh> iscsiadm does not always give a non 0 exit status in case of # multiple sessions and some sessions could get logged into and
# error so we grep for any messages to stderr and see those as errors too # some could be down temporarily.
if [ ${PIPESTATUS[0]} -ne 0 -o ${PIPESTATUS[1]} -eq 0 ]; then
failure $"Starting $prog"
echo
return 1
fi
success $"Starting $prog" success $"Starting $prog"
touch $lockfile touch $lockfile
echo echo
@ -65,12 +59,30 @@ start() {
} }
stop() { stop() {
echo -n $"Stopping $prog: " # Don't turn off iscsi if root is possibly on a iscsi disk.
$exec -m node --logoutall=automatic 2>&1 > /dev/null | grep iscsiadm rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
if [[ "$rootopts" =~ "_netdev" ]] ; then
echo $"Can not shutdown iSCSI. Root is on a iSCSI disk."
# <sigh> iscsiadm does not always give a non 0 exit status in case of # Just clean up lock file if this is a system shutdown/reboot.
# error so we grep for any messages to stderr and see those as errors too if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
if [ ${PIPESTATUS[0]} -ne 0 -o ${PIPESTATUS[1]} -eq 0 ]; then rm -f $lockfile
fi
exit 1
fi
echo -n $"Stopping $prog: "
if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
$exec -m node --logoutall=all 2>&1 > /dev/null
else
$exec -m node --logoutall=automatic 2>&1 > /dev/null
fi
ret=$?
# ignore ISCSI_ERR_NO_OBJS_FOUND/21
if [[ "$ret" -ne 0 && "$ret" -ne 21 ]]; then
failure $"Stopping $prog" failure $"Stopping $prog"
echo echo
return 1 return 1
@ -95,10 +107,20 @@ force_reload() {
restart restart
} }
iscsi_sessions_running() {
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") )
if [[ -z "${iparams[*]}" ]]; then
# no sessions
return 2
fi
return 0
}
rh_status() { rh_status() {
[ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; } [ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; }
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i") ) declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") )
if [[ -z "${iparams[*]}" ]]; then if [[ -z "${iparams[*]}" ]]; then
# no sessions # no sessions
echo $"No active sessions" echo $"No active sessions"
@ -120,7 +142,7 @@ case "$1" in
$1 $1
;; ;;
stop) stop)
rh_status_q || exit 0 iscsi_sessions_running || exit 0
$1 $1
;; ;;
restart) restart)