sync with upstream

minor context fixes after rebase of out-of-tree patches
iscsiuio is merged upstream, remove old source archive and patches
spec cleanups to fix rpmlint issues
This commit is contained in:
Chris Leech 2013-08-18 15:15:35 -07:00
parent be68e033bf
commit c2d5d21256
41 changed files with 80558 additions and 6539 deletions

View File

@ -1,22 +1,31 @@
From 59b5b828b2a763f47fb205aedf202990d64e748c Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 24 Dec 2012 13:37:53 -0800
Subject: iscsid iscsiuio ipc interface
From 2ff28eacd7c98d438a1864a09a124991ff2e1189 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Tue, 28 May 2013 02:18:08 -0500
Subject: ISCSID: Added socket communication hooks for uip
From Eddie Wai:
This patch adds the communication path between iscsid->iscsiuio.
It utilizes the set_net_config func ptr in the iscsi_transport_template
to initiate the callbacks.
Two new files are introduced: uip_mgmt_ipc.h and uip_mgmt_ipc.c
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
include/iscsi_err.h | 2 +
usr/Makefile | 3 +-
usr/initiator.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++-
usr/initiator.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++-
usr/initiator.h | 4 ++
usr/initiator_common.c | 34 +++++++++++++++
usr/iscsi_err.c | 1 +
usr/iscsid_req.c | 91 +++++++++++++++++++++++++++++++++++++--
usr/iscsid_req.c | 91 +++++++++++++++++++++++++++++++++++++++-
usr/iscsid_req.h | 2 +
usr/transport.c | 2 +
usr/transport.h | 3 ++
usr/uip_mgmt_ipc.c | 41 ++++++++++++++++++
usr/uip_mgmt_ipc.h | 73 ++++++++++++++++++++++++++++++++
12 files changed, 364 insertions(+), 5 deletions(-)
11 files changed, 363 insertions(+), 4 deletions(-)
create mode 100644 usr/uip_mgmt_ipc.c
create mode 100644 usr/uip_mgmt_ipc.h
@ -34,21 +43,21 @@ index aabea4e..1139133 100644
/* Always last. Indicates end of error code space */
ISCSI_MAX_ERR_VAL,
diff --git a/usr/Makefile b/usr/Makefile
index 1669890..5bf5f83 100644
index 673b7f1..33b517c 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -40,7 +40,8 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o)
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 iser.o cxgbi.o be2iscsi.o \
- initiator_common.o iscsi_err.o iscsi_param.o $(IPC_OBJ) $(SYSDEPS_SRCS)
+ initiator_common.o iscsi_err.o iscsi_param.o uip_mgmt_ipc.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 kern_err_table.o
diff --git a/usr/initiator.c b/usr/initiator.c
index d475358..597e0ff 100644
index d475358..86df222 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -45,6 +45,7 @@
@ -90,7 +99,7 @@ index d475358..597e0ff 100644
+ /* while reopening the recv pool should be full */
+ log_error("BUG: __session_conn_reopen could "
+ "not get conn context for recv.");
+ return ENOMEM;
+ return -ENOMEM;
+ }
+
+ ev_context->data = qtask;
@ -102,7 +111,7 @@ index d475358..597e0ff 100644
+ &conn->login_timer, conn->login_timeout);
+ actor_timer(&conn->login_timer, conn->login_timeout * 1000,
+ iscsi_uio_poll_login_timedout, qtask);
+ return EAGAIN;
+ return -EAGAIN;
+}
+
static void
@ -205,14 +214,6 @@ index d475358..597e0ff 100644
__session_destroy(session);
return ISCSI_ERR_LOGIN;
}
@@ -2001,6 +2111,7 @@ iscsi_host_send_targets(queue_task_t *qtask, int host_no, int do_login,
struct sockaddr_storage *ss)
{
struct iscsi_transport *t;
+ int rc;
t = iscsi_sysfs_get_transport_by_hba(host_no);
if (!t) {
diff --git a/usr/initiator.h b/usr/initiator.h
index b45caab..d6dc02e 100644
--- a/usr/initiator.h
@ -286,20 +287,8 @@ index ef6820c..eb72795 100644
rc = host_set_param(t, session->hostno,
ISCSI_HOST_PARAM_IPADDRESS,
iface->ipaddress, ISCSI_STRING);
diff --git a/usr/iscsi_err.c b/usr/iscsi_err.c
index 4fe1c53..f9ba130 100644
--- a/usr/iscsi_err.c
+++ b/usr/iscsi_err.c
@@ -51,6 +51,7 @@ static char *iscsi_err_msgs[] = {
/* 26 */ "iSNS registration failed",
/* 27 */ "operation not supported",
/* 28 */ "device or resource in use",
+ /* 29 */ "Retryable failure",
};
char *iscsi_err_to_str(int err)
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index 1c4678d..a436194 100644
index 1c4678d..15f6353 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -22,6 +22,7 @@
@ -327,21 +316,17 @@ index 1c4678d..a436194 100644
{
int nsec, addr_len;
struct sockaddr_un addr;
@@ -65,11 +67,11 @@ static int iscsid_connect(int *fd, int start_iscsid)
return ISCSI_ERR_ISCSID_NOTCONN;
}
- addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSIADM_NAMESPACE) + 1;
+ addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(unix_sock_name) + 1;
@@ -69,7 +71,8 @@ static int 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, addr_len);
+ memcpy((char *) &addr.sun_path + 1, unix_sock_name, addr_len);
+ memcpy((char *) &addr.sun_path + 1, unix_sock_name,
+ strlen(unix_sock_name));
/*
* Trying to connect with exponential backoff
@@ -98,6 +100,11 @@ static int iscsid_connect(int *fd, int start_iscsid)
@@ -98,6 +101,11 @@ static int iscsid_connect(int *fd, int start_iscsid)
return ISCSI_ERR_ISCSID_NOTCONN;
}
@ -353,7 +338,7 @@ index 1c4678d..a436194 100644
int iscsid_request(int *fd, iscsiadm_req_t *req, int start_iscsid)
{
int err;
@@ -194,3 +201,81 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid)
@@ -194,3 +202,82 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid)
return err;
return iscsid_req_wait(cmd, fd);
}
@ -380,7 +365,8 @@ index 1c4678d..a436194 100644
+ log_debug(3, "connected to uIP daemon");
+
+ /* Send the data to uIP */
+ if ((err = write(fd, buf, buf_len)) != buf_len) {
+ err = write(fd, buf, buf_len);
+ if (err != buf_len) {
+ log_error("got write error (%d/%d), daemon died?",
+ err, errno);
+ close(fd);
@ -395,7 +381,7 @@ index 1c4678d..a436194 100644
+ if (flags == -1)
+ flags = 0;
+ err = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+ if(err != 0) {
+ if (err) {
+ log_error("could not set uip broadcast to non-blocking: %d",
+ errno);
+ close(fd);
@ -403,7 +389,7 @@ index 1c4678d..a436194 100644
+ }
+
+#define MAX_UIP_BROADCAST_READ_TRIES 3
+ for(count = 0; count < MAX_UIP_BROADCAST_READ_TRIES; count++) {
+ for (count = 0; count < MAX_UIP_BROADCAST_READ_TRIES; count++) {
+ /* Wait for the response */
+ err = read(fd, &rsp, sizeof(rsp));
+ if (err == sizeof(rsp)) {
@ -412,12 +398,12 @@ index 1c4678d..a436194 100644
+ rsp.command, rsp.err);
+ err = 0;
+ break;
+ } else if((err == -1) && (errno == EAGAIN)) {
+ } else if ((err == -1) && (errno == EAGAIN)) {
+ usleep(250000);
+ continue;
+ } else {
+ log_error("Could not read response (%d/%d), daemon died?",
+ err, errno);
+ log_error("Could not read response (%d/%d), daemon "
+ "died?", err, errno);
+ err = ISCSI_ERR;
+ break;
+ }
@ -427,7 +413,7 @@ index 1c4678d..a436194 100644
+ 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) {
+ } else if (rsp.err != ISCSID_UIP_MGMT_IPC_DEVICE_UP) {
+ log_debug(3, "Device is not ready\n");
+ err = ISCSI_ERR_AGAIN;
+ }
@ -482,7 +468,7 @@ index 672561b..5dcf872 100644
/* 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
index 0000000..f3074ee
--- /dev/null
+++ b/usr/uip_mgmt_ipc.c
@@ -0,0 +1,41 @@
@ -514,7 +500,7 @@ index 0000000..73b1632
+{
+ struct iscsid_uip_broadcast broadcast;
+
+ log_debug(3, "broadcasting to uip\n");
+ log_debug(3, "broadcasting to uip\n");
+
+ memset(&broadcast, 0, sizeof(broadcast));
+
@ -529,7 +515,7 @@ index 0000000..73b1632
+}
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
new file mode 100644
index 0000000..3859688
index 0000000..29a4769
--- /dev/null
+++ b/usr/uip_mgmt_ipc.h
@@ -0,0 +1,73 @@
@ -565,7 +551,7 @@ index 0000000..3859688
+ ISCSID_UIP_IPC_UNKNOWN = 0,
+ ISCSID_UIP_IPC_GET_IFACE = 1,
+
+ __ISCSID_UIP_IPC_MAX_COMMAND
+ __ISCSID_UIP_IPC_MAX_COMMAND
+} iscsid_uip_cmd_e;
+
+typedef struct iscsid_uip_broadcast_header {
@ -587,11 +573,11 @@ index 0000000..3859688
+
+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,
+ ISCISD_UIP_MGMT_IPC_DEVICE_UP = 4,
+ ISCISD_UIP_MGMT_IPC_DEVICE_INITIALIZING = 5,
+ ISCSID_UIP_MGMT_IPC_ERR = 1,
+ ISCSID_UIP_MGMT_IPC_ERR_NOT_FOUND = 2,
+ ISCSID_UIP_MGMT_IPC_ERR_NOMEM = 3,
+ ISCSID_UIP_MGMT_IPC_DEVICE_UP = 4,
+ ISCSID_UIP_MGMT_IPC_DEVICE_INITIALIZING = 5,
+} iscsid_uip_mgmt_ipc_err_e;
+
+/* IPC Response */
@ -607,5 +593,5 @@ index 0000000..3859688
+
+#endif /* UIP_MGMT_IPC_H */
--
1.7.11.7
1.8.1.4

View File

@ -0,0 +1,70 @@
From c9ff6b4ce766a25da4a2e9f9f4836139c9c2331e Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Fri, 15 Feb 2013 16:58:37 -0800
Subject: ISCSID: Modified the Makefile for iscsiuio compilation
This patch modifies the open-iscsi Makefile to include the compilation,
binary/manpage install, and clean of the iscsiuio source.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
Makefile | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index c5d9700..0b7bb98 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,8 @@ mandir = $(prefix)/share/man
etcdir = /etc
initddir = $(etcdir)/init.d
-MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8
-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname
+MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8 iscsiuio/docs/iscsiuio.8
+PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname iscsiuio/src/unix/iscsiuio
INSTALL = install
ETCFILES = etc/iscsid.conf
IFACEFILES = etc/iface.example
@@ -26,24 +26,29 @@ IFACEFILES = etc/iface.example
all: user
-user: utils/open-isns/Makefile
+user: utils/open-isns/Makefile iscsiuio/Makefile
$(MAKE) -C utils/open-isns
$(MAKE) -C utils/sysdeps
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
$(MAKE) -C utils
+ $(MAKE) -C iscsiuio
@echo
@echo "Compilation complete Output file"
@echo "----------------------------------- ----------------"
@echo "Built iSCSI daemon: usr/iscsid"
@echo "Built management application: usr/iscsiadm"
@echo "Built boot tool: usr/iscsistart"
+ @echo "Built iscsiuio daemon: iscsiuio/src/unix/iscsiuio"
@echo
@echo "Read README file for detailed information."
utils/open-isns/Makefile: utils/open-isns/configure utils/open-isns/Makefile.in
cd utils/open-isns; ./configure CFLAGS="$(OPTFLAGS)" --with-security=no
+iscsiuio/Makefile: iscsiuio/configure iscsiuio/Makefile.in
+ cd iscsiuio; ./configure
+
kernel: force
$(MAKE) -C kernel
@echo "Kernel Compilation complete Output file"
@@ -61,6 +66,7 @@ clean:
$(MAKE) -C utils clean
$(MAKE) -C usr clean
$(MAKE) -C kernel clean
+ $(MAKE) -C iscsiuio clean
$(MAKE) -C utils/open-isns clean
$(MAKE) -C utils/open-isns distclean
--
1.8.1.4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,107 @@
From 28336bc000520e89670ce29360697a71a42b5e24 Mon Sep 17 00:00:00 2001
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Date: Fri, 22 Mar 2013 07:35:52 -0400
Subject: Manpage changes for flashnode submode support for host mode.
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
doc/iscsiadm.8 | 35 +++++++++++++++++++++++++++++++----
1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index 7c209f6..b4c7388 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -16,7 +16,7 @@ iscsiadm \- open-iscsi administration utility
\fBiscsiadm\fR \-m fw [\-l]
-\fBiscsiadm\fR \-m host [ \-P printlevel ] [ \-H hostno|MAC ] [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ]
+\fBiscsiadm\fR \-m host [ \-P printlevel ] [ \-H hostno|MAC ] [ [ \-C chap [ \-o operation ] [ \-v chap_tbl_idx ] ] | [ \-C flashnode [ \-o operation ] [ \-A portal_type ] [ \-x flashnode_idx ] [ \-n name ] [ \-v value ] ] ]
\fBiscsiadm\fR \-k priority
@@ -47,6 +47,12 @@ daemon (iscsid) be running.
This option is only valid for ping submode.
.TP
+\fB\-A\fR, \fB\-\-portal_type=\fI[ipv4|ipv6]\fR
+Specify the portal type for the new flash node entry to be created.
+.IP
+This option is only valid for flashnode submode of host mode and only with \fInew\fR operation.
+
+.TP
\fB\-b\fR, \fB\-\-packetsize=\fIpacketsize\fP
Specify the ping \fIpacketsize\fR.
@@ -66,6 +72,12 @@ Currently iscsiadm support ping as submode for iface. For example,
iscsiadm -m iface -I ifacename -C ping -a ipaddr -b packetsize -c count -i interval
+For host, it supports chap and flashnode as submodes. For example,
+
+iscsiadm -m host -H hostno -C chap -v chap_tbl_idx -o operation
+
+iscsiadm -m host -H hostno -C flashnode -x flashnode_idx -o operation
+
.TP
\fB\-d\fR, \fB\-\-debug=\fIdebug_level\fP
print debugging information. Valid values for debug_level are 0 to 8.
@@ -170,8 +182,9 @@ for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
.TP
\fB\-n\fR, \fB\-\-name=\fIname\fR
-Specify a field \fIname\fR in a record. For use with the \fIupdate\fR
-operator.
+In node mode, specify a field \fIname\fR in a record. In flashnode submode of host mode, specify name of the flash node parameter.
+
+For use with the \fIupdate\fR operator.
.IP
.TP
@@ -181,6 +194,8 @@ Specifies a database operator \fIop\fR. \fIop\fR must be one of
.IP
For iface mode, \fIapply\fR and \fIapplyall\fR are also applicable.
.IP
+For flashnode submode of host mode, \fIlogin\fR and \fIlogout\fR are also applicable.
+.IP
This option is valid for all modes except fw. Delete should not be used on a running session. If it is iscsiadm will stop the session and then delete the
record.
.IP
@@ -210,6 +225,12 @@ sid is passed in.
.IP
\fIapplyall\fR will cause the network settings to take effect on all the ifaces whose MAC address or host number matches that of the specific host.
+.IP
+\fIlogin\fR will log into the specified flash node entry.
+
+.IP
+\fIlogout\fR does the logout from the given flash node entry.
+
.TP
\fB\-p\fR, \fB\-\-portal=\fIip[:port]\fR
Use target portal with ip-address \fIip\fR and \fIport\fR. If port is not passed
@@ -292,12 +313,18 @@ for session mode).
\fB\-v\fR, \fB\-\-value=\fIvalue\fR
Specify a \fIvalue\fR for use with the \fIupdate\fR operator.
.IP
-This option is only valid for node mode.
+This option is only valid for node mode and flashnode submode of host mode.
.TP
\fB\-V\fR, \fB\-\-version\fR
display version and exit
+.TP
+\fB\-x\fR, \fB\-\-flashnode_idx=\fIindex\fR
+Specify the \fIindex\fR of the flash node to operate on.
+.IP
+This option is only valid for flashnode submode of host mode.
+
.SH DISCOVERY TYPES
iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.
--
1.8.1.4

View File

@ -0,0 +1,105 @@
From 65998ba3f2413069aa2242645712969d62d9c140 Mon Sep 17 00:00:00 2001
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Date: Fri, 22 Mar 2013 07:35:53 -0400
Subject: README changes for flashnode submode support for host mode.
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
README | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/README b/README
index ec22098..29b00a9 100644
--- a/README
+++ b/README
@@ -406,6 +406,29 @@ Usage: iscsiadm [OPTION]
is connected to.
3 = Print iscsi params used.
4 = Print SCSI info like LUNs, device state.
+ -m host --host=hostno|MAC -C flashnode
+ Display list of all the targets in adapter's
+ flash (flash node), for the specified host,
+ with ip, port, tpgt and iqn.
+ -m host --host=hostno|MAC -C flashnode --op=[NEW] --portal_type=[ipv4|ipv6]
+ Create new flash node entry for the given host of the
+ specified portal_type. This returns the index of the
+ newly created entry on success.
+ -m host --host=hostno|MAC -C flashnode --flashnode_idx=[flashnode index] \
+ --op=[UPDATE] --name=[name] --value=[value]
+ Update the params of the speficied flash node.
+ The [name] and [value] pairs must be provided for the
+ params that need to be updated. Multiple params can
+ be updated using a single command.
+ -m host --host=hostno|MAC -C flashnode--flashnode_idx=[flashnode index] \
+ --op=[SHOW | DELETE | LOGIN | LOGOUT]
+ op=DELETE|LOGIN|LOGOUT will perform deletion/login/
+ logout operation on the specified flash node.
+
+ op=SHOW will list all params with the values for the
+ specified flash node. This is the default operation.
+
+ See the iscsiadm example section for more info.
-d, --debug debuglevel print debugging information
-V, --version display version and exit
-h, --help display this help and exit
@@ -960,6 +983,56 @@ To now log into targets it is the same as with sofware iscsi. See section
./iscsiadm -m session -P 1
+
+ Host mode with flashnode submode:
+
+ - Display list of flash nodes for a host
+
+ ./iscsiadm -m host -H 6 -C flashnode
+
+ This will print list of all the flash node entries for the given host 6
+ along with their ip, port, tpgt and iqn values.
+
+ - Display all parameters of a flash node entry for a host
+
+ ./iscsiadm -m host -H 6 -C flashnode -x 0
+
+ This will list all the parameter name,value pairs for flash node entry at
+ index 0 of host 6.
+
+ - Add a new flash node entry for a host
+
+ ./iscsiadm -m host -H 6 -C flashnode -o new -A ipv4
+ or
+ ./iscsiadm -m host -H 6 -C flashnode -o new -A ipv6
+
+ This will add new flash node entry for the given host 6 with portal
+ type of either ipv4 or ipv6. The new operation returns the index of
+ the newly created flash node entry.
+
+ - Update a flashnode entry
+ ./iscsiadm -m host -H 6 -C flashnode -x 1 -o update \
+ -n flashnode.conn[0].ipaddress -v 192.168.1.12 \
+ -n flashnode.session.targetname \
+ -v iqn.2002-03.com.compellent:5000d310004b0716
+
+ This will update the values of ipaddress and targetname params of
+ flash node entry at index 1 of host 6.
+
+ - Login to a flash node entry
+ ./iscsiadm -m host -H 6 -C flashnode -x 1 -o login
+
+ - Logout from a flash node entry
+ ./iscsiadm -m host -H 6 -C flashnode -x 1 -o logout
+ or
+ ./iscsiadm -m session -r $sid -u
+
+ Logout can be performed either using the flash node index or using the
+ corresponding session index.
+
+ - Delete a flash node entry
+ ./iscsiadm -m host -H 6 -C flashnode -x 1 -o delete
+
6. Configuration
================
--
1.8.1.4

View File

@ -0,0 +1,30 @@
From 8d3e9e5c3e1813b372f84d3bcca08bbe479f7f63 Mon Sep 17 00:00:00 2001
From: Lee Duncan <leeman.duncan@gmail.com>
Date: Tue, 21 May 2013 14:16:38 -0700
Subject: PATCH 1 of 1] correctly check return value of nice()
The nice() call can return a negative value, since
it returns the previous nice value.
Signed-off-by: Lee Duncan <leeman.duncan@gmail.com>
---
usr/iscsi_util.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
index 5e3420e..ac86847 100644
--- a/usr/iscsi_util.c
+++ b/usr/iscsi_util.c
@@ -60,7 +60,8 @@ int oom_adjust(void)
char path[ISCSI_OOM_PATH_LEN];
struct stat statb;
- if (nice(-10) < 0)
+ errno = 0;
+ if (nice(-10) == -1 && errno != 0)
log_debug(1, "Could not increase process priority: %s",
strerror(errno));
--
1.8.1.4

View File

@ -0,0 +1,55 @@
From 7a5cd01731e0eb86960cc4fa543136b7e3a86e1e Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Mon, 13 May 2013 03:19:54 -0500
Subject: Allow firmware mode to use debug flag
From Lee Duncan:
When iscsiadm is called with "-m fw", the debug flag can be
useful.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
doc/iscsiadm.8 | 2 +-
usr/iscsiadm.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index b4c7388..6b15fcd 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -14,7 +14,7 @@ iscsiadm \- open-iscsi administration utility
\fBiscsiadm\fR \-m iface [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I ifacename | \-H hostno|MAC ] [ [ \-o operation ] [ \-n name ] [ \-v value ] ] [ \-C ping [ \-a ip ] [ \-b packetsize ] [ \-c count ] [ \-i interval ] ]
-\fBiscsiadm\fR \-m fw [\-l]
+\fBiscsiadm\fR \-m fw [ \-d debug_level ] [\-l]
\fBiscsiadm\fR \-m host [ \-P printlevel ] [ \-H hostno|MAC ] [ [ \-C chap [ \-o operation ] [ \-v chap_tbl_idx ] ] | [ \-C flashnode [ \-o operation ] [ \-A portal_type ] [ \-x flashnode_idx ] [ \-n name ] [ \-v value ] ] ]
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 5a18522..df76df9 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -135,7 +135,7 @@ iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,au
[ [ -o operation ] [ -n name ] [ -v value ] ]\n\
iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]\n\
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]\n\
-iscsiadm -m fw [ -l ]\n\
+iscsiadm -m fw [ -d debug_level ] [ -l ]\n\
iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ] | [ -C flashnode [ -o operation ] [ -A portal_type ] [ -x flashnode_idx ] [ -n name ] [ -v value ] ] ]\n\
iscsiadm -k priority\n");
}
@@ -2987,7 +2987,7 @@ main(int argc, char **argv)
usage(ISCSI_ERR_INVAL);
if (mode == MODE_FW) {
- if ((rc = verify_mode_params(argc, argv, "ml", 0))) {
+ if ((rc = verify_mode_params(argc, argv, "dml", 0))) {
log_error("fw mode: option '-%c' is not "
"allowed/supported", rc);
rc = ISCSI_ERR_INVAL;
--
1.8.1.4

View File

@ -0,0 +1,37 @@
From f1994bc91688889e4b7ffbca687739023f2a815b Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Fri, 8 Mar 2013 11:11:13 -0800
Subject: iscsiadm: return error when login fails
When login fails because there are too many sessions we should be
returning an error code so that userland is aware that something
is amiss.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
usr/session_mgmt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/usr/session_mgmt.c b/usr/session_mgmt.c
index ec1f43a..0b7373f 100644
--- a/usr/session_mgmt.c
+++ b/usr/session_mgmt.c
@@ -178,12 +178,12 @@ int iscsi_login_portal(void *data, struct list_head *list, struct node_rec *rec)
goto done;
}
if (session_count >= rec->session.nr_sessions) {
- log_debug(1, "%s: %d session%s requested, but %d "
+ log_warning("%s: %d session%s requested, but %d "
"already present.",
rec->iface.name, rec->session.nr_sessions,
rec->session.nr_sessions == 1 ? "" : "s",
session_count);
- rc = 0;
+ rc = ISCSI_ERR_SESS_EXISTS;
goto done;
}
--
1.8.1.4

View File

@ -0,0 +1,217 @@
From 2991867601094b39ca1cf7e14d8eefecda14ffb7 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Tue, 22 Jan 2013 10:44:27 -0700
Subject: iscsiadm: bind ifaces to portals found using isns
Bug and patch from Jayamohan Kallickal at Emulex.
This adds support to be able to use isns discovery and
bind the portals found to offload ifaces. Note that
this does not do iSNS through the offload card. It
uses a normal net connection but portals that are found
will be setup to login using the offload card.
The problem with the previous code was that isns
discovery code was not reading in the iface info before
binding, so the resulting setup was not binding the offload
card to the record.
[Minor cleanup of patch by Mike Christie]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
usr/iscsiadm.c | 127 ++++++++++++++++++++++++++++++---------------------------
1 file changed, 66 insertions(+), 61 deletions(-)
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index df76df9..efe6383 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -1133,17 +1133,55 @@ do_software_sendtargets(discovery_rec_t *drec, struct list_head *ifaces,
return rc;
}
+static int do_isns(discovery_rec_t *drec, struct list_head *ifaces,
+ int info_level, int do_login, int op)
+{
+ struct list_head rec_list;
+ struct node_rec *rec, *tmp;
+ int rc;
+
+ INIT_LIST_HEAD(&rec_list);
+ /*
+ * compat: if the user did not pass any op then we do all
+ * ops for them
+ */
+ if (!op)
+ op = OP_NEW | OP_DELETE | OP_UPDATE;
+
+
+ rc = idbm_bind_ifaces_to_nodes(discovery_isns, drec, ifaces,
+ &rec_list);
+ if (rc) {
+ log_error("Could not perform iSNS discovery: %s",
+ iscsi_err_to_str(rc));
+ return rc;
+ } else if (list_empty(&rec_list)) {
+ log_error("No portals found");
+ return ISCSI_ERR_NO_OBJS_FOUND;
+ }
+
+ rc = exec_disc_op_on_recs(drec, &rec_list, info_level, do_login, op);
+
+ list_for_each_entry_safe(rec, tmp, &rec_list, list) {
+ list_del(&rec->list);
+ free(rec);
+ }
+
+ return rc;
+}
+
static int
-do_sendtargets(discovery_rec_t *drec, struct list_head *ifaces,
- int info_level, int do_login, int op, int sync_drec)
+do_target_discovery(discovery_rec_t *drec, struct list_head *ifaces,
+ int info_level, int do_login, int op, int sync_drec)
{
+
struct iface_rec *tmp, *iface;
int rc, host_no;
struct iscsi_transport *t;
if (list_empty(ifaces)) {
ifaces = NULL;
- goto sw_st;
+ goto sw_discovery;
}
/* we allow users to mix hw and sw iscsi so we have to sort it out */
@@ -1177,59 +1215,30 @@ do_sendtargets(discovery_rec_t *drec, struct list_head *ifaces,
continue;
}
- if (t->caps & CAP_SENDTARGETS_OFFLOAD) {
- do_offload_sendtargets(drec, host_no, do_login);
- list_del(&iface->list);
- free(iface);
- }
+ if (drec->type == DISCOVERY_TYPE_SENDTARGETS)
+ if (t->caps & CAP_SENDTARGETS_OFFLOAD) {
+ do_offload_sendtargets(drec, host_no, do_login);
+ list_del(&iface->list);
+ free(iface);
+ }
}
if (list_empty(ifaces))
return ISCSI_ERR_NO_OBJS_FOUND;
-sw_st:
- return do_software_sendtargets(drec, ifaces, info_level, do_login,
- op, sync_drec);
-}
-
-static int do_isns(discovery_rec_t *drec, struct list_head *ifaces,
- int info_level, int do_login, int op)
-{
- struct list_head rec_list;
- struct node_rec *rec, *tmp;
- int rc;
-
- INIT_LIST_HEAD(&rec_list);
- /*
- * compat: if the user did not pass any op then we do all
- * ops for them
- */
- if (!op)
- op = OP_NEW | OP_DELETE | OP_UPDATE;
-
- drec->type = DISCOVERY_TYPE_ISNS;
-
- rc = idbm_bind_ifaces_to_nodes(discovery_isns, drec, ifaces,
- &rec_list);
- if (rc) {
- log_error("Could not perform iSNS discovery: %s",
- iscsi_err_to_str(rc));
- return rc;
- } else if (list_empty(&rec_list)) {
- log_error("No portals found");
- return ISCSI_ERR_NO_OBJS_FOUND;
- }
-
- rc = exec_disc_op_on_recs(drec, &rec_list, info_level, do_login, op);
-
- list_for_each_entry_safe(rec, tmp, &rec_list, list) {
- list_del(&rec->list);
- free(rec);
+sw_discovery:
+ switch (drec->type) {
+ case DISCOVERY_TYPE_SENDTARGETS:
+ return do_software_sendtargets(drec, ifaces, info_level,
+ do_login, op, sync_drec);
+ case DISCOVERY_TYPE_ISNS:
+ return do_isns(drec, ifaces, info_level, do_login, op);
+ default:
+ log_debug(1, "Unknown Discovery Type : %d\n", drec->type);
}
-
- return rc;
}
+
static int
verify_mode_params(int argc, char **argv, char *allowed, int skip_m)
{
@@ -2394,15 +2403,9 @@ static int exec_discover(int disc_type, char *ip, int port,
rc = 0;
switch (disc_type) {
case DISCOVERY_TYPE_SENDTARGETS:
- /*
- * idbm_add_discovery call above handles drec syncing so
- * we always pass in 0 here.
- */
- rc = do_sendtargets(drec, ifaces, info_level, do_login, op,
- 0);
- break;
case DISCOVERY_TYPE_ISNS:
- rc = do_isns(drec, ifaces, info_level, do_login, op);
+ rc = do_target_discovery(drec, ifaces, info_level, do_login, op,
+ 0);
break;
default:
log_error("Unsupported discovery type.");
@@ -2535,8 +2538,7 @@ static int exec_disc_op(int disc_type, char *ip, int port,
idbm_sendtargets_defaults(&drec.u.sendtargets);
strlcpy(drec.address, ip, sizeof(drec.address));
drec.port = port;
-
- rc = do_sendtargets(&drec, ifaces, info_level,
+ rc = do_target_discovery(&drec, ifaces, info_level,
do_login, op, 1);
if (rc)
goto done;
@@ -2559,7 +2561,9 @@ static int exec_disc_op(int disc_type, char *ip, int port,
else
drec.port = port;
- rc = do_isns(&drec, ifaces, info_level, do_login, op);
+ drec.type = DISCOVERY_TYPE_ISNS;
+ rc = do_target_discovery(&drec, ifaces, info_level,
+ do_login, op, 0);
if (rc)
goto done;
break;
@@ -2590,8 +2594,9 @@ static int exec_disc_op(int disc_type, char *ip, int port,
}
if ((do_discover || do_login) &&
drec.type == DISCOVERY_TYPE_SENDTARGETS) {
- rc = do_sendtargets(&drec, ifaces, info_level,
- do_login, op, 0);
+ rc = do_target_discovery(&drec, ifaces,
+ info_level, do_login,
+ op, 0);
} else if (op == OP_NOOP || op == OP_SHOW) {
if (!idbm_print_discovery_info(&drec,
do_show)) {
--
1.8.1.4

View File

@ -0,0 +1,32 @@
From 71f0db9ccb46be357c9b6505d35340150795996c Mon Sep 17 00:00:00 2001
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Date: Thu, 9 May 2013 13:57:49 +0530
Subject: iscsiadm: Check for mode is not required when creating params list
There is no need to explicitly check for mode while creating the params
list of name/value pairs.
Reported-by: Leeman Duncan <leeman.duncan@gmail.com>
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
---
usr/iscsiadm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index efe6383..84d5a27 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -2962,9 +2962,7 @@ main(int argc, char **argv)
usage(0);
}
- if ((mode == MODE_IFACE ||
- (mode == MODE_HOST && sub_mode == MODE_FLASHNODE)) &&
- name && value) {
+ if (name && value) {
param = idbm_alloc_user_param(name, value);
if (!param) {
log_error("Cannot allocate memory for params.");
--
1.8.1.4

View File

@ -0,0 +1,46 @@
From 2d0a0570b4d067f0b4e100f0cbab190efcfe3c67 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Wed, 29 May 2013 12:00:40 -0500
Subject: iscsid/iscsiadm: add support for emulex one connect storage
From Chris Moore.
Add support for emulex one connect storage driver.
---
iscsiuio/config.status | 0
usr/transport.c | 8 ++++++++
2 files changed, 8 insertions(+)
mode change 100644 => 100755 iscsiuio/config.status
diff --git a/iscsiuio/config.status b/iscsiuio/config.status
old mode 100644
new mode 100755
diff --git a/usr/transport.c b/usr/transport.c
index 10212af..52b7674 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -99,6 +99,13 @@ struct iscsi_transport_template qla4xxx = {
.ep_disconnect = ktransport_ep_disconnect,
};
+struct iscsi_transport_template ocs = {
+ .name = "ocs",
+ .ep_connect = ktransport_ep_connect,
+ .ep_poll = ktransport_ep_poll,
+ .ep_disconnect = ktransport_ep_disconnect,
+};
+
static struct iscsi_transport_template *iscsi_transport_templates[] = {
&iscsi_tcp,
&iscsi_iser,
@@ -107,6 +114,7 @@ static struct iscsi_transport_template *iscsi_transport_templates[] = {
&bnx2i,
&qla4xxx,
&be2iscsi,
+ &ocs,
NULL
};
--
1.8.1.4

View File

@ -0,0 +1,607 @@
From 669d4aeb6103c236e7cba94bbbb3c3098f8b4b15 Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Wed, 19 Jun 2013 14:48:27 -0700
Subject: ISCSIUIO: Updated iscsiuio to version 0.7.8.1b for perf optimization
uIP v0.7.8.1b (May 01, 2013)
=======================================================
Enhancements
------------
1. Change: Performance optimization by caching the page size
Impact: All
2. Change: Fixed a bug in the tx completion interrupt handler
Impact: 10G only
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
iscsiuio/README | 9 ++-
iscsiuio/RELEASE.TXT | 15 ++++-
iscsiuio/configure | 124 ++++++++++++++++++++---------------------
iscsiuio/configure.ac | 4 +-
iscsiuio/docs/iscsiuio.8 | 8 +--
iscsiuio/src/unix/libs/bnx2.c | 14 ++---
iscsiuio/src/unix/libs/bnx2x.c | 19 ++++---
iscsiuio/src/unix/nic.c | 1 +
iscsiuio/src/unix/nic.h | 6 +-
9 files changed, 108 insertions(+), 92 deletions(-)
diff --git a/iscsiuio/README b/iscsiuio/README
index 1a6386f..e7e5fe4 100644
--- a/iscsiuio/README
+++ b/iscsiuio/README
@@ -1,6 +1,6 @@
Iscsiuio Userspace Tool
-Version 0.7.6.1g
-Jan 14, 2013
+Version 0.7.8.1b
+May 01, 2013
------------------------------------------------------
This tool is to be used in conjunction with the Broadcom NetXtreme II Linux
@@ -189,9 +189,8 @@ To run the daemon in debug mode please pass the parameter '-d <debug level>'
where the following debug levels are defined:
-PACKET 5 - Print all messages
-DEBUG 4 - Print debug messages
-INFO 3 - Print messages needed to follow the uIP code
+DEBUG 4 - Print all messages
+INFO 3 - Print messages needed to follow the uIP code (default)
WARN 2 - Print warning messages
ERROR 1 - Only print critical errors
diff --git a/iscsiuio/RELEASE.TXT b/iscsiuio/RELEASE.TXT
index 2fa19bb..de70667 100644
--- a/iscsiuio/RELEASE.TXT
+++ b/iscsiuio/RELEASE.TXT
@@ -1,7 +1,7 @@
Release Notes
Broadcom uIP Linux Driver
- Version 0.7.6.1g
- 01/14/2013
+ Version 0.7.8.1b
+ 05/01/2013
Broadcom Corporation
5300 California Avenue,
@@ -10,6 +10,16 @@
Copyright (c) 2004 - 2013 Broadcom Corporation
All rights reserved
+uIP v0.7.8.1b (May 01, 2013)
+=======================================================
+ Enhancements
+ ------------
+ 1. Change: Performance optimization by caching the page size
+ Impact: All
+
+ 2. Change: Fixed a bug in the tx completion interrupt handler
+ Impact: 10G only
+
uIP v0.7.6.1g (Jan 14, 2013)
=======================================================
@@ -1986,3 +1996,4 @@ uIP v0.5.0b (Nov 24, 2009)
1. Change: Add Broadcom 10G iSCSI offload support
Impact: Linux
+
diff --git a/iscsiuio/configure b/iscsiuio/configure
index 1852551..2740598 100755
--- a/iscsiuio/configure
+++ b/iscsiuio/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.6.1g.
+# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.8.1b.
#
# Report bugs to <eddie.wai@broadcom.com>.
#
@@ -72,9 +72,9 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
# PATH needs CR, and LINENO needs CR and PATH.
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='iscsiuio'
PACKAGE_TARNAME='iscsiuio'
-PACKAGE_VERSION='0.7.6.1g'
-PACKAGE_STRING='iscsiuio 0.7.6.1g'
+PACKAGE_VERSION='0.7.8.1b'
+PACKAGE_STRING='iscsiuio 0.7.8.1b'
PACKAGE_BUGREPORT='eddie.wai@broadcom.com'
# Factoring default headers for most tests.
@@ -870,10 +870,10 @@ $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures iscsiuio 0.7.6.1g to adapt to many kinds of systems.
+\`configure' configures iscsiuio 0.7.8.1b to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of iscsiuio 0.7.6.1g:";;
+ short | recursive ) echo "Configuration of iscsiuio 0.7.8.1b:";;
esac
cat <<\_ACEOF
@@ -1160,7 +1160,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-iscsiuio configure 0.7.6.1g
+iscsiuio configure 0.7.8.1b
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1174,7 +1174,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by iscsiuio $as_me 0.7.6.1g, which was
+It was created by iscsiuio $as_me 0.7.8.1b, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -11743,7 +11743,7 @@ echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
if test "${lt_cv_dlopen_self+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11843,7 +11843,7 @@ echo $ECHO_N "checking whether a statically linked program can dlopen itself...
if test "${lt_cv_dlopen_self_static+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then :
+ if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -21519,9 +21519,9 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
# PATH needs CR, and LINENO needs CR and PATH.
@@ -21705,7 +21705,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by iscsiuio $as_me 0.7.6.1g, which was
+This file was extended by iscsiuio $as_me 0.7.8.1b, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21768,7 +21768,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-iscsiuio config.status 0.7.6.1g
+iscsiuio config.status 0.7.8.1b
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -22113,10 +22113,10 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
{ if $as_mkdir_p; then
mkdir -p "$ac_dir"
else
@@ -22132,10 +22132,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
done
test ! -n "$as_dirs" || mkdir $as_dirs
fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
@@ -22470,10 +22470,10 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
{ if $as_mkdir_p; then
mkdir -p "$ac_dir"
else
@@ -22489,10 +22489,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
done
test ! -n "$as_dirs" || mkdir $as_dirs
fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
@@ -22524,10 +22524,10 @@ $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X$ac_file |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`/stamp-h$_am_stamp_count
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
@@ -22546,10 +22546,10 @@ $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$ac_dest" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
{ if $as_mkdir_p; then
mkdir -p "$ac_dir"
else
@@ -22565,10 +22565,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
done
test ! -n "$as_dirs" || mkdir $as_dirs
fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
@@ -22662,10 +22662,10 @@ $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
else
continue
fi
@@ -22695,10 +22695,10 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
{ if $as_mkdir_p; then
mkdir -p $dirpart/$fdir
else
@@ -22714,10 +22714,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
. : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
done
test ! -n "$as_dirs" || mkdir $as_dirs
fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
@@ -22762,4 +22762,4 @@ if test "$no_create" != yes; then
# would make configure fail if this is the last instruction.
$ac_cs_success || { (exit 1); exit 1; }
fi
-#
+
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
index 34f0481..e9a5e32 100644
--- a/iscsiuio/configure.ac
+++ b/iscsiuio/configure.ac
@@ -11,9 +11,9 @@ dnl Benjamin Li (benli@broadcom.com)
dnl
PACKAGE=iscsiuio
-VERSION=0.7.6.1g
+VERSION=0.7.8.1b
-AC_INIT(iscsiuio, 0.7.6.1g, eddie.wai@broadcom.com)
+AC_INIT(iscsiuio, 0.7.8.1b, eddie.wai@broadcom.com)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_CONFIG_HEADER(config.h)
diff --git a/iscsiuio/docs/iscsiuio.8 b/iscsiuio/docs/iscsiuio.8
index 2f577bc..ea21d78 100644
--- a/iscsiuio/docs/iscsiuio.8
+++ b/iscsiuio/docs/iscsiuio.8
@@ -3,9 +3,9 @@
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation.
.\"
-.\" bnx2.4,v 0.7.6.1g
+.\" bnx2.4,v 0.7.8.1b
.\"
-.TH iscsiuio 8 "01/14/2013" "Broadcom Corporation"
+.TH iscsiuio 8 "05/01/2013" "Broadcom Corporation"
.\"
.\" NAME part
.\"
@@ -81,6 +81,6 @@ Display this help and exit.
.\" AUTHOR part
.\"
.SH AUTHOR
-Eddie Wai \- eddie.wai@broadcom.com
-.P
Benjamin Li \- benli@broadcom.com
+.P
+Eddie Wai \- eddie.wai@broadcom.com
diff --git a/iscsiuio/src/unix/libs/bnx2.c b/iscsiuio/src/unix/libs/bnx2.c
index b72b8ce..91c44e5 100644
--- a/iscsiuio/src/unix/libs/bnx2.c
+++ b/iscsiuio/src/unix/libs/bnx2.c
@@ -576,7 +576,7 @@ static int bnx2_open(nic_t *nic)
bp->sblk_map = mmap(NULL, bp->status_blk_size,
PROT_READ | PROT_WRITE, MAP_SHARED,
- nic->fd, (off_t) getpagesize());
+ nic->fd, (off_t) nic->page_size);
if (bp->sblk_map == MAP_FAILED) {
LOG_INFO(PFX "%s: Could not mmap status block: %s",
nic->log_name, strerror(errno));
@@ -602,9 +602,9 @@ static int bnx2_open(nic_t *nic)
BNX2_SBLK_EVEN_IDX(bp->status_blk.msi->rx2));
}
- bp->tx_ring = mmap(NULL, 2 * getpagesize(),
+ bp->tx_ring = mmap(NULL, 2 * nic->page_size,
PROT_READ | PROT_WRITE, MAP_SHARED, nic->fd,
- (off_t) 2 * getpagesize());
+ (off_t) 2 * nic->page_size);
if (bp->tx_ring == MAP_FAILED) {
LOG_INFO(PFX "%s: Could not mmap tx ring: %s",
nic->log_name, strerror(errno));
@@ -614,7 +614,7 @@ static int bnx2_open(nic_t *nic)
bp->bufs = mmap(NULL, (bp->rx_ring_size + 1) * bp->rx_buffer_size,
PROT_READ | PROT_WRITE,
- MAP_SHARED, nic->fd, (off_t) 3 * getpagesize());
+ MAP_SHARED, nic->fd, (off_t) 3 * nic->page_size);
if (bp->bufs == MAP_FAILED) {
LOG_INFO(PFX "%s: Could not mmap buffers: %s",
nic->log_name, strerror(errno));
@@ -693,7 +693,7 @@ static int bnx2_open(nic_t *nic)
return 0;
error_bufs:
- munmap(bp->tx_ring, 2 * getpagesize());
+ munmap(bp->tx_ring, 2 * nic->page_size);
error_tx_ring:
munmap(bp->status_blk.msi, bp->status_blk_size);
@@ -765,7 +765,7 @@ static int bnx2_uio_close_resources(nic_t *nic, NIC_SHUTDOWN_T graceful)
}
if (bp->tx_ring != NULL) {
- rc = munmap(bp->tx_ring, 2 * getpagesize());
+ rc = munmap(bp->tx_ring, 2 * nic->page_size);
if (rc != 0)
LOG_WARN(PFX "%s: Couldn't unmap tx_rings",
nic->log_name);
@@ -884,7 +884,7 @@ void bnx2_start_xmit(nic_t *nic, size_t len, u16_t vlan_id)
uint16_t ring_prod;
struct tx_bd *txbd;
struct rx_bd *rxbd;
- rxbd = (struct rx_bd *)(((__u8 *) bp->tx_ring) + getpagesize());
+ rxbd = (struct rx_bd *)(((__u8 *) bp->tx_ring) + nic->page_size);
if ((rxbd->rx_bd_haddr_hi == 0) && (rxbd->rx_bd_haddr_lo == 0)) {
LOG_PACKET(PFX "%s: trying to transmit when device is closed",
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
index c6e92cf..36fc48e 100644
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
@@ -818,7 +818,7 @@ static int bnx2x_open(nic_t *nic)
bp->status_blk.def = mmap(NULL, bp->status_blk_size,
PROT_READ | PROT_WRITE, MAP_SHARED,
- nic->fd, (off_t) getpagesize());
+ nic->fd, (off_t) nic->page_size);
if (bp->status_blk.def == MAP_FAILED) {
LOG_INFO(PFX "%s: Could not mmap status block: %s",
nic->log_name, strerror(errno));
@@ -827,10 +827,10 @@ static int bnx2x_open(nic_t *nic)
goto open_error;
}
- bp->tx_ring = mmap(NULL, 4 * getpagesize(),
+ bp->tx_ring = mmap(NULL, 4 * nic->page_size,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_LOCKED,
- nic->fd, (off_t) 2 * getpagesize());
+ nic->fd, (off_t) 2 * nic->page_size);
if (bp->tx_ring == MAP_FAILED) {
LOG_INFO(PFX "%s: Could not mmap tx ring: %s",
nic->log_name, strerror(errno));
@@ -840,12 +840,12 @@ static int bnx2x_open(nic_t *nic)
}
bp->rx_comp_ring.cqe = (union eth_rx_cqe *)
- (((__u8 *) bp->tx_ring) + 2 * getpagesize());
+ (((__u8 *) bp->tx_ring) + 2 * nic->page_size);
bp->bufs = mmap(NULL, (bp->rx_ring_size + 1) * bp->rx_buffer_size,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_LOCKED,
- nic->fd, (off_t) 3 * getpagesize());
+ nic->fd, (off_t) 3 * nic->page_size);
if (bp->bufs == MAP_FAILED) {
LOG_INFO(PFX "%s: Could not mmap buffers: %s",
nic->log_name, strerror(errno));
@@ -937,7 +937,7 @@ static int bnx2x_open(nic_t *nic)
bp->rx_prod_io = BAR_USTRORM_INTMEM +
USTORM_RX_PRODS_OFFSET(bp->port, bp->client_id);
- bp->tx_doorbell = bp->cid * getpagesize() + 0x40;
+ bp->tx_doorbell = bp->cid * nic->page_size + 0x40;
bp->get_rx_cons = bnx2x_get_rx;
bp->get_tx_cons = bnx2x_get_tx;
@@ -1073,7 +1073,7 @@ SF:
open_error:
if (bp->tx_ring) {
- munmap(bp->tx_ring, 4 * getpagesize());
+ munmap(bp->tx_ring, 4 * nic->page_size);
bp->tx_ring = NULL;
}
@@ -1150,7 +1150,7 @@ static int bnx2x_uio_close_resources(nic_t *nic, NIC_SHUTDOWN_T graceful)
}
if (bp->tx_ring != NULL) {
- rc = munmap(bp->tx_ring, 4 * getpagesize());
+ rc = munmap(bp->tx_ring, 4 * nic->page_size);
if (rc != 0)
LOG_WARN(PFX "%s: Couldn't unmap tx_rings",
nic->log_name);
@@ -1284,7 +1284,7 @@ void bnx2x_start_xmit(nic_t *nic, size_t len, u16_t vlan_id)
struct eth_tx_start_bd *txbd;
struct eth_tx_bd *txbd2;
struct eth_rx_bd *rx_bd;
- rx_bd = (struct eth_rx_bd *)(((__u8 *) bp->tx_ring) + getpagesize());
+ rx_bd = (struct eth_rx_bd *)(((__u8 *) bp->tx_ring) + nic->page_size);
if ((rx_bd->addr_hi == 0) && (rx_bd->addr_lo == 0)) {
LOG_PACKET(PFX "%s: trying to transmit when device is closed",
@@ -1539,6 +1539,7 @@ static int bnx2x_clear_tx_intr(nic_t *nic)
LOG_ERR(PFX "bnx2x tx lock with prod == cons");
pthread_mutex_unlock(&nic->xmit_mutex);
+ return 0;
}
return -EAGAIN;
}
diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c
index 457797d..7c3f4d5 100644
--- a/iscsiuio/src/unix/nic.c
+++ b/iscsiuio/src/unix/nic.c
@@ -400,6 +400,7 @@ nic_t *nic_init()
nic->tx_packet_queue = NULL;
nic->nic_library = NULL;
nic->pci_id = NULL;
+ nic->page_size = getpagesize();
/* nic_mutex is used to protect nic ops */
pthread_mutex_init(&nic->nic_mutex, NULL);
diff --git a/iscsiuio/src/unix/nic.h b/iscsiuio/src/unix/nic.h
index 7d2d078..7d1ae28 100644
--- a/iscsiuio/src/unix/nic.h
+++ b/iscsiuio/src/unix/nic.h
@@ -140,7 +140,9 @@ typedef struct nic_interface {
time_t start_time;
struct uip_stack ustack;
-#define IFACE_NUM_INVALID -1
+
+#define IFACE_NUM_PRESENT (1<<0)
+#define IFACE_NUM_INVALID -1
int iface_num;
int request_type;
} nic_interface_t;
@@ -247,6 +249,8 @@ typedef struct nic {
uint32_t intr_count; /* Total UIO interrupt count */
+ int page_size;
+
/* Held for nic ops manipulation */
pthread_mutex_t nic_mutex;
--
1.8.1.4

View File

@ -0,0 +1,43 @@
From f0d81b5ea1170274c57be7ee7989dc7bb0b64b84 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Wed, 26 Jun 2013 11:57:39 -0700
Subject: Fix discovery error return without return value
openSUSE Build Service compiler noticed that one discovery
error path did not have a return value, so an appropriate
error is now being returned.
Signed-of-by: Lee Duncan <lduncan@suse.com>
---
include/iscsi_err.h | 2 ++
usr/iscsiadm.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/include/iscsi_err.h b/include/iscsi_err.h
index 1139133..125f443 100644
--- a/include/iscsi_err.h
+++ b/include/iscsi_err.h
@@ -64,6 +64,8 @@ enum {
ISCSI_ERR_BUSY = 28,
/* Operation failed, but retrying layer may succeed */
ISCSI_ERR_AGAIN = 29,
+ /* unknown discovery type */
+ ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE = 30,
/* Always last. Indicates end of error code space */
ISCSI_MAX_ERR_VAL,
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 84d5a27..5030894 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -1235,6 +1235,7 @@ sw_discovery:
return do_isns(drec, ifaces, info_level, do_login, op);
default:
log_debug(1, "Unknown Discovery Type : %d\n", drec->type);
+ return ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE;
}
}
--
1.8.1.4

View File

@ -0,0 +1,29 @@
From 5569a3d9d0933a226860284cbad8b0c04f1ba0e5 Mon Sep 17 00:00:00 2001
From: Jan Vesely <jvesely@redhat.com>
Date: Wed, 26 Jun 2013 14:45:57 +0200
Subject: iscsid: Fix strlen parameter
The target socket name is passed as parameter, don't use the hardwired
one.
Signed-off-by: Jan Vesely <jvesely@redhat.com>
---
usr/iscsid_req.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index 15f6353..715c0aa 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -67,7 +67,7 @@ static int ipc_connect(int *fd, char *unix_sock_name, int start_iscsid)
return ISCSI_ERR_ISCSID_NOTCONN;
}
- addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSIADM_NAMESPACE) + 1;
+ addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(unix_sock_name) + 1;
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_LOCAL;
--
1.8.1.4

View File

@ -0,0 +1,50 @@
From fef4db2784fac34fa99468de09c386114b228b36 Mon Sep 17 00:00:00 2001
From: Jan Vesely <jvesely@redhat.com>
Date: Wed, 26 Jun 2013 15:55:12 +0200
Subject: iscsiuio: Change socket bind to use the same struct size as iscsid
Without this patch connections to iscsiuio fail, and strace prints:
connect(8, {sa_family=AF_FILE, path=@"ISCSID_UIP_ABSTRACT_NAMESPACE"}, 32) = -1 ECONNREFUSED (Connection refused)
Note that updating mgmt_ipc_listen and ipc_connect to use sizeof(addr) instead
of the precomputed values also fixes the issue.
Looks like "(Null bytes in the name have no special significance.)" [man 7 unix] is the culprit here.
Signed-off-by: Jan Vesely <jvesely@redhat.com>
---
iscsiuio/src/unix/iscsid_ipc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/iscsiuio/src/unix/iscsid_ipc.c b/iscsiuio/src/unix/iscsid_ipc.c
index 5c097e6..e22de0d 100644
--- a/iscsiuio/src/unix/iscsid_ipc.c
+++ b/iscsiuio/src/unix/iscsid_ipc.c
@@ -958,7 +958,7 @@ static void *iscsid_loop(void *arg)
*/
int iscsid_init()
{
- int rc;
+ int rc, addr_len;
struct sockaddr_un addr;
iscsid_opts.fd = socket(AF_LOCAL, SOCK_STREAM, 0);
@@ -967,12 +967,14 @@ int iscsid_init()
return iscsid_opts.fd;
}
+ addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSID_UIP_NAMESPACE) + 1;
+
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_LOCAL;
memcpy((char *)&addr.sun_path + 1, ISCSID_UIP_NAMESPACE,
strlen(ISCSID_UIP_NAMESPACE));
- rc = bind(iscsid_opts.fd, (struct sockaddr *)&addr, sizeof(addr));
+ rc = bind(iscsid_opts.fd, (struct sockaddr *)&addr, addr_len);
if (rc < 0) {
LOG_ERR(PFX "Can not bind IPC socket: %s", strerror(errno));
goto error;
--
1.8.1.4

View File

@ -0,0 +1,299 @@
From 3c5ec3835d5fd57a993cb814ecd74b48419a7459 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Mon, 29 Jul 2013 14:13:36 -0500
Subject: Make rescan run in parallel
Patch from Saggi Mizrahi:
This fixes a problem where a host which is inaccessible would block the
scan of other hosts in the system.
[compilation and minor cosmetic fixes by Mike Christie]
Signed-off-by: Saggi Mizrahi <smizrahi@redhat.com>
---
usr/host.c | 2 +-
usr/initiator.c | 3 ++-
usr/iscsi_sysfs.c | 61 +++++++++++++++++++++++++++++++++++++++++++++---------
usr/iscsi_sysfs.h | 3 ++-
usr/iscsiadm.c | 18 +++++++++-------
usr/iscsid.c | 3 ++-
usr/session_info.c | 4 ++--
usr/session_mgmt.c | 7 ++++---
8 files changed, 74 insertions(+), 27 deletions(-)
diff --git a/usr/host.c b/usr/host.c
index b03e50f..1fcb350 100644
--- a/usr/host.c
+++ b/usr/host.c
@@ -242,7 +242,7 @@ static int host_info_print_tree(void *data, struct host_info *hinfo)
link_info.data = &hinfo->host_no;
err = iscsi_sysfs_for_each_session(&link_info, &num_found,
- session_info_create_list);
+ session_info_create_list, 0);
if (err || !num_found)
return 0;
diff --git a/usr/initiator.c b/usr/initiator.c
index 86df222..a3b24b7 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -1855,7 +1855,8 @@ static int session_is_running(node_rec_t *rec)
if (session_find_by_rec(rec))
return 1;
- if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_session))
+ if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_session,
+ 0))
return 1;
return 0;
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index 64a4ce7..aed10a3 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -24,6 +24,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include "log.h"
#include "initiator.h"
@@ -1167,11 +1168,13 @@ int iscsi_sysfs_get_sessioninfo_by_id(struct session_info *info, char *session)
}
int iscsi_sysfs_for_each_session(void *data, int *nr_found,
- iscsi_sysfs_session_op_fn *fn)
+ iscsi_sysfs_session_op_fn *fn,
+ int in_parallel)
{
struct dirent **namelist;
- int rc = 0, n, i;
+ int rc = 0, n, i, chldrc = 0;
struct session_info *info;
+ pid_t pid = 0;
info = calloc(1, sizeof(*info));
if (!info)
@@ -1193,14 +1196,52 @@ int iscsi_sysfs_for_each_session(void *data, int *nr_found,
continue;
}
- rc = fn(data, info);
- if (rc > 0)
- break;
- else if (rc == 0)
- (*nr_found)++;
- else
- /* if less than zero it means it was not a match */
- rc = 0;
+ if (in_parallel) {
+ pid = fork();
+ }
+ if (pid == 0) {
+ rc = fn(data, info);
+ if (in_parallel) {
+ exit(rc);
+ } else {
+ if (rc > 0) {
+ break;
+ } else if (rc == 0) {
+ (*nr_found)++;
+ } else {
+ /* if less than zero it means it was not a match */
+ rc = 0;
+ }
+ }
+ } else if (pid < 0) {
+ log_error("could not fork() for session %s, err %d",
+ namelist[i]->d_name, errno);
+ }
+ }
+
+ if (in_parallel) {
+ while (1) {
+ if (wait(&chldrc) < 0) {
+ /*
+ * ECHILD means no more children which is
+ * expected to happen sooner or later.
+ */
+ if (errno != ECHILD) {
+ rc = errno;
+ }
+ break;
+ }
+
+ if ((chldrc > 0) && (rc == 0)) {
+ /*
+ * The non-parallel code path returns the first
+ * error so this keeps the same semantics.
+ */
+ rc = chldrc;
+ } else if (chldrc == 0) {
+ (*nr_found)++;
+ }
+ }
}
for (i = 0; i < n; i++)
diff --git a/usr/iscsi_sysfs.h b/usr/iscsi_sysfs.h
index d130d36..9a56105 100644
--- a/usr/iscsi_sysfs.h
+++ b/usr/iscsi_sysfs.h
@@ -51,7 +51,8 @@ extern int iscsi_sysfs_for_each_iface_on_host(void *data, uint32_t host_no,
int *nr_found,
iscsi_sysfs_iface_op_fn *fn);
extern int iscsi_sysfs_for_each_session(void *data, int *nr_found,
- iscsi_sysfs_session_op_fn *fn);
+ iscsi_sysfs_session_op_fn *fn,
+ int in_parallel);
extern int iscsi_sysfs_for_each_host(void *data, int *nr_found,
iscsi_sysfs_host_op_fn *fn);
extern uint32_t iscsi_sysfs_get_host_no_from_sid(uint32_t sid, int *err);
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 5030894..da0a3ec 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -347,7 +347,8 @@ match_startup_mode(node_rec_t *rec, char *mode)
}
static int
-for_each_session(struct node_rec *rec, iscsi_sysfs_session_op_fn *fn)
+for_each_session(struct node_rec *rec, iscsi_sysfs_session_op_fn *fn,
+ int in_parallel)
{
int err, num_found = 0;
@@ -355,7 +356,8 @@ for_each_session(struct node_rec *rec, iscsi_sysfs_session_op_fn *fn)
num_found = 1;
err = fn(rec, rec->session.info);
} else {
- err = iscsi_sysfs_for_each_session(rec, &num_found, fn);
+ err = iscsi_sysfs_for_each_session(rec, &num_found, fn,
+ in_parallel);
}
if (err)
log_error("Could not execute operation on all sessions: %s",
@@ -435,7 +437,7 @@ logout_by_startup(char *mode)
rc = iscsi_logout_portals(mode, &nr_found, 1, __logout_by_startup);
if (rc == ISCSI_ERR_NO_OBJS_FOUND)
log_error("No matching sessions found");
- return rc;
+ return rc;
}
struct startup_data {
@@ -479,7 +481,7 @@ __do_leading_login(void *data, struct list_head *list, struct node_rec *rec)
* If there is an existing session that matcthes the target,
* the leading login is complete.
*/
- if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_target)) {
+ if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_target, 0)) {
log_debug(1, "Skipping %s: Already a session for that target",
rec->name);
return -1;
@@ -579,7 +581,7 @@ login_by_startup(char *mode)
list_for_each_entry_safe(rec, tmp_rec, &startup.leading_logins,
list) {
if (!iscsi_sysfs_for_each_session(rec, &nr_found,
- iscsi_match_target))
+ iscsi_match_target, 0))
missed_leading_login++;
/*
* Cleanup the list, since 'iscsi_login_portals_safe'
@@ -1210,7 +1212,7 @@ do_target_discovery(discovery_rec_t *drec, struct list_head *ifaces,
host_no = iscsi_sysfs_get_host_no_from_hwinfo(iface, &rc);
if (rc || host_no == -1) {
log_debug(1, "Could not match iface" iface_fmt " to "
- "host.", iface_str(iface));
+ "host.", iface_str(iface));
/* try software iscsi */
continue;
}
@@ -2116,12 +2118,12 @@ static int exec_node_op(int op, int do_login, int do_logout,
}
if (do_rescan) {
- rc = for_each_session(rec, rescan_portal);
+ rc = for_each_session(rec, rescan_portal, 1);
goto out;
}
if (do_stats) {
- rc = for_each_session(rec, session_stats);
+ rc = for_each_session(rec, session_stats, 0);
goto out;
}
diff --git a/usr/iscsid.c b/usr/iscsid.c
index b4bb65b..8f19220 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -511,7 +511,8 @@ int main(int argc, char *argv[])
if (pid == 0) {
int nr_found = 0;
/* child */
- iscsi_sysfs_for_each_session(NULL, &nr_found, sync_session);
+ /* TODO - test with async support enabled */
+ iscsi_sysfs_for_each_session(NULL, &nr_found, sync_session, 0);
exit(0);
} else if (pid < 0) {
log_error("Fork failed error %d: existing sessions"
diff --git a/usr/session_info.c b/usr/session_info.c
index 1f84c49..de156c6 100644
--- a/usr/session_info.c
+++ b/usr/session_info.c
@@ -368,7 +368,7 @@ int session_info_print(int info_level, struct session_info *info, int do_show)
num_found = 1;
} else
err = iscsi_sysfs_for_each_session(info, &num_found,
- session_info_print_flat);
+ session_info_print_flat, 0);
break;
case 3:
version = iscsi_sysfs_get_iscsi_kernel_version();
@@ -403,7 +403,7 @@ int session_info_print(int info_level, struct session_info *info, int do_show)
link_info.match_fn = NULL;
err = iscsi_sysfs_for_each_session(&link_info, &num_found,
- session_info_create_list);
+ session_info_create_list, 0);
if (err || !num_found)
break;
diff --git a/usr/session_mgmt.c b/usr/session_mgmt.c
index 0b7373f..87b8e00 100644
--- a/usr/session_mgmt.c
+++ b/usr/session_mgmt.c
@@ -172,7 +172,7 @@ int iscsi_login_portal(void *data, struct list_head *list, struct node_rec *rec)
* that are missing.
*/
rc = iscsi_sysfs_for_each_session(rec, &session_count,
- iscsi_match_session_count);
+ iscsi_match_session_count, 0);
if (rc) {
log_error("Could not count current number of sessions");
goto done;
@@ -421,7 +421,7 @@ int iscsi_logout_portals(void *data, int *nr_found, int wait,
*nr_found = 0;
err = iscsi_sysfs_for_each_session(&link_info, nr_found,
- session_info_create_list);
+ session_info_create_list, 0);
if (err && !list_empty(&session_list))
log_error("Could not read in all sessions: %s",
iscsi_err_to_str(err));
@@ -466,7 +466,8 @@ free_list:
int iscsi_check_for_running_session(struct node_rec *rec)
{
int nr_found = 0;
- if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_session))
+ if (iscsi_sysfs_for_each_session(rec, &nr_found, iscsi_match_session,
+ 0))
return 1;
return 0;
}
--
1.8.1.4

View File

@ -0,0 +1,164 @@
From 68ef07c23f7c0d1ea6b502c28be1152e77ff1bde Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Fri, 12 Apr 2013 10:41:15 -0700
Subject: ISCSISTART: Saved ibft boot info to the session sysfs
Three new session sysfs parameters are introduced:
boot_root - holds the ibft boot root folder name
boot_nic - holds the ibft boot ethernetN name
boot_target - holds the ibft boot targetN name
This patch copies over the /sys/firmware/<boot_root>/ethernetN/targetN info
from the boot context to the node_rec.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
include/fw_context.h | 3 +++
include/iscsi_if.h | 4 ++++
include/iscsi_proto.h | 1 +
usr/config.h | 3 +++
usr/idbm.c | 6 ++++++
usr/initiator_common.c | 14 +++++++++++++-
utils/fwparam_ibft/fwparam_sysfs.c | 8 ++++++++
7 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/include/fw_context.h b/include/fw_context.h
index 1640859..6563d68 100644
--- a/include/fw_context.h
+++ b/include/fw_context.h
@@ -30,6 +30,9 @@
struct boot_context {
struct list_head list;
+ char boot_root[BOOT_NAME_MAXLEN];
+ char boot_nic[BOOT_NAME_MAXLEN];
+ char boot_target[BOOT_NAME_MAXLEN];
/* target settings */
int target_port;
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index 20f2bc2..b47dde7 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -495,6 +495,10 @@ enum iscsi_param {
ISCSI_PARAM_TGT_RESET_TMO,
ISCSI_PARAM_TARGET_ALIAS,
+
+ ISCSI_PARAM_BOOT_ROOT,
+ ISCSI_PARAM_BOOT_NIC,
+ ISCSI_PARAM_BOOT_TARGET,
/* must always be last */
ISCSI_PARAM_MAX,
};
diff --git a/include/iscsi_proto.h b/include/iscsi_proto.h
index 1c69feb..56f757b 100644
--- a/include/iscsi_proto.h
+++ b/include/iscsi_proto.h
@@ -619,6 +619,7 @@ struct iscsi_reject {
#define KEY_MAXLEN 64
#define VALUE_MAXLEN 255
#define TARGET_NAME_MAXLEN VALUE_MAXLEN
+#define BOOT_NAME_MAXLEN 256
#define ISCSI_DEF_MAX_RECV_SEG_LEN 8192
#define ISCSI_MIN_MAX_RECV_SEG_LEN 512
diff --git a/usr/config.h b/usr/config.h
index 998caff..d457bdd 100644
--- a/usr/config.h
+++ b/usr/config.h
@@ -201,6 +201,9 @@ typedef struct session_rec {
* allowed to be initiated on this record
*/
unsigned char multiple;
+ char boot_root[BOOT_NAME_MAXLEN];
+ char boot_nic[BOOT_NAME_MAXLEN];
+ char boot_target[BOOT_NAME_MAXLEN];
} session_rec_t;
#define ISCSI_TRANSPORT_NAME_MAXLEN 16
diff --git a/usr/idbm.c b/usr/idbm.c
index bc06058..1e4f8c8 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2748,6 +2748,12 @@ struct node_rec *idbm_create_rec_from_boot_context(struct boot_context *context)
strlen((char *)context->chap_password);
rec->session.auth.password_in_length =
strlen((char *)context->chap_password_in);
+ strlcpy(rec->session.boot_root, context->boot_root,
+ sizeof(context->boot_root));
+ strlcpy(rec->session.boot_nic, context->boot_nic,
+ sizeof(context->boot_nic));
+ strlcpy(rec->session.boot_target, context->boot_target,
+ sizeof(context->boot_target));
iface_setup_from_boot_context(&rec->iface, context);
diff --git a/usr/initiator_common.c b/usr/initiator_common.c
index eb72795..544d637 100644
--- a/usr/initiator_common.c
+++ b/usr/initiator_common.c
@@ -324,7 +324,7 @@ int iscsi_host_set_params(struct iscsi_session *session)
return 0;
}
-#define MAX_SESSION_PARAMS 32
+#define MAX_SESSION_PARAMS 35
int iscsi_session_set_params(struct iscsi_conn *conn)
{
@@ -496,6 +496,18 @@ int iscsi_session_set_params(struct iscsi_conn *conn)
.param = ISCSI_PARAM_INITIATOR_NAME,
.value = session->initiator_name,
.type = ISCSI_STRING,
+ }, {
+ .param = ISCSI_PARAM_BOOT_ROOT,
+ .value = session->nrec.session.boot_root,
+ .type = ISCSI_STRING,
+ }, {
+ .param = ISCSI_PARAM_BOOT_NIC,
+ .value = session->nrec.session.boot_nic,
+ .type = ISCSI_STRING,
+ }, {
+ .param = ISCSI_PARAM_BOOT_TARGET,
+ .value = session->nrec.session.boot_target,
+ .type = ISCSI_STRING,
},
};
diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c
index 3997363..2f37b59 100644
--- a/utils/fwparam_ibft/fwparam_sysfs.c
+++ b/utils/fwparam_ibft/fwparam_sysfs.c
@@ -200,6 +200,9 @@ static int fill_nic_context(char *subsys, char *id,
strlcpy(context->scsi_host_name, subsys,
sizeof(context->scsi_host_name));
+ memset(&context->boot_nic, 0, sizeof(context->boot_nic));
+ snprintf(context->boot_nic, sizeof(context->boot_nic), "%s", id);
+
sysfs_get_str(id, subsys, "ip-addr", context->ipaddr,
sizeof(context->ipaddr));
sysfs_get_str(id, subsys, "vlan", context->vlan,
@@ -224,6 +227,8 @@ static void fill_initiator_context(char *subsys, struct boot_context *context)
sizeof(context->initiatorname));
sysfs_get_str("initiator", subsys, "isid", context->isid,
sizeof(context->isid));
+
+ strlcpy(context->boot_root, subsys, sizeof(context->boot_root));
}
static int fill_tgt_context(char *subsys, char *id,
struct boot_context *context)
@@ -240,6 +245,9 @@ static int fill_tgt_context(char *subsys, char *id,
if (rc)
return rc;
+ memset(&context->boot_target, 0, sizeof(context->boot_target));
+ snprintf(context->boot_target, sizeof(context->boot_target), "%s", id);
+
/*
* 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.
--
1.8.1.4

View File

@ -0,0 +1,112 @@
From d86ca42685620ad3263da098923308a3a00ac55a Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Fri, 12 Apr 2013 10:41:16 -0700
Subject: ISCSID: Added the extraction of the session boot info
This patch does the work to extract the corresponding
<boot_root>->ethernetN net params as specified from the kernel
session boot_nic sysfs entry based on the transport param
use_boot_info.
This is only populated for iscsi_tcp and bnx2i.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
usr/iscsi_sysfs.c | 40 ++++++++++++++++++++++++++++++++++++++++
usr/transport.c | 2 ++
usr/transport.h | 1 +
3 files changed, 43 insertions(+)
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index aed10a3..79ec79d 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -674,6 +674,43 @@ free_fnode:
return rc;
}
+static int iscsi_sysfs_read_boot(struct iface_rec *iface, char *session)
+{
+ char boot_root[BOOT_NAME_MAXLEN], boot_nic[BOOT_NAME_MAXLEN];
+ char boot_name[BOOT_NAME_MAXLEN], boot_content[BOOT_NAME_MAXLEN];
+
+ /* Extract boot info */
+ strlcpy(boot_name, "boot_target", sizeof(boot_name));
+ if (sysfs_get_str(session, ISCSI_SESSION_SUBSYS, boot_name,
+ boot_content, BOOT_NAME_MAXLEN))
+ return -1;
+ strlcpy(boot_name, "boot_nic", sizeof(boot_name));
+ if (sysfs_get_str(session, ISCSI_SESSION_SUBSYS, boot_name, boot_nic,
+ BOOT_NAME_MAXLEN))
+ return -1;
+ strlcpy(boot_name, "boot_root", sizeof(boot_name));
+ if (sysfs_get_str(session, ISCSI_SESSION_SUBSYS, boot_name, boot_root,
+ BOOT_NAME_MAXLEN))
+ return -1;
+
+ /* If all boot_root/boot_target/boot_nic exist, then extract the
+ info from the boot nic */
+ if (sysfs_get_str(boot_nic, boot_root, "vlan", boot_content,
+ BOOT_NAME_MAXLEN))
+ log_debug(5, "could not read %s/%s/vlan", boot_root, boot_nic);
+ else
+ iface->vlan_id = atoi(boot_content);
+
+ if (sysfs_get_str(boot_nic, boot_root, "subnet-mask",
+ iface->subnet_mask, NI_MAXHOST))
+ log_debug(5, "could not read %s/%s/subnet", boot_root,
+ boot_nic);
+
+ log_debug(5, "sysfs read boot returns %s/%s/ vlan = %d subnet = %s",
+ boot_root, boot_nic, iface->vlan_id, iface->subnet_mask);
+ return 0;
+}
+
/*
* Read in iface settings based on host and session values. If
* session is not passed in, then the ifacename will not be set. And
@@ -802,6 +839,9 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
}
}
+ if (t->template->use_boot_info)
+ iscsi_sysfs_read_boot(iface, session);
+
if (!iface_kern_id)
goto done;
diff --git a/usr/transport.c b/usr/transport.c
index 52b7674..4d030a8 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -42,6 +42,7 @@
struct iscsi_transport_template iscsi_tcp = {
.name = "tcp",
+ .use_boot_info = 1,
.ep_connect = iscsi_io_tcp_connect,
.ep_poll = iscsi_io_tcp_poll,
.ep_disconnect = iscsi_io_tcp_disconnect,
@@ -77,6 +78,7 @@ struct iscsi_transport_template cxgb4i = {
struct iscsi_transport_template bnx2i = {
.name = "bnx2i",
.set_host_ip = 1,
+ .use_boot_info = 1,
.ep_connect = ktransport_ep_connect,
.ep_poll = ktransport_ep_poll,
.ep_disconnect = ktransport_ep_disconnect,
diff --git a/usr/transport.h b/usr/transport.h
index 5dcf872..388e4b1 100644
--- a/usr/transport.h
+++ b/usr/transport.h
@@ -31,6 +31,7 @@ struct iscsi_transport_template {
* the host's ip address.
*/
uint8_t set_host_ip;
+ uint8_t use_boot_info;
int (*ep_connect) (struct iscsi_conn *conn, int non_blocking);
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
void (*ep_disconnect) (struct iscsi_conn *conn);
--
1.8.1.4

View File

@ -0,0 +1,57 @@
From ec7d79ed691619b6ffa8c25f162ce62e1e25e6c1 Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Fri, 12 Apr 2013 10:41:17 -0700
Subject: ISCSID: Added iface content override fix
Patch provided by Mike Christie.
This patch fixes the unconditional overwrite of the iface struct
even when the corresponding iface info from the node config was
found and extracted.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
usr/iscsid.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/usr/iscsid.c b/usr/iscsid.c
index 8f19220..d1756ef 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -111,9 +111,7 @@ setup_rec_from_negotiated_values(node_rec_t *rec, struct session_info *info)
strlcpy(rec->name, info->targetname, TARGET_NAME_MAXLEN);
rec->conn[0].port = info->persistent_port;
strlcpy(rec->conn[0].address, info->persistent_address, NI_MAXHOST);
- memcpy(&rec->iface, &info->iface, sizeof(struct iface_rec));
rec->tpgt = info->tpgt;
- iface_copy(&rec->iface, &info->iface);
iscsi_sysfs_get_negotiated_session_conf(info->sid, &session_conf);
iscsi_sysfs_get_negotiated_conn_conf(info->sid, &conn_conf);
@@ -238,6 +236,7 @@ static int sync_session(void *data, struct session_info *info)
log_warning("Could not read data from db. Using default and "
"currently negotiated values\n");
setup_rec_from_negotiated_values(&rec, info);
+ iface_copy(&rec.iface, &info->iface);
} else {
/*
* we have a valid record and iface so lets merge
@@ -251,13 +250,12 @@ static int sync_session(void *data, struct session_info *info)
memset(&sysfsrec, 0, sizeof(node_rec_t));
setup_rec_from_negotiated_values(&sysfsrec, info);
/*
- * target, portal and iface name values have to be the same
+ * target, portal and iface values have to be the same
* or we would not have found the record, so just copy
- * CHAP and iface settings.
+ * CHAP settings.
*/
memcpy(&rec.session.auth, &sysfsrec.session.auth,
sizeof(struct iscsi_auth_config));
- memcpy(&rec.iface, &info->iface, sizeof(rec.iface));
}
/* multiple drivers could be connected to the same portal */
--
1.8.1.4

View File

@ -0,0 +1,55 @@
From 24a4d8156786dfd91dcc17b2472653e963ebd028 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 13 Aug 2013 10:59:44 -0700
Subject: idmb_rec_write, check for tpgt first
Factor out the check for a tpgt to a single place, before going crazy on
the rec files. Makes flow of this function easier to follow, and preps
for splitting it up.
---
usr/idbm.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/usr/idbm.c b/usr/idbm.c
index 1e4f8c8..0a88699 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -1849,6 +1849,10 @@ static int idbm_rec_write(node_rec_t *rec)
if (rc)
goto free_portal;
+ if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
+ /* drop down to old style portal as config */
+ goto open_conf;
+
rc = stat(portal, &statb);
if (rc) {
rc = 0;
@@ -1857,23 +1861,11 @@ static int idbm_rec_write(node_rec_t *rec)
* set the tgpt. In new versions you must pass all the info in
* from the start
*/
- if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
- /* drop down to old style portal as config */
- goto open_conf;
- else
- goto mkdir_portal;
+ goto mkdir_portal;
}
if (!S_ISDIR(statb.st_mode)) {
/*
- * older iscsiadm versions had you create the config then set
- * set the tgpt. In new versions you must pass all the info in
- * from the start
- */
- if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
- /* drop down to old style portal as config */
- goto open_conf;
- /*
* Old style portal as a file, but with tpgt. Let's update it.
*/
if (unlink(portal)) {
--
1.8.1.4

View File

@ -0,0 +1,180 @@
From 954a9492b5ed1de5907ad2a7d7cc0ae6215d8fac Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 13 Aug 2013 11:34:31 -0700
Subject: idbm_rec_write, seperate old and new style writes
Duplicates a small bit of code, but easier to understand and extened.
---
usr/idbm.c | 116 +++++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 79 insertions(+), 37 deletions(-)
diff --git a/usr/idbm.c b/usr/idbm.c
index 0a88699..cb6ffd1 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -1808,7 +1808,7 @@ mkdir_portal:
return f;
}
-static int idbm_rec_write(node_rec_t *rec)
+static int idbm_rec_write_new(node_rec_t *rec)
{
struct stat statb;
FILE *f;
@@ -1820,38 +1820,8 @@ static int idbm_rec_write(node_rec_t *rec)
log_error("Could not alloc portal\n");
return ISCSI_ERR_NOMEM;
}
-
- snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR);
- if (access(portal, F_OK) != 0) {
- if (mkdir(portal, 0660) != 0) {
- log_error("Could not make %s: %s\n", portal,
- strerror(errno));
- rc = ISCSI_ERR_IDBM;
- goto free_portal;
- }
- }
-
- snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name);
- if (access(portal, F_OK) != 0) {
- if (mkdir(portal, 0660) != 0) {
- log_error("Could not make %s: %s\n", portal,
- strerror(errno));
- rc = ISCSI_ERR_IDBM;
- goto free_portal;
- }
- }
-
snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR,
rec->name, rec->conn[0].address, rec->conn[0].port);
- log_debug(5, "Looking for config file %s", portal);
-
- rc = idbm_lock();
- if (rc)
- goto free_portal;
-
- if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
- /* drop down to old style portal as config */
- goto open_conf;
rc = stat(portal, &statb);
if (rc) {
@@ -1872,11 +1842,11 @@ static int idbm_rec_write(node_rec_t *rec)
log_error("Could not convert %s: %s\n", portal,
strerror(errno));
rc = ISCSI_ERR_IDBM;
- goto unlock;
+ goto free_portal;
}
} else {
rc = ISCSI_ERR_INVAL;
- goto unlock;
+ goto free_portal;
}
mkdir_portal:
@@ -1887,24 +1857,96 @@ mkdir_portal:
log_error("Could not make dir %s: %s\n",
portal, strerror(errno));
rc = ISCSI_ERR_IDBM;
- goto unlock;
+ goto free_portal;
}
}
snprintf(portal, PATH_MAX, "%s/%s/%s,%d,%d/%s", NODE_CONFIG_DIR,
rec->name, rec->conn[0].address, rec->conn[0].port, rec->tpgt,
rec->iface.name);
-open_conf:
+/* open_conf: */
f = fopen(portal, "w");
if (!f) {
log_error("Could not open %s: %sd\n", portal, strerror(errno));
rc = ISCSI_ERR_IDBM;
- goto unlock;
+ goto free_portal;
}
idbm_print(IDBM_PRINT_TYPE_NODE, rec, 1, f);
fclose(f);
-unlock:
+free_portal:
+ free(portal);
+ return rc;
+}
+
+static int idbm_rec_write_old(node_rec_t *rec)
+{
+ FILE *f;
+ char *portal;
+ int rc = 0;
+
+ portal = malloc(PATH_MAX);
+ if (!portal) {
+ log_error("Could not alloc portal\n");
+ return ISCSI_ERR_NOMEM;
+ }
+ snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR,
+ rec->name, rec->conn[0].address, rec->conn[0].port);
+
+ f = fopen(portal, "w");
+ if (!f) {
+ log_error("Could not open %s: %sd\n", portal, strerror(errno));
+ rc = ISCSI_ERR_IDBM;
+ goto free_portal;
+ }
+ idbm_print(IDBM_PRINT_TYPE_NODE, rec, 1, f);
+ fclose(f);
+free_portal:
+ free(portal);
+ return rc;
+}
+
+static int idbm_rec_write(node_rec_t *rec)
+{
+ char *portal;
+ int rc = 0;
+
+ portal = malloc(PATH_MAX);
+ if (!portal) {
+ log_error("Could not alloc portal\n");
+ return ISCSI_ERR_NOMEM;
+ }
+
+ snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR);
+ if (access(portal, F_OK) != 0) {
+ if (mkdir(portal, 0660) != 0) {
+ log_error("Could not make %s: %s\n", portal,
+ strerror(errno));
+ rc = ISCSI_ERR_IDBM;
+ goto free_portal;
+ }
+ }
+
+ snprintf(portal, PATH_MAX, "%s/%s", NODE_CONFIG_DIR, rec->name);
+ if (access(portal, F_OK) != 0) {
+ if (mkdir(portal, 0660) != 0) {
+ log_error("Could not make %s: %s\n", portal,
+ strerror(errno));
+ rc = ISCSI_ERR_IDBM;
+ goto free_portal;
+ }
+ }
+
+ rc = idbm_lock();
+ if (rc)
+ goto free_portal;
+
+ if (rec->tpgt == PORTAL_GROUP_TAG_UNKNOWN)
+ /* old style portal as config */
+ rc = idbm_rec_write_old(rec);
+ else
+ rc = idbm_rec_write_new(rec);
+
idbm_unlock();
free_portal:
free(portal);
--
1.8.1.4

View File

@ -0,0 +1,76 @@
From cdb98072f7690cd9f5ec4aa5aa503711e552b5da Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 13 Aug 2013 12:39:07 -0700
Subject: idbw_rec_write, pick tpgt from existing record
On a static add (-m node -o new) without a user specified tpgt, looks
for existing new style records with tpgt before creating an old style
record without. If one exists, take the tpgt from it an write an
updated new style record instead.
---
usr/idbm.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/usr/idbm.c b/usr/idbm.c
index cb6ffd1..5adbd95 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -27,6 +27,7 @@
#include <errno.h>
#include <dirent.h>
#include <limits.h>
+#include <glob.h>
#include <sys/stat.h>
#include <sys/file.h>
@@ -1884,12 +1885,47 @@ static int idbm_rec_write_old(node_rec_t *rec)
FILE *f;
char *portal;
int rc = 0;
+ glob_t globbuf;
+ int i;
+ int tpgt = PORTAL_GROUP_TAG_UNKNOWN;
portal = malloc(PATH_MAX);
if (!portal) {
log_error("Could not alloc portal\n");
return ISCSI_ERR_NOMEM;
}
+
+ /* check for newer portal dir with tpgt */
+ snprintf(portal, PATH_MAX, "%s/%s/%s,%d,*", NODE_CONFIG_DIR,
+ rec->name, rec->conn[0].address, rec->conn[0].port);
+ rc = glob(portal, GLOB_ONLYDIR, NULL, &globbuf);
+ if (!rc) {
+ if (globbuf.gl_pathc > 1)
+ log_warning("multiple tpg records for portal "
+ "%s/%s:%d found", rec->name,
+ rec->conn[0].address, rec->conn[0].port);
+ /* set pattern for sscanf matching of tpgt */
+ snprintf(portal, PATH_MAX, "%s/%s/%s,%d,%%u", NODE_CONFIG_DIR,
+ rec->name, rec->conn[0].address, rec->conn[0].port);
+ for (i = 0; i < globbuf.gl_pathc; i++) {
+ rc = sscanf(globbuf.gl_pathv[i], portal, &tpgt);
+ if (rc == 1)
+ break;
+ }
+ if (tpgt == PORTAL_GROUP_TAG_UNKNOWN)
+ log_warning("glob match on existing records, "
+ "but no valid tpgt found");
+ }
+ globfree(&globbuf);
+
+ /* if a tpgt was selected from an old record, write entry in new format */
+ if (tpgt != PORTAL_GROUP_TAG_UNKNOWN) {
+ log_warning("using tpgt %u from existing record", tpgt);
+ rec->tpgt = tpgt;
+ free(portal);
+ return idbm_rec_write_new(rec);
+ }
+
snprintf(portal, PATH_MAX, "%s/%s/%s,%d", NODE_CONFIG_DIR,
rec->name, rec->conn[0].address, rec->conn[0].port);
--
1.8.1.4

View File

@ -1,7 +1,8 @@
From ac3447ab680ef5319717fc6b85a4c5b22e652e5e Mon Sep 17 00:00:00 2001
From e5d7c7070358a5db8b849c8c5886e67881fe8906 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Fri, 7 Dec 2012 17:01:42 -0800
Subject: iscsiadm, iscsid: newroot command to survive switch_root
Subject: [PATCH 47/47] iscsiadm, iscsid: newroot command to survive
switch_root
When started from initramfs, iscsid needs to be able to chroot itself
to the runtime filesystem before the switch_root occurs. In the
@ -16,26 +17,26 @@ Signed-off-by: Chris Leech <cleech@redhat.com>
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 8f9de05..323d0a8 100644
index da0a3ec..af6d607 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -111,6 +111,7 @@ static struct option const long_options[] =
{"packetsize", required_argument, NULL, 'b'},
{"count", required_argument, NULL, 'c'},
@@ -117,6 +117,7 @@ static struct option const long_options[] =
{"interval", required_argument, NULL, 'i'},
{"flashnode_idx", optional_argument, NULL, 'x'},
{"portal_type", optional_argument, NULL, 'A'},
+ {"newroot", required_argument, NULL, 0},
{NULL, 0, NULL, 0},
};
static char *short_options = "RlDVhm:a:b:c:C:p:P:T:H:i:I:U:k:L:d:r:n:v:o:sSt:u";
@@ -131,6 +132,7 @@ iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid
static char *short_options = "RlDVhm:a:b:c:C:p:P:T:H:i:I:U:k:L:d:r:n:v:o:sSt:ux:A:";
@@ -137,6 +138,7 @@ iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]\n\
iscsiadm -m fw [ -l ]\n\
iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ]\n\
iscsiadm -m fw [ -d debug_level ] [ -l ]\n\
iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ] | [ -C flashnode [ -o operation ] [ -A portal_type ] [ -x flashnode_idx ] [ -n name ] [ -v value ] ] ]\n\
+iscsiadm --newroot switch_root_path\n\
iscsiadm -k priority\n");
}
exit(status);
@@ -251,6 +253,22 @@ static void kill_iscsid(int priority)
@@ -278,6 +280,22 @@ static void kill_iscsid(int priority)
}
}
@ -58,7 +59,7 @@ index 8f9de05..323d0a8 100644
/*
* TODO: we can display how the ifaces are related to node records.
* And we can add a scsi_host mode which would display how
@@ -2397,6 +2415,7 @@ main(int argc, char **argv)
@@ -2800,6 +2818,7 @@ main(int argc, char **argv)
{
char *ip = NULL, *name = NULL, *value = NULL;
char *targetname = NULL, *group_session_mgmt_mode = NULL;
@ -66,7 +67,7 @@ index 8f9de05..323d0a8 100644
int ch, longindex, mode=-1, port=-1, do_login=0, do_rescan=0;
int rc=0, sid=-1, op=OP_NOOP, type=-1, do_logout=0, do_stats=0;
int do_login_all=0, do_logout_all=0, info_level=-1, num_ifaces = 0;
@@ -2433,6 +2452,12 @@ main(int argc, char **argv)
@@ -2837,6 +2856,12 @@ main(int argc, char **argv)
while ((ch = getopt_long(argc, argv, short_options,
long_options, &longindex)) >= 0) {
switch (ch) {
@ -79,7 +80,7 @@ index 8f9de05..323d0a8 100644
case 'k':
killiscsid = atoi(optarg);
if (killiscsid < 0) {
@@ -2579,6 +2604,11 @@ main(int argc, char **argv)
@@ -2989,6 +3014,11 @@ main(int argc, char **argv)
goto free_ifaces;
}
@ -153,5 +154,5 @@ index 55972ed..102ffff 100644
} iscsiadm_req_t;
--
1.7.11.7
1.8.1.4

View File

@ -1,7 +1,7 @@
From a41a27cd9b910191a616706c4f473259909bc45d Mon Sep 17 00:00:00 2001
From b58f3b48a36821d10a3377acfcbf18113fba0c9d Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 18 Dec 2012 11:27:00 -0800
Subject: iscsiadm: --param parsing for advanced node creation
Subject: [PATCH 48/48] iscsiadm: --param parsing for advanced node creation
Share parse_param and apply_param code from iscsistart, allow using multiple
--param options to set arbitrary fields in node mode.
@ -18,18 +18,18 @@ Signed-off-by: Chris Leech <cleech@redhat.com>
create mode 100644 usr/iscsi_param.h
diff --git a/usr/Makefile b/usr/Makefile
index 673b7f1..1506111 100644
index 3d8ee22..a7e80c0 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -40,7 +40,7 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o)
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 iser.o cxgbi.o be2iscsi.o \
- initiator_common.o iscsi_err.o $(IPC_OBJ) $(SYSDEPS_SRCS)
+ initiator_common.o iscsi_err.o iscsi_param.o $(IPC_OBJ) $(SYSDEPS_SRCS)
- initiator_common.o iscsi_err.o flashnode.o uip_mgmt_ipc.o \
+ initiator_common.o iscsi_err.o iscsi_param.o flashnode.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 kern_err_table.o
diff --git a/usr/iscsi_param.c b/usr/iscsi_param.c
new file mode 100644
index 0000000..c075e8f
@ -145,7 +145,7 @@ index 0000000..8b7956c
+
+#endif
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 323d0a8..ef866ae 100644
index af6d607..2003d48 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -53,6 +53,7 @@
@ -153,18 +153,18 @@ index 323d0a8..ef866ae 100644
#include "iscsi_ipc.h"
#include "iscsi_timer.h"
+#include "iscsi_param.h"
#include "flashnode.h"
static char program_name[] = "iscsiadm";
static char config_file[TARGET_NAME_MAXLEN];
@@ -112,6 +113,7 @@ static struct option const long_options[] =
{"count", required_argument, NULL, 'c'},
{"interval", required_argument, NULL, 'i'},
@@ -118,6 +119,7 @@ static struct option const long_options[] =
{"flashnode_idx", optional_argument, NULL, 'x'},
{"portal_type", optional_argument, NULL, 'A'},
{"newroot", required_argument, NULL, 0},
+ {"param", required_argument, NULL, 0},
{NULL, 0, NULL, 0},
};
static char *short_options = "RlDVhm:a:b:c:C:p:P:T:H:i:I:U:k:L:d:r:n:v:o:sSt:u";
@@ -127,7 +129,7 @@ iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p
static char *short_options = "RlDVhm:a:b:c:C:p:P:T:H:i:I:U:k:L:d:r:n:v:o:sSt:ux:A:";
@@ -133,7 +135,7 @@ iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p
[ -o operation ] [ -n name ] [ -v value ] [ -lD ] ] \n\
iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ] \n\
iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] \
@ -172,8 +172,8 @@ index 323d0a8..ef866ae 100644
+[ [ -o operation ] [ -n name ] [ -v value ] ] [ --param=NAME=VALUE ]\n\
iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]\n\
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]\n\
iscsiadm -m fw [ -l ]\n\
@@ -2430,9 +2432,11 @@ main(int argc, char **argv)
iscsiadm -m fw [ -d debug_level ] [ -l ]\n\
@@ -2834,9 +2836,11 @@ main(int argc, char **argv)
uint32_t host_no = -1;
struct user_param *param;
struct list_head params;
@ -185,7 +185,7 @@ index 323d0a8..ef866ae 100644
/* do not allow ctrl-c for now... */
memset(&sa_old, 0, sizeof(struct sigaction));
memset(&sa_new, 0, sizeof(struct sigaction));
@@ -2455,8 +2459,14 @@ main(int argc, char **argv)
@@ -2859,8 +2863,14 @@ main(int argc, char **argv)
case 0:
if (long_options[longindex].flag != 0)
break;
@ -201,7 +201,7 @@ index 323d0a8..ef866ae 100644
break;
case 'k':
killiscsid = atoi(optarg);
@@ -2748,6 +2758,8 @@ main(int argc, char **argv)
@@ -3169,6 +3179,8 @@ main(int argc, char **argv)
goto out;
}
@ -333,5 +333,5 @@ index 6924d49..85be35b 100644
exit(err);
break;
--
1.7.11.7
1.8.1.4

View File

@ -1,4 +1,4 @@
From aaf2b26eae472e5fd596f9bd23f9bf5886b1eb98 Mon Sep 17 00:00:00 2001
From be8702e609fdfd417547f758cb88956066b63023 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:38:45 -0800
Subject: use var for config
@ -7,12 +7,12 @@ Subject: use var for config
README | 33 ++++++++++++++++-----------------
doc/iscsiadm.8 | 8 ++++----
usr/idbm.c | 6 +++---
usr/idbm.h | 15 +++++++++------
usr/idbm.h | 13 +++++++------
usr/iface.h | 4 +++-
5 files changed, 35 insertions(+), 31 deletions(-)
5 files changed, 33 insertions(+), 31 deletions(-)
diff --git a/README b/README
index 2a8319a..e5ae2c1 100644
index 90e2074..9cc62ca 100644
--- a/README
+++ b/README
@@ -156,8 +156,7 @@ Usage: iscsid [OPTION]
@ -25,7 +25,7 @@ index 2a8319a..e5ae2c1 100644
Configuration is contained in directories for:
@@ -444,7 +443,7 @@ a scsi_host per HBA port).
@@ -467,7 +466,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
@ -34,7 +34,7 @@ index 2a8319a..e5ae2c1 100644
Prep:
@@ -478,29 +477,29 @@ Running:
@@ -501,29 +500,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
@ -69,7 +69,7 @@ index 2a8319a..e5ae2c1 100644
iface.transport_name = tcp
iface.hwaddress = 00:C0:DD:08:63:E7
@@ -550,7 +549,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
@@ -573,7 +572,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
@ -78,7 +78,7 @@ index 2a8319a..e5ae2c1 100644
The format is:
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
@@ -636,7 +635,7 @@ need a seperate network connection to the target for discovery purposes.
@@ -659,7 +658,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
@ -87,7 +87,7 @@ index 2a8319a..e5ae2c1 100644
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
@@ -654,7 +653,7 @@ we do not bind a session to a iface, then you can use the special iface
@@ -677,7 +676,7 @@ we do not bind a session to a iface, then you can use the special iface
iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
@ -96,7 +96,7 @@ index 2a8319a..e5ae2c1 100644
not pass anything into iscsiadm, running iscsiadm will do the default
behavior, where we allow the network subsystem to decide which
device to use.
@@ -696,7 +695,7 @@ To now log into targets it is the same as with sofware iscsi. See section
@@ -719,7 +718,7 @@ To now log into targets it is the same as with sofware iscsi. See section
./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
@ -105,7 +105,7 @@ index 2a8319a..e5ae2c1 100644
ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
will perform discovery using the settings stored in the record.
If a record does not exist, it will be created using the iscsid.conf
@@ -705,7 +704,7 @@ To now log into targets it is the same as with sofware iscsi. See section
@@ -728,7 +727,7 @@ To now log into targets it is the same as with sofware iscsi. See section
The argument to -p may also be a hostname instead of an address.
./iscsiadm -m discoverydb -t st -p smoehost --discover
@ -114,7 +114,7 @@ index 2a8319a..e5ae2c1 100644
interfaces using software iscsi. If any are found then nodes found
during discovery will be setup so that they can logged in through
those interfaces. To specify a specific iface, pass the
@@ -761,7 +760,7 @@ To now log into targets it is the same as with sofware iscsi. See section
@@ -784,7 +783,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
@ -123,7 +123,7 @@ index 2a8319a..e5ae2c1 100644
then you can pass them in during discovery:
./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
@@ -1072,8 +1071,8 @@ where targetname is the name of the target and ip_address:port is the address
@@ -1145,8 +1144,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
@ -134,7 +134,7 @@ index 2a8319a..e5ae2c1 100644
Default here is iscsi_tcp/tcp to be used over which ever NIC the
network layer decides is best.
@@ -1188,7 +1187,7 @@ If set, iscsid will perform discovery to the address every
@@ -1261,7 +1260,7 @@ If set, iscsid will perform discovery to the address every
discovery.isns.discoveryd_poll_inval or
discovery.sendtargets.discoveryd_poll_inval seconds,
and it will log into any portals found from the discovery source using
@ -144,10 +144,10 @@ index 2a8319a..e5ae2c1 100644
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.
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index 7c209f6..e94cca0 100644
index 6b15fcd..30811bd 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -89,7 +89,7 @@ This option is only valid for ping submode.
@@ -101,7 +101,7 @@ This option is only valid for ping submode.
.TP
\fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
The interface argument specifies the iSCSI interface to use for the operation.
@ -156,7 +156,7 @@ index 7c209f6..e94cca0 100644
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
@@ -166,7 +166,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
@@ -178,7 +178,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
of their respective records are displayed; for \fIsession\fR, all active
sessions and connections are displayed; for \fIfw\fR, all boot firmware
values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
@ -165,7 +165,7 @@ index 7c209f6..e94cca0 100644
.TP
\fB\-n\fR, \fB\-\-name=\fIname\fR
@@ -535,10 +535,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
@@ -562,10 +562,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
@ -179,10 +179,10 @@ index 7c209f6..e94cca0 100644
.SH "SEE ALSO"
diff --git a/usr/idbm.c b/usr/idbm.c
index a1d7d37..806d90e 100644
index 634e547..4bb9810 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2472,9 +2472,9 @@ free_info:
@@ -2721,9 +2721,9 @@ free_info:
int idbm_init(idbm_get_config_file_fn *fn)
{
/* make sure root db dir is there */
@ -196,12 +196,12 @@ index a1d7d37..806d90e 100644
return errno;
}
diff --git a/usr/idbm.h b/usr/idbm.h
index 245f046..5d81df7 100644
index 5e4038d..1e9b132 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
@@ -28,12 +28,15 @@
#include "config.h"
@@ -29,12 +29,13 @@
#include "list.h"
#include "flashnode.h"
-#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes"
-#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp"
@ -209,15 +209,13 @@ index 245f046..5d81df7 100644
-#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 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_DIR ISCSIVAR"send_targets"
#define ST_CONFIG_NAME "st_config"
#define ISNS_CONFIG_NAME "isns_config"
@ -237,5 +235,5 @@ index 01f7074..f396918 100644
struct iface_rec;
struct list_head;
--
1.7.11.7
1.8.1.4

View File

@ -1,4 +1,4 @@
From ce1f29f2049320af18eeffd3aefccf840c442ce0 Mon Sep 17 00:00:00 2001
From 38800fb6984ca4c3ad963708c47c1946c33b6d1a Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:43:15 -0800
Subject: add libiscsi
@ -43,18 +43,18 @@ Subject: add libiscsi
create mode 100644 libiscsi/tests/test_set_auth.c
diff --git a/Makefile b/Makefile
index c5d9700..6dfbde3 100644
index 0b7bb98..02346bf 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,7 @@ user: utils/open-isns/Makefile
$(MAKE) -C utils/fwparam_ibft
@@ -33,6 +33,7 @@ user: utils/open-isns/Makefile iscsiuio/Makefile
$(MAKE) -C usr
$(MAKE) -C utils
$(MAKE) -C iscsiuio
+ $(MAKE) -C libiscsi
@echo
@echo "Compilation complete Output file"
@echo "----------------------------------- ----------------"
@@ -56,6 +57,7 @@ kernel: force
@@ -61,6 +62,7 @@ kernel: force
force: ;
clean:
@ -597,7 +597,7 @@ index 0000000..2a176e8
+ struct node_rec rec;
+
+ node_to_rec(node, &rec);
+ CHECK(iscsi_sysfs_for_each_session(&rec, &nr_found, logout_helper))
+ CHECK(iscsi_sysfs_for_each_session(&rec, &nr_found, logout_helper,0))
+ if (nr_found == 0) {
+ strcpy(context->error_str, "No matching session");
+ rc = ENODEV;
@ -3828,7 +3828,7 @@ index 0000000..a21f888
+ return rc;
+}
diff --git a/usr/Makefile b/usr/Makefile
index 1506111..015f1b9 100644
index 3d8ee22..e731545 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -31,7 +31,7 @@ endif
@ -3881,10 +3881,10 @@ index afce6c0..0c93749 100644
int discovery_fw(void *data, struct iface_rec *iface,
struct list_head *rec_list)
diff --git a/usr/idbm.c b/usr/idbm.c
index 806d90e..c20f7d9 100644
index 4bb9810..c84ae69 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -1335,9 +1335,9 @@ int idbm_print_all_discovery(int info_level)
@@ -1515,9 +1515,9 @@ int idbm_print_all_discovery(int info_level)
* 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.
*/
@ -3898,10 +3898,10 @@ index 806d90e..c20f7d9 100644
DIR *iface_dirfd;
struct dirent *iface_dent;
diff --git a/usr/idbm.h b/usr/idbm.h
index 5d81df7..f645561 100644
index 1e9b132..4d08b31 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
@@ -101,6 +101,9 @@ struct rec_op_data {
@@ -102,6 +102,9 @@ struct rec_op_data {
node_rec_t *match_rec;
idbm_iface_op_fn *fn;
};
@ -3912,16 +3912,16 @@ index 5d81df7..f645561 100644
idbm_portal_op_fn *fn, char *targetname);
extern int idbm_for_each_node(int *found, void *data,
diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h
index db5f1f0..e0bf051 100644
index b6665cb..3e7f82a 100644
--- a/usr/iscsi_ipc.h
+++ b/usr/iscsi_ipc.h
@@ -147,4 +147,6 @@ struct iscsi_ipc {
uint16_t chap_tbl_idx);
@@ -160,4 +160,6 @@ struct iscsi_ipc {
uint32_t host_no, uint32_t sid);
};
+struct iscsi_ipc *ipc;
+
#endif /* ISCSI_IPC_H */
--
1.7.11.7
1.8.1.4

View File

@ -1,7 +1,7 @@
From e74f511ba862195d909bba90091fd84bd7904914 Mon Sep 17 00:00:00 2001
From 6e979154c9c51dedd54c91e46106e495a65ced43 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 2 Jan 2013 14:45:05 -0800
Subject: iscsiuio IPC newroot command
Subject: [PATCH 58/58] iscsiuio IPC newroot command
---
usr/mgmt_ipc.c | 11 +++++++++++
@ -43,10 +43,10 @@ index 5cb7143..a8f8473 100644
return ISCSI_SUCCESS;
}
diff --git a/usr/transport.c b/usr/transport.c
index 10212af..02ad717 100644
index 4d030a8..e0488ad 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -81,6 +81,7 @@ struct iscsi_transport_template bnx2i = {
@@ -83,6 +83,7 @@ struct iscsi_transport_template bnx2i = {
.ep_poll = ktransport_ep_poll,
.ep_disconnect = ktransport_ep_disconnect,
.set_net_config = uip_broadcast_params,
@ -55,10 +55,10 @@ index 10212af..02ad717 100644
struct iscsi_transport_template be2iscsi = {
diff --git a/usr/transport.h b/usr/transport.h
index 5dcf872..eb3a946 100644
index 388e4b1..d4d9ec7 100644
--- a/usr/transport.h
+++ b/usr/transport.h
@@ -38,6 +38,7 @@ struct iscsi_transport_template {
@@ -39,6 +39,7 @@ struct iscsi_transport_template {
int (*set_net_config) (struct iscsi_transport *t,
struct iface_rec *iface,
struct iscsi_session *session);
@ -67,7 +67,7 @@ index 5dcf872..eb3a946 100644
/* represents data path provider */
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
index 73b1632..9fa5398 100644
index f3074ee..d5d496a 100644
--- a/usr/uip_mgmt_ipc.c
+++ b/usr/uip_mgmt_ipc.c
@@ -39,3 +39,17 @@ int uip_broadcast_params(struct iscsi_transport *t,
@ -89,7 +89,7 @@ index 73b1632..9fa5398 100644
+ PATH_MAX + 1);
+}
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
index 3859688..9de88c2 100644
index 29a4769..3ca4fb1 100644
--- a/usr/uip_mgmt_ipc.h
+++ b/usr/uip_mgmt_ipc.h
@@ -29,6 +29,7 @@
@ -98,7 +98,7 @@ index 3859688..9de88c2 100644
ISCSID_UIP_IPC_GET_IFACE = 1,
+ ISCSID_UIP_NEWROOT = 2,
__ISCSID_UIP_IPC_MAX_COMMAND
__ISCSID_UIP_IPC_MAX_COMMAND
} iscsid_uip_cmd_e;
@@ -47,6 +48,9 @@ typedef struct iscsid_uip_broadcast {
struct ipc_broadcast_iface_rec {
@ -118,5 +118,5 @@ index 3859688..9de88c2 100644
#endif /* UIP_MGMT_IPC_H */
--
1.7.11.7
1.8.1.4

View File

@ -0,0 +1,52 @@
From fcad7de1a8c3d140d1d0eb120727966017d3727b Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Sat, 17 Aug 2013 15:50:45 -0700
Subject: libiscsi: fix incorrect strncpy use
Changes to internal structures make the src and dst buffers of some
copies (potentially) different sizes. Fix strncpy calls that were using
the size of the src argument as the limit.
---
libiscsi/libiscsi.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
index 6e6846a..064e4b5 100644
--- a/libiscsi/libiscsi.c
+++ b/libiscsi/libiscsi.c
@@ -587,15 +587,13 @@ int libiscsi_get_firmware_network_config(
return ENODEV;
config->dhcp = strlen(fw_entry.dhcp) ? 1 : 0;
- strncpy(config->iface_name, fw_entry.iface, sizeof fw_entry.iface);
- strncpy(config->mac_address, fw_entry.mac, sizeof fw_entry.mac);
- strncpy(config->ip_address, fw_entry.ipaddr, sizeof fw_entry.ipaddr);
- strncpy(config->netmask, fw_entry.mask, sizeof fw_entry.mask);
- strncpy(config->gateway, fw_entry.gateway, sizeof fw_entry.gateway);
- strncpy(config->primary_dns, fw_entry.primary_dns,
- sizeof fw_entry.primary_dns);
- strncpy(config->secondary_dns, fw_entry.secondary_dns,
- sizeof fw_entry.secondary_dns);
+ strlcpy(config->iface_name, fw_entry.iface, LIBISCSI_VALUE_MAXLEN);
+ strlcpy(config->mac_address, fw_entry.mac, LIBISCSI_VALUE_MAXLEN);
+ strlcpy(config->ip_address, fw_entry.ipaddr, LIBISCSI_VALUE_MAXLEN);
+ strlcpy(config->netmask, fw_entry.mask, LIBISCSI_VALUE_MAXLEN);
+ strlcpy(config->gateway, fw_entry.gateway, LIBISCSI_VALUE_MAXLEN);
+ strlcpy(config->primary_dns, fw_entry.primary_dns, LIBISCSI_VALUE_MAXLEN);
+ strlcpy(config->secondary_dns, fw_entry.secondary_dns, LIBISCSI_VALUE_MAXLEN);
return 0;
}
@@ -613,8 +611,7 @@ int libiscsi_get_firmware_initiator_name(char *initiatorname)
if (fw_get_entry(&fw_entry))
return ENODEV;
- strncpy(initiatorname, fw_entry.initiatorname,
- sizeof fw_entry.initiatorname);
+ strlcpy(initiatorname, fw_entry.initiatorname, LIBISCSI_VALUE_MAXLEN);
return 0;
}
--
1.8.1.4

File diff suppressed because it is too large Load Diff

View File

@ -1,326 +0,0 @@
From 057e4ade3814e3ae41a4226c63e76cc36c8147bf Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:28:18 -0800
Subject: iscsiuio 0.7.6.1
---
README | 4 ++--
RELEASE.TXT | 34 ++++++++++++++++++++++++++++++++--
configure | 18 +++++++++---------
configure.ac | 4 ++--
docs/iscsiuio.8 | 4 ++--
src/uip/uip_arp.c | 1 -
src/unix/libs/bnx2x.c | 19 ++++++++++++++++---
src/unix/libs/bnx2x.h | 8 +++++++-
src/unix/nic.c | 3 ++-
src/unix/nic_nl.c | 2 +-
10 files changed, 73 insertions(+), 24 deletions(-)
diff --git a/README b/README
index a716263..e5ee23f 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
iscsiuio Userspace Tool
-Version 0.7.4.3
-Aug 16, 2012
+Version 0.7.6.1
+Oct 09, 2012
------------------------------------------------------
This tool is to be used in conjunction with the Broadcom NetXtreme II Linux
diff --git a/RELEASE.TXT b/RELEASE.TXT
index cb1d470..0e7665c 100644
--- a/RELEASE.TXT
+++ b/RELEASE.TXT
@@ -1,7 +1,7 @@
Release Notes
Broadcom uIP Linux Driver
- Version 0.7.4.3
- 08/16/2012
+ Version 0.7.6.1
+ 10/15/2012
Broadcom Corporation
5300 California Avenue,
@@ -11,6 +11,36 @@
All rights reserved
+uIP v0.7.6.1 (Oct 15, 2012)
+=======================================================
+ Fixes
+ -----
+ 1. Problem: Cont00065690 - Vconfig method of connecting over
+ tagged vlan with IPv6 failed
+ Cause: The new net param support changes has prevented
+ the old vconfig method from execising the IPv6
+ acquisition engine properly
+ Change: Ensure that this old vconfig method to run the IPv6
+ acquisition engine properly and to its entirety
+ Impact: IPv6 + VLAN using the network VLAN configuration
+ method
+
+ 2. Problem: Cont00065768 - RHEL5.X iscsiuio segfault possible
+ if there is a specific 1024 byte size broadcast
+ packet
+ Cause: This is a corner case where the packet size is
+ exactly 1024 bytes + padding that exceeded the
+ DMA rx buffer. This has been there since day 1.
+ Change: Ensure that the packet size + padding do not
+ exceed this limit.
+ Impact: 10G only. 1G already has the guard against it.
+
+ Enhancements
+ ------------
+ 1. Change: Added support for 10G 57840 4x10 and 2x20
+ Impact: 10G 57840
+
+
uIP v0.7.4.3 (Aug 16, 2012)
=======================================================
Fixes
diff --git a/configure b/configure
index 6ff2e68..0b2abc4 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.4.3.
+# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.6.1.
#
# Report bugs to <eddie.wai@broadcom.com>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='iscsiuio'
PACKAGE_TARNAME='iscsiuio'
-PACKAGE_VERSION='0.7.4.3'
-PACKAGE_STRING='iscsiuio 0.7.4.3'
+PACKAGE_VERSION='0.7.6.1'
+PACKAGE_STRING='iscsiuio 0.7.6.1'
PACKAGE_BUGREPORT='eddie.wai@broadcom.com'
# Factoring default headers for most tests.
@@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures iscsiuio 0.7.4.3 to adapt to many kinds of systems.
+\`configure' configures iscsiuio 0.7.6.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of iscsiuio 0.7.4.3:";;
+ short | recursive ) echo "Configuration of iscsiuio 0.7.6.1:";;
esac
cat <<\_ACEOF
@@ -1161,7 +1161,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-iscsiuio configure 0.7.4.3
+iscsiuio configure 0.7.6.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1175,7 +1175,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by iscsiuio $as_me 0.7.4.3, which was
+It was created by iscsiuio $as_me 0.7.6.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -21726,7 +21726,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by iscsiuio $as_me 0.7.4.3, which was
+This file was extended by iscsiuio $as_me 0.7.6.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21789,7 +21789,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-iscsiuio config.status 0.7.4.3
+iscsiuio config.status 0.7.6.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 0b1e7f1..1045a80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,9 +11,9 @@ dnl Maintained by: Eddie Wai (eddie.wai@broadcom.com)
dnl
PACKAGE=iscsiuio
-VERSION=0.7.4.3
+VERSION=0.7.6.1
-AC_INIT(iscsiuio, 0.7.4.3, eddie.wai@broadcom.com)
+AC_INIT(iscsiuio, 0.7.6.1, eddie.wai@broadcom.com)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_CONFIG_HEADER(config.h)
diff --git a/docs/iscsiuio.8 b/docs/iscsiuio.8
index 4bf26df..d107327 100644
--- a/docs/iscsiuio.8
+++ b/docs/iscsiuio.8
@@ -3,9 +3,9 @@
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation.
.\"
-.\" bnx2.4,v 0.7.4.3
+.\" bnx2.4,v 0.7.6.1
.\"
-.TH iscsiuio 8 "08/16/2012" "Broadcom Corporation"
+.TH iscsiuio 8 "10/09/2012" "Broadcom Corporation"
.\"
.\" NAME part
.\"
diff --git a/src/uip/uip_arp.c b/src/uip/uip_arp.c
index 3ef3b07..9dd02a1 100644
--- a/src/uip/uip_arp.c
+++ b/src/uip/uip_arp.c
@@ -273,7 +273,6 @@ uip_arp_arpin(nic_interface_t * nic_iface,
pkt->buf_size = sizeof(*arp) +
sizeof(struct uip_vlan_eth_hdr);
}
- pkt->buf_size = sizeof(*arp) + sizeof(*eth);
}
break;
case const_htons(ARP_REPLY):
diff --git a/src/unix/libs/bnx2x.c b/src/unix/libs/bnx2x.c
index 5e33420..70e85c0 100644
--- a/src/unix/libs/bnx2x.c
+++ b/src/unix/libs/bnx2x.c
@@ -103,6 +103,10 @@ static const char brcm_57840_MF[] = "Broadcom NetXtreme II BCM57840 MF "
"10-Gigabit";
static const char brcm_57840_VF[] = "Broadcom NetXtreme II BCM57840 VF "
"10-Gigabit";
+static const char brcm_57840_4_10[] = "Broadcom NetXtreme II BCM57840 4x"
+ "10-Gigabit";
+static const char brcm_57840_2_20[] = "Broadcom NetXtreme II BCM57840 2x"
+ "20-Gigabit";
/*******************************************************************************
* PCI ID constants
@@ -123,6 +127,8 @@ static const char brcm_57840_VF[] = "Broadcom NetXtreme II BCM57840 VF "
#define PCI_DEVICE_ID_NX2_57840 0x168d
#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab
#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
+#define PCI_DEVICE_ID_NX2_57840_4_10 0x16a1
+#define PCI_DEVICE_ID_NX2_57840_2_20 0x16a2
#define PCI_ANY_ID (~0)
/* This is the table used to match PCI vendor and device ID's to the
@@ -158,6 +164,10 @@ static const struct pci_device_id bnx2x_pci_tbl[] = {
PCI_ANY_ID, PCI_ANY_ID, brcm_57840_MF},
{PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57840_VF,
PCI_ANY_ID, PCI_ANY_ID, brcm_57840_VF},
+ {PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57840_4_10,
+ PCI_ANY_ID, PCI_ANY_ID, brcm_57840_4_10},
+ {PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57840_2_20,
+ PCI_ANY_ID, PCI_ANY_ID, brcm_57840_2_20},
};
static struct iro e1_iro[2] = {
@@ -1401,7 +1411,7 @@ static int bnx2x_read(nic_t * nic, packet_t * pkt)
union eth_rx_cqe *cqe;
__u8 cqe_fp_flags;
void *rx_pkt;
- int len, pad, cqe_size;
+ int len, pad, cqe_size, max_len;
rc = 1;
if (bnx2x_is_ver70(bp)) {
@@ -1427,10 +1437,13 @@ static int bnx2x_read(nic_t * nic, packet_t * pkt)
/* Doto query MTU size of physical device */
/* Ensure len is valid */
- if (len > pkt->max_buf_size)
+ max_len = pkt->max_buf_size < bp->rx_buffer_size ?
+ pkt->max_buf_size : bp->rx_buffer_size;
+ if (len > max_len) {
LOG_DEBUG(PFX "%s: bad BD length: %d",
nic->log_name, len);
-
+ len = max_len;
+ }
if (len > 0) {
msync(rx_pkt, len, MS_SYNC);
/* Copy the data */
diff --git a/src/unix/libs/bnx2x.h b/src/unix/libs/bnx2x.h
index b758179..1f47011 100644
--- a/src/unix/libs/bnx2x.h
+++ b/src/unix/libs/bnx2x.h
@@ -430,6 +430,8 @@ struct client_init_general_data {
#define CHIP_NUM_57800 0x168a
#define CHIP_NUM_57810 0x168e
#define CHIP_NUM_57840 0x168d
+#define CHIP_NUM_57840_4_10 0x16a1
+#define CHIP_NUM_57840_2_20 0x16a2
#define CHIP_IS_E1(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57710)
#define CHIP_IS_57711(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57711)
@@ -438,7 +440,11 @@ struct client_init_general_data {
#define CHIP_IS_57712E(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57712E)
#define CHIP_IS_57800(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57800)
#define CHIP_IS_57810(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57810)
-#define CHIP_IS_57840(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57840)
+#define CHIP_IS_57840_4_10(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57840_4_10)
+#define CHIP_IS_57840_2_20(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57840_2_20)
+#define CHIP_IS_57840(bp) (BNX2X_CHIP_NUM(bp) == CHIP_NUM_57840 || \
+ CHIP_IS_57840_4_10(bp) || \
+ CHIP_IS_57840_2_20(bp))
#define CHIP_IS_E1H(bp) (CHIP_IS_57711(bp) || \
CHIP_IS_57711E(bp))
#define CHIP_IS_E2(bp) (CHIP_IS_57712(bp) || \
diff --git a/src/unix/nic.c b/src/unix/nic.c
index 0b3c538..72afff0 100644
--- a/src/unix/nic.c
+++ b/src/unix/nic.c
@@ -460,6 +460,7 @@ int nic_remove(nic_t * nic)
rc = stat(nic->uio_device_name, &file_stat);
if ((rc == 0) && (nic->ops))
nic->ops->close(nic, 0);
+ pthread_mutex_unlock(&nic->nic_mutex);
nic->state = NIC_EXIT;
@@ -910,7 +911,7 @@ int do_timers_per_nic_iface(nic_t *nic, nic_interface_t *nic_iface,
if (pkt == NULL)
return -EIO;
- if (nic_iface->ustack.ip_config == AF_INET) {
+ if (nic_iface->protocol == AF_INET) {
for (i = 0; i < UIP_UDP_CONNS; i++) {
prepare_ustack(nic, nic_iface, ustack, pkt);
diff --git a/src/unix/nic_nl.c b/src/unix/nic_nl.c
index 34e2062..8afd9ae 100644
--- a/src/unix/nic_nl.c
+++ b/src/unix/nic_nl.c
@@ -408,7 +408,7 @@ static int ctldev_handle(char *data, nic_t *nic)
persist_all_nic_iface(nic);
nic_iface = vlan_iface;
-
+ nic_iface->flags |= NIC_IFACE_ACQUIRE;
pthread_mutex_unlock(&nic->nic_mutex);
/* nic_disable but not going down */
--
1.7.11.7

View File

@ -1,31 +0,0 @@
From bff9048411c891d2eafab1e588077e4bfa56cb43 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:32:44 -0800
Subject: iscsiuio fix long options
---
src/unix/main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/unix/main.c b/src/unix/main.c
index 2008913..ef9e069 100644
--- a/src/unix/main.c
+++ b/src/unix/main.c
@@ -83,9 +83,11 @@ static char default_pid_filepath[] = "/var/run/iscsiuio.pid";
* Global Variables
******************************************************************************/
static const struct option long_options[] = {
- {"debug", 0, 0, 0},
- {"version", 0, 0, 0},
- {"help", 0, 0, 0},
+ {"foreground", no_argument, NULL, 'f'},
+ {"debug", required_argument, NULL, 'd'},
+ {"pid", required_argument, NULL, 'p'},
+ {"version", no_argument, NULL, 'v'},
+ {"help", no_argument, NULL, 'h'},
{0, 0, 0, 0}
};
--
1.7.11.7

View File

@ -1,51 +0,0 @@
From fefc8e39129dbdeadf2a0b6ba7a28e9e47597e11 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:37:18 -0800
Subject: iscsiuio add --initrd option to set run from initrd hint for systemd
See http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
---
src/unix/main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/unix/main.c b/src/unix/main.c
index ef9e069..c5fb5ab 100644
--- a/src/unix/main.c
+++ b/src/unix/main.c
@@ -82,12 +82,15 @@ static char default_pid_filepath[] = "/var/run/iscsiuio.pid";
/*******************************************************************************
* Global Variables
******************************************************************************/
+static int initrd = 0;
+
static const struct option long_options[] = {
{"foreground", no_argument, NULL, 'f'},
{"debug", required_argument, NULL, 'd'},
{"pid", required_argument, NULL, 'p'},
{"version", no_argument, NULL, 'v'},
{"help", no_argument, NULL, 'h'},
+ {"initrd", no_argument, &initrd, 1},
{0, 0, 0, 0}
};
@@ -176,6 +179,7 @@ iscsiuio daemon.\n\
-f, --foreground make the program run in the foreground\n\
-d, --debug debuglevel print debugging information\n\
-p, --pid=pidfile use pid file (default %s).\n\
+ --initrd systemd initrd hint\n\
-h, --help display this help and exit\n\
-v, --version display version and exit\n\
", default_pid_filepath);
@@ -279,6 +283,9 @@ int main(int argc, char *argv[])
}
}
+ if (initrd)
+ argv[0][0] = '@';
+
if (main_log.enabled == LOGGER_ENABLED) {
/* initialize the logger */
rc = init_logger(main_log.log_file);
--
1.7.11.7

View File

@ -1,58 +0,0 @@
From b923362bb847eab5856fa3593f053e670d90e0fd Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:39:06 -0800
Subject: iscsiuio systemd socket activation support
---
src/unix/iscsid_ipc.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/unix/iscsid_ipc.c b/src/unix/iscsid_ipc.c
index d7372fc..1c28822 100644
--- a/src/unix/iscsid_ipc.c
+++ b/src/unix/iscsid_ipc.c
@@ -948,6 +948,30 @@ static void *iscsid_loop(void *arg)
pthread_exit(NULL);
}
+#define SD_SOCKET_FDS_START 3
+
+static int ipc_systemd(void)
+{
+ char *env;
+
+ env = getenv("LISTEN_PID");
+
+ if (!env || (strtoul(env, NULL, 10) != getpid()))
+ return -EINVAL;
+
+ env = getenv("LISTEN_FDS");
+
+ if (!env)
+ return -EINVAL;
+
+ if (strtoul(env, NULL, 10) != 1) {
+ LOG_ERR("Did not receive exactly one IPC socket from systemd");
+ return -EINVAL;
+ }
+
+ return SD_SOCKET_FDS_START;
+}
+
/******************************************************************************
* Initialize/Cleanup routines
******************************************************************************/
@@ -961,6 +985,10 @@ int iscsid_init()
int rc;
struct sockaddr_un addr;
+ iscsid_opts.fd = ipc_systemd();
+ if (iscsid_opts.fd >= 0)
+ return 0;
+
iscsid_opts.fd = socket(AF_LOCAL, SOCK_STREAM, 0);
if (iscsid_opts.fd < 0) {
LOG_ERR(PFX "Can not create IPC socket");
--
1.7.11.7

View File

@ -1,62 +0,0 @@
From 07bf3074ccdd9debe844fe1bae0244799d01fe58 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 2 Jan 2013 14:46:14 -0800
Subject: iscsiuio: iscsid IPC newroot command
---
include/uip_mgmt_ipc.h | 4 ++++
src/unix/iscsid_ipc.c | 9 +++++++++
2 files changed, 13 insertions(+)
diff --git a/include/uip_mgmt_ipc.h b/include/uip_mgmt_ipc.h
index 7054df5..db87b2b 100644
--- a/include/uip_mgmt_ipc.h
+++ b/include/uip_mgmt_ipc.h
@@ -26,6 +26,7 @@
typedef enum iscsid_uip_cmd {
ISCSID_UIP_IPC_UNKNOWN = 0,
ISCSID_UIP_IPC_GET_IFACE = 1,
+ ISCSID_UIP_NEWROOT = 2,
__ISCSID_UIP_IPC_MAX_COMMAND
} iscsid_uip_cmd_e;
@@ -45,6 +46,9 @@ typedef struct iscsid_uip_broadcast {
struct ipc_broadcast_iface_rec {
struct iface_rec rec;
} iface_rec;
+ struct ipc_broadcast_newroot {
+ char path[PATH_MAX + 1];
+ } newroot;
} u;
} iscsid_uip_broadcast_t;
diff --git a/src/unix/iscsid_ipc.c b/src/unix/iscsid_ipc.c
index 1c28822..dcbeb4c 100644
--- a/src/unix/iscsid_ipc.c
+++ b/src/unix/iscsid_ipc.c
@@ -801,6 +801,7 @@ int process_iscsid_broadcast(int s2)
size_t size;
iscsid_uip_cmd_e cmd;
uint32_t payload_len;
+ char *newroot;
fd = fdopen(s2, "r+");
if (fd == NULL) {
@@ -857,6 +858,14 @@ int process_iscsid_broadcast(int s2)
}
break;
+ case ISCSID_UIP_NEWROOT:
+ rsp.command = cmd;
+ newroot = data->u.newroot.path;
+ if (chdir(newroot) || chroot(".") || chdir("/"))
+ rsp.err = ISCSID_UIP_MGMT_IPC_ERR;
+ else
+ rsp.err = ISCSID_UIP_MGMT_IPC_OK;
+ break;
default:
LOG_WARN(PFX "Unknown iscsid broadcast command: %x",
data->header.command);
--
1.7.11.7

View File

@ -1,32 +0,0 @@
From 1453c612ce34c6d3722e0d83b5e2def5048421dc Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 21 Jan 2013 15:49:02 -0800
Subject: iscsiuio document pidfile option
---
docs/iscsiuio.8 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/iscsiuio.8 b/docs/iscsiuio.8
index d107327..6d79108 100644
--- a/docs/iscsiuio.8
+++ b/docs/iscsiuio.8
@@ -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/iscsiuio.pid )
+.PP
+.TP
+.BI -h
+Display this help and exit.
+
.\"
.\" AUTHOR part
--
1.7.11.7

View File

@ -16,7 +16,7 @@ index a090522..aef0c3d 100644
* some other maintainer could merge a patch without going through us
*/
-#define ISCSI_VERSION_STR "2.0-873"
+#define ISCSI_VERSION_STR "6.2.0.873-1"
+#define ISCSI_VERSION_STR "6.2.0.873-10"
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif

View File

@ -1,20 +1,15 @@
%global _hardened_build 1
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define open_iscsi_version 2.0
%define open_iscsi_build 873
%define iscsiuio_version 0.7.2.1
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.%{open_iscsi_version}.%{open_iscsi_build}
Release: 9%{?dist}
Release: 10%{?dist}
Group: System Environment/Daemons
License: GPLv2+
URL: http://www.open-iscsi.org
Source0: http://www.open-iscsi.org/bits/open-iscsi-%{open_iscsi_version}-%{open_iscsi_build}.tar.gz
Source1: iscsiuio-%{iscsiuio_version}.tar.gz
Source4: 04-iscsi
Source5: iscsi-tmpfiles.conf
@ -29,11 +24,36 @@ Patch7: 0007-iscsid-iscsiadm-fix-abstract-socket-length-in-bind-c.patch
Patch8: 0008-iscsid-implement-systemd-compatible-socket-activatio.patch
Patch9: 0009-iscsid-add-example-unit-files-for-systemd.patch
Patch10: 0010-iscsi-tools-fix-get_random_bytes-error-handling.patch
# pending upstream merge
Patch31: 0031-iscsid-add-initrd-option-to-set-run-from-initrd-hint.patch
Patch32: 0032-iscsiadm-iscsid-newroot-command-to-survive-switch_ro.patch
Patch33: 0033-iscsiadm-param-parsing-for-advanced-node-creation.patch
Patch34: 0034-update-systemd-service-files-add-iscsi.service-for-s.patch
Patch11: 0011-ISCSID-Added-socket-communication-hooks-for-uip.patch
Patch12: 0012-ISCSID-Modified-the-Makefile-for-iscsiuio-compilatio.patch
Patch13: 0013-ISCSID-Added-iscsiuio-source-to-the-open-iscsi-pkg.patch
Patch14: 0014-From-Adheer-Chandravanshi-adheer.chandravanshi-qlogi.patch
Patch15: 0015-Manpage-changes-for-flashnode-submode-support-for-ho.patch
Patch16: 0016-README-changes-for-flashnode-submode-support-for-hos.patch
Patch17: 0017-PATCH-1-of-1-correctly-check-return-value-of-nice.patch
Patch18: 0018-Allow-firmware-mode-to-use-debug-flag.patch
Patch19: 0019-iscsiadm-return-error-when-login-fails.patch
Patch20: 0020-iscsiadm-bind-ifaces-to-portals-found-using-isns.patch
Patch21: 0021-iscsiadm-Check-for-mode-is-not-required-when-creatin.patch
Patch22: 0022-iscsid-iscsiadm-add-support-for-emulex-one-connect-s.patch
Patch23: 0023-ISCSIUIO-Updated-iscsiuio-to-version-0.7.8.1b-for-pe.patch
Patch24: 0024-Fix-discovery-error-return-without-return-value.patch
Patch25: 0025-iscsid-Fix-strlen-parameter.patch
Patch26: 0026-iscsiuio-Change-socket-bind-to-use-the-same-struct-s.patch
Patch27: 0027-Make-rescan-run-in-parallel.patch
# not (yet) upstream merged
Patch40: 0040-ISCSISTART-Saved-ibft-boot-info-to-the-session-sysfs.patch
Patch41: 0041-ISCSID-Added-the-extraction-of-the-session-boot-info.patch
Patch42: 0042-ISCSID-Added-iface-content-override-fix.patch
Patch43: 0043-idmb_rec_write-check-for-tpgt-first.patch
Patch44: 0044-iscsid-add-initrd-option-to-set-run-from-initrd-hint.patch
Patch45: 0045-idbm_rec_write-seperate-old-and-new-style-writes.patch
Patch46: 0046-idbw_rec_write-pick-tpgt-from-existing-record.patch
Patch47: 0047-iscsiadm-iscsid-newroot-command-to-survive-switch_ro.patch
Patch48: 0048-iscsiadm-param-parsing-for-advanced-node-creation.patch
Patch49: 0049-update-systemd-service-files-add-iscsi.service-for-s.patch
# distro specific modifications
Patch51: 0051-update-initscripts-and-docs.patch
Patch52: 0052-use-var-for-config.patch
@ -41,31 +61,27 @@ Patch53: 0053-use-red-hat-for-name.patch
Patch54: 0054-add-libiscsi.patch
Patch55: 0055-dont-use-static.patch
Patch56: 0056-remove-the-offload-boot-supported-ifdef.patch
Patch57: 0057-iscsid-iscsiuio-ipc-interface.patch
Patch58: 0058-iscsiuio-IPC-newroot-command.patch
Patch59: 0059-iscsiuio-systemd-unit-files.patch
Patch60: 0060-use-systemctl-to-start-iscsid.patch
Patch61: 0061-resolve-565245-multilib-issues-caused-by-doxygen.patch
Patch62: 0062-Don-t-check-for-autostart-sessions-if-iscsi-is-not-u.patch
Patch63: 0063-fix-order-of-setting-uid-gid-and-drop-supplementary-.patch
# iscsiuio patches
Patch71: 0071-iscsiuio-0.7.4.3.patch
Patch72: 0072-iscsiuio-0.7.6.1.patch
Patch73: 0073-iscsiuio-fix-long-options.patch
Patch74: 0074-iscsiuio-add-initrd-option-to-set-run-from-initrd-hi.patch
Patch75: 0075-iscsiuio-systemd-socket-activation-support.patch
Patch76: 0076-iscsiuio-iscsid-IPC-newroot-command.patch
Patch77: 0077-iscsiuio-document-pidfile-option.patch
Patch64: 0064-libiscsi-fix-incorrect-strncpy-use.patch
# version string, needs to be updated with each build
Patch99: 0099-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
# 44 47 48 58
BuildRequires: openssl-devel flex bison python-devel doxygen glibc-static kmod-devel systemd-devel
BuildRequires: flex bison python-devel doxygen kmod-devel systemd-devel
# For dir ownership
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%global _hardened_build 1
%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$
%description
The iscsi package provides the server daemon for the iSCSI protocol,
as well as the utility programs used to manage it. iSCSI is a protocol
@ -82,8 +98,7 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q -n open-iscsi-%{open_iscsi_version}-%{open_iscsi_build} -a 1
mv iscsiuio-%{iscsiuio_version} iscsiuio
%setup -q -n open-iscsi-%{open_iscsi_version}-%{open_iscsi_build}
# upstream patches
%patch1 -p1
%patch2 -p1
@ -95,11 +110,34 @@ mv iscsiuio-%{iscsiuio_version} iscsiuio
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
# pending upstream merge
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
# distro specific modifications
%patch51 -p1
%patch52 -p1
@ -107,37 +145,19 @@ mv iscsiuio-%{iscsiuio_version} iscsiuio
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
# iscsiuio patches
cd iscsiuio
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
cd ..
%patch64 -p1
# version string
%patch99 -p1
%build
chmod +x iscsiuio/configure
make OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod"
cd iscsiuio
chmod u+x configure
./configure --enable-debug
make OPTFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
cd ..
pushd libiscsi
python setup.py build
touch -r libiscsi.doxy html/*
@ -145,55 +165,56 @@ popd
%install
mkdir -p $RPM_BUILD_ROOT/sbin
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
mkdir -p $RPM_BUILD_ROOT/etc/iscsi
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/nodes
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/send_targets
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/static
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/isns
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/slp
mkdir -p $RPM_BUILD_ROOT/var/lib/iscsi/ifaces
mkdir -p $RPM_BUILD_ROOT/var/lock/iscsi
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}
mkdir -p $RPM_BUILD_ROOT%{python_sitearch}
make DESTDIR=%{?buildroot} install_programs install_doc install_etc
# upstream makefile doesn't get everything the way we like it
rm $RPM_BUILD_ROOT/sbin/iscsi_discovery
rm $RPM_BUILD_ROOT%{_mandir}/man8/iscsi_discovery.8
install -pm 755 usr/iscsistart $RPM_BUILD_ROOT/sbin
install -pm 644 doc/iscsistart.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -pm 644 doc/iscsi-iname.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -pm 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -p -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin
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 644 iscsiuio/docs/iscsiuio.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -p -m 755 iscsiuio/src/unix/iscsiuio $RPM_BUILD_ROOT/sbin
install -p -D -m 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir}/iscsi.service
install -p -D -m 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir}/iscsid.service
install -p -D -m 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir}/iscsid.socket
install -p -D -m 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.service
install -p -D -m 644 etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.socket
install -p -D -m 755 etc/systemd/iscsi_mark_root_nodes $RPM_BUILD_ROOT/usr/libexec/iscsi_mark_root_nodes
install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
install -p -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/iscsi.conf
install -p -m 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}
ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so
install -p -m 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir}
install -p -m 755 libiscsi/build/lib.linux-*/libiscsimodule.so \
$RPM_BUILD_ROOT%{python_sitearch}
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/nodes
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/send_targets
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/static
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/isns
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/slp
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/ifaces
# for %%ghost
install -d $RPM_BUILD_ROOT/var/lock/iscsi
touch $RPM_BUILD_ROOT/var/lock/iscsi/lock
install -d $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{_unitdir}
install -d $RPM_BUILD_ROOT%{_libexecdir}
install -pm 755 etc/systemd/iscsi_mark_root_nodes $RPM_BUILD_ROOT%{_libexecdir}
install -d $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
install -pm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
install -d $RPM_BUILD_ROOT%{_tmpfilesdir}
install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_tmpfilesdir}/iscsi.conf
install -d $RPM_BUILD_ROOT%{_libdir}
install -pm 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}
ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so
install -d $RPM_BUILD_ROOT%{_includedir}
install -pm 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir}
install -d $RPM_BUILD_ROOT%{python_sitearch}
install -pm 755 libiscsi/build/lib.linux-*/libiscsimodule.so \
$RPM_BUILD_ROOT%{python_sitearch}
%post
/sbin/ldconfig
@ -236,13 +257,13 @@ fi
%files
%doc README
%dir %{_var}/lib/iscsi
%dir %{_var}/lib/iscsi/nodes
%dir %{_var}/lib/iscsi/isns
%dir %{_var}/lib/iscsi/static
%dir %{_var}/lib/iscsi/slp
%dir %{_var}/lib/iscsi/ifaces
%dir %{_var}/lib/iscsi/send_targets
%dir %{_sharedstatedir}/iscsi
%dir %{_sharedstatedir}/iscsi/nodes
%dir %{_sharedstatedir}/iscsi/isns
%dir %{_sharedstatedir}/iscsi/static
%dir %{_sharedstatedir}/iscsi/slp
%dir %{_sharedstatedir}/iscsi/ifaces
%dir %{_sharedstatedir}/iscsi/send_targets
%ghost %{_var}/lock/iscsi
%ghost %{_var}/lock/iscsi/lock
%{_unitdir}/iscsi.service
@ -250,16 +271,16 @@ fi
%{_unitdir}/iscsid.socket
%{_unitdir}/iscsiuio.service
%{_unitdir}/iscsiuio.socket
/usr/libexec/iscsi_mark_root_nodes
%{_libexecdir}/iscsi_mark_root_nodes
%{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi
/usr/lib/tmpfiles.d/iscsi.conf
%{_tmpfilesdir}/iscsi.conf
%dir %{_sysconfdir}/iscsi
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf
/sbin/*
%{_libdir}/libiscsi.so.0
%{python_sitearch}/libiscsimodule.so
%{_mandir}/man8/*
%{_sysconfdir}/logrotate.d/iscsiuiolog
%config(noreplace) %{_sysconfdir}/logrotate.d/iscsiuiolog
%files devel
%doc libiscsi/html
@ -267,6 +288,11 @@ fi
%{_includedir}/libiscsi.h
%changelog
* Sun Aug 18 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-10
- sync with upstream git, minor context fixes after rebase of out-of-tree patches
- iscsiuio is merged upstream, remove old source archive and patches
- spec cleanups to fix rpmlint issues
* Sun Aug 4 2013 Peter Robinson <pbrobinson@fedoraproject.org> 6.2.0.873-9
- Fix FTBFS, cleanup spec

View File

@ -1,2 +1 @@
8b8316d7c9469149a6cc6234478347f7 open-iscsi-2.0-873.tar.gz
22e8862a1aee0f3565b9caa4e22995f4 iscsiuio-0.7.2.1.tar.gz