Re: [PATCH 0/3] iscsi bidi & varlen support

2008-02-18 Thread Boaz Harrosh

On Tue, Feb 12 2008 at 22:17 +0200, Pete Wyckoff <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote on Tue, 12 Feb 2008 15:12 -0500:
>> [EMAIL PROTECTED] wrote on Thu, 31 Jan 2008 20:08 +0200:
>>> Cheers after 1.3 years these can go in.
>>>
>>> [PATCH 1/3] iscsi: extended cdb support
>>>The varlen support is not yet in mainline for
>>>   block and scsi-ml. But the API for drivers will
>>>   not change. All LLD need to do is max_command to
>>>   the it's maximum and be ready for bigger commands.
>>>   This is what's done here. Once these commands start
>>>   coming iscsi will be ready for them.
>>>
>>> [PATCH 2/3] iscsi: bidi support - libiscsi
>>> [PATCH 3/3] iscsi: bidi support - iscsi_tcp
>>>   bidirectional commands support in iscsi.
>>>   iSER is not yet ready, but it will not break.
>>>   There is already a mechanism in libiscsi that will
>>>   return error if bidi commands are sent iSER way.
>>>
>>> Pete please send me the iSER bits so we can port them
>>> to this latest version.
>>>
>>> Mike these patches are ontop of iscs branch of the iscsi
>>> git tree, they will apply but for compilation you will need
>>> to sync with Linus mainline. The patches are for the in-tree
>>> iscsi code. I own you the compat patch for the out-off-tree
>>> code, but this I will only be Sunday.
>> Here's the patch to add bidi support to iSER too.  It works
>> with my setup, but could use more testing.  Note that this does
>> rely on the 3 patches quoted above.
> 
> Similar, for varlen support to iSER.  Probably apply this one before
> the bidi one I just sent.
> 
>   -- Pete
> 
> 
> From: Pete Wyckoff <[EMAIL PROTECTED]>
> Subject: [PATCH] iscsi iser: varlen
> 
> Handle variable-length CDBs in iSER.
> 
> Signed-off-by: Pete Wyckoff <[EMAIL PROTECTED]>
> ---
>  drivers/infiniband/ulp/iser/iscsi_iser.c |5 +++--
>  drivers/infiniband/ulp/iser/iscsi_iser.h |2 +-
>  drivers/infiniband/ulp/iser/iser_initiator.c |   16 ++--
>  3 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c 
> b/drivers/infiniband/ulp/iser/iscsi_iser.c
> index 5f2284d..9dfc310 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.c
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
> @@ -401,7 +401,8 @@ iscsi_iser_session_create(struct iscsi_transport *iscsit,
>   ctask  = session->cmds[i];
>   iser_ctask = ctask->dd_data;
>   ctask->hdr = (struct iscsi_cmd *)&iser_ctask->desc.iscsi_header;
> - ctask->hdr_max = sizeof(iser_ctask->desc.iscsi_header);
> + ctask->hdr_max = sizeof(iser_ctask->desc.iscsi_header) +
> +  sizeof(iser_ctask->desc.hdrextbuf);
>   }
>  
>   for (i = 0; i < session->mgmtpool_max; i++) {
> @@ -604,7 +605,7 @@ static struct iscsi_transport iscsi_iser_transport = {
>   .host_template  = &iscsi_iser_sht,
>   .conndata_size  = sizeof(struct iscsi_conn),
>   .max_lun= ISCSI_ISER_MAX_LUN,
> - .max_cmd_len= ISCSI_ISER_MAX_CMD_LEN,
> + .max_cmd_len= 260,

Same bug I had. .max_cmd_len is still char, before the varlen patch to scsi-ml.
So it must be at most 252, Until that patch is introduced and it can return to
the correct 260 or better yet SCSI_MAX_VARLEN_CDB_SIZE. That also is only 
defined in the scsi-ml varlen patch.

>   /* session management */
>   .create_session = iscsi_iser_session_create,
>   .destroy_session= iscsi_session_teardown,
> diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h 
> b/drivers/infiniband/ulp/iser/iscsi_iser.h
> index db8f81a..66905df 100644
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
> @@ -90,7 +90,6 @@
>  /* FMR space for 1 MB of 4k-page transfers, plus 1 if not page aligned */
>  #define ISCSI_ISER_SG_TABLESIZE (((1<<20) >> SHIFT_4K) + 1)
>  #define ISCSI_ISER_MAX_LUN   256
> -#define ISCSI_ISER_MAX_CMD_LEN   16
>  
>  /* QP settings */
>  /* Maximal bounds on received asynchronous PDUs */
> @@ -217,6 +216,7 @@ enum iser_desc_type {
>  struct iser_desc {
>   struct iser_hdr  iser_header;
>   struct iscsi_hdr iscsi_header;
> + char hdrextbuf[ISCSI_MAX_AHS_SIZE];
>   struct iser_regd_buf hdr_regd_buf;
>   void *data; /* used by RX & TX_CONTROL 
> */
>   struct iser_regd_buf data_regd_buf; /* used by RX & TX_CONTROL 
> */
> diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c 
> b/drivers/infiniband/ulp/iser/iser_initiator.c
> index 83247f1..ea3f5dc 100644
> --- a/drivers/infiniband/ulp/iser/iser_initiator.c
> +++ b/drivers/infiniband/ulp/iser/iser_initiator.c
> @@ -246,9 +246,13 @@ post_rx_kmalloc_failure:
>   return err;
>  }
>  
> -/* creates a new tx descriptor and adds header regd buffer */
> +/**
>

Re: [PATCH 0/3 ver2] iscsi bidi & varlen support

2008-02-18 Thread Boaz Harrosh

On Mon, Feb 18 2008 at 19:22 +0200, James Bottomley <[EMAIL PROTECTED]> wrote:
> On Mon, 2008-02-18 at 17:08 +0200, Boaz Harrosh wrote:
>> But ... James? is
>> there any chance these can go into scsi-rc-fixes for the 2.6.25
>> kernel? The reason they are so late was mainly because of a fallout
>> in the merge process and a bug that was introduced because of that,
>> but they were intended to go together with bidi into 2.6.25. Also
>> as an important client code to the bidi-api that is introduced in
>> 2.6.25 kernel.
> 
> Well, I think you know the answer to that one under Linus' rules for non
> merge window submission.  It's not a bug fix; we haven't even put it
> into -mm for testing and it's a pretty invasive change.
> 
> James
> 
> 

It was extensively tested by all iscsi people. It has the Sign-off-by
of the iscsi maintainer. They are not new patches.

But, yes you are right. I now remember the trouble we had with Linus
last time. So it's 2.6.26 then. :-( . People that need it for 2.6.25
will just get it off the git tree.

Boaz


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: [PATCH 0/3 ver2] iscsi bidi & varlen support

2008-02-18 Thread James Bottomley

On Mon, 2008-02-18 at 17:08 +0200, Boaz Harrosh wrote:
> But ... James? is
> there any chance these can go into scsi-rc-fixes for the 2.6.25
> kernel? The reason they are so late was mainly because of a fallout
> in the merge process and a bug that was introduced because of that,
> but they were intended to go together with bidi into 2.6.25. Also
> as an important client code to the bidi-api that is introduced in
> 2.6.25 kernel.

Well, I think you know the answer to that one under Linus' rules for non
merge window submission.  It's not a bug fix; we haven't even put it
into -mm for testing and it's a pretty invasive change.

James



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



[PATCH 1/3 ver2] iscsi: extended cdb support

2008-02-18 Thread Boaz Harrosh


Support for extended CDBs in iscsi.
All we need is to check if command spills over 16 bytes then allocate
an iscsi-extended-header for the leftovers.

Signed-off-by: Boaz Harrosh <[EMAIL PROTECTED]>
Reviewed-by: Pete Wyckoff <[EMAIL PROTECTED]>
Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
---
 drivers/scsi/libiscsi.c|   55 
 include/scsi/iscsi_proto.h |6 +++-
 2 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 59f8445..a43b8ee 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -137,6 +137,45 @@ static int iscsi_add_hdr(struct iscsi_cmd_task *ctask, 
unsigned len)
return 0;
 }
 
+/*
+ * make an extended cdb AHS
+ */
+static int iscsi_prep_ecdb_ahs(struct iscsi_cmd_task *ctask)
+{
+   struct scsi_cmnd *cmd = ctask->sc;
+   unsigned rlen, pad_len;
+   unsigned short ahslength;
+   struct iscsi_ecdb_ahdr *ecdb_ahdr;
+   int rc;
+
+   ecdb_ahdr = iscsi_next_hdr(ctask);
+   rlen = cmd->cmd_len - ISCSI_CDB_SIZE;
+
+   BUG_ON(rlen > sizeof(ecdb_ahdr->ecdb));
+   ahslength = rlen + sizeof(ecdb_ahdr->reserved);
+
+   pad_len = iscsi_padding(rlen);
+
+   rc = iscsi_add_hdr(ctask, sizeof(ecdb_ahdr->ahslength) +
+  sizeof(ecdb_ahdr->ahstype) + ahslength + pad_len);
+   if (rc)
+   return rc;
+
+   if (pad_len)
+   memset(&ecdb_ahdr->ecdb[rlen], 0, pad_len);
+
+   ecdb_ahdr->ahslength = cpu_to_be16(ahslength);
+   ecdb_ahdr->ahstype = ISCSI_AHSTYPE_CDB;
+   ecdb_ahdr->reserved = 0;
+   memcpy(ecdb_ahdr->ecdb, cmd->cmnd + ISCSI_CDB_SIZE, rlen);
+
+   debug_scsi("iscsi_prep_ecdb_ahs: varlen_cdb_len %d "
+  "rlen %d pad_len %d ahs_length %d iscsi_headers_size %u\n",
+  cmd->cmd_len, rlen, pad_len, ahslength, ctask->hdr_len);
+
+   return 0;
+}
+
 /**
  * iscsi_prep_scsi_cmd_pdu - prep iscsi scsi cmd pdu
  * @ctask: iscsi cmd task
@@ -150,7 +189,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
struct iscsi_session *session = conn->session;
struct iscsi_cmd *hdr = ctask->hdr;
struct scsi_cmnd *sc = ctask->sc;
-   unsigned hdrlength;
+   unsigned hdrlength, cmd_len;
int rc;
 
ctask->hdr_len = 0;
@@ -165,10 +204,16 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
hdr->cmdsn = cpu_to_be32(session->cmdsn);
session->cmdsn++;
hdr->exp_statsn = cpu_to_be32(conn->exp_statsn);
-   memcpy(hdr->cdb, sc->cmnd, sc->cmd_len);
-   if (sc->cmd_len < MAX_COMMAND_SIZE)
-   memset(&hdr->cdb[sc->cmd_len], 0,
-   MAX_COMMAND_SIZE - sc->cmd_len);
+   cmd_len = sc->cmd_len;
+   if (cmd_len < ISCSI_CDB_SIZE)
+   memset(&hdr->cdb[cmd_len], 0, ISCSI_CDB_SIZE - cmd_len);
+   else if (cmd_len > ISCSI_CDB_SIZE) {
+   rc = iscsi_prep_ecdb_ahs(ctask);
+   if (rc)
+   return rc;
+   cmd_len = ISCSI_CDB_SIZE;
+   }
+   memcpy(hdr->cdb, sc->cmnd, cmd_len);
 
ctask->imm_count = 0;
if (sc->sc_data_direction == DMA_TO_DEVICE) {
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 5ffec8a..e0593bf 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -112,6 +112,7 @@ struct iscsi_ahs_hdr {
 
 #define ISCSI_AHSTYPE_CDB  1
 #define ISCSI_AHSTYPE_RLENGTH  2
+#define ISCSI_CDB_SIZE 16
 
 /* iSCSI PDU Header */
 struct iscsi_cmd {
@@ -125,7 +126,7 @@ struct iscsi_cmd {
__be32 data_length;
__be32 cmdsn;
__be32 exp_statsn;
-   uint8_t cdb[16];/* SCSI Command Block */
+   uint8_t cdb[ISCSI_CDB_SIZE];/* SCSI Command Block */
/* Additional Data (Command Dependent) */
 };
 
@@ -154,7 +155,8 @@ struct iscsi_ecdb_ahdr {
__be16 ahslength;   /* CDB length - 15, including reserved byte */
uint8_t ahstype;
uint8_t reserved;
-   uint8_t ecdb[260 - 16]; /* 4-byte aligned extended CDB spillover */
+   /* 4-byte aligned extended CDB spillover */
+   uint8_t ecdb[260 - ISCSI_CDB_SIZE];
 };
 
 /* SCSI Response Header */
-- 
1.5.3.3



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



[PATCH 2/3 ver2] iscsi: bidi support - libiscsi

2008-02-18 Thread Boaz Harrosh


  iscsi bidi support at the generic libiscsi level
  - prepare the additional bidi_read rlength header.
  - access the right scsi_in() and/or scsi_out() side of things.
also for resid.
  - Handle BIDI underflow overflow from target

Signed-off-by: Boaz Harrosh <[EMAIL PROTECTED]>
Reviewed-by: Pete Wyckoff <[EMAIL PROTECTED]>
Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
---
 drivers/scsi/libiscsi.c |   85 ++
 1 files changed, 70 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index a43b8ee..9c12915 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -176,6 +176,31 @@ static int iscsi_prep_ecdb_ahs(struct iscsi_cmd_task 
*ctask)
return 0;
 }
 
+static int iscsi_prep_bidi_ahs(struct iscsi_cmd_task *ctask)
+{
+   struct scsi_cmnd *sc = ctask->sc;
+   struct iscsi_rlength_ahdr *rlen_ahdr;
+   int rc;
+
+   rlen_ahdr = iscsi_next_hdr(ctask);
+   rc = iscsi_add_hdr(ctask, sizeof(*rlen_ahdr));
+   if (rc)
+   return rc;
+
+   rlen_ahdr->ahslength =
+   cpu_to_be16(sizeof(rlen_ahdr->read_length) +
+ sizeof(rlen_ahdr->reserved));
+   rlen_ahdr->ahstype = ISCSI_AHSTYPE_RLENGTH;
+   rlen_ahdr->reserved = 0;
+   rlen_ahdr->read_length = cpu_to_be32(scsi_in(sc)->length);
+
+   debug_scsi("bidi-in rlen_ahdr->read_length(%d) "
+  "rlen_ahdr->ahslength(%d)\n",
+  be32_to_cpu(rlen_ahdr->read_length),
+  be16_to_cpu(rlen_ahdr->ahslength));
+   return 0;
+}
+
 /**
  * iscsi_prep_scsi_cmd_pdu - prep iscsi scsi cmd pdu
  * @ctask: iscsi cmd task
@@ -200,7 +225,6 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
hdr->flags = ISCSI_ATTR_SIMPLE;
int_to_scsilun(sc->device->lun, (struct scsi_lun *)hdr->lun);
hdr->itt = build_itt(ctask->itt, session->age);
-   hdr->data_length = cpu_to_be32(scsi_bufflen(sc));
hdr->cmdsn = cpu_to_be32(session->cmdsn);
session->cmdsn++;
hdr->exp_statsn = cpu_to_be32(conn->exp_statsn);
@@ -216,7 +240,15 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
memcpy(hdr->cdb, sc->cmnd, cmd_len);
 
ctask->imm_count = 0;
+   if (scsi_bidi_cmnd(sc)) {
+   hdr->flags |= ISCSI_FLAG_CMD_READ;
+   rc = iscsi_prep_bidi_ahs(ctask);
+   if (rc)
+   return rc;
+   }
if (sc->sc_data_direction == DMA_TO_DEVICE) {
+   unsigned out_len = scsi_out(sc)->length;
+   hdr->data_length = cpu_to_be32(out_len);
hdr->flags |= ISCSI_FLAG_CMD_WRITE;
/*
 * Write counters:
@@ -237,19 +269,19 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
ctask->unsol_datasn = 0;
 
if (session->imm_data_en) {
-   if (scsi_bufflen(sc) >= session->first_burst)
+   if (out_len >= session->first_burst)
ctask->imm_count = min(session->first_burst,
conn->max_xmit_dlength);
else
-   ctask->imm_count = min(scsi_bufflen(sc),
+   ctask->imm_count = min(out_len,
conn->max_xmit_dlength);
hton24(hdr->dlength, ctask->imm_count);
} else
zero_data(hdr->dlength);
 
if (!session->initial_r2t_en) {
-   ctask->unsol_count = min((session->first_burst),
-   (scsi_bufflen(sc))) - ctask->imm_count;
+   ctask->unsol_count = min(session->first_burst, out_len)
+- ctask->imm_count;
ctask->unsol_offset = ctask->imm_count;
}
 
@@ -259,6 +291,7 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
} else {
hdr->flags |= ISCSI_FLAG_CMD_FINAL;
zero_data(hdr->dlength);
+   hdr->data_length = cpu_to_be32(scsi_in(sc)->length);
 
if (sc->sc_data_direction == DMA_FROM_DEVICE)
hdr->flags |= ISCSI_FLAG_CMD_READ;
@@ -277,10 +310,12 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task 
*ctask)
return EIO;
 
conn->scsicmd_pdus_cnt++;
-   debug_scsi("iscsi prep [%s cid %d sc %p cdb 0x%x itt 0x%x len %d "
-   "cmdsn %d win %d]\n",
-   sc->sc_data_direction == DMA_TO_DEVICE ? "write" : "read",
-   conn->id, sc, sc->cmnd[0], ctask->itt, scsi_bufflen(sc),
+   debug_scsi("iscsi prep [%s cid %d sc %p cdb 0x%x itt 0x%x "
+   

[PATCH 3/3 ver2] iscsi: bidi support - iscsi_tcp

2008-02-18 Thread Boaz Harrosh


  bidi support for iscsi_tcp
  - access the right scsi_in() and/or scsi_out() side of things.
also for resid

Signed-off-by: Boaz Harrosh <[EMAIL PROTECTED]>
Reviewed-by: Pete Wyckoff <[EMAIL PROTECTED]>
Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
---
 drivers/scsi/iscsi_tcp.c |   31 +--
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 8a17867..72b9b2a 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -528,6 +528,7 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct 
iscsi_cmd_task *ctask)
struct iscsi_session *session = conn->session;
struct scsi_cmnd *sc = ctask->sc;
int datasn = be32_to_cpu(rhdr->datasn);
+   unsigned total_in_length = scsi_in(sc)->length;
 
iscsi_update_cmdsn(session, (struct iscsi_nopin*)rhdr);
if (tcp_conn->in.datalen == 0)
@@ -542,10 +543,10 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct 
iscsi_cmd_task *ctask)
tcp_ctask->exp_datasn++;
 
tcp_ctask->data_offset = be32_to_cpu(rhdr->offset);
-   if (tcp_ctask->data_offset + tcp_conn->in.datalen > scsi_bufflen(sc)) {
+   if (tcp_ctask->data_offset + tcp_conn->in.datalen > total_in_length) {
debug_tcp("%s: data_offset(%d) + data_len(%d) > 
total_length_in(%d)\n",
  __FUNCTION__, tcp_ctask->data_offset,
- tcp_conn->in.datalen, scsi_bufflen(sc));
+ tcp_conn->in.datalen, total_in_length);
return ISCSI_ERR_DATA_OFFSET;
}
 
@@ -558,8 +559,8 @@ iscsi_data_rsp(struct iscsi_conn *conn, struct 
iscsi_cmd_task *ctask)
 
if (res_count > 0 &&
(rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW ||
-res_count <= scsi_bufflen(sc)))
-   scsi_set_resid(sc, res_count);
+res_count <= total_in_length))
+   scsi_in(sc)->resid = res_count;
else
sc->result = (DID_BAD_TARGET << 16) |
rhdr->cmd_status;
@@ -670,11 +671,11 @@ iscsi_r2t_rsp(struct iscsi_conn *conn, struct 
iscsi_cmd_task *ctask)
r2t->data_length, session->max_burst);
 
r2t->data_offset = be32_to_cpu(rhdr->data_offset);
-   if (r2t->data_offset + r2t->data_length > scsi_bufflen(ctask->sc)) {
+   if (r2t->data_offset + r2t->data_length > scsi_out(ctask->sc)->length) {
iscsi_conn_printk(KERN_ERR, conn,
  "invalid R2T with data len %u at offset %u "
  "and total length %d\n", r2t->data_length,
- r2t->data_offset, scsi_bufflen(ctask->sc));
+ r2t->data_offset, 
scsi_out(ctask->sc)->length);
__kfifo_put(tcp_ctask->r2tpool.queue, (void*)&r2t,
sizeof(void*));
return ISCSI_ERR_DATALEN;
@@ -771,6 +772,7 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct 
iscsi_hdr *hdr)
if (tcp_conn->in.datalen) {
struct iscsi_tcp_cmd_task *tcp_ctask = ctask->dd_data;
struct hash_desc *rx_hash = NULL;
+   struct scsi_data_buffer *sdb = scsi_in(ctask->sc);
 
/*
 * Setup copy of Data-In into the Scsi_Cmnd
@@ -788,8 +790,8 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct 
iscsi_hdr *hdr)
  tcp_ctask->data_offset,
  tcp_conn->in.datalen);
return iscsi_segment_seek_sg(&tcp_conn->in.segment,
-scsi_sglist(ctask->sc),
-scsi_sg_count(ctask->sc),
+sdb->table.sgl,
+sdb->table.nents,
 tcp_ctask->data_offset,
 tcp_conn->in.datalen,
 iscsi_tcp_process_data_in,
@@ -1332,7 +1334,8 @@ iscsi_tcp_ctask_init(struct iscsi_cmd_task *ctask)
return 0;
 
/* If we have immediate data, attach a payload */
-   err = iscsi_tcp_send_data_prep(conn, scsi_sglist(sc), scsi_sg_count(sc),
+   err = iscsi_tcp_send_data_prep(conn, scsi_out(sc)->table.sgl,
+  scsi_out(sc)->table.nents,
   0, ctask->imm_count);
if (err)
return err;
@@ -1386,6 +1389,7 @@ iscsi_tcp_ctask_xmit(struct iscsi_conn *conn, struct 
iscsi_cmd_task *ctask)
 {
struct iscsi_tcp

[PATCH 0/3 ver2] iscsi bidi & varlen support

2008-02-18 Thread Boaz Harrosh

On Thu, Jan 31 2008 at 20:08 +0200, Boaz Harrosh <[EMAIL PROTECTED]> wrote:
> Cheers after 1.3 years these can go in.
> 
> [PATCH 1/3] iscsi: extended cdb support
>The varlen support is not yet in mainline for
>   block and scsi-ml. But the API for drivers will
>   not change. All LLD need to do is max_command to
>   the it's maximum and be ready for bigger commands.
>   This is what's done here. Once these commands start
>   coming iscsi will be ready for them.
> 
> [PATCH 2/3] iscsi: bidi support - libiscsi
> [PATCH 3/3] iscsi: bidi support - iscsi_tcp
>   bidirectional commands support in iscsi.
>   iSER is not yet ready, but it will not break.
>   There is already a mechanism in libiscsi that will
>   return error if bidi commands are sent iSER way.
> 
> Pete please send me the iSER bits so we can port them
> to this latest version.
> 
> Mike these patches are ontop of iscs branch of the iscsi
> git tree, they will apply but for compilation you will need
> to sync with Linus mainline. The patches are for the in-tree
> iscsi code. I own you the compat patch for the out-off-tree
> code, but this I will only be Sunday.
> 
> If we do it fast it might get accepted to 2.6.25 merge window
> 
> Everybody is invited to a party at Shila ben-yhuda 52 Tel-Aviv
> 9:45 pm. Drinks and wonderful see-food on us :)
> 
> Boaz
>  
> -
Everything the same as before. But working this time. Also
Pete's comment about second patch, was correct and code is now
fixed.

I have got Mike's Signed-off-by, on these they were tested and
approved by him. So they are for scsi-misc. But ... James? is
there any chance these can go into scsi-rc-fixes for the 2.6.25
kernel? The reason they are so late was mainly because of a fallout
in the merge process and a bug that was introduced because of that,
but they were intended to go together with bidi into 2.6.25. Also
as an important client code to the bidi-api that is introduced in
2.6.25 kernel.

Thanks
Boaz

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: [PATCH 2/3] iscsi: bidi support - libiscsi

2008-02-18 Thread Boaz Harrosh

On Mon, Feb 11 2008 at 17:43 +0200, Pete Wyckoff <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote on Thu, 31 Jan 2008 22:29 +0200:
>>   iscsi bidi support at the generic libiscsi level
>>   - prepare the additional bidi_read rlength header.
>>   - access the right scsi_in() and/or scsi_out() side of things.
>> also for resid.
>>   - Handle BIDI underflow overflow from target
>>
>> Signed-off-by: Boaz Harrosh <[EMAIL PROTECTED]>
> 
> I see you do this a bit differently than in your previous patch set.
> In particular, the residual handling in libiscsi.c.  (I'm editing in
> a bit more context to the patch below.)
> 
>> +if (scsi_bidi_cmnd(sc) &&
>> +(rhdr->flags & (ISCSI_FLAG_CMD_BIDI_UNDERFLOW |
>> +ISCSI_FLAG_CMD_BIDI_OVERFLOW))) {
>> +int res_count = be32_to_cpu(rhdr->bi_residual_count);
>> +
>> +if (res_count > 0 &&
>> +(rhdr->flags & ISCSI_FLAG_CMD_BIDI_OVERFLOW ||
>> +res_count <= scsi_in(sc)->length))
>> +scsi_in(sc)->resid = res_count;
>> +else
>> +sc->result =
>> +(DID_BAD_TARGET << 16) | rhdr->cmd_status;
>> +}
>> +
>>  if (rhdr->flags & (ISCSI_FLAG_CMD_UNDERFLOW |
>> ISCSI_FLAG_CMD_OVERFLOW)) {
>>  int res_count = be32_to_cpu(rhdr->residual_count);
>>
>>  if (res_count > 0 &&
>>  (rhdr->flags & ISCSI_FLAG_CMD_OVERFLOW ||
>>   res_count <= scsi_bufflen(sc)))
>> +/* write side for bidi or uni-io set_resid */
>>  scsi_set_resid(sc, res_count);
>>  else
>>  sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
>>   } else if (rhdr->flags & (ISCSI_FLAG_CMD_BIDI_UNDERFLOW |
>> ISCSI_FLAG_CMD_BIDI_OVERFLOW))
>>   sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
> 
> I haven't tested this, but, consider a bidi command that results in
> an overflow on the read part, and no overflow on the write part.
> E.g., the user supplied a data-in buffer that wasn't big enough to
> hold the returned data from the target, but the data-out buffer was
> just right.
> 
> Then this code will set scsi_in(sc)->resid properly, informing the
> caller that there were extra bytes that were not transferred.  But
> the "else" clause at the bottom will also set sc->result to be bad.
> I don't think we want this.
> 
> Your earlier patch got rid of the second bidi_overflow handler and
> just did all the logic for both bidi and non-bidi cases in a single
> if clause.  Seemed better.
> 
>   -- Pete
You are most probably right I will investigate what happened. It looks
like I went back to some old version right? or a merge fallout
Thanks for reviewing.

Please also test latest head-of-line code if possible + iscsi patches
+ last varlen I sent.

Is there any new patches I need for 2.6.24 or head-of-line for my 
osd-dev tree?

Boaz

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



can not bind NETLINK_ISCSI socket

2008-02-18 Thread David L. Lambert
I'm trying to get open-iscsi to run on a Gentoo system.  I've set some
other systems up,  but on this one the /etc/init.d/open-iscsi script
hangs.  When I try to start it wit debugging options,  here's what I
get:

 

# iscsid -f -d 99

iscsid: transport class version 2.0-865. iscsid version 2.0-865

iscsid: in ctldev_open

iscsid: can not bind NETLINK_ISCSI socket

iscsid: iscsid_exit

iscsid: in ctldev_close

*** glibc detected *** double free or corruption (out): 0x08078118 ***

Aborted

 

Any pointers on where to look for the problem?

 

 

 

--

David Lee Lambert

Software Developer, Precision Motor Transport Group, LLC

517-349-3011 x223 (work) ... 586-873-8813 (cell)

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: [PATCH 2/3] iscsi: bidi support - libiscsi

2008-02-18 Thread Boaz Harrosh

On Mon, Feb 11 2008 at 18:24 +0200, Pete Wyckoff <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote on Mon, 11 Feb 2008 18:05 +0200:
>> You are most probably right I will investigate what happened. It looks
>> like I went back to some old version right? or a merge fallout
>> Thanks for reviewing.
>>
>> Please also test latest head-of-line code if possible + iscsi patches
>> + last varlen I sent.
>>
>> Is there any new patches I need for 2.6.24 or head-of-line for my 
>> osd-dev tree?
> 
> Testing now.  My patch set is actually shrinking (!) thanks to some
> merges.  Some rebasing was required to apply your three varlen
> patches and three bidi patches, but I'm sure you'll update your tree
> and push those upstream soon enough.  I'll take a look at iser bidi
> then update my patch list and let you know soon.
> 
>   -- Pete
> 
- It is made to apply iscsi 3 patches, as this mail thread first.
- Then these:
   http://www.spinics.net/lists/linux-scsi/msg23676.html
   That I sent yesterday.

All that on top of mainline if you had any trouble please tell me
because it's suppose to be good.

(Minus the resid fix which I'll send later)

Thanks
Boaz

  

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Update (Re: open iSCSI over iSER target RPM ...)

2008-02-18 Thread Joe Landman

Update:

[EMAIL PROTECTED] etc]# dd if=/dev/zero of=/big/local.file bs=256k count=10
10+0 records in
10+0 records out
2621440 bytes (26 GB) copied, 58.7484 seconds, 446 MB/s

Better. I rebuilt OFED 1.2.5.5.  Are there specific recommended tuning 
guides for iSER?  Backing store in this case are real disks, and we can 
sink/source >750 MB/s on them, so I am not worried about disk IO 
bottlenecks, more worried about bad config of iSCSI/iSER.

BTW:  the 2TB LUN limit I asked about is still here in this code.  Same 
machines (initiator and target) used for SRP reported correct LUN sizes. 
  Here we are using the -868 open-iscsi initiator, and the tgt RPM 
announced.  I would like to dig into this.

This is what I am getting in dmesg for this iSER target:

iscsi: registered transport (tcp)
iscsi: registered transport (iser)
iser: iser_connect:connecting to: 10.2.1.2, port 0xbc0c
iser: iser_cma_handler:event 0 conn 81024b9f69c0 id 810209748c00
iser: iser_cma_handler:event 2 conn 81024b9f69c0 id 810209748c00
iser: iser_create_ib_conn_res:setting conn 81024b9f69c0 cma_id 
810209748c00: fmr_pool 81024bfb32c0 qp 8101cb16d600
iser: iser_cma_handler:event 9 conn 81024b9f69c0 id 810209748c00
iser: iscsi_iser_ep_poll:ib conn 81024b9f69c0 rc = 1
scsi13 : iSCSI Initiator over iSER, v.0.1
iser: iscsi_iser_conn_bind:binding iscsi conn 81021b65fa90 to 
iser_conn 81024b9f69c0
   Vendor: IET   Model: ControllerRev: 0001
   Type:   RAID   ANSI SCSI revision: 05
scsi 13:0:0:0: Attached scsi generic sg2 type 12
   Vendor: IET   Model: VIRTUAL-DISK  Rev: 0001
   Type:   Direct-Access  ANSI SCSI revision: 05
sdc : very big device. try to use READ CAPACITY(16).
sdc : READ CAPACITY(16) failed.
sdc : status=1, message=00, host=0, driver=08
sdc : use 0x as device size
SCSI device sdc: 4294967296 512-byte hdwr sectors (2199023 MB)
sdc: Write Protect is off
sdc: Mode Sense: 79 00 00 08
SCSI device sdc: drive cache: write back
sdc : very big device. try to use READ CAPACITY(16).
sdc : READ CAPACITY(16) failed.
sdc : status=1, message=00, host=0, driver=08
sdc : use 0x as device size
SCSI device sdc: 4294967296 512-byte hdwr sectors (2199023 MB)
sdc: Write Protect is off
sdc: Mode Sense: 79 00 00 08
SCSI device sdc: drive cache: write back
  sdc: unknown partition table
sd 13:0:0:1: Attached scsi disk sdc
sd 13:0:0:1: Attached scsi generic sg3 type 0


and this is what we get in SRP

scsi6 : SRP.T10:0008F104039862A4
   Vendor: SCST_BIO  Model: vdisk0Rev:  096
   Type:   Direct-Access  ANSI SCSI revision: 04
sdc : very big device. try to use READ CAPACITY(16).
SCSI device sdc: 12693355130 512-byte hdwr sectors (6498998 MB)
sdc: Write Protect is off
sdc: Mode Sense: 6b 00 10 08
SCSI device sdc: drive cache: write back w/ FUA


This looks suspiciously like a 2^32 limit somewhere.


Our exported device is

[EMAIL PROTECTED] ~]# parted /dev/sdb print

Model: Areca jrvs1 (scsi)
Disk /dev/sdb: 6500GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start   End SizeFile system  Flags
  1  0.00kB  6500GB  6500GB  xfs


and this is what tgtadm reports

[EMAIL PROTECTED] ~]# tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2001-04.com.jr1-jackrabbit.small
 System information:
 Driver: iscsi
 Status: running
 I_T nexus information:
 I_T nexus: 4
 Initiator: iqn.1996-04.voltaire.com:01:dfaa3fd
 Connection: 0
 RDMA IP Address: 10.2.1.1
 LUN information:
 LUN: 0
 Type: controller
 SCSI ID: deadbeaf1:0
 SCSI SN: beaf10
 Size: 0
 Online: No
 Poweron/Reset: Yes
 Removable media: No
 Backing store: No backing store
 LUN: 1
 Type: disk
 SCSI ID: deadbeaf1:1
 SCSI SN: beaf11
 Size: 5T
 Online: Yes
 Poweron/Reset: No
 Removable media: No
 Backing store: /dev/sdb
 Account information:
 ACL information:
 10.2.1.1

So it looks like the LUN 1 is approximately correct (5T ???) on the 
target, and incorrect when the initiator asks for it.

Please note that I have successfully used the full 6+TB as an iSCSI 
target using the SCST-iscsi code, so I do know that the initiator works 
correctly.

Is there a source RPM/tree for this target?

Joe Landman wrote:
> Hi Erez
> 
> Erez Zilber wrote:
>> stgt (SCSI target) is an open-source framework for storage target
>> drivers. It supports iSCSI over iSER among other storage target drivers.
>>
>> Voltaire added a git tree for stgt that will be added to OFED 1.4:
>> http://www2.openfabrics.org/git/?p=~dorons/tgt.git;a=summary
>>
>> Until OFED 1.4 gets released, it is possible to install the stgt RPM on
>> t

Re: [ofa-general] [ANNOUNCE] open iSCSI over iSER target RPM is available

2008-02-18 Thread Joe Landman

Hi Erez

Erez Zilber wrote:
> stgt (SCSI target) is an open-source framework for storage target
> drivers. It supports iSCSI over iSER among other storage target drivers.
> 
> Voltaire added a git tree for stgt that will be added to OFED 1.4:
> http://www2.openfabrics.org/git/?p=~dorons/tgt.git;a=summary
> 
> Until OFED 1.4 gets released, it is possible to install the stgt RPM on
> top of OFED 1.3. For more details about how to install and use stgt,
> please refer to https://wiki.openfabrics.org/tiki-index.php?page=ISER-target
> 
> Some performance numbers that were measured by OSC (using SDR cards):

Is there a 2TB limit on this target? It turns our 6TB partition into a 
2TB lun.

> * READ: 920 MB/sec
> * WRITE: 850 MB/sec

Not getting anything even remotely close to this.  Are there more 
details on configuration somewhere?  I followed the web page as indicated.

Joe

> 
> We hope to have DDR measurements numbers soon.
> 


-- 
Joseph Landman, Ph.D
Founder and CEO
Scalable Informatics LLC,
email: [EMAIL PROTECTED]
web  : http://www.scalableinformatics.com
http://jackrabbit.scalableinformatics.com
phone: +1 734 786 8423
fax  : +1 866 888 3112
cell : +1 734 612 4615

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: [Cbe-oss-dev] LIO Target iSCSI/SE PS3-Linux / FC8 builds

2008-02-18 Thread Marc Dietrich

Hi Nicholas,

can you please also upload a src.rpm? I'm having toubles compiling the kernel 
code:

# cd target/ ; ./autoconfig --write-to-file ; cat .make_autoconfig ; make 
kernel
/usr/src/linux-iscsi/trunk/target/.make_autoconfig
ARCH?=ppc
AUTO_CFLAGS?= -DHAS_UTS_RELEASE -DUSE_SCSI_H 
-I/lib/modules/2.6.24-06289-g144de36/source/drivers/scsi  -DUSE_MSLEEP 
-DUSE_COMPAT_IOCTL -Dscsi_execute_async_address  
-DPYX_ISCSI_VENDOR='"Linux-iSCSI.org"'  
-DIQN_PREFIX='"iqn.2003-01.org.linux-iscsi"'  -DLINUX 
-DLINUX_SCATTERLIST_HAS_PAGE -DSVN_VSN=\"209\"
BASENAME?=FedoraCore-R8-Werewolf.ppc
DISTRO?=FEDORA
KERNEL?=26
KERNEL_DIR?=/lib/modules/2.6.24-06289-g144de36/build
KERNEL_INCLUDE_DIR?=/lib/modules/2.6.24-06289-g144de36/source/include
KERNEL_SOURCE_DIR?=/lib/modules/2.6.24-06289-g144de36/source
KERNEL_VERSION_INFO?=LINUX_KERNEL_26
OSTYPE?=LINUX
PYX_ISCSI_VERSION?=2.9.0.209
RELEASE?=2.6.24-06289-g144de36
RELEASES?=ARRAY(0x102052d4)
RPM_DIR?=/usr/src/redhat
SNMP?=0
SYSTEM?=FedoraCore-R8-Werewolf
VERSION_IPYXD?=2.9.0.209
make -C target clean all
make[1]: Entering directory `/usr/src/linux-iscsi/trunk/target/target'
rm -f /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_crc.o 
/usr/src/linux-iscsi/trunk/target/target/../common/iscsi_debug_opcodes.o 
/usr/src/linux-iscsi/trunk/target/target/../common/iscsi_parameters.o 
/usr/src/linux-iscsi/trunk/target/target/../common/iscsi_seq_and_pdu_list.o 
/usr/src/linux-iscsi/trunk/target/target/../common/iscsi_serial.o 
/usr/src/linux-iscsi/trunk/target/target/../common/iscsi_thread_queue.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_datain_values.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_device.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_discovery.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_erl0.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_erl1.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_erl2.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_feature_obj.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_hba.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_info.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_ioctl.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_linux_proc.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_login.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_nego.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_nodeattrib.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_plugin.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_reportluns.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_scdb.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_seobj.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_tmr.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_tpg.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_transport.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_util.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target.o 
/usr/src/linux-iscsi/trunk/target/target/div64.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_raid.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_repl.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_iblock.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_pscsi.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_rd.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_file.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_vt.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_mc.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_mib.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_mod.o 
/usr/src/linux-iscsi/trunk/target/target/iscsi_target_mod.mod.o
rm -f iscsi_target_mod.ko iscsi_target_mod.mod.c
rm -f .*.cmd ../common/.*.cmd .make_autoconfig *~
rm -fr .tmp_versions
make -C /lib/modules/2.6.24-06289-g144de36/build 
SUBDIRS=/usr/src/linux-iscsi/trunk/target/target modules 
CWD=/usr/src/linux-iscsi/trunk/target/target ARCH=ppc KBUILD_VERBOSE=0
make[2]: Entering directory `/usr/src/ps3-linux'
  CC [M]  /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_crc.o
In file included from include/asm/mmu.h:7,
 from include/asm/lppaca.h:32,
 from include/asm/paca.h:20,
 from include/asm/hw_irq.h:17,
 from include/asm/system.h:9,
 from include/linux/list.h:9,
 from include/linux/preempt.h:11,
 from include/linux/spinlock.h:49,
 from include/linux/mmzone.h:7,
 from include/linux/gfp.h:4,
 from include/linux/slab.h:14,
 
from /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_crc.c:29:
include/asm/mmu-hash64.h: In function 'hpte_encode_v':
include/asm/mmu-hash64.h:213: warning: left shift count >= width of type
include/asm/mmu-hash64.h: In function 'hpte_encode_r':
include/asm/mmu-hash64.h:228: warn

Re: [Cbe-oss-dev] LIO Target iSCSI/SE PS3-Linux / FC8 builds

2008-02-18 Thread Marc Dietrich


Hi Nicholas,

thanks for your quick reply.

Am Montag 04 Februar 2008 16:52:40 schrieb Nicholas A. Bellinger:
> Hi Marc,
>
> You can generate the kernel RPM with 'make kernel ARCH=powerpc'.

Yes, this works. The arch detection is a little ugly. I wonder why it is 
necessary at all.

> Also, while module-assistant is supported on debian/ubuntu,
> trunk/buildtools/ currently does not support generating kernel module
> source rpms.  If you want to send a patch, I would be more than happy to
> take it.

I don't think, that it is useful to provide a kernel module rpm - kernels are 
changing to fast ;-) Better go for dkms ...

Anyway, heres a quick ugly fix for the ARCH detection code, tested on ps3.

Thanks

Marc


--- ostype.pm.orig  2008-02-04 17:02:48.0 +0100
+++ ostype.pm   2008-02-04 17:37:19.0 +0100
@@ -33,14 +33,10 @@

 if ($rval->{ARCH} eq "")
 {
-   my $uname = `file $root/bin/ls`;
-   $uname =~ s/\n+//g;
-
-   $rval->{ARCH}="x86_64" if ($uname =~ /64.*(AMD|Intel)/);
-   $rval->{ARCH}="i386" if ($uname =~ /32.*(AMD|Intel)/);
-   $rval->{ARCH}="ppc" if ($uname =~ /32.*(PowerPC)/);
-   $rval->{ARCH}="ppc64" if ($uname =~ /64.*(PowerPC)/);
-   $rval->{ARCH}="alpha" if ($uname =~ /64.*(Alpha)/);
+   my $uname = `uname -r`;
+   $uname =~ s/\n//g;
+   $rval->{ARCH} = readlink "/lib/modules/$uname/build/include/asm";
+   $rval->{ARCH} =~ s/asm\-(.*)/\1/g;
 }
 if ($rval->{ARCH} eq "")
 {



>
> --nab
>
> On Mon, 2008-02-04 at 16:47 +0100, Marc Dietrich wrote:
> > Hi Nicholas,
> >
> > can you please also upload a src.rpm? I'm having toubles compiling the
> > kernel code:
> >
> > # cd target/ ; ./autoconfig --write-to-file ; cat .make_autoconfig ; make
> > kernel
> > /usr/src/linux-iscsi/trunk/target/.make_autoconfig
> > ARCH?=ppc
> > AUTO_CFLAGS?= -DHAS_UTS_RELEASE -DUSE_SCSI_H
> > -I/lib/modules/2.6.24-06289-g144de36/source/drivers/scsi  -DUSE_MSLEEP
> > -DUSE_COMPAT_IOCTL -Dscsi_execute_async_address 
> > -DPYX_ISCSI_VENDOR='"Linux-iSCSI.org"' 
> > -DIQN_PREFIX='"iqn.2003-01.org.linux-iscsi"'  -DLINUX
> > -DLINUX_SCATTERLIST_HAS_PAGE -DSVN_VSN=\"209\"
> > BASENAME?=FedoraCore-R8-Werewolf.ppc
> > DISTRO?=FEDORA
> > KERNEL?=26
> > KERNEL_DIR?=/lib/modules/2.6.24-06289-g144de36/build
> > KERNEL_INCLUDE_DIR?=/lib/modules/2.6.24-06289-g144de36/source/include
> > KERNEL_SOURCE_DIR?=/lib/modules/2.6.24-06289-g144de36/source
> > KERNEL_VERSION_INFO?=LINUX_KERNEL_26
> > OSTYPE?=LINUX
> > PYX_ISCSI_VERSION?=2.9.0.209
> > RELEASE?=2.6.24-06289-g144de36
> > RELEASES?=ARRAY(0x102052d4)
> > RPM_DIR?=/usr/src/redhat
> > SNMP?=0
> > SYSTEM?=FedoraCore-R8-Werewolf
> > VERSION_IPYXD?=2.9.0.209
> > make -C target clean all
> > make[1]: Entering directory `/usr/src/linux-iscsi/trunk/target/target'
> > rm -f /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_crc.o
> > /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_debug_opcodes.o
> > /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_parameters.o
> > /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_seq_and_pdu_list
> >.o /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_serial.o
> > /usr/src/linux-iscsi/trunk/target/target/../common/iscsi_thread_queue.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_datain_values.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_device.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_discovery.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_erl0.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_erl1.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_erl2.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_feature_obj.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_hba.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_info.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_ioctl.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_linux_proc.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_login.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_nego.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_nodeattrib.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_plugin.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_reportluns.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_scdb.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_seobj.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_tmr.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_tpg.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_transport.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_util.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target.o
> > /usr/src/linux-iscsi/trunk/target/target/div64.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_raid.o
> > /usr/src/linux-iscsi/trunk/target/target/iscsi_target_repl.o
> > /usr/src/linux

Re: Multiple connections to target from different local NICs?

2008-02-18 Thread Mike Christie

[EMAIL PROTECTED] wrote:
> Hello!
> 
> I am trying to put together a system that can emulate lots of iSCSI
> initiators
> connecting to a single iSCSI target.  What I would like to do is to
> add multiple
> NICs to a machine and have it 'mount' the target from each NIC
> independently.
> 
> The goal is to have the iSCSI target think it has a large number of
> machines
> connected to it, when in fact there will be a single machine with
> multiple
> interfaces.
> 
> Is this possible with iSCSI, possibly with relatively minor
> modifications to
> the open-iscsi stack?
> 

Sorry for the late response. I just saw this mail.

If you look at the iface bits in the README in the current release
http://www.open-iscsi.org/bits/open-iscsi-2.0-865.15.tar.gz
it describes how to create a session through different NICs on a system.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: [PATCH 0/3] iscsi bidi & varlen support

2008-02-18 Thread Pete Wyckoff

[EMAIL PROTECTED] wrote on Mon, 18 Feb 2008 17:39 +0200:
> On Tue, Feb 12 2008 at 22:17 +0200, Pete Wyckoff <[EMAIL PROTECTED]> wrote:
> > From: Pete Wyckoff <[EMAIL PROTECTED]>
> > Subject: [PATCH] iscsi iser: varlen
> > 
> > Handle variable-length CDBs in iSER.
> > 
> > Signed-off-by: Pete Wyckoff <[EMAIL PROTECTED]>
> > ---
> >  drivers/infiniband/ulp/iser/iscsi_iser.c |5 +++--
> >  drivers/infiniband/ulp/iser/iscsi_iser.h |2 +-
> >  drivers/infiniband/ulp/iser/iser_initiator.c |   16 ++--
> >  3 files changed, 14 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c 
> > b/drivers/infiniband/ulp/iser/iscsi_iser.c
> > index 5f2284d..9dfc310 100644
> > --- a/drivers/infiniband/ulp/iser/iscsi_iser.c
> > +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
> > @@ -401,7 +401,8 @@ iscsi_iser_session_create(struct iscsi_transport 
> > *iscsit,
> > ctask  = session->cmds[i];
> > iser_ctask = ctask->dd_data;
> > ctask->hdr = (struct iscsi_cmd *)&iser_ctask->desc.iscsi_header;
> > -   ctask->hdr_max = sizeof(iser_ctask->desc.iscsi_header);
> > +   ctask->hdr_max = sizeof(iser_ctask->desc.iscsi_header) +
> > +sizeof(iser_ctask->desc.hdrextbuf);
> > }
> >  
> > for (i = 0; i < session->mgmtpool_max; i++) {
> > @@ -604,7 +605,7 @@ static struct iscsi_transport iscsi_iser_transport = {
> > .host_template  = &iscsi_iser_sht,
> > .conndata_size  = sizeof(struct iscsi_conn),
> > .max_lun= ISCSI_ISER_MAX_LUN,
> > -   .max_cmd_len= ISCSI_ISER_MAX_CMD_LEN,
> > +   .max_cmd_len= 260,
> 
> Same bug I had. .max_cmd_len is still char, before the varlen patch to 
> scsi-ml.
> So it must be at most 252, Until that patch is introduced and it can return to
> the correct 260 or better yet SCSI_MAX_VARLEN_CDB_SIZE. That also is only 
> defined in the scsi-ml varlen patch.

Ah, that is unfortunate.

> I'm afraid the varlen patches to block and scsi-ml are waiting because of
> me. There are more things I need to check, before they can get approved.
> 
> Once I do that, and varlen gets accepted, iSER and iscsi_tcp can go up 
> to 260 for the .max_cmd_len as they should.

I will sit on these iser changes until we get core varlen resolved,
then.  Or you can just sequence it all cleverly through the various
maintainers.

-- Pete

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: kernel panic on open-iscsi login to target

2008-02-18 Thread Joe Landman

On Feb 17, 4:57 pm, Joe Landman <[EMAIL PROTECTED]> wrote:

[...]

> For the Centos load, this was the 5.1 kernel driver with the 865 user
> space tools.

"fixed"

I completely rebuilt/re-installed the 865 tools after removing every
trace of the previous builds (userspace and kernel modules) and
rebooting.  Now logins are fine without the crash.

Thanks for point me in the right direction.

Joe
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---



Re: slow failover with multipath and open-iscsi

2008-02-18 Thread Erez Zilber


>> OK. Is it configurable? Where?
>> 
>
>
> node.session.timeo.replacement_timeouts is conifigurable in the iscsi 
> config file as you know. The scsi command timer is configurabale in sysfs:
>
> /sys/block/sdX/device/timeout
>
> and in some distros udev
>
> /etc/udev/rules.d/50-udev.rules, and find the
> following lines:
>
> ACTION=="add", SUBSYSTEM=="scsi" , SYSFS{type}=="0|7|14", \
>  RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"
>
>   
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~--~~~~--~~--~--~---