Re: iscsi_sysfs_read_iface

2011-08-01 Thread Mike Christie
On 07/26/2011 01:38 AM, Hannes Reinecke wrote:
> diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
> index e82fe80..145816d 100644
> --- a/usr/iscsi_sysfs.c
> +++ b/usr/iscsi_sysfs.c
> @@ -489,7 +489,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec
> *iface, int host_no,
> if (ret) {
> ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "initiatorname",
> iface->iname, sizeof(iface->iname));
> -   if (ret)
> +   if (ret) {
> /*
>  * default iname is picked up later from
>  * initiatorname.iscsi if software/partial-offload.
> @@ -499,6 +499,8 @@ static int iscsi_sysfs_read_iface(struct iface_rec
> *iface, int host_no,
>  */
> log_debug(7, "Could not read initiatorname for "
>   "host%d\n", host_no);
> +   ret = 0;
> +   }
> }
> 

Added in commit 4cc22470d5a1391108f329842f63ff3c31ccd288. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: iscsi_sysfs_read_iface

2011-07-27 Thread Mike Christie
On 07/27/2011 01:34 AM, Hannes Reinecke wrote:
> And actually I'm working on an 'iscsi_offload' scripts which configures
> the interface definitions for the various offload engines. If there is
> enough interest maybe we should include it in the open-iscsi tarball.
> 

Ok my me.

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: iscsi_sysfs_read_iface

2011-07-27 Thread Ravi Anand
On Jul 26, 2011, at 11:34 PM, Hannes Reinecke wrote:
> On 07/26/2011 09:44 PM, Mike Christie wrote:
>> On 07/26/2011 01:38 AM, Hannes Reinecke wrote:
>>> Hi Eddie,
>>>
>>> you beat me to it ...
>>>
>>> On 07/26/2011 02:28 AM, Eddie Wai wrote:
 Hello Mike,

 The following snippet from the 39d4ceb04f051c208ae7509d268a3871ffa194c5
 commit is preventing bnx2i from being able to offload when connecting
 through the iscsi_sysfs_get_hostinfo_by_host_no code path where the
 session argument == NULL.  The initiatorname sysfs inquiry failed but
 this is expected since it does not exist in the iscsi_host for bnx2i.

 Perhaps the error return code should only be propagated upward when
 session != NULL specifically for hbas like qla4xxx?

 Thanks,
 Eddie

 - 8<   - 8<   -
 @@ -527,7 +528,10 @@ static int iscsi_sysfs_read_iface(struct iface_rec
 *iface, int host_no,
iface_str(iface));
  }
  }
 -   return ret;
 +   if (ret)
 +   return ISCSI_ERR_SYSFS_LOOKUP;
 +   else
 +   return 0;
   }
 - 8<   - 8<   -
>>> Actually, this is the patch I have:
>>>
>>> diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
>>> index e82fe80..145816d 100644
>>> --- a/usr/iscsi_sysfs.c
>>> +++ b/usr/iscsi_sysfs.c
>>> @@ -489,7 +489,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec
>>> *iface, int host_no,
>>> if (ret) {
>>> ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "initiatorname",
>>> iface->iname, sizeof(iface->iname));
>>> -   if (ret)
>>> +   if (ret) {
>>> /*
>>>  * default iname is picked up later from
>>>  * initiatorname.iscsi if software/partial-offload.
>>> @@ -499,6 +499,8 @@ static int iscsi_sysfs_read_iface(struct iface_rec
>>> *iface, int host_no,
>>>  */
>>> log_debug(7, "Could not read initiatorname for "
>>>   "host%d\n", host_no);
>>> +   ret = 0;
>>> +   }
>>> }
>>>
>>> /*
>>>
>>> (Well, of course it got line-wrapped, but should get you the idea).
>>>
>>> I'll be sending the proper patch to the mailing-list shortly.
>>> But yes, that is a real issue.
>>
>> Yeah, this is right. That is the behavior we had before. I can just fix
>> this up and merge it if there were no other changes needed.
> Not in this area, no.
>
> I've got some minor patches to the SUSE init script but they still
> need further testing.
>
> And actually I'm working on an 'iscsi_offload' scripts which
> configures the interface definitions for the various offload
> engines. If there is enough interest maybe we should include it in
> the open-iscsi tarball.
>
I think this is a good idea.

Ravi



This message and any attached documents contain information from QLogic 
Corporation or its wholly-owned subsidiaries that may be confidential. If you 
are not the intended recipient, you may not read, copy, distribute, or use this 
information. If you have received this transmission in error, please notify the 
sender immediately by reply e-mail and then delete this message.

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: iscsi_sysfs_read_iface

2011-07-26 Thread Hannes Reinecke

On 07/26/2011 09:44 PM, Mike Christie wrote:

On 07/26/2011 01:38 AM, Hannes Reinecke wrote:

Hi Eddie,

you beat me to it ...

On 07/26/2011 02:28 AM, Eddie Wai wrote:

Hello Mike,

The following snippet from the 39d4ceb04f051c208ae7509d268a3871ffa194c5
commit is preventing bnx2i from being able to offload when connecting
through the iscsi_sysfs_get_hostinfo_by_host_no code path where the
session argument == NULL.  The initiatorname sysfs inquiry failed but
this is expected since it does not exist in the iscsi_host for bnx2i.

Perhaps the error return code should only be propagated upward when
session != NULL specifically for hbas like qla4xxx?

Thanks,
Eddie

- 8<   - 8<   -
@@ -527,7 +528,10 @@ static int iscsi_sysfs_read_iface(struct iface_rec
*iface, int host_no,
iface_str(iface));
  }
  }
-   return ret;
+   if (ret)
+   return ISCSI_ERR_SYSFS_LOOKUP;
+   else
+   return 0;
   }
- 8<   - 8<   -

Actually, this is the patch I have:

diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index e82fe80..145816d 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -489,7 +489,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec
*iface, int host_no,
 if (ret) {
 ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "initiatorname",
 iface->iname, sizeof(iface->iname));
-   if (ret)
+   if (ret) {
 /*
  * default iname is picked up later from
  * initiatorname.iscsi if software/partial-offload.
@@ -499,6 +499,8 @@ static int iscsi_sysfs_read_iface(struct iface_rec
*iface, int host_no,
  */
 log_debug(7, "Could not read initiatorname for "
   "host%d\n", host_no);
+   ret = 0;
+   }
 }

 /*

(Well, of course it got line-wrapped, but should get you the idea).

I'll be sending the proper patch to the mailing-list shortly.
But yes, that is a real issue.


Yeah, this is right. That is the behavior we had before. I can just fix
this up and merge it if there were no other changes needed.

Not in this area, no.

I've got some minor patches to the SUSE init script but they still 
need further testing.


And actually I'm working on an 'iscsi_offload' scripts which 
configures the interface definitions for the various offload 
engines. If there is enough interest maybe we should include it in 
the open-iscsi tarball.


Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: iscsi_sysfs_read_iface

2011-07-26 Thread Mike Christie
On 07/26/2011 01:38 AM, Hannes Reinecke wrote:
> Hi Eddie,
> 
> you beat me to it ...
> 
> On 07/26/2011 02:28 AM, Eddie Wai wrote:
>> Hello Mike,
>>
>> The following snippet from the 39d4ceb04f051c208ae7509d268a3871ffa194c5
>> commit is preventing bnx2i from being able to offload when connecting
>> through the iscsi_sysfs_get_hostinfo_by_host_no code path where the
>> session argument == NULL.  The initiatorname sysfs inquiry failed but
>> this is expected since it does not exist in the iscsi_host for bnx2i.
>>
>> Perhaps the error return code should only be propagated upward when
>> session != NULL specifically for hbas like qla4xxx?
>>
>> Thanks,
>> Eddie
>>
>> - 8<  - 8<  -
>> @@ -527,7 +528,10 @@ static int iscsi_sysfs_read_iface(struct iface_rec
>> *iface, int host_no,
>>iface_str(iface));
>>  }
>>  }
>> -   return ret;
>> +   if (ret)
>> +   return ISCSI_ERR_SYSFS_LOOKUP;
>> +   else
>> +   return 0;
>>   }
>> - 8<  - 8<  -
> Actually, this is the patch I have:
> 
> diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
> index e82fe80..145816d 100644
> --- a/usr/iscsi_sysfs.c
> +++ b/usr/iscsi_sysfs.c
> @@ -489,7 +489,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec
> *iface, int host_no,
> if (ret) {
> ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, "initiatorname",
> iface->iname, sizeof(iface->iname));
> -   if (ret)
> +   if (ret) {
> /*
>  * default iname is picked up later from
>  * initiatorname.iscsi if software/partial-offload.
> @@ -499,6 +499,8 @@ static int iscsi_sysfs_read_iface(struct iface_rec
> *iface, int host_no,
>  */
> log_debug(7, "Could not read initiatorname for "
>   "host%d\n", host_no);
> +   ret = 0;
> +   }
> }
> 
> /*
> 
> (Well, of course it got line-wrapped, but should get you the idea).
> 
> I'll be sending the proper patch to the mailing-list shortly.
> But yes, that is a real issue.

Yeah, this is right. That is the behavior we had before. I can just fix
this up and merge it if there were no other changes needed.

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.



Re: iscsi_sysfs_read_iface

2011-07-25 Thread Hannes Reinecke

Hi Eddie,

you beat me to it ...

On 07/26/2011 02:28 AM, Eddie Wai wrote:

Hello Mike,

The following snippet from the 39d4ceb04f051c208ae7509d268a3871ffa194c5
commit is preventing bnx2i from being able to offload when connecting
through the iscsi_sysfs_get_hostinfo_by_host_no code path where the
session argument == NULL.  The initiatorname sysfs inquiry failed but
this is expected since it does not exist in the iscsi_host for bnx2i.

Perhaps the error return code should only be propagated upward when
session != NULL specifically for hbas like qla4xxx?

Thanks,
Eddie

- 8<  - 8<  -
@@ -527,7 +528,10 @@ static int iscsi_sysfs_read_iface(struct iface_rec
*iface, int host_no,
   iface_str(iface));
 }
 }
-   return ret;
+   if (ret)
+   return ISCSI_ERR_SYSFS_LOOKUP;
+   else
+   return 0;
  }
- 8<  - 8<  -

Actually, this is the patch I have:

diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index e82fe80..145816d 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -489,7 +489,7 @@ static int iscsi_sysfs_read_iface(struct 
iface_rec *iface, int host_no,

if (ret) {
ret = sysfs_get_str(id, ISCSI_HOST_SUBSYS, 
"initiatorname",
iface->iname, 
sizeof(iface->iname));

-   if (ret)
+   if (ret) {
/*
 * default iname is picked up later from
 * initiatorname.iscsi if 
software/partial-offload.
@@ -499,6 +499,8 @@ static int iscsi_sysfs_read_iface(struct 
iface_rec *iface, int host_no,

 */
log_debug(7, "Could not read initiatorname 
for "

  "host%d\n", host_no);
+   ret = 0;
+   }
}

/*

(Well, of course it got line-wrapped, but should get you the idea).

I'll be sending the proper patch to the mailing-list shortly.
But yes, that is a real issue.
Independent on any bnx2i; any offloading engine _not_ listing the 
initiatorname as a host attribute will fail.

Not nice.

Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.