Re: [PATCH V1] IB/iser: Add Discovery support

2013-08-08 Thread Or Gerlitz

On 31/07/2013 18:58, Michael Christie wrote:

On Jul 31, 2013, at 5:35 AM, Or Gerlitz  wrote:


To run discovery over iSER we need to advertize the CAP_TEXT_NEGO capability
towards user space. Also need to make sure the login RX buffer is posted when
SendTargets TEXT PDUs are sent. For that end, we use a setting of the
ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this is discovery
session.

Signed-off-by: Or Gerlitz 
---

changes from V0:

- applied feedback from Mike
-- moved the iscsi_set_param part to libiscsi.c
-- advertize ISCSI_PARAM_DISCOVERY_SESS too in iser_attr_is_visible

To apply this patch need to pick these two patches

[PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi session and 
connection in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&w=2

[PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and connection 
in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&q=raw

Patch looks ok to me. Did you intend for me to pass this along to 
linux-scsi/James or did you mean to cc that list or were you going to resend to 
that list? Let me know what you prefer. It does not matter to me.



Mike,


Just before hitting the send button to James, I noticed that the patch 
introduced this build warning


CC [M]  drivers/scsi/libiscsi.o
drivers/scsi/libiscsi.c: In function ?iscsi_set_param?:
drivers/scsi/libiscsi.c:3268: warning: format %u expects type unsigned 
int *, but argument 3 has type uint8_t *


So I changed the code to do the reading in two stages, hope this is OK 
with you


I also tested against V2 of the pre-patches this patch require


diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b3ff1bb..f17a692 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -3170,6 +3170,7 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
 {
struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_session *session = conn->session;
+   int val;

switch(param) {
case ISCSI_PARAM_FAST_ABORT:
@@ -3265,7 +3266,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
return 
iscsi_switch_str_param(&session->discovery_parent_type,

  buf);
case ISCSI_PARAM_DISCOVERY_SESS:
-   sscanf(buf, "%u", &session->discovery_sess);
+   sscanf(buf, "%d", &val);
+   session->discovery_sess = !!val;
break;
default:
return -ENOSYS;

--
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/groups/opt_out.


Re: [PATCH V1] IB/iser: Add Discovery support

2013-08-03 Thread Or Gerlitz
On Sat, Aug 3, 2013 at 10:40 PM, Mike Christie  wrote:
> On 08/01/2013 05:58 AM, Or Gerlitz wrote:

>> Could you coach me if/how to use the kernel patch or whatever the
>> fastest way to come up with the user space patch?

> I am not completely sure what info you need so let me know if you need more.
>
> - Take the needed include pieces and submit a patch against the
> open-iscsi/include code. Do not worry about touching the
> open-iscsi/kernel code. It is only for old kernels/distros and is not udpated.
> - Modify the open-isccsi/usr initiator_common.c (I think that was the
> file or was it the discovery.c one) related code as needed.
> - Run against a kernel with your patches and Qlogic's patches for testing.
> Does that answer your question?

Yes,  I will look on doing that tomorrow, so the only needed pieces
are the includes and a set_param call to set the session type, cool.

-- 
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/groups/opt_out.




Re: [PATCH V1] IB/iser: Add Discovery support

2013-08-03 Thread Mike Christie
On 08/01/2013 05:58 AM, Or Gerlitz wrote:
> On 31/07/2013 19:54, Mike Christie wrote:
>> Just send to linux-scsi. When it goes there I will respond to the mail
>> with a Reviewed-by email.
> 
> Thanks, will do that.
> 
> So now what about the user space part... as minimum we need to apply the
> relevant parts from
> patch 1/4 below, that is add new params to iscsi_if.h and actually what
> else besides calling down to set param of ISCSI_PARAM_DISCOVERY_SESS
> from within the
> discovery code.
> 
> Could you coach me if/how to use the kernel patch or whatever the
> fastest way to come up
> with the user space patch?
> 

I am not completely sure what info you need so let me know if you need more.

- Take the needed include pieces and submit a patch against the
open-iscsi/include code. Do not worry about touching the
open-iscsi/kernel code. It is only for old kernels/distros and is not
udpated.
- Modify the open-isccsi/usr initiator_common.c (I think that was the
file or was it the discovery.c one) related code as needed.
- Run against a kernel with your patches and Qlogic's patches for testing.

Does that answer your question?

-- 
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/groups/opt_out.




Re: [PATCH V1] IB/iser: Add Discovery support

2013-08-01 Thread Or Gerlitz

On 31/07/2013 19:54, Mike Christie wrote:
Just send to linux-scsi. When it goes there I will respond to the mail 
with a Reviewed-by email.


Thanks, will do that.

So now what about the user space part... as minimum we need to apply the 
relevant parts from

patch 1/4 below, that is add new params to iscsi_if.h and actually what
else besides calling down to set param of ISCSI_PARAM_DISCOVERY_SESS 
from within the

discovery code.

Could you coach me if/how to use the kernel patch or whatever the 
fastest way to come up

with the user space patch?


Or.



To apply this patch need to pick these two patches

[PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi session and 
connection in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&w=2

[PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and connection 
in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&q=raw




--
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/groups/opt_out.




Re: [PATCH V1] IB/iser: Add Discovery support

2013-07-31 Thread Mike Christie
On 07/31/2013 11:18 AM, Or Gerlitz wrote:
> On Wed, Jul 31, 2013 at 6:58 PM, Michael Christie  > wrote:
> 
> 
> On Jul 31, 2013, at 5:35 AM, Or Gerlitz  > wrote:
> 
> > To run discovery over iSER we need to advertize the CAP_TEXT_NEGO
> capability
> > towards user space. Also need to make sure the login RX buffer is
> posted when
> > SendTargets TEXT PDUs are sent. For that end, we use a setting of the
> > ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this
> is discovery
> > session.
> >
> > Signed-off-by: Or Gerlitz  >
> > ---
> >
> > changes from V0:
> >
> > - applied feedback from Mike
> > -- moved the iscsi_set_param part to libiscsi.c
> > -- advertize ISCSI_PARAM_DISCOVERY_SESS too in iser_attr_is_visible
> >
> > To apply this patch need to pick these two patches
> >
> > [PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi
> session and connection in sysfs
> > http://marc.info/?l=linux-scsi&m=137225028829588&w=2
> >
> > [PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and
> connection in sysfs
> > http://marc.info/?l=linux-scsi&m=137225028829588&q=raw
> 
> Patch looks ok to me. Did you intend for me to pass this along to
> linux-scsi/James or did you mean to cc that list or were you going
> to resend to that list? Let me know what you prefer. It does not
> matter to me.
> 
> 
> 
> 
> I wanted to get your review so when I send to James I can add your ack
> or signature... which should I add?
> 

Just send to linux-scsi. When it goes there I will respond to the mail
with a Reviewed-by email. That sequence seems to be most successful. If
you send to the list with my Reviewed/Acked line already on it, I have
noticed James will sometimes not pick it up. It might be due to his
email rules/filters.

-- 
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/groups/opt_out.




Re: [PATCH V1] IB/iser: Add Discovery support

2013-07-31 Thread Or Gerlitz
On Wed, Jul 31, 2013 at 6:58 PM, Michael Christie wrote:

>
> On Jul 31, 2013, at 5:35 AM, Or Gerlitz  wrote:
>
> > To run discovery over iSER we need to advertize the CAP_TEXT_NEGO
> capability
> > towards user space. Also need to make sure the login RX buffer is posted
> when
> > SendTargets TEXT PDUs are sent. For that end, we use a setting of the
> > ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this is
> discovery
> > session.
> >
> > Signed-off-by: Or Gerlitz 
> > ---
> >
> > changes from V0:
> >
> > - applied feedback from Mike
> > -- moved the iscsi_set_param part to libiscsi.c
> > -- advertize ISCSI_PARAM_DISCOVERY_SESS too in iser_attr_is_visible
> >
> > To apply this patch need to pick these two patches
> >
> > [PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi
> session and connection in sysfs
> > http://marc.info/?l=linux-scsi&m=137225028829588&w=2
> >
> > [PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and
> connection in sysfs
> > http://marc.info/?l=linux-scsi&m=137225028829588&q=raw
>
> Patch looks ok to me. Did you intend for me to pass this along to
> linux-scsi/James or did you mean to cc that list or were you going to
> resend to that list? Let me know what you prefer. It does not matter to me.
>



I wanted to get your review so when I send to James I can add your ack or
signature... which should I add?

-- 
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/groups/opt_out.




Re: [PATCH V1] IB/iser: Add Discovery support

2013-07-31 Thread Michael Christie

On Jul 31, 2013, at 5:35 AM, Or Gerlitz  wrote:

> To run discovery over iSER we need to advertize the CAP_TEXT_NEGO capability
> towards user space. Also need to make sure the login RX buffer is posted when
> SendTargets TEXT PDUs are sent. For that end, we use a setting of the
> ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this is 
> discovery 
> session.
> 
> Signed-off-by: Or Gerlitz 
> ---
> 
> changes from V0:
> 
> - applied feedback from Mike
> -- moved the iscsi_set_param part to libiscsi.c
> -- advertize ISCSI_PARAM_DISCOVERY_SESS too in iser_attr_is_visible
> 
> To apply this patch need to pick these two patches
> 
> [PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi session 
> and connection in sysfs
> http://marc.info/?l=linux-scsi&m=137225028829588&w=2
> 
> [PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and connection 
> in sysfs
> http://marc.info/?l=linux-scsi&m=137225028829588&q=raw

Patch looks ok to me. Did you intend for me to pass this along to 
linux-scsi/James or did you mean to cc that list or were you going to resend to 
that list? Let me know what you prefer. It does not matter to me.

-- 
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/groups/opt_out.




[PATCH V1] IB/iser: Add Discovery support

2013-07-31 Thread Or Gerlitz
To run discovery over iSER we need to advertize the CAP_TEXT_NEGO capability
towards user space. Also need to make sure the login RX buffer is posted when
SendTargets TEXT PDUs are sent. For that end, we use a setting of the
ISCSI_PARAM_DISCOVERY_SESS iscsi param as an indication that this is discovery 
session.

Signed-off-by: Or Gerlitz 
---

changes from V0:

 - applied feedback from Mike
 -- moved the iscsi_set_param part to libiscsi.c
 -- advertize ISCSI_PARAM_DISCOVERY_SESS too in iser_attr_is_visible

To apply this patch need to pick these two patches

[PATCH V1 1/4] scsi_transport_iscsi: Exporting new attrs for iscsi session and 
connection in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&w=2

[PATCH V1 2/4] libiscsi: Exporting new attrs for iscsi session and connection 
in sysfs
http://marc.info/?l=linux-scsi&m=137225028829588&q=raw

 drivers/infiniband/ulp/iser/iscsi_iser.c |3 ++-
 drivers/infiniband/ulp/iser/iser_initiator.c |   11 ++-
 drivers/scsi/libiscsi.c  |3 +++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c 
b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 2e84ef8..1ec78bd 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -672,6 +672,7 @@ static umode_t iser_attr_is_visible(int param_type, int 
param)
case ISCSI_PARAM_TGT_RESET_TMO:
case ISCSI_PARAM_IFACE_NAME:
case ISCSI_PARAM_INITIATOR_NAME:
+   case ISCSI_PARAM_DISCOVERY_SESS:
return S_IRUGO;
default:
return 0;
@@ -701,7 +702,7 @@ static struct scsi_host_template iscsi_iser_sht = {
 static struct iscsi_transport iscsi_iser_transport = {
.owner  = THIS_MODULE,
.name   = "iser",
-   .caps   = CAP_RECOVERY_L0 | CAP_MULTI_R2T,
+   .caps   = CAP_RECOVERY_L0 | CAP_MULTI_R2T | 
CAP_TEXT_NEGO,
/* session management */
.create_session = iscsi_iser_session_create,
.destroy_session= iscsi_iser_session_destroy,
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c 
b/drivers/infiniband/ulp/iser/iser_initiator.c
index b6d81a8..b31fa1d 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -234,6 +234,7 @@ void iser_free_rx_descriptors(struct iser_conn *ib_conn)
 static int iser_post_rx_bufs(struct iscsi_conn *conn, struct iscsi_hdr *req)
 {
struct iscsi_iser_conn *iser_conn = conn->dd_data;
+   struct iscsi_session *session = conn->session;
 
iser_dbg("req op %x flags %x\n", req->opcode, req->flags);
/* check if this is the last login - going to full feature phase */
@@ -248,7 +249,13 @@ static int iser_post_rx_bufs(struct iscsi_conn *conn, 
struct iscsi_hdr *req)
WARN_ON(iser_conn->ib_conn->post_recv_buf_count != 1);
WARN_ON(atomic_read(&iser_conn->ib_conn->post_send_buf_count) != 0);
 
-   iser_dbg("Initially post: %d\n", ISER_MIN_POSTED_RX);
+   if (session->discovery_sess) {
+   iser_info("Discovery session, re-using login RX buffer\n");
+   return 0;
+   } else
+   iser_info("Normal session, posting batch of RX %d buffers\n",
+ ISER_MIN_POSTED_RX);
+
/* Initial post receive buffers */
if (iser_post_recvm(iser_conn->ib_conn, ISER_MIN_POSTED_RX))
return -ENOMEM;
@@ -425,6 +432,8 @@ int iser_send_control(struct iscsi_conn *conn,
}
 
if (task == conn->login_task) {
+   iser_dbg("op %x dsl %lx, posting login rx buffer\n",
+task->hdr->opcode, data_seg_len);
err = iser_post_recvl(iser_conn->ib_conn);
if (err)
goto send_control_error;
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 12aca69..ca1efb9 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -3255,6 +3255,9 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
return iscsi_switch_str_param(&session->discovery_parent_type,
  buf);
+   case ISCSI_PARAM_DISCOVERY_SESS:
+   sscanf(buf, "%u", &session->discovery_sess);
+   break;
default:
return -ENOSYS;
}
-- 
1.7.1

-- 
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/groups/opt_out