[PATCH v3] Add user interface for dynamic reconfiguration

2014-11-11 Thread Tomoaki Nishimura
Add user interface for dynamic reconfiguration (USERSPACE TODO ITEM #3).

Note1:
Examples of the user interface in this patch is as follows. 
 
 # iscsiadm -m session -o update -n PARAM_NAME -v VALUE 
 = Update node DB and session parameter in all running sessions. 

 # iscsiadm -m session -o nonpersistent -n PARAM_NAME -v VALUE 
 = Update session parameter in all running sessions (not update node DB). 

 # iscsiadm -m session -o update -n PARAM_NAME -v VALUE -r SESSION_ID 
 = Update node DB and session parameter in a specified session. 

 # iscsiadm -m session -o nonpersistent -n PARAM_NAME -v VALUE -r 
SESSION_ID 
 = Update session parameter in a specified session (not update node DB). 


Note2:
This patch makes following parameters to be modifiable in running sessions.
 
 node.session.timeo.replacement_timeout
 node.session.iscsi.FastAbort
 node.session.err_timeo.abort_timeout
 node.session.err_timeo.lu_reset_timeout
 node.session.err_timeo.tgt_reset_timeout
 node.conn[0].timeo.noop_out_timeout
 node.conn[0].timeo.noop_out_interval


v2:
- Bug fixes and Misc cleanups.
v3:
- Add iscsi_session_update_params() in initiator_common.c and replace
  iscsi_session_set_params() with iscsi_session_update_params() in
  mgmt_ipc_session_update().
- Make it possible to set node.session.timeo.replacement_timeout to -1.

Signed-off-by: Tomoaki Nishimura t-nishim...@hf.jp.nec.com
---
 usr/config.h   |   3 +
 usr/initiator.h|   2 +
 usr/initiator_common.c |  88 
 usr/iscsiadm.c | 154 +++--
 usr/mgmt_ipc.c |  56 ++
 usr/mgmt_ipc.h |   1 +
 6 files changed, 300 insertions(+), 4 deletions(-)

diff --git a/usr/config.h b/usr/config.h
index fd31a54..93a84ac 100644
--- a/usr/config.h
+++ b/usr/config.h
@@ -39,6 +39,9 @@
 /* max len of interface */
 #define ISCSI_MAX_IFACE_LEN65
 
+/* flag of excluded session update */
+#define NO_UPDATE  -2
+
 /* the following structures store the options set in the config file.
  * a structure is defined for each logically-related group of options.
  * if you are adding a new option, first check if it should belong
diff --git a/usr/initiator.h b/usr/initiator.h
index c34625b..cefcfbc 100644
--- a/usr/initiator.h
+++ b/usr/initiator.h
@@ -359,5 +359,7 @@ extern int iscsi_set_net_config(struct iscsi_transport *t,
iscsi_session_t *session,
struct iface_rec *iface);
 extern void iscsi_session_init_params(struct iscsi_session *session);
+extern int iscsi_session_update_params(struct iscsi_conn *conn,
+   node_rec_t *rec);
 
 #endif /* INITIATOR_H */
diff --git a/usr/initiator_common.c b/usr/initiator_common.c
index 8ff993d..bfa1ed7 100644
--- a/usr/initiator_common.c
+++ b/usr/initiator_common.c
@@ -637,6 +637,94 @@ TODO handle this
return 0;
 }
 
+#define MAX_UPDATE_PARAMS 7
+
+int iscsi_session_update_params(struct iscsi_conn *conn, node_rec_t *rec)
+{
+   struct iscsi_session *session = conn-session;
+   int i, rc;
+struct connparam {
+ int param;
+ int type;
+ void *value;
+ int conn_only;
+} conntbl[MAX_UPDATE_PARAMS] = {
+ {
+   .param = ISCSI_PARAM_SESS_RECOVERY_TMO,
+   .value = rec-session.timeo.replacement_timeout,
+   .type = ISCSI_INT,
+   .conn_only = 0,
+ }, {
+   .param = ISCSI_PARAM_FAST_ABORT,
+   .value = rec-session.iscsi.FastAbort,
+   .type = ISCSI_INT,
+   .conn_only = 0,
+ }, {
+   .param = ISCSI_PARAM_ABORT_TMO,
+   .value = rec-session.err_timeo.abort_timeout,
+   .type = ISCSI_INT,
+   .conn_only = 0,
+ }, {
+   .param = ISCSI_PARAM_LU_RESET_TMO,
+   .value = rec-session.err_timeo.lu_reset_timeout,
+   .type = ISCSI_INT,
+   .conn_only = 0,
+ }, {
+   .param = ISCSI_PARAM_TGT_RESET_TMO,
+   .value = rec-session.err_timeo.tgt_reset_timeout,
+   .type = ISCSI_INT,
+   .conn_only = 0,
+ }, {
+   .param = ISCSI_PARAM_PING_TMO,
+   .value = rec-conn[conn-id].timeo.noop_out_timeout,
+   .type = ISCSI_INT,
+   .conn_only = 1,
+ }, {
+   .param = ISCSI_PARAM_RECV_TMO,
+   .value = rec-conn[conn-id].timeo.noop_out_interval,
+   

Re: [PATCHES] Fixup iBFT and IPv6, some cleanup

2014-11-11 Thread Mike Christie
On 10/30/2014 08:16 PM, The Lee-Man wrote:
 0003-fwparam_ibft-Check-iBFT-target-and-NIC-flags.patch
 
 This was the patch that you had problems with last time, and
 for good reason, as it checks iBFT flags for Bit-0, as per the
 iBFT standard, but as you pointed out many adapters don't
 follow the standard and instead set Bit-1. So now we just check
 for any bit being set. This *has* been tested with more adapters.

Did you by any chance take note of what cards do what? Mostly interested
in bnx2i, cxgb*i, intel, and the ibm boxes with the initiator on them.

If you do not know, do not worry. Just wanted to document it somewhere
if we knew.


-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCHES] Fixup iBFT and IPv6, some cleanup

2014-11-11 Thread Mike Christie
On 10/30/2014 08:16 PM, The Lee-Man wrote:
 0002-Represent-DHCP-origin-as-an-integer-not-string.patch
 
 This just changes the origin attribute from a string, to a number,
 which
 is what it really is.
 

Could you send me a link to where origin is defined? In the doc I have
it is a dead link.

 0004-Fixup-IPv6-iBFT-interface-description.patch
 
 This patch adds prefix-len to the open-iscsi attributes, as it
 is needed for IPv6, which doesn't use mask like IPv4 does.
 

Could you send me a link to the prefix-len kernel patch that you guys
did, or did you reply the mail where I was asking what is it (if so I
cannot find it)? For the offload drivers that simulate ibft did they
report the correct value in your kernel patch?

-- 
You received this message because you are subscribed to the Google Groups 
open-iscsi group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.