Re: [PATCH 0/3] open-iscsi patchset to add iscsiuio

2013-05-28 Thread Mike Christie
On 02/15/2013 06:58 PM, Eddie Wai wrote:
 This patchset can be applied on top of the open-iscsi package
 to enable Broadcom's iSCSI offload user space tool 'iscsiuio'.
 
 This user space tool is used in conjunction with the following
 Broadcom Network Controllers to enable iSCSI offload functionality:
   bnx2:  BCM5706, BCM5708, BCM5709 devices
   bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E,
  BCM57800, BCM57810, BCM57840 devices
 
 Please use 'git apply' to apply the patches.  Otherwise, the
 file mode attribute will get lost.
 
 open-iscsi version: mainline
 iscsiuio version: 0.7.6.1g
 
 
 Eddie Wai (3):
   ISCSID: Added socket communication hooks for uip
   ISCSID: Modified the Makefile for iscsiuio compilation
   ISCSID: Added iscsiuio source to the open-iscsi pkg
 


Merged in commits

d571cdfc0b3c539310f43dc11d54d9308299efdc
b25533232e2eb35f0f1e4c4dc4ac4aefa05e0bf0
fcab9b7b116ea861a5ed58b36ae88a3154b779d4

I think there is just a issue with make clean and git diff. Clean does
not clean everything so git diff spits out those changes by accident.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCH 0/3] iscsiadm: Patches for iSCSI flash node mgmt support

2013-05-28 Thread Mike Christie
On 03/22/2013 06:35 AM, vikas.chaudh...@qlogic.com wrote:
 From: Vikas Chaudhary vikas.chaudh...@qlogic.com
 
 Mike,
 
 Following patches allows iscsiadm to manage iSCSI target information
 stored on adapter flash on per host basis and and perform various
 operations like add, delete, login, logout, and update the target
 information.
 
 Please merge these patches to open-iscsi.git tree at your earliest
 convenience.
 
 Adheer Chandravanshi (3):
   iscsiadm: Add flash node mgmt support.
   Manpage changes for flashnode submode support for host mode.
   README changes for flashnode submode support for host mode.
 
 Thanks,
 Vikas.
 

Merged in commit

42fa2585ff7a922ddea83d55aa7751a319cf29bf
d64f50de2bbddd49b0d5360877fa890d7d997584
3584b987dc8ff86c46b1ca58de35bd7627130968

I also picked up the fix for the bug Lee found in commit

ff4b2c1eb0058ed5e20aaddf7039d57715cebd57

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: PATCH 1 of 1] correctly check return value of nice()

2013-05-28 Thread Mike Christie
On 05/21/2013 04:16 PM, Lee Duncan wrote:
 The nice() call can return a negative value, since
 it returns the previous nice value.
 
 Signed-off-by: Lee Duncan leeman.dun...@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));
  
 


Merged in commit fdac3904c36f2d0bf0a096d533e483ec3be004d2

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCHv2 0/3] SUSE Patch that should be upstream

2013-05-28 Thread Mike Christie
On 03/08/2013 01:11 PM, Lee Duncan wrote:
 Here are 3 patches. The first one is a bug I found in how
 nice() return value is being checked, and the other two are
 patches that we have been carrying in the SUSE version of
 open-iscsi that I wanted to pass upstream.
 
 Lee Duncan:
 [PATCH 1/3] Fix check for return from nice call
 
 Hannes Reinecke:
 [PATCH 2/3] Allow firmware mode to use debug flag
 [PATCH 3/3] iscsiadm: return error when login fails 
 

Merged 2 and 3 in commit

6674fd4cf43d5fd2ce5a666e5172865e8d61d559
fc2a8e9a2911bc76f961fe3e4a159fab9b8b9691

Merged your other nice call fix.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCH 1/1] iscsiadm: bind ifaces to portals found using isns

2013-05-28 Thread Mike Christie
On 04/23/2013 06:55 PM, Mike Christie wrote:
 Sorry. I forgot to merge this patch. It even happens to patches I send
 myself :) When I get home this weekend I will merge it up and all the
 other outstanding patches that I have reviewed. I will also review the
 iscsi boot ones from Eddie.
 
 
 On 01/22/2013 09:44 AM, micha...@cs.wisc.edu wrote:
 From: Mike Christie micha...@cs.wisc.edu

 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 micha...@cs.wisc.edu
 ---


Merged in commit


8b338146812db9c8f5ddb9f508a74a652de12eef

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Antw: Re: [PATCH 0/3] open-iscsi patchset to add iscsiuio

2013-05-28 Thread Ulrich Windl
 Mike Christie micha...@cs.wisc.edu schrieb am 28.05.2013 um 10:19 in
Nachricht 51a4689b.1040...@cs.wisc.edu:
 On 02/15/2013 06:58 PM, Eddie Wai wrote:
 This patchset can be applied on top of the open-iscsi package
 to enable Broadcom's iSCSI offload user space tool 'iscsiuio'.
 
 This user space tool is used in conjunction with the following
 Broadcom Network Controllers to enable iSCSI offload functionality:
   bnx2:  BCM5706, BCM5708, BCM5709 devices
   bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E,
  BCM57800, BCM57810, BCM57840 devices
 
 Please use 'git apply' to apply the patches.  Otherwise, the
 file mode attribute will get lost.
 
 open-iscsi version: mainline
 iscsiuio version: 0.7.6.1g
 
 
 Eddie Wai (3):
   ISCSID: Added socket communication hooks for uip
   ISCSID: Modified the Makefile for iscsiuio compilation
   ISCSID: Added iscsiuio source to the open-iscsi pkg
 
 
 
 Merged in commits
 
 d571cdfc0b3c539310f43dc11d54d9308299efdc
 b25533232e2eb35f0f1e4c4dc4ac4aefa05e0bf0
 fcab9b7b116ea861a5ed58b36ae88a3154b779d4
 
 I think there is just a issue with make clean and git diff. Clean does
 not clean everything so git diff spits out those changes by accident.

Hi Mike!

I wonder: Doesn't git ignore untracked filed when diffing? If so, do you track 
generated content (that is expected to be cleaned)?
Maybe a git status after a make clean (on a clean tree) will show what is 
dirty...

Regards,
Ulrich


 
 -- 
 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?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCH 1/2] iscsiadm: Correct the comparison for invalid hostno in host mode

2013-05-28 Thread Mike Christie
On 04/05/2013 06:34 AM, vikas.chaudh...@qlogic.com wrote:
 From: Adheer Chandravanshi adheer.chandravan...@qlogic.com
 
 Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
 Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
 ---
  usr/iscsiadm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
 index 5a18522..f87f48c 100644
 --- a/usr/iscsiadm.c
 +++ b/usr/iscsiadm.c
 @@ -3016,7 +3016,7 @@ main(int argc, char **argv)
   if (sub_mode != -1) {
   switch (sub_mode) {
   case MODE_CHAP:
 - if (!op || !host_no) {
 + if (!op || (host_no == 0x)) {
   log_error(CHAP mode requires host 
   no and valid operation);
   rc = ISCSI_ERR_INVAL;
 @@ -3026,7 +3026,7 @@ main(int argc, char **argv)
  value);
   break;
   case MODE_FLASHNODE:
 - if (!host_no) {
 + if (host_no == 0x) {
   log_error(FLASHNODE mode requires host 
 no);
   rc = ISCSI_ERR_INVAL;
   break;
 

I merged the attached instead. It uses a define instead.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


diff --git a/usr/host.h b/usr/host.h
index 894ab91..bb65a77 100644
--- a/usr/host.h
+++ b/usr/host.h
@@ -5,6 +5,8 @@
 #include types.h
 #include config.h
 
+#define MAX_HOST_NO 0x
+
 #define MAX_CHAP_BUF_SZ 4096
 #define REQ_CHAP_BUF_SZ (MAX_CHAP_BUF_SZ + sizeof(struct iscsi_uevent))
 
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 84d5a27..7b257b9 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -3019,7 +3019,7 @@ main(int argc, char **argv)
if (sub_mode != -1) {
switch (sub_mode) {
case MODE_CHAP:
-   if (!op || !host_no) {
+   if (!op || (host_no == MAX_HOST_NO)) {
log_error(CHAP mode requires host 
no and valid operation);
rc = ISCSI_ERR_INVAL;
@@ -3029,7 +3029,7 @@ main(int argc, char **argv)
   value);
break;
case MODE_FLASHNODE:
-   if (!host_no) {
+   if (host_no == MAX_HOST_NO) {
log_error(FLASHNODE mode requires host 
no);
rc = ISCSI_ERR_INVAL;
break;


Re: [PATCH 1/2] iscsiadm: Correct the comparison for invalid hostno in host mode

2013-05-28 Thread Mike Christie
On 05/28/2013 03:27 AM, Mike Christie wrote:
 On 04/05/2013 06:34 AM, vikas.chaudh...@qlogic.com wrote:
 From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

 Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
 Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
 ---
  usr/iscsiadm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
 index 5a18522..f87f48c 100644
 --- a/usr/iscsiadm.c
 +++ b/usr/iscsiadm.c
 @@ -3016,7 +3016,7 @@ main(int argc, char **argv)
  if (sub_mode != -1) {
  switch (sub_mode) {
  case MODE_CHAP:
 -if (!op || !host_no) {
 +if (!op || (host_no == 0x)) {
  log_error(CHAP mode requires host 
  no and valid operation);
  rc = ISCSI_ERR_INVAL;
 @@ -3026,7 +3026,7 @@ main(int argc, char **argv)
 value);
  break;
  case MODE_FLASHNODE:
 -if (!host_no) {
 +if (host_no == 0x) {
  log_error(FLASHNODE mode requires host 
 no);
  rc = ISCSI_ERR_INVAL;
  break;

 
 I merged the attached instead. It uses a define instead.
 

Actually, this is wrong. I guess the host no in the kernel is now a
unsigned int, so 0x is a valid host no. I think we have to make
the host no a unin64_t?

Same for flashnode_idx. That should be fixed and the hard coding of the
max should be replaced with a define instead of hard coding 0x
in places like exec_flashnode_op.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Antw: Re: [PATCH 0/3] open-iscsi patchset to add iscsiuio

2013-05-28 Thread Mike Christie
On 05/28/2013 03:24 AM, Ulrich Windl wrote:
 Mike Christie micha...@cs.wisc.edu schrieb am 28.05.2013 um 10:19 in
 Nachricht 51a4689b.1040...@cs.wisc.edu:
 On 02/15/2013 06:58 PM, Eddie Wai wrote:
 This patchset can be applied on top of the open-iscsi package
 to enable Broadcom's iSCSI offload user space tool 'iscsiuio'.

 This user space tool is used in conjunction with the following
 Broadcom Network Controllers to enable iSCSI offload functionality:
   bnx2:  BCM5706, BCM5708, BCM5709 devices
   bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E,
  BCM57800, BCM57810, BCM57840 devices

 Please use 'git apply' to apply the patches.  Otherwise, the
 file mode attribute will get lost.

 open-iscsi version: mainline
 iscsiuio version: 0.7.6.1g


 Eddie Wai (3):
   ISCSID: Added socket communication hooks for uip
   ISCSID: Modified the Makefile for iscsiuio compilation
   ISCSID: Added iscsiuio source to the open-iscsi pkg



 Merged in commits

 d571cdfc0b3c539310f43dc11d54d9308299efdc
 b25533232e2eb35f0f1e4c4dc4ac4aefa05e0bf0
 fcab9b7b116ea861a5ed58b36ae88a3154b779d4

 I think there is just a issue with make clean and git diff. Clean does
 not clean everything so git diff spits out those changes by accident.
 
 Hi Mike!
 
 I wonder: Doesn't git ignore untracked filed when diffing? If so, do you 
 track generated content (that is expected to be cleaned)?

Yeah, it does.

I think we are not handling generated content correctly. I noticed the
issue with some other files too.


 Maybe a git status after a make clean (on a clean tree) will show what is 
 dirty...
 

Thanks. I will look into it.

 Regards,
 Ulrich
 
 

 -- 
 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?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 
 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Antw: Re: [PATCH 1/2] iscsiadm: Correct the comparison for invalid hostno in host mode

2013-05-28 Thread Ulrich Windl
 Mike Christie micha...@cs.wisc.edu schrieb am 28.05.2013 um 10:34 in
Nachricht 51a46c13.3030...@cs.wisc.edu:
 On 05/28/2013 03:27 AM, Mike Christie wrote:
 On 04/05/2013 06:34 AM, vikas.chaudh...@qlogic.com wrote:
 From: Adheer Chandravanshi adheer.chandravan...@qlogic.com

 Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
 Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
 ---
  usr/iscsiadm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
 index 5a18522..f87f48c 100644
 --- a/usr/iscsiadm.c
 +++ b/usr/iscsiadm.c
 @@ -3016,7 +3016,7 @@ main(int argc, char **argv)
 if (sub_mode != -1) {
 switch (sub_mode) {
 case MODE_CHAP:
 -   if (!op || !host_no) {
 +   if (!op || (host_no == 0x)) {
 log_error(CHAP mode requires host 
 no and valid operation);
 rc = ISCSI_ERR_INVAL;
 @@ -3026,7 +3026,7 @@ main(int argc, char **argv)
value);
 break;
 case MODE_FLASHNODE:
 -   if (!host_no) {
 +   if (host_no == 0x) {
 log_error(FLASHNODE mode requires host 
 no);
 rc = ISCSI_ERR_INVAL;
 break;

 
 I merged the attached instead. It uses a define instead.
 
 
 Actually, this is wrong. I guess the host no in the kernel is now a
 unsigned int, so 0x is a valid host no. I think we have to make
 the host no a unin64_t?

Whatever it is or will be: It seems to be a good reason for a macro like 
#define valid_host_no(h) ((h) != whatever)
I away wonder whether 0x is (unsigned) -1. I would avoid concrete 
bits as much as possible...

 
 Same for flashnode_idx. That should be fixed and the hard coding of the
 max should be replaced with a define instead of hard coding 0x
 in places like exec_flashnode_op.
 
 -- 
 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?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Antw: Re: [PATCH 1/2] iscsiadm: Correct the comparison for invalid hostno in host mode

2013-05-28 Thread Ulrich Windl
 I wrote a moment ago:
[...]
 I away wonder whether 0x is (unsigned) -1. I would avoid concrete 

away was meant to read always: Isn't it interesting how a tired mind works? 
;-) Sorry for the bad typing!

 bits as much as possible...
[...]


-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCH v4 2/3] ISCSID: Added the extraction of the session boot info

2013-05-28 Thread Mike Christie
On 04/12/2013 12:41 PM, Eddie Wai wrote:
 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@broadcom.com
 ---
  usr/iscsi_sysfs.c |   40 
  usr/transport.c   |2 ++
  usr/transport.h   |1 +
  3 files changed, 43 insertions(+), 0 deletions(-)
 
 diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
 index 4015b35..91c3989 100644
 --- a/usr/iscsi_sysfs.c
 +++ b/usr/iscsi_sysfs.c
 @@ -439,6 +439,43 @@ uint32_t iscsi_sysfs_get_host_no_from_hwinfo(struct 
 iface_rec *iface, int *rc)
   return host_no;
  }
  
 +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
 @@ -567,6 +604,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);
 +

I forgot what we were saying for this. For the running boot session is
it possible to change the network settings while the session is running?
If so then this would print the old info (info used for boot that might
not be currently used) right? Was this ok?

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCH v4 2/3] ISCSID: Added the extraction of the session boot info

2013-05-28 Thread Eddie Wai

On Tue, 2013-05-28 at 04:05 -0500, Mike Christie wrote:
 On 04/12/2013 12:41 PM, Eddie Wai wrote:
  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@broadcom.com
  ---
   usr/iscsi_sysfs.c |   40 
   usr/transport.c   |2 ++
   usr/transport.h   |1 +
   3 files changed, 43 insertions(+), 0 deletions(-)
  
  diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
  index 4015b35..91c3989 100644
  --- a/usr/iscsi_sysfs.c
  +++ b/usr/iscsi_sysfs.c
  @@ -439,6 +439,43 @@ uint32_t iscsi_sysfs_get_host_no_from_hwinfo(struct 
  iface_rec *iface, int *rc)
  return host_no;
   }
   
  +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
  @@ -567,6 +604,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);
  +
 
 I forgot what we were saying for this. For the running boot session is
 it possible to change the network settings while the session is running?
 If so then this would print the old info (info used for boot that might
 not be currently used) right? Was this ok?
I'm not sure if this applies to iscsi_tcp or not, but for bnx2i, the
boot session network settings cannot be altered once its booted.  So the
print out will follow the boot params; which is also the currently used
params.

 
 


-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [PATCH v4 2/3] ISCSID: Added the extraction of the session boot info

2013-05-28 Thread Mike Christie
On 05/28/2013 12:07 PM, Eddie Wai wrote:
 
 On Tue, 2013-05-28 at 04:05 -0500, Mike Christie wrote:
 On 04/12/2013 12:41 PM, Eddie Wai wrote:
 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@broadcom.com
 ---
  usr/iscsi_sysfs.c |   40 
  usr/transport.c   |2 ++
  usr/transport.h   |1 +
  3 files changed, 43 insertions(+), 0 deletions(-)

 diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
 index 4015b35..91c3989 100644
 --- a/usr/iscsi_sysfs.c
 +++ b/usr/iscsi_sysfs.c
 @@ -439,6 +439,43 @@ uint32_t iscsi_sysfs_get_host_no_from_hwinfo(struct 
 iface_rec *iface, int *rc)
 return host_no;
  }
  
 +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
 @@ -567,6 +604,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);
 +

 I forgot what we were saying for this. For the running boot session is
 it possible to change the network settings while the session is running?
 If so then this would print the old info (info used for boot that might
 not be currently used) right? Was this ok?
 I'm not sure if this applies to iscsi_tcp or not, but for bnx2i, the
 boot session network settings cannot be altered once its booted.  So the
 print out will follow the boot params; which is also the currently used
 params.

For tcp we can. Let's just set use_boot_info for bnx2i for now. Let me
think about tcp some more or let someone complain :)

I think it then looks ok. Or, at least I do not remember if I had other
concerns about it :) So send kernel stuff upstream. I can actually hand
edit the userspace patches to remove the tcp use_boot_info bit if these
patches are ok with you.

Thanks.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [RFC_V5 PATCH 1/3] scsi_transport_iscsi: Add flash node mgmt support

2013-05-28 Thread Eddie Wai
Hello Mike, Vikas, and all,

Thanks for the great work in creating the flash node mechanism!

To extend the conversation we had to add support for software and other
offload solutions that requires iscsid/iscsiadm to create the sessions,
the following needs to be further discussed:

1. Flash node creation.

The current solution relies on the transport driver to initiate the
flash node sysfs creation upon iscsi_host allocation.  This presents a
fundamental problem for software iSCSI as new iscsi_host instance won't
get created until there's a session initiation.

Per our conversation, I think it makes sense to move the flash node
initiation code altogether to a separate module like how its done for
ibft.  The new module shall cycle through each existing iSCSI host and
query the corresponding transport to fill the flash node sysfs entries
specific to that host.  Perhaps via a new transport callback or so.

Since there won't be any pre-existing host created for software iSCSI,
this needs to be handled differently.  Instead, the new module will also
need to cycle through each network interfaces present and query for the
flash node content separately.

To accomplish this, each network interface will need to be made aware of
flash nodes and also provide a way for the new module to read out the
flash node content.  Per our conversation, this can be done via an
extension of the ethtool utility.  For unsupported network drivers, this
call will simply return an unsupported ethtool extension error.  For
others, it can return a memory pointer to the flash node content.

Additionally, the net tools must also provide a way for these net params
to be populated to the corresponding network interfaces.  This needs
further discussion.


2. Initiator iSCSI/network params.

The current solution does not provide any means to link initiator
parameters to the associated flash nodes.

In order to resolve this, new initiator entries will need to be created
alongside or inside these flash node sysfs entries.  The content and
naming will somewhat follow our last conversation of creating
corresponding entries inside the iscsi_flashnode sysfs as follows:

/sys/bus/iscsi_flashnode/devices/flashnode_initiator-host_no:flashnode_id/
initiator attrs

Offload solutions that doesn't need to use this can ignore these
initiator entries.


3. Connection initiation.

The current solution provides 2 ways to initiate the connection to these
flash node targets; initiate from inside the driver, or via the iscsiadm
flash node login command.
 
This posts a problem for software iSCSI and other offload solutions as
they do not conventionally initiate a connection from within the driver.

One way to resolve this is to augment the iscsi tool to loop through
these entries and create the sessions automatically upon start-up.

We can simply add a transport switch here for offload solutions that
doesn't want/need this.


Comments welcome!  Thanks.

Eddie


On Tue, 2013-02-19 at 07:05 -0500, vikas.chaudh...@qlogic.com wrote:
 From: Adheer Chandravanshi adheer.chandravan...@qlogic.com
 
 This patch allows iscsiadm to manage iSCSI target information stored on
 adapter flash on per host basis.
 
 The sysfs entries will look as cited below:
 
 /sys/bus/iscsi_flashnode/devices/flashnode_sess-host_no:flashnode_id/session
  attrs
 
 /sys/bus/iscsi_flashnode/devices/flashnode_conn-host_no:flashnode_id:conn_id/conn
  attrs
 
 Signed-off-by: Adheer Chandravanshi adheer.chandravan...@qlogic.com
 Signed-off-by: Manish Rangankar manish.rangan...@qlogic.com
 Signed-off-by: Vikas Chaudhary vikas.chaudh...@qlogic.com
 ---
  drivers/scsi/scsi_transport_iscsi.c |  998 
 ++-
  include/scsi/iscsi_if.h |  112 
  include/scsi/scsi_transport_iscsi.h |  150 ++
  3 files changed, 1259 insertions(+), 1 deletions(-)
 



-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.