Sync devel and F-13

This commit is contained in:
Mike Christie 2010-05-06 21:41:12 +00:00
parent cedd464de0
commit 5ebdd59579
14 changed files with 5641 additions and 119 deletions

View File

@ -12,3 +12,4 @@ open-iscsi-2.0-865.13.tar.gz
open-iscsi-2.0-868-test1.tar.gz
open-iscsi-2.0-870-rc1.tar.gz
open-iscsi-2.0-870.1.tar.gz
open-iscsi-2.0-872-rc1-bnx2i.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/be2iscsi.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/be2iscsi.c
--- open-iscsi-2.0-872-rc1-bnx2i/usr/be2iscsi.c 2010-05-05 09:21:40.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/be2iscsi.c 2010-05-05 09:21:52.000000000 -0500
@@ -24,11 +24,11 @@ void be2iscsi_create_conn(struct iscsi_c
if (conn->max_recv_dlength > 65536)
conn->max_recv_dlength = 65536;
- if (conn->session->first_burst > 8192)
- conn->session->first_burst = 8192;
+ if (session->first_burst > 8192)
+ session->first_burst = 8192;
- if (conn->session->max_burst > 262144)
- conn->session->max_burst = 262144;
+ if (session->max_burst > 262144)
+ session->max_burst = 262144;
if (conn->max_xmit_dlength > 65536)
conn->max_xmit_dlength = 65536;
@@ -37,5 +37,6 @@ void be2iscsi_create_conn(struct iscsi_c
conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
- conn->session->erl = 0;
+ session->erl = 0;
+ session->initial_r2t_en = 1;
}

View File

@ -0,0 +1,74 @@
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
index 4aeb44f..a91d6b8 100644
--- a/libiscsi/Makefile
+++ b/libiscsi/Makefile
@@ -3,7 +3,7 @@
OSNAME=$(shell uname -s)
OPTFLAGS ?= -O2 -g
WARNFLAGS ?= -Wall -Wstrict-prototypes
-CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr -I../utils/open-isns \
+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
@@ -43,11 +43,10 @@ fw-objs/%.o: ../utils/fwparam_ibft/%.c
$(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 $@
+ $(CC) $(CFLAGS) -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
diff --git a/usr/Makefile b/usr/Makefile
index 8e505bf..13a60f9 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -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
diff --git a/usr/discovery.c b/usr/discovery.c
index 2233de7..02c6f25 100644
--- a/usr/discovery.c
+++ b/usr/discovery.c
@@ -45,9 +45,11 @@
#include "iscsid_req.h"
#include "iscsi_util.h"
/* libisns includes */
+#ifdef ISNS_ENABLE
#include "isns.h"
#include "paths.h"
#include "message.h"
+#endif
#ifdef SLP_ENABLE
#include "iscsi-slp-discovery.h"
@@ -94,6 +96,7 @@ static int request_initiator_name(void)
return 0;
}
+#ifdef ISNS_ENABLE
void discovery_isns_free_servername(void)
{
if (isns_config.ic_server_name)
@@ -367,6 +370,7 @@ retry:
discovery_isns_free_servername();
return rc;
}
+#endif
int discovery_fw(void *data, struct iface_rec *iface,
struct list_head *rec_list)
--
1.6.6.1

View File

@ -0,0 +1,59 @@
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/be2iscsi.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/be2iscsi.c
--- open-iscsi-2.0-872-rc1-bnx2i/usr/be2iscsi.c 2010-04-16 14:15:44.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/be2iscsi.c 2010-04-16 14:17:00.000000000 -0500
@@ -18,6 +18,9 @@
void be2iscsi_create_conn(struct iscsi_conn *conn)
{
+ struct iscsi_session *session = conn->session;
+ conn_rec_t *conn_rec = &session->nrec.conn[conn->id];
+
if (conn->max_recv_dlength > 65536)
conn->max_recv_dlength = 65536;
@@ -30,5 +33,9 @@ void be2iscsi_create_conn(struct iscsi_c
if (conn->max_xmit_dlength > 65536)
conn->max_xmit_dlength = 65536;
+ if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
+ conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
+ conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
+
conn->session->erl = 0;
}
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/initiator.c
--- open-iscsi-2.0-872-rc1-bnx2i/usr/initiator.c 2010-04-16 14:16:30.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/initiator.c 2010-04-16 14:16:41.000000000 -0500
@@ -369,9 +369,10 @@ iscsi_copy_operational_params(iscsi_conn
/* zero indicates to use the target's value */
conn->max_xmit_dlength =
__padding(conn_rec->iscsi.MaxXmitDataSegmentLength);
- if (conn->max_xmit_dlength != 0 &&
- (conn->max_xmit_dlength < ISCSI_MIN_MAX_RECV_SEG_LEN ||
- conn->max_xmit_dlength > ISCSI_MAX_MAX_RECV_SEG_LEN)) {
+ if (conn->max_xmit_dlength == 0)
+ conn->max_xmit_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN;
+ if (conn->max_xmit_dlength < ISCSI_MIN_MAX_RECV_SEG_LEN ||
+ conn->max_xmit_dlength > ISCSI_MAX_MAX_RECV_SEG_LEN) {
log_error("Invalid iscsi.MaxXmitDataSegmentLength. Must be "
"within %u and %u. Setting to %u\n",
ISCSI_MIN_MAX_RECV_SEG_LEN,
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/login.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/login.c
--- open-iscsi-2.0-872-rc1-bnx2i/usr/login.c 2010-04-16 14:16:30.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/login.c 2010-04-16 14:16:41.000000000 -0500
@@ -390,9 +390,14 @@ get_op_params_text_keys(iscsi_session_t
if (session->type == ISCSI_SESSION_TYPE_DISCOVERY ||
!session->t->template->rdma) {
int tgt_max_xmit;
+ conn_rec_t *conn_rec = &session->nrec.conn[cid];
tgt_max_xmit = strtoul(value, NULL, 0);
- if (conn->max_xmit_dlength == 0 ||
+ /*
+ * if the rec value is zero it means to use
+ * what the target gave us.
+ */
+ if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
tgt_max_xmit < conn->max_xmit_dlength)
conn->max_xmit_dlength = tgt_max_xmit;
}

View File

@ -0,0 +1,696 @@
diff --git a/include/fw_context.h b/include/fw_context.h
index abdff42..770b41a 100644
--- a/include/fw_context.h
+++ b/include/fw_context.h
@@ -54,6 +54,8 @@ struct boot_context {
char mask[18];
char lun[17];
char vlan[15];
+
+ char scsi_host_name[64];
};
extern int fw_get_entry(struct boot_context *context);
diff --git a/usr/iface.c b/usr/iface.c
index 27b59d0..9c74117 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -778,31 +778,62 @@ void iface_link_ifaces(struct list_head *ifaces)
iface_for_each_iface(ifaces, 1, &nr_found, iface_link);
}
-void iface_setup_from_boot_context(struct iface_rec *iface,
+/**
+ * iface_setup_from_boot_context - setup iface from boot context info
+ * @iface: iface t setup
+ * @context: boot context info
+ *
+ * Returns 1 if setup for offload.
+ */
+int iface_setup_from_boot_context(struct iface_rec *iface,
struct boot_context *context)
{
if (strlen(context->initiatorname))
strlcpy(iface->iname, context->initiatorname,
sizeof(iface->iname));
- if (strlen(context->iface)) {
- if (!net_get_transport_name_from_netdev(context->iface,
- iface->transport_name)) {
- /* set up for access through offload card */
- memset(iface->name, 0, sizeof(iface->name));
- snprintf(iface->name, sizeof(iface->name),
- "%s.%s", iface->transport_name,
- context->mac);
-
- strlcpy(iface->netdev, context->iface,
- sizeof(iface->netdev));
- strlcpy(iface->hwaddress, context->mac,
- sizeof(iface->hwaddress));
- strlcpy(iface->ipaddress, context->ipaddr,
- sizeof(iface->ipaddress));
+ if (strlen(context->scsi_host_name)) {
+ struct iscsi_transport *t;
+ uint32_t hostno;
+
+ if (sscanf(context->scsi_host_name, "iscsi_host%u", &hostno) != 1) {
+ log_error("Could not parse %s's host no.",
+ context->scsi_host_name);
+ return 0;
}
- }
+ t = iscsi_sysfs_get_transport_by_hba(hostno);
+ if (!t) {
+ log_error("Could not get transport for %s. "
+ "Make sure the iSCSI driver is loaded.",
+ context->scsi_host_name);
+ return 0;
+ }
+
+ log_debug(3, "boot context has %s transport %s",
+ context->scsi_host_name, t->name);
+ strcpy(iface->transport_name, t->name);
+ } else if (strlen(context->iface) &&
+ (!net_get_transport_name_from_netdev(context->iface,
+ iface->transport_name))) {
+ log_debug(3, "boot context has netdev %s",
+ context->iface);
+ strlcpy(iface->netdev, context->iface,
+ sizeof(iface->netdev));
+ } else
+ return 0;
+ /*
+ * set up for access through a offload card.
+ */
+ memset(iface->name, 0, sizeof(iface->name));
+ snprintf(iface->name, sizeof(iface->name), "%s.%s",
+ iface->transport_name, context->mac);
+
+ strlcpy(iface->hwaddress, context->mac,
+ sizeof(iface->hwaddress));
+ strlcpy(iface->ipaddress, context->ipaddr,
+ sizeof(iface->ipaddress));
log_debug(1, "iface " iface_fmt "\n", iface_str(iface));
+ return 1;
}
/**
@@ -817,32 +848,24 @@ void iface_setup_from_boot_context(struct iface_rec *iface,
int iface_create_ifaces_from_boot_contexts(struct list_head *ifaces,
struct list_head *targets)
{
- char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
- char iface_name[ISCSI_MAX_IFACE_LEN];
struct boot_context *context;
struct iface_rec *iface, *tmp_iface;
int rc = 0;
list_for_each_entry(context, targets, list) {
- memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN);
-
- if (net_get_transport_name_from_netdev(context->iface,
- transport_name))
- continue;
-
- /* offload + ibft support */
- memset(iface_name, 0, ISCSI_MAX_IFACE_LEN);
- snprintf(iface_name, ISCSI_MAX_IFACE_LEN,
- "%s.%s", transport_name, context->mac);
-
rc = 0;
- iface = iface_alloc(iface_name, &rc);
+ /* use dummy name. If valid it will get overwritten below */
+ iface = iface_alloc(DEFAULT_IFACENAME, &rc);
if (!iface) {
log_error("Could not setup iface %s for boot\n",
- iface_name);
+ context->iface);
goto fail;
}
- iface_setup_from_boot_context(iface, context);
+ if (!iface_setup_from_boot_context(iface, context)) {
+ /* no offload so forget it */
+ free(iface);
+ continue;
+ }
rc = iface_conf_write(iface);
if (rc) {
diff --git a/usr/iface.h b/usr/iface.h
index f948686..9f6d47e 100644
--- a/usr/iface.h
+++ b/usr/iface.h
@@ -50,7 +50,7 @@ extern int iface_conf_write(struct iface_rec *iface);
extern int iface_conf_delete(struct iface_rec *iface);
extern int iface_is_valid(struct iface_rec *iface);
extern void iface_link_ifaces(struct list_head *ifaces);
-extern void iface_setup_from_boot_context(struct iface_rec *iface,
+extern int iface_setup_from_boot_context(struct iface_rec *iface,
struct boot_context *context);
extern int iface_create_ifaces_from_boot_contexts(struct list_head *ifaces,
struct list_head *targets);
diff --git a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
index b9e7988..ca07b76 100644
--- a/utils/fwparam_ibft/Makefile
+++ b/utils/fwparam_ibft/Makefile
@@ -22,7 +22,7 @@
#
SYSDEPS_OBJS = $(wildcard ../sysdeps/*.o)
-OBJS := fw_entry.o fwparam_ibft_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
+OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o
CLEANFILES = $(OBJS) *.output *~
diff --git a/utils/fwparam_ibft/fw_entry.c b/utils/fwparam_ibft/fw_entry.c
index ae5d34a..bbdb6d2 100644
--- a/utils/fwparam_ibft/fw_entry.c
+++ b/utils/fwparam_ibft/fw_entry.c
@@ -102,8 +102,7 @@ int fw_get_entry(struct boot_context *context)
ret = fwparam_ppc_boot_info(context);
if (ret)
- ret = fwparam_ibft_sysfs_boot_info(context);
-
+ ret = fwparam_sysfs_boot_info(context);
return ret;
}
@@ -124,8 +123,7 @@ int fw_get_targets(struct list_head *list)
ret = fwparam_ppc_get_targets(list);
if (ret)
- ret = fwparam_ibft_sysfs_get_targets(list);
-
+ ret = fwparam_sysfs_get_targets(list);
return ret;
}
diff --git a/utils/fwparam_ibft/fwparam.h b/utils/fwparam_ibft/fwparam.h
index a79213b..32e4961 100644
--- a/utils/fwparam_ibft/fwparam.h
+++ b/utils/fwparam_ibft/fwparam.h
@@ -24,8 +24,8 @@
struct boot_context;
-int fwparam_ibft_sysfs_boot_info(struct boot_context *context);
-int fwparam_ibft_sysfs_get_targets(struct list_head *list);
+int fwparam_sysfs_boot_info(struct boot_context *context);
+int fwparam_sysfs_get_targets(struct list_head *list);
int fwparam_ppc_boot_info(struct boot_context *context);
int fwparam_ppc_get_targets(struct list_head *list);
diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c
new file mode 100644
index 0000000..9b73d1a
--- /dev/null
+++ b/utils/fwparam_ibft/fwparam_sysfs.c
@@ -0,0 +1,484 @@
+/*
+ * Copyright (C) IBM Corporation. 2007
+ * Author: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ * Copyright (C) Red Hat, Inc. All rights reserved. 2008 - 2010
+ * Copyright (C) Mike Christie 2008 - 2010
+ *
+ * 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
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define _XOPEN_SOURCE 500
+#define _SVID_SOURCE
+#include <ftw.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "sysfs.h"
+#include "fw_context.h"
+#include "fwparam.h"
+#include "sysdeps.h"
+#include "iscsi_net_util.h"
+
+#define ISCSI_BOOT_MAX 255
+#define IBFT_SYSFS_ROOT "/sys/firmware/ibft/"
+#define IBFT_SUBSYS "ibft"
+
+#define ISCSI_LLD_ROOT "/sys/firmware/"
+#define ISCSI_LLD_SUBSYS_PREFIX "iscsi_host"
+
+static char *target_list[ISCSI_BOOT_MAX];
+static char *nic_list[ISCSI_BOOT_MAX];
+static int nic_cnt;
+static int tgt_cnt;
+
+static int file_exist(const char *file)
+{
+ struct stat bootpath_stat;
+
+ return !stat(file, &bootpath_stat);
+}
+
+/*
+ * Finds the etherrnetX and targetX under the sysfs directory.
+ */
+static int find_sysfs_dirs(const char *fpath, const struct stat *sb,
+ int tflag, struct FTW *ftw)
+{
+ if (tflag == FTW_D && (strstr(fpath + ftw->base, "target"))) {
+ if (tgt_cnt == ISCSI_BOOT_MAX) {
+ printf("Too many targets found in iSCSI boot data."
+ "Max number of targets %d\n", ISCSI_BOOT_MAX);
+ return 0;
+ }
+ target_list[tgt_cnt++] = strdup(strstr(fpath, "target"));
+ }
+
+ if (tflag == FTW_D && (strstr(fpath + ftw->base, "ethernet"))) {
+ if (nic_cnt == ISCSI_BOOT_MAX) {
+ printf("Too many nics found in iSCSI boot data."
+ "Max number of nics %d\n", ISCSI_BOOT_MAX);
+ return 0;
+ }
+ nic_list[nic_cnt++] = strdup(strstr(fpath, "ethernet"));
+ }
+
+ return 0;
+}
+
+static int get_iface_from_device(char *id, struct boot_context *context)
+{
+ char dev_dir[FILENAMESZ];
+ int rc = ENODEV;
+ DIR *dirfd;
+ struct dirent *dent;
+
+ memset(dev_dir, 0, FILENAMESZ);
+ snprintf(dev_dir, FILENAMESZ, IBFT_SYSFS_ROOT"/%s/device", id);
+
+ if (!file_exist(dev_dir))
+ return 0;
+
+ dirfd = opendir(dev_dir);
+ if (!dirfd)
+ return errno;
+
+ while ((dent = readdir(dirfd))) {
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..") ||
+ strncmp(dent->d_name, "net:", 4))
+ continue;
+
+ if (!strncmp(dent->d_name, "net:", 4)) {
+ if ((strlen(dent->d_name) - 4) >
+ (sizeof(context->iface) - 1)) {
+ rc = EINVAL;
+ printf("Net device %s too big for iface "
+ "buffer.\n", dent->d_name);
+ break;
+ }
+
+ if (sscanf(dent->d_name, "net:%s", context->iface) != 1)
+ rc = EINVAL;
+ rc = 0;
+ break;
+ } else {
+ printf("Could not read ethernet to net link.\n");
+ rc = EOPNOTSUPP;
+ break;
+ }
+ }
+
+ closedir(dirfd);
+
+ if (rc != ENODEV)
+ return rc;
+
+ /* If not found try again with newer kernel networkdev sysfs layout */
+ strlcat(dev_dir, "/net", FILENAMESZ);
+
+ if (!file_exist(dev_dir))
+ return rc;
+
+ dirfd = opendir(dev_dir);
+ if (!dirfd)
+ return errno;
+
+ while ((dent = readdir(dirfd))) {
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
+ continue;
+
+ /* Take the first "regular" directory entry */
+ if (strlen(dent->d_name) > (sizeof(context->iface) - 1)) {
+ rc = EINVAL;
+ printf("Net device %s too big for iface buffer.\n",
+ dent->d_name);
+ break;
+ }
+
+ strcpy(context->iface, dent->d_name);
+ rc = 0;
+ break;
+ }
+
+ closedir(dirfd);
+ return rc;
+}
+
+/*
+ * Routines to fill in the context values.
+ */
+static int fill_nic_context(char *subsys, char *id,
+ struct boot_context *context)
+{
+ int rc;
+
+ rc = sysfs_get_str(id, subsys, "mac", context->mac,
+ sizeof(context->mac));
+ if (rc)
+ return rc;
+
+ /*
+ * Some offload cards like bnx2i use different MACs for the net and
+ * iscsi functions, so we have to follow the sysfs links.
+ *
+ * Other ibft implementations may not be tied to a pci function,
+ * so there will not be any device/net link, so we drop down to
+ * the MAC matching.
+ *
+ * And finally, some cards like be2iscsi and qla4xxx do not have
+ * any linux network subsys representation. These hosts will
+ * not have the ibft subsys. Instead the subsys is the scsi host
+ * number.
+ */
+ if (!strcmp(IBFT_SUBSYS, subsys)) {
+ rc = get_iface_from_device(id, context);
+ if (rc) {
+ rc = net_get_netdev_from_hwaddress(context->mac,
+ context->iface);
+ if (rc)
+ return rc;
+ }
+ } else
+ strlcpy(context->scsi_host_name, subsys,
+ sizeof(context->scsi_host_name));
+
+ sysfs_get_str(id, subsys, "ip-addr", context->ipaddr,
+ sizeof(context->ipaddr));
+ sysfs_get_str(id, subsys, "vlan", context->vlan,
+ sizeof(context->vlan));
+ sysfs_get_str(id, subsys, "subnet-mask", context->mask,
+ sizeof(context->mask));
+ sysfs_get_str(id, subsys, "gateway", context->gateway,
+ sizeof(context->gateway));
+ sysfs_get_str(id, subsys, "primary-dns", context->primary_dns,
+ sizeof(context->primary_dns));
+ sysfs_get_str(id, subsys, "secondary-dns", context->secondary_dns,
+ sizeof(context->secondary_dns));
+ sysfs_get_str(id, subsys, "dhcp", context->dhcp,
+ sizeof(context->dhcp));
+ return 0;
+}
+
+static void fill_initiator_context(char *subsys, struct boot_context *context)
+{
+ sysfs_get_str("initiator", subsys, "initiator-name",
+ context->initiatorname,
+ sizeof(context->initiatorname));
+ sysfs_get_str("initiator", subsys, "isid", context->isid,
+ sizeof(context->isid));
+}
+static int fill_tgt_context(char *subsys, char *id,
+ struct boot_context *context)
+{
+ int rc;
+
+ rc = sysfs_get_str(id, subsys, "target-name", context->targetname,
+ sizeof(context->targetname));
+ if (rc)
+ return rc;
+
+ rc = sysfs_get_str(id, subsys, "ip-addr", context->target_ipaddr,
+ sizeof(context->target_ipaddr));
+ if (rc)
+ return rc;
+
+ /*
+ * We can live without the rest of they do not exist. If we
+ * failed to get them we will figure it out when we login.
+ */
+ if (sysfs_get_int(id, subsys, "port", &context->target_port))
+ context->target_port = ISCSI_LISTEN_PORT;
+
+ sysfs_get_str(id, subsys, "lun", context->lun,
+ sizeof(context->lun));
+ sysfs_get_str(id, subsys, "chap-name", context->chap_name,
+ sizeof(context->chap_name));
+ sysfs_get_str(id, subsys, "chap-secret", context->chap_password,
+ sizeof(context->chap_password));
+ sysfs_get_str(id, subsys, "rev-chap-name", context->chap_name_in,
+ sizeof(context->chap_name_in));
+ sysfs_get_str(id, subsys, "rev-chap-name-secret",
+ context->chap_password_in,
+ sizeof(context->chap_password_in));
+ return 0;
+}
+
+#define IBFT_SYSFS_FLAG_FW_SEL_BOOT 2
+
+static int find_boot_flag(char *subsys, char *list[], ssize_t size,
+ int *boot_idx)
+{
+ int rc = ENODEV;
+ int i, flag = 0;
+
+ for (i = 0; i < size; i++, flag = -1) {
+ rc = sysfs_get_int(list[i], subsys, "flags", &flag);
+ if (rc)
+ continue;
+
+ if (flag & IBFT_SYSFS_FLAG_FW_SEL_BOOT) {
+ *boot_idx = i;
+ rc = 0;
+ break;
+ }
+ rc = ENODEV;
+ flag = 0;
+
+ }
+
+ return rc;
+}
+
+static void deallocate_lists(void)
+{
+ int i;
+
+ for (i = 0; i < nic_cnt; i++)
+ free(nic_list[i]);
+
+ nic_cnt = 0;
+ for (i = 0; i < tgt_cnt; i++)
+ free(target_list[i]);
+
+ tgt_cnt = 0;
+
+}
+
+static int get_boot_info(struct boot_context *context, char *rootdir,
+ char *subsys)
+{
+ char initiator_dir[FILENAMESZ];
+ int rc = ENODEV;
+ int nic_idx = -1, tgt_idx = -1;
+
+ memset(&initiator_dir, 0 , FILENAMESZ);
+ snprintf(initiator_dir, FILENAMESZ, "%sinitiator", rootdir);
+
+ nic_cnt = 0;
+ tgt_cnt = 0;
+ if (file_exist(initiator_dir)) {
+ /* Find the target's and the ethernet's */
+ rc = nftw(rootdir, find_sysfs_dirs, 20, 1);
+
+ /* Find wihch target and which ethernet have
+ the boot flag set. */
+ rc = find_boot_flag(subsys, nic_list, nic_cnt, &nic_idx);
+ if (rc)
+ goto free;
+
+ rc = find_boot_flag(subsys, target_list, tgt_cnt, &tgt_idx);
+ if (rc)
+ goto free;
+
+ /* Fill in the context values */
+ rc = fill_nic_context(subsys, nic_list[nic_idx], context);
+ rc |= fill_tgt_context(subsys, target_list[tgt_idx], context);
+ fill_initiator_context(subsys, context);
+ }
+free:
+ deallocate_lists();
+ return rc;
+}
+
+int fwparam_sysfs_boot_info(struct boot_context *context)
+{
+ struct dirent *dent;
+ DIR *dirfd;
+ int rc = 0;
+
+ if (!get_boot_info(context, IBFT_SYSFS_ROOT, IBFT_SUBSYS))
+ return 0;
+ /*
+ * We could have multiple iscsi llds and each lld could have
+ * multiple targets/ethernet ports
+ */
+ dirfd = opendir(ISCSI_LLD_ROOT);
+ if (!dirfd)
+ return errno;
+
+ while ((dent = readdir(dirfd))) {
+ char lld_root[FILENAMESZ];
+
+ memset(&lld_root, 0 , FILENAMESZ);
+
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
+ continue;
+
+ if (strncmp(dent->d_name, ISCSI_LLD_SUBSYS_PREFIX, 10))
+ continue;
+
+ snprintf(lld_root, FILENAMESZ, ISCSI_LLD_ROOT"%s",
+ dent->d_name);
+ if (!get_boot_info(context, lld_root, dent->d_name))
+ goto done;
+ }
+ rc = ENODEV;
+done:
+ closedir(dirfd);
+ return rc;
+}
+
+static int get_targets(struct list_head *list, char *rootdir, char *subsys)
+{
+ struct boot_context *context;
+ int rc = 0, i, nic_idx, nic;
+ char initiator_dir[FILENAMESZ];
+
+ memset(&initiator_dir, 0 , FILENAMESZ);
+ snprintf(initiator_dir, FILENAMESZ, "%sinitiator", rootdir);
+
+ if (!file_exist(initiator_dir))
+ return ENODEV;
+
+ nic_cnt = 0;
+ tgt_cnt = 0;
+
+ /* Find the target's and the ethernet's */
+ nftw(rootdir, find_sysfs_dirs, 20, 1);
+ for (i = 0; i < tgt_cnt; i++) {
+ context = calloc(1, sizeof(*context));
+ if (!context) {
+ rc = ENOMEM;
+ break;
+ }
+
+ rc = fill_tgt_context(subsys, target_list[i], context);
+ if (rc)
+ break;
+
+ rc = sysfs_get_int(target_list[i], subsys, "nic-assoc",
+ &nic_idx);
+ if (rc)
+ break;
+
+ for (nic = 0; nic < nic_cnt; nic++) {
+ int id;
+
+ rc = sysfs_get_int(nic_list[nic], subsys, "index",
+ &id);
+ if (!rc && (id == nic_idx))
+ break;
+ }
+
+ if (nic == nic_cnt) {
+ printf("Invalid nic-assoc of %d. Max id %d.\n",
+ nic_idx, nic_cnt);
+ break;
+ }
+
+ rc = fill_nic_context(subsys, nic_list[nic], context);
+ if (rc)
+ break;
+
+ fill_initiator_context(subsys, context);
+ list_add_tail(&context->list, list);
+ }
+
+ if (rc) {
+ if (context)
+ free(context);
+ fw_free_targets(list);
+ }
+
+ deallocate_lists();
+ return rc;
+}
+
+int fwparam_sysfs_get_targets(struct list_head *list)
+{
+ struct dirent *dent;
+ DIR *dirfd;
+ int rc = 0;
+
+ /* ibft only has one instance */
+ get_targets(list, IBFT_SYSFS_ROOT, IBFT_SUBSYS);
+ /*
+ * We could have multiple iscsi llds and each lld could have
+ * multiple targets/ethernet ports
+ */
+ dirfd = opendir(ISCSI_LLD_ROOT);
+ if (!dirfd) {
+ rc = errno;
+ goto done;
+ }
+
+ while ((dent = readdir(dirfd))) {
+ char lld_root[FILENAMESZ];
+
+ memset(&lld_root, 0 , FILENAMESZ);
+
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
+ continue;
+
+ if (strncmp(dent->d_name, ISCSI_LLD_SUBSYS_PREFIX, 10))
+ continue;
+
+ snprintf(lld_root, FILENAMESZ, ISCSI_LLD_ROOT"%s",
+ dent->d_name);
+ get_targets(list, lld_root, dent->d_name);
+ }
+ closedir(dirfd);
+done:
+ if (!rc && list_empty(list))
+ rc = ENODEV;
+ if (rc)
+ fw_free_targets(list);
+ return rc;
+}
--
1.6.6.1

View File

@ -0,0 +1,127 @@
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/log.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/log.c
--- open-iscsi-2.0-872-rc1-bnx2i/usr/log.c 2010-05-06 15:26:01.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/log.c 2010-05-06 15:51:47.000000000 -0500
@@ -281,10 +281,15 @@ void log_do_log_daemon(int prio, void *p
void log_do_log_stderr(int prio, void *priv, const char *fmt, va_list ap)
{
- fprintf(stderr, "%s: ", log_name);
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
- fflush(stderr);
+ if (prio == LOG_INFO) {
+ vfprintf(stdout, fmt, ap);
+ fprintf(stdout, "\n");
+ } else {
+ fprintf(stderr, "%s: ", log_name);
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ }
}
void log_warning(const char *fmt, ...)
@@ -313,6 +318,14 @@ void log_debug(int level, const char *fm
}
}
+void log_info(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ log_func(LOG_INFO, log_func_priv, fmt, ap);
+ va_end(ap);
+}
+
static void __dump_line(int level, unsigned char *buf, int *cp)
{
char line[16*3+5], *lp = line;
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/log.h open-iscsi-2.0-872-rc1-bnx2i.work/usr/log.h
--- open-iscsi-2.0-872-rc1-bnx2i/usr/log.h 2010-05-06 15:26:01.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/log.h 2010-05-06 15:39:58.000000000 -0500
@@ -71,6 +71,8 @@ extern int log_init(char *program_name,
void *priv);
extern void log_close (pid_t pid);
extern void dump_logmsg (void *);
+extern void log_info(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
extern void log_warning(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
extern void log_error(const char *fmt, ...)
diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/session_mgmt.c
--- open-iscsi-2.0-872-rc1-bnx2i/usr/session_mgmt.c 2010-05-06 15:26:01.000000000 -0500
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/session_mgmt.c 2010-05-06 15:43:28.000000000 -0500
@@ -42,10 +42,10 @@ static void log_login_msg(struct node_re
rec->conn[0].port);
iscsid_handle_error(rc);
} else
- log_warning("Login to [iface: %s, target: %s, portal: "
- "%s,%d] successful.", rec->iface.name,
- rec->name, rec->conn[0].address,
- rec->conn[0].port);
+ log_info("Login to [iface: %s, target: %s, portal: "
+ "%s,%d] successful.", rec->iface.name,
+ rec->name, rec->conn[0].address,
+ rec->conn[0].port);
}
struct iscsid_async_req {
@@ -100,15 +100,15 @@ int iscsi_login_portal(void *data, struc
struct iscsid_async_req *async_req = NULL;
int rc = 0, fd;
- log_warning("Logging in to [iface: %s, target: %s, portal: %s,%d]",
- rec->iface.name, rec->name, rec->conn[0].address,
- rec->conn[0].port);
+ log_info("Logging in to [iface: %s, target: %s, portal: %s,%d]",
+ rec->iface.name, rec->name, rec->conn[0].address,
+ rec->conn[0].port);
if (list) {
async_req = calloc(1, sizeof(*async_req));
if (!async_req)
- log_error("Could not allocate memory for async login "
- "handling. Using sequential login instead.");
+ log_info("Could not allocate memory for async login "
+ "handling. Using sequential login instead.");
else
INIT_LIST_HEAD(&async_req->list);
}
@@ -215,10 +215,10 @@ static void log_logout_msg(struct sessio
info->persistent_address, info->port);
iscsid_handle_error(rc);
} else
- log_warning("Logout of [sid: %d, target: %s, "
- "portal: %s,%d] successful.",
- info->sid, info->targetname,
- info->persistent_address, info->port);
+ log_info("Logout of [sid: %d, target: %s, "
+ "portal: %s,%d] successful.",
+ info->sid, info->targetname,
+ info->persistent_address, info->port);
}
static int iscsid_logout_reqs_wait(struct list_head *list)
@@ -252,16 +252,16 @@ int iscsi_logout_portal(struct session_i
int fd, rc;
/* TODO: add fn to add session prefix info like dev_printk */
- log_warning("Logging out of session [sid: %d, target: %s, portal: "
- "%s,%d]",
- info->sid, info->targetname, info->persistent_address,
- info->port);
+ log_info("Logging out of session [sid: %d, target: %s, portal: "
+ "%s,%d]",
+ info->sid, info->targetname, info->persistent_address,
+ info->port);
if (list) {
async_req = calloc(1, sizeof(*async_req));
if (!async_req)
- log_error("Could not allocate memory for async logout "
- "handling. Using sequential logout instead.");
+ log_info("Could not allocate memory for async logout "
+ "handling. Using sequential logout instead.");
}
if (!async_req)

View File

@ -0,0 +1,385 @@
diff --git a/usr/Makefile b/usr/Makefile
index e9d6bd1..8e505bf 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -42,7 +42,7 @@ ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o login.o log.o md5.o sha1.o iface.o \
iscsid_req.o $(SYSDEPS_SRCS)
# core initiator files
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o \
- transport.o cxgb3i.o be2iscsi.o
+ 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
index 1c9d8b6..8f7a383 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -45,6 +45,7 @@
#include "iscsi_sysfs.h"
#include "iscsi_settings.h"
#include "iface.h"
+#include "host.h"
#include "sysdeps.h"
#define ISCSI_CONN_ERR_REOPEN_DELAY 3
@@ -743,6 +744,38 @@ static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask)
return 0;
}
+static int __set_net_config(struct iscsi_transport *t,
+ iscsi_session_t *session,
+ struct iface_rec *iface)
+{
+ if (t->template->set_net_config) {
+ /* uip needs the netdev name */
+ struct host_info hinfo;
+ int hostno, rc;
+
+ /* this assumes that the netdev or hw address is going to be
+ set */
+ hostno = iscsi_sysfs_get_host_no_from_hwinfo(iface, &rc);
+ if (rc) {
+ log_debug(4, "Couldn't get host no.\n");
+ return rc;
+ }
+
+ /* uip needs the netdev name */
+ if (!strlen(iface->netdev)) {
+ memset(&hinfo, 0, sizeof(hinfo));
+ hinfo.host_no = hostno;
+ iscsi_sysfs_get_hostinfo_by_host_no(&hinfo);
+ strcpy(iface->netdev, hinfo.iface.netdev);
+ }
+
+ return t->template->set_net_config(t, iface, session);
+ }
+
+ return 0;
+}
+
+
static void
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
int redirected)
@@ -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;
}
+ rc = __set_net_config(t, session, iface);
+ if (rc != 0)
+ return rc;
+
rc = __iscsi_host_set_param(t, session->hostno,
ISCSI_HOST_PARAM_IPADDRESS,
iface->ipaddress, ISCSI_STRING);
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index 5280a0a..6eb8b1d 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <fcntl.h>
#include <sys/un.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -31,6 +32,7 @@
#include "mgmt_ipc.h"
#include "iscsi_util.h"
#include "config.h"
+#include "uip_mgmt_ipc.h"
static void iscsid_startup(void)
{
@@ -51,7 +53,8 @@ static void iscsid_startup(void)
#define MAXSLEEP 128
-static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
+static mgmt_ipc_err_e ipc_connect(int *fd, char *unix_sock_name,
+ int start_iscsid)
{
int nsec;
struct sockaddr_un addr;
@@ -64,8 +67,8 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_LOCAL;
- memcpy((char *) &addr.sun_path + 1, ISCSIADM_NAMESPACE,
- strlen(ISCSIADM_NAMESPACE));
+ memcpy((char *) &addr.sun_path + 1, unix_sock_name,
+ strlen(unix_sock_name));
/*
* Trying to connect with exponential backoff
*/
@@ -93,6 +96,11 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
return MGMT_IPC_ERR_ISCSID_NOTCONN;
}
+static mgmt_ipc_err_e iscsid_connect(int *fd, int 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 err;
@@ -190,6 +198,72 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid)
return iscsid_req_wait(cmd, fd);
}
+static mgmt_ipc_err_e uip_connect(int *fd)
+{
+ return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0);
+}
+
+int uip_broadcast(void *buf, size_t buf_len)
+{
+ int err;
+ int fd;
+ iscsid_uip_rsp_t rsp;
+ int flags;
+ int count;
+
+ err = uip_connect(&fd);
+ if (err) {
+ log_warning("uIP daemon is not up");
+ return err;
+ }
+
+ /* Send the data to uIP */
+ if ((err = write(fd, buf, buf_len)) != buf_len) {
+ log_error("got write error (%d/%d), daemon died?",
+ err, errno);
+ close(fd);
+ return -EIO;
+ }
+
+ /* Set the socket to a non-blocking read, this way if there are
+ * problems waiting for uIP, iscsid can bailout early */
+ flags = fcntl(fd, F_GETFL, 0);
+ if (flags == -1)
+ flags = 0;
+ err = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+ if(err != 0) {
+ log_error("could not set uip broadcast to non-blocking: %d",
+ errno);
+ close(fd);
+ return -EIO;
+ }
+
+#define MAX_UIP_BROADCAST_READ_TRIES 3
+ for(count = 0; count < MAX_UIP_BROADCAST_READ_TRIES; count++) {
+ /* Wait for the response */
+ err = read(fd, &rsp, sizeof(rsp));
+ if (err == sizeof(rsp)) {
+ log_debug(3, "Broadcasted to uIP with length: %ld\n",
+ buf_len);
+ break;
+ } else if((err == -1) && (errno == EAGAIN)) {
+ usleep(250000);
+ continue;
+ } else {
+ log_error("Could not read response (%d/%d), daemon died?",
+ err, errno);
+ break;
+ }
+ }
+
+ if(count == MAX_UIP_BROADCAST_READ_TRIES)
+ log_error("Could not broadcast to uIP");
+
+ close(fd);
+
+ return 0;
+}
+
void iscsid_handle_error(mgmt_ipc_err_e err)
{
static char *err_msgs[] = {
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(int cmd, int sid);
+extern int uip_broadcast(void *buf, size_t buf_len);
+
#endif
diff --git a/usr/transport.c b/usr/transport.c
index c0789bb..aa0395c 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -25,6 +25,7 @@
#include "log.h"
#include "iscsi_util.h"
#include "iscsi_sysfs.h"
+#include "uip_mgmt_ipc.h"
#include "cxgb3i.h"
#include "be2iscsi.h"
@@ -58,6 +59,7 @@ struct iscsi_transport_template bnx2i = {
.ep_connect = ktransport_ep_connect,
.ep_poll = ktransport_ep_poll,
.ep_disconnect = ktransport_ep_disconnect,
+ .set_net_config = uip_broadcast_params,
};
struct iscsi_transport_template be2iscsi = {
diff --git a/usr/transport.h b/usr/transport.h
index 5ceedb3..2ec903c 100644
--- a/usr/transport.h
+++ b/usr/transport.h
@@ -35,6 +35,9 @@ struct iscsi_transport_template {
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
void (*ep_disconnect) (struct iscsi_conn *conn);
void (*create_conn) (struct iscsi_conn *conn);
+ int (*set_net_config) (struct iscsi_transport *t,
+ struct iface_rec *iface,
+ struct iscsi_session *session);
};
/* represents data path provider */
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
new file mode 100644
index 0000000..73b1632
--- /dev/null
+++ b/usr/uip_mgmt_ipc.c
@@ -0,0 +1,41 @@
+/*
+ * uIP iSCSI Daemon/Admin Management IPC
+ *
+ * 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 the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * See the file COPYING included with this distribution for more details.
+ */
+
+#include <string.h>
+
+#include "log.h"
+#include "uip_mgmt_ipc.h"
+#include "iscsid_req.h"
+
+int uip_broadcast_params(struct iscsi_transport *t,
+ struct iface_rec *iface,
+ struct iscsi_session *session)
+{
+ struct iscsid_uip_broadcast broadcast;
+
+ log_debug(3, "broadcasting to uip\n");
+
+ memset(&broadcast, 0, sizeof(broadcast));
+
+ broadcast.header.command = ISCSID_UIP_IPC_GET_IFACE;
+ broadcast.header.payload_len = sizeof(*iface);
+
+ memcpy(&broadcast.u.iface_rec, iface, sizeof(*iface));
+
+ return uip_broadcast(&broadcast,
+ sizeof(iscsid_uip_broadcast_header_t) +
+ sizeof(*iface));
+}
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
new file mode 100644
index 0000000..dd49c0b
--- /dev/null
+++ b/usr/uip_mgmt_ipc.h
@@ -0,0 +1,71 @@
+/*
+ * uIP iSCSI Daemon/Admin Management IPC
+ *
+ * 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 the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * See the file COPYING included with this distribution for more details.
+ */
+#ifndef UIP_MGMT_IPC_H
+#define UIP_MGMT_IPC_H
+
+#include "types.h"
+#include "iscsi_if.h"
+#include "config.h"
+#include "mgmt_ipc.h"
+
+#include "initiator.h"
+#include "transport.h"
+
+#define ISCSID_UIP_NAMESPACE "ISCSID_UIP_ABSTRACT_NAMESPACE"
+
+typedef enum iscsid_uip_cmd {
+ ISCSID_UIP_IPC_UNKNOWN = 0,
+ ISCSID_UIP_IPC_GET_IFACE = 1,
+
+ __ISCSID_UIP_IPC_MAX_COMMAND
+} iscsid_uip_cmd_e;
+
+typedef struct iscsid_uip_broadcast_header {
+ iscsid_uip_cmd_e command;
+ uint32_t payload_len;
+} iscsid_uip_broadcast_header_t;
+
+/* IPC Request */
+typedef struct iscsid_uip_broadcast {
+ struct iscsid_uip_broadcast_header header;
+
+ union {
+ /* messages */
+ struct ipc_broadcast_iface_rec {
+ struct iface_rec rec;
+ } iface_rec;
+ } u;
+} iscsid_uip_broadcast_t;
+
+typedef enum iscsid_uip_mgmt_ipc_err {
+ ISCSID_UIP_MGMT_IPC_OK = 0,
+ ISCISD_UIP_MGMT_IPC_ERR = 1,
+ ISCISD_UIP_MGMT_IPC_ERR_NOT_FOUND = 2,
+ ISCISD_UIP_MGMT_IPC_ERR_NOMEM = 3,
+} iscsid_uip_mgmt_ipc_err_e;
+
+/* IPC Response */
+typedef struct iscsid_uip_mgmt_rsp {
+ iscsid_uip_cmd_e command;
+ iscsid_uip_mgmt_ipc_err_e err;
+} iscsid_uip_rsp_t;
+
+extern int uip_broadcast_params(struct iscsi_transport *t,
+ struct iface_rec *iface,
+ struct iscsi_session *session);
+
+
+#endif /* UIP_MGMT_IPC_H */
--
1.6.6.1

View File

@ -1,21 +1,20 @@
diff -aurp open-iscsi-2.0-870-rc1/etc/iscsid.conf open-iscsi-2.0-870-rc1.work/etc/iscsid.conf
--- open-iscsi-2.0-870-rc1/etc/iscsid.conf 2008-06-30 20:14:03.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/etc/iscsid.conf 2008-06-30 21:08:29.000000000 -0500
@@ -27,8 +27,8 @@
# To request that the iscsi initd scripts startup a session set to "automatic".
# node.startup = automatic
#
-# To manually startup the session set to "manual". The default is manual.
-node.startup = manual
+# To manually startup the session set to "manual". The default is automatic.
+node.startup = automatic
# *************
# CHAP Settings
diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
--- open-iscsi-2.0-870-rc1/README 2008-06-30 20:14:03.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/README 2008-06-30 21:08:29.000000000 -0500
@@ -78,11 +78,6 @@ the cache sync command will fail.
From 4f85b76a1c1bd54dd4d0779c4bf7da485a80b50e Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Tue, 23 Mar 2010 19:24:09 -0500
Subject: [PATCH 3/7] Add Red Hat specific info to docs.
iscsi-initiator-utils-update-initscripts-and-docs.patch
---
README | 9 +++------
etc/iscsid.conf | 23 ++++++++++-------------
usr/idbm.c | 4 ++++
3 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/README b/README
index eadb385..121bd45 100644
--- a/README
+++ b/README
@@ -74,11 +74,6 @@ the cache sync command will fail.
- iscsiadm's -P 3 option will not print out scsi devices.
- iscsid will not automatically online devices.
@ -27,7 +26,7 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
By default the kernel source found at
/lib/modules/`uname -a`/build
will be used to compile the open-iscsi modules. To specify a different
@@ -694,7 +689,7 @@ Red Hat or Fedora:
@@ -813,7 +808,7 @@ Red Hat or Fedora:
-----------------
To start open-iscsi in Red Hat/Fedora you can do:
@ -36,7 +35,7 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
To get open-iscsi to automatically start at run time you may have to
run:
@@ -873,6 +868,8 @@ To login to all the automated nodes, sim
@@ -1012,6 +1007,8 @@ To login to all the automated nodes, simply restart the iscsi service:
e.g /etc/init.d/open-iscsi restart. On your next startup the nodes will
be logged into autmotically.
@ -45,3 +44,88 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
8. Advanced Configuration
=========================
diff --git a/etc/iscsid.conf b/etc/iscsid.conf
index 78c225c..e96833e 100644
--- a/etc/iscsid.conf
+++ b/etc/iscsid.conf
@@ -17,10 +17,10 @@
# maintainers.
#
# Default for Fedora and RHEL. (uncomment to activate).
-# iscsid.startup = /etc/rc.d/init.d/iscsid force-start
+iscsid.startup = /etc/rc.d/init.d/iscsid force-start
#
# Default for upstream open-iscsi scripts (uncomment to activate).
-iscsid.startup = /sbin/iscsid
+# iscsid.startup = /sbin/iscsid
@@ -110,8 +110,8 @@ iscsid.startup = /sbin/iscsid
# To request that the iscsi initd scripts startup a session set to "automatic".
# node.startup = automatic
#
-# To manually startup the session set to "manual". The default is manual.
-node.startup = manual
+# To manually startup the session set to "manual". The default is automatic.
+node.startup = automatic
# *************
@@ -329,29 +329,26 @@ node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
# To allow the targets to control the setting of the digest checking,
-# with the initiator requesting a preference of enabling the checking, uncomment# one or both of the following lines:
+# with the initiator requesting a preference of enabling the checking, uncomment
+# the following lines (Data digests are not supported.):
#node.conn[0].iscsi.HeaderDigest = CRC32C,None
-#node.conn[0].iscsi.DataDigest = CRC32C,None
#
# To allow the targets to control the setting of the digest checking,
# with the initiator requesting a preference of disabling the checking,
-# uncomment one or both of the following lines:
+# uncomment the following lines:
#node.conn[0].iscsi.HeaderDigest = None,CRC32C
-#node.conn[0].iscsi.DataDigest = None,CRC32C
#
# To enable CRC32C digest checking for the header and/or data part of
-# iSCSI PDUs, uncomment one or both of the following lines:
+# iSCSI PDUs, uncomment the following lines:
#node.conn[0].iscsi.HeaderDigest = CRC32C
-#node.conn[0].iscsi.DataDigest = CRC32C
#
# To disable digest checking for the header and/or data part of
-# iSCSI PDUs, uncomment one or both of the following lines:
+# iSCSI PDUs, uncomment the following lines:
#node.conn[0].iscsi.HeaderDigest = None
-#node.conn[0].iscsi.DataDigest = None
#
# The default is to never use DataDigests or HeaderDigests.
#
-
+node.conn[0].iscsi.HeaderDigest = None
#************
# Workarounds
diff --git a/usr/idbm.c b/usr/idbm.c
index 1428365..8ad8024 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -324,9 +324,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
IDBM_SHOW, "None", "CRC32C", "CRC32C,None",
"None,CRC32C", num, 1);
sprintf(key, CONN_DATA_DIGEST, i);
+
+#if 0
+We do not support data digests
__recinfo_int_o4(key, ri, r, conn[i].iscsi.DataDigest, IDBM_SHOW,
"None", "CRC32C", "CRC32C,None",
"None,CRC32C", num, 1);
+#endif
sprintf(key, CONN_IFMARKER, i);
__recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW,
"No", "Yes", num, 1);
--
1.6.6.1

View File

@ -1,11 +1,12 @@
--- open-iscsi-2.0-865/utils/iscsi-iname.c 2007-02-21 12:20:47.000000000 -0600
+++ open-iscsi-2.0-865.work/utils/iscsi-iname.c 2007-06-20 12:37:10.000000000 -0500
@@ -72,7 +72,7 @@ main(int argc, char *argv[])
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/utils/iscsi-iname.c open-iscsi-2.0-871.1.1-bnx2i.work/utils/iscsi-iname.c
--- open-iscsi-2.0-871.1.1-bnx2i/utils/iscsi-iname.c 2010-01-15 02:24:02.000000000 -0600
+++ open-iscsi-2.0-871.1.1-bnx2i.work/utils/iscsi-iname.c 2010-01-15 03:44:23.000000000 -0600
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
exit(0);
}
} else {
- prefix = "iqn.2005-03.org.open-iscsi";
+ prefix = "iqn.1994-05.com.fedora";
+ prefix = "iqn.1994-05.com.redhat";
}
/* try to feed some entropy from the pool to MD5 in order to get

View File

@ -1,32 +1,8 @@
diff -aurp open-iscsi-2.0-870-rc1/doc/iscsiadm.8 open-iscsi-2.0-870-rc1.work/doc/iscsiadm.8
--- open-iscsi-2.0-870-rc1/doc/iscsiadm.8 2008-06-30 20:14:03.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/doc/iscsiadm.8 2008-06-30 21:36:44.000000000 -0500
@@ -47,7 +47,7 @@ display help text and exit
.TP
\fB\-I\fR, \fB\-\-interface\fI[iface]\fR
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 /var/lib/iscsi/ifaces. For hardware
or the iface config must have the hardware address (iface.hwaddress)
and the driver/transport_name (iface.transport_name). The iface's name is
then the filename of the iface config. For software iSCSI, the iface config
@@ -317,10 +317,10 @@ The configuration file read by \fBiscsid
The file containing the iSCSI InitiatorName and InitiatorAlias read by
\fBiscsid\fR and \fBiscsiadm\fR on startup.
.TP
-/etc/iscsi/nodes/
+/var/lib/iscsi/nodes/
This directory contains the nodes with their targets.
.TP
-/etc/iscsi/send_targets
+/var/lib/iscsi/send_targets
This directory contains the portals.
.SH "SEE ALSO"
diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
--- open-iscsi-2.0-870-rc1/README 2008-06-30 21:37:05.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/README 2008-06-30 21:36:44.000000000 -0500
@@ -148,10 +148,10 @@ available on all Linux installations.
diff --git a/README b/README
index 121bd45..c863044 100644
--- a/README
+++ b/README
@@ -144,10 +144,10 @@ available on all Linux installations.
The database contains two tables:
@ -40,24 +16,24 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
The iscsiadm utility is a command-line tool to manage (update, delete,
insert, query) the persistent database.
@@ -327,7 +327,7 @@ a scsi_host per HBA port).
@@ -352,7 +352,7 @@ a scsi_host per HBA port).
To manage both types of initiator stacks, iscsiadm uses the interface (iface)
structure. For each HBA port or for software iscsi for each network
device (ethX) or NIC, that you wish to bind sessions to you must create
-a iface config /etc/iscsi/ifaces.
+a iface config /var/lib/iscsi/ifaces.
When you run iscsiadm the first time a hardware iscsi driver like qla4xxx is
loaded, iscsiadm will create default iface configs for you. The config created
@@ -340,29 +340,29 @@ Running:
iface0 qla4xxx,00:c0:dd:08:63:e8,default
iface1 qla4xxx,00:c0:dd:08:63:ea,default
Running:
@@ -360,29 +360,29 @@ Running:
iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
-Will report iface configurations that are setup in /etc/iscsi/ifaces.
+Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
The format is:
iface_name transport_name,hwaddress,net_ifacename
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
For software iscsi, you can create the iface configs by hand, but it is
reccomended that you use iscsiadm's iface mode. There is a iface.example in
@ -84,16 +60,34 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
iface.transport_name = tcp
iface.hwaddress = 00:C0:DD:08:63:E7
@@ -386,7 +386,7 @@ but you have not logged in then, iscsiad
all existing bindings.
@@ -431,7 +431,7 @@ iser iser,<empty>,<empty>,<empty>,<empty>
cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
When you then run iscsiadm to do discovery, it will check for interfaces
-in /etc/iscsi/ifaces and bind the portals that are discovered so that
+in /var/lib/iscsi/ifaces and bind the portals that are discovered so that
they will be logged in through each iface. This behavior can also be overriden
by passing in the interfaces you want to use. For example if you had defined
two interface but only wanted to use one you can use the
@@ -400,7 +400,7 @@ we do not bind a session to a iface, the
-Will report iface configurations that are setup in /etc/iscsi/ifaces.
+Will report iface configurations that are setup in /var/lib/iscsi/ifaces.
The format is:
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
@@ -447,7 +447,7 @@ default one in /etc/iscsi/initiatorname.iscsi.
-To display these values in a more friendly run:
+To display these values in a more friendly way run:
iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07
# BEGIN RECORD 2.0-871
@@ -485,7 +485,7 @@ need a seperate network connection to the target for discovery purposes.
*This will be fixed in the next version of open-iscsi*
For compatibility reasons, when you run iscsiadm to do discovery, it
-will check for interfaces in /etc/iscsi/iscsi/ifaces that are using
+will check for interfaces in /var/lib/iscsi/ifaces that are using
tcp for the iface.transport and it will bind the portals that are discovered
so that they will be logged in through those ifaces. This behavior can also
be overriden by passing in the interfaces you want to use. For the case
@@ -503,7 +503,7 @@ we do not bind a session to a iface, then you can use the special iface
iscsiadm -m discovery -t st -p ip:port -I default -P 1
@ -102,7 +96,7 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
not pass anything into iscsiadm, running iscsiadm will do the default
behavior, where we allow the network subsystem to decide which
device to use.
@@ -435,7 +435,7 @@ iscsiadm -m node -p ip:port -I iface0 --
@@ -543,7 +543,7 @@ To now log into targets it is the same as with sofware iscsi. See section
./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260
@ -111,8 +105,8 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
using software iscsi. If any are found then nodes found during
discovery will be setup so that they can logged in through
those interfaces.
@@ -483,7 +483,7 @@ iscsiadm -m node -p ip:port -I iface0 --
existing portals.
@@ -598,7 +598,7 @@ To now log into targets it is the same as with sofware iscsi. See section
This command will perform discovery, but not manipulate the node DB.
- SendTargets iSCSI Discovery with a specific interface. If you
- wish to only use a subset of the interfaces in /etc/iscsi/ifaces
@ -120,7 +114,7 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
then you can pass them in during discovery:
./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260 \
@@ -768,8 +768,8 @@ where targetname is the name of the targ
@@ -911,8 +911,8 @@ where targetname is the name of the target and ip_address:port is the address
and port of the portal. tpgt, is the portal group tag of
the portal, and is not used in iscsiadm commands except for static
record creation. And iface name is the name of the iscsi interface
@ -131,10 +125,37 @@ diff -aurp open-iscsi-2.0-870-rc1/README open-iscsi-2.0-870-rc1.work/README
Default here is iscsi_tcp/tcp to be used over which ever NIC the
network layer decides is best.
diff -aurp open-iscsi-2.0-870-rc1/usr/idbm.c open-iscsi-2.0-870-rc1.work/usr/idbm.c
--- open-iscsi-2.0-870-rc1/usr/idbm.c 2008-06-30 20:14:03.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/usr/idbm.c 2008-06-30 21:36:44.000000000 -0500
@@ -2137,9 +2137,9 @@ free_info:
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index b2bad47..6f1bac9 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -49,7 +49,7 @@ display help text and exit
.TP
\fB\-I\fR, \fB\-\-interface\fI[iface]\fR
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 /var/lib/iscsi/ifaces. For hardware
iSCSI (qla4xxx) the iface config must have the hardware address
(iface.hwaddress = port's MAC address)
and the driver/transport_name (iface.transport_name). The iface's name is
@@ -318,10 +318,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
The file containing the iSCSI InitiatorName and InitiatorAlias read by
\fBiscsid\fR and \fBiscsiadm\fR on startup.
.TP
-/etc/iscsi/nodes/
+/var/lib/iscsi/nodes/
This directory contains the nodes with their targets.
.TP
-/etc/iscsi/send_targets
+/var/lib/iscsi/send_targets
This directory contains the portals.
.SH "SEE ALSO"
diff --git a/usr/idbm.c b/usr/idbm.c
index 8ad8024..f5694f3 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2078,9 +2078,9 @@ free_info:
int idbm_init(idbm_get_config_file_fn *fn)
{
/* make sure root db dir is there */
@ -147,10 +168,11 @@ diff -aurp open-iscsi-2.0-870-rc1/usr/idbm.c open-iscsi-2.0-870-rc1.work/usr/idb
errno);
return errno;
}
diff -aurp open-iscsi-2.0-870-rc1/usr/idbm.h open-iscsi-2.0-870-rc1.work/usr/idbm.h
--- open-iscsi-2.0-870-rc1/usr/idbm.h 2008-06-30 20:14:03.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/usr/idbm.h 2008-06-30 21:36:58.000000000 -0500
@@ -26,11 +26,12 @@
diff --git a/usr/idbm.h b/usr/idbm.h
index 57b9295..44cb976 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
@@ -27,12 +27,15 @@
#include "initiator.h"
#include "config.h"
@ -158,25 +180,35 @@ diff -aurp open-iscsi-2.0-870-rc1/usr/idbm.h open-iscsi-2.0-870-rc1.work/usr/idb
-#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp"
-#define ISNS_CONFIG_DIR ISCSI_CONFIG_ROOT"isns"
-#define STATIC_CONFIG_DIR ISCSI_CONFIG_ROOT"static"
-#define FW_CONFIG_DIR ISCSI_CONFIG_ROOT"fw"
-#define ST_CONFIG_DIR ISCSI_CONFIG_ROOT"send_targets"
+#define ISCSIVAR "/var/lib/iscsi/"
+
+#define NODE_CONFIG_DIR ISCSIVAR"nodes"
+#define SLP_CONFIG_DIR ISCSIVAR"slp"
+#define ISNS_CONFIG_DIR ISCSIVAR"isns"
+#define STATIC_CONFIG_DIR ISCSIVAR"static"
+#define ST_CONFIG_DIR ISCSIVAR"send_targets"
+#define FW_CONFIG_DIR ISCSIVAR"fw"
+
#define ST_CONFIG_NAME "st_config"
#define TYPE_INT 0
diff -aurp open-iscsi-2.0-870-rc1/usr/iface.h open-iscsi-2.0-870-rc1.work/usr/iface.h
--- open-iscsi-2.0-870-rc1/usr/iface.h 2008-06-30 20:14:03.000000000 -0500
+++ open-iscsi-2.0-870-rc1.work/usr/iface.h 2008-06-30 21:36:44.000000000 -0500
@@ -20,7 +20,7 @@
diff --git a/usr/iface.h b/usr/iface.h
index 9f6d47e..f7624ea 100644
--- a/usr/iface.h
+++ b/usr/iface.h
@@ -20,7 +20,9 @@
#ifndef ISCSI_IFACE_H
#define ISCSI_IFACE_H
-#define IFACE_CONFIG_DIR ISCSI_CONFIG_ROOT"ifaces"
+#define IFACE_CONFIG_DIR "/var/lib/iscsi/ifaces"
+#include "idbm.h"
+
+#define IFACE_CONFIG_DIR ISCSIVAR"ifaces"
struct iface_rec;
struct list_head;
--
1.6.6.1

View File

@ -2,25 +2,33 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.2.0.870
Release: 13%{?dist}
Source0: http://www.open-iscsi.org/bits/open-iscsi-2.0-870.1.tar.gz
Version: 6.2.0.872
Release: 4%{?dist}
Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc1-bnx2i.tar.gz
Source1: iscsid.init
Source2: iscsidevs.init
Source3: 04-iscsi
Patch0: iscsi-initiator-utils-update-initscripts-and-docs.patch
Patch1: iscsi-initiator-utils-use-var-for-config.patch
Patch2: iscsi-initiator-utils-use-red-hat-for-name.patch
Patch3: iscsi-initiator-utils-ibft-sysfs.patch
Patch4: iscsi-initiator-utils-print-ibft-net-info.patch
Patch5: iscsi-initiator-utils-only-root-use.patch
Patch6: iscsi-initiator-utils-start-iscsid.patch
Patch7: open-iscsi-2.0-870.1-add-libiscsi.patch
Patch8: open-iscsi-2.0-870.1-no-exit.patch
Patch9: open-iscsi-2.0-870.1-ibft-newer-kernel.patch
Patch10: open-iscsi-2.0-870.1-485217.patch
Patch11: open-iscsi-2.0-870.1-fwparam-ppc-crash.patch
Patch12: open-iscsi-2.0-870.1-compile-fix.patch
# fw boot support
Patch0: iscsi-initiator-utils-fw-boot.patch
# Add Red Hat specific info to docs.
Patch1: iscsi-initiator-utils-update-initscripts-and-docs.patch
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
Patch2: iscsi-initiator-utils-use-var-for-config.patch
# Add redhat.com string to default initiator name.
Patch3: iscsi-initiator-utils-use-red-hat-for-name.patch
# Add a lib for use by anaconda.
Patch4: iscsi-initiator-utils-add-libiscsi.patch
# Add bnx2i support.
Patch5: iscsi-initiator-utils-uip-mgmt.patch
# disable isns for libiscsi (libiscsi does not support isns)
Patch6: iscsi-initiator-utils-disable-isns-for-lib.patch
# fix MaxXmitDataSegmentLength=0 handling
Patch7: iscsi-initiator-utils-fix-zero-MaxXmitDataSegmentLength.patch
# fix initial r2t handling for be2iscsi
Patch8: iscsi-initiator-utils-be2iscsi-fix-init-r2t.patch
# do not send informational msgs to stderr
Patch9: iscsi-initiator-utils-log-info.patch
Group: System Environment/Daemons
License: GPLv2+
@ -48,23 +56,24 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q -n open-iscsi-2.0-870.1
%patch0 -p1 -b .update-initscripts-and-docs
%patch1 -p1 -b .use-var-for-config
%patch2 -p1 -b .use-red-hat-for-name
%patch3 -p1 -b .ibft-sysfs
%patch4 -p1 -b .print-ibft-net-info
%patch5 -p1 -b .only-root
%patch6 -p1 -b .start-iscsid
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%setup -q -n open-iscsi-2.0-872-rc1-bnx2i
%patch0 -p1 -b .fw-boot
%patch1 -p1 -b .update-initscripts-and-docs
%patch2 -p1 -b .use-var-for-config
%patch3 -p1 -b .use-red-hat-for-name
%patch4 -p1 -b .add-libiscsi
%patch5 -p1 -b .uip-mgmt
%patch6 -p1 -b .disable-isns-for-lib
%patch7 -p1 -b .fix-zero-MaxXmitDataSegmentLength
%patch8 -p1 -b .be2iscsi-fix-init-r2t
%patch9 -p1 -b .log-info
%build
cd utils/open-isns
./configure
make OPTFLAGS="%{optflags}"
cd ../../
make OPTFLAGS="%{optflags}" -C utils/sysdeps
make OPTFLAGS="%{optflags}" -C utils/fwparam_ibft
make OPTFLAGS="%{optflags}" -C usr
make OPTFLAGS="%{optflags}" -C utils
@ -100,6 +109,8 @@ install -p -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_
install -p -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 doc/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 etc/iscsid.conf $RPM_BUILD_ROOT%{_sysconfdir}/iscsi
install -p -m 644 doc/iscsistart.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 doc/iscsi-iname.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/iscsid
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/iscsi
@ -168,10 +179,40 @@ fi
%{_includedir}/libiscsi.h
%changelog
* Thu May 6 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.4
- Fix iscsi script operations to check for offload drivers in rh_status
- Fix iscsiadm logging to not trigger iscsi script error detection
* Wed May 5 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.3
- 578455 Fix initial R2T=0 handling for be2iscsi
* Wed Mar 31 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.2
- 578455 Fix handling of MaxXmitDataSegmentLength=0 for be2iscsi
* Wed Mar 31 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.1
- 578455 Fix handling of MaxXmitDataSegmentLength=0
* Wed Mar 24 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.0
- 516444 Add iSNS SCN handling (rebased to open-iscsi-2.0-872-rc1-)
- Update brcm to 0.5.7
* Sun Feb 14 2010 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-13
- Preserve timestamps on doxygen generated files
- Fix FTBFS (#565038)
* Mon Feb 8 2010 Mike Christie <mchristi@redhat.com> 6.2.0.871.1.1-3
- Add spec patch comments.
* Thu Jan 21 2010 Mike Christie <mchristi@redhat.com> 6.2.0.871.1.1-2
- 556985 Fix up init.d iscsid script to remove offload modules and
load be2iscsi.
- Enable s390/s390x
* Fri Jan 15 2010 Mike Christie <mchristi@redhat.com> 6.2.0.871.1.1-1
- Sync to upstream
- 529324 Add iscsi-iname and iscsistart man page
- 463582 OF/iBFT support
* Thu Jan 7 2010 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-12
- Change python_sitelib macro to use %%global as the new rpm will break
using %%define here, see:

View File

@ -98,7 +98,7 @@ force_reload() {
rh_status() {
[ -f $lockfile ] || return 3
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser") )
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i") )
if [[ -z "${iparams[*]}" ]]; then
# no sessions
return 2

View File

@ -1 +1 @@
3b7e273ad2696899df2b8e5622fdeb2c open-iscsi-2.0-870.1.tar.gz
05e667ff053169d7e8a620a517448cb7 open-iscsi-2.0-872-rc1-bnx2i.tar.gz