Re: [OpenFCoE PATCH] [PATCH] Performance improvement, combine received data copy with CRC.

2007-12-06 Thread Joe Eykholt
Rob Love wrote:
 Joe Eykholt wrote:
 [PATCH] Performance improvement, combine received data copy with CRC.
   
 Shouldn't we remove  openfc_cp_to_user() if we're moving that
 functionality into openfc_scsi_recv_data()? 

Yes.  That was an oversight.  I did intend to remove it.
Do you want a new patch for that or will you take care of it?

Joe

 I don't see anything calling
 it anymore. My guess is that your leaving it in there for future usage,
 but my argument would be to remove it since it's not being used and then
 add it back if needed in the future.
 -
 To unsubscribe from this list: send the line unsubscribe linux-scsi in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [OpenFCoE PATCH] If expecting pre-T11 frames, a T11 frame caused a data fault.

2007-12-05 Thread Joe Eykholt
Christoph Hellwig wrote:
 Just wondering:
 
From my quick reading of the code these pre-T11 frames are basically
 a different frame-level protocol.  Given that T11 has standardized
 on a different one what's the rationale for supporting the old frames?

There is still some use in lab environments of the old frame format, and
it would greatly help if we could keep it working for now.  Eventually,
in a year or so, it could be removed completely.  It seems to be a small
amount of code and in a loadable module besides.

Joe
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE PATCH] Add a missing spin_unlock() found when a BLS frame was mis-delivered.

2007-12-04 Thread Joe Eykholt
Add a missing spin_unlock() found when a BLS frame was mis-delivered.



Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/openfc/openfc_scsi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c 
b/drivers/scsi/ofc/openfc/openfc_scsi.c
index 86e6895..5fa0ad6 100644
--- a/drivers/scsi/ofc/openfc/openfc_scsi.c
+++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
@@ -548,6 +548,8 @@ void openfc_scsi_abort_iocontext(struct fc_scsi_pkt *fsp)
fsp-status_code = OPENFC_ERROR;
fsp-io_status = (SUGGEST_RETRY  24);
(*fsp-done) (fsp);
+   } else {
+   spin_unlock(qp-scsi_pkt_lock);
}
 }
 


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE PATCH] Don't deliver BLS frames to the fast path.

2007-12-04 Thread Joe Eykholt
Don't deliver BLS frames to the fast path.



Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/libfc/fc_local_port.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ofc/libfc/fc_local_port.c 
b/drivers/scsi/ofc/libfc/fc_local_port.c
index 55de5d3..66a1d47 100644
--- a/drivers/scsi/ofc/libfc/fc_local_port.c
+++ b/drivers/scsi/ofc/libfc/fc_local_port.c
@@ -1607,7 +1607,8 @@ void fc_local_port_recv(struct fc_local_port *lp, struct 
fc_frame *fp)
/* fall through */
case FC_EOF_N:
mp = lp-fl_vf-vf_exch_mgr;
-   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX) {
+   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX 
+   fh-fh_type != FC_TYPE_BLS) {
fc_exch_recv_seq_resp(mp, fp);
} else if (f_ctl  FC_FC_SEQ_CTX) {
fc_exch_recv_resp(mp, fp);


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE PATCH] fcoe_create() fails without destroying the kmem slab.

2007-12-04 Thread Joe Eykholt
fcoe_create() fails without destroying the kmem slab.

This causes the next create to panic.
The destroy should be done in openfc_put_dev.

Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/openfc/openfc_if.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_if.c 
b/drivers/scsi/ofc/openfc/openfc_if.c
index 0d9c370..6f9a276 100644
--- a/drivers/scsi/ofc/openfc/openfc_if.c
+++ b/drivers/scsi/ofc/openfc/openfc_if.c
@@ -1115,7 +1115,6 @@ void openfc_unregister(struct fcdev *dev)
fc_remove_host(openfcp-host);
scsi_remove_host(openfcp-host);
fcs_destroy(openfcp-fcs_state);
-   openfc_destroy_scsi_slab(openfcp);
 }
 EXPORT_SYMBOL(openfc_unregister);
 
@@ -1127,9 +1126,7 @@ void openfc_put_dev(struct fcdev *dev)
 {
struct openfc_softc *openfcp = openfc_get_softc(dev);
 
-   /*
-* put back the scsi host structure
-*/
+   openfc_destroy_scsi_slab(openfcp);
scsi_host_put(openfcp-host);
 }
 EXPORT_SYMBOL(openfc_put_dev);


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE PATCH] If expecting pre-T11 frames, a T11 frame caused a data fault.

2007-12-04 Thread Joe Eykholt
If expecting pre-T11 frames, a T11 frame caused a data fault.

This is because the T11 frames have zeros where the old length/SOF
field was, and a length of less than the size of the FC header was
not checked for.

Also limit length error messages to frames (per-CPU actually).

Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/fcoe/fcoe_dev.c |   23 +++
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/ofc/fcoe/fcoe_dev.c b/drivers/scsi/ofc/fcoe/fcoe_dev.c
index df652b6..878efd4 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_dev.c
+++ b/drivers/scsi/ofc/fcoe/fcoe_dev.c
@@ -485,8 +485,9 @@ int fcoe_percpu_receive_thread(void *arg)
 
hp = (struct fcoe_hdr *)skb-data;
if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) {
-   SA_LOG(unknown FCoE version %x,
-  FC_FCOE_DECAPS_VER(hp));
+   if (stats-ErrorFrames  5)
+   SA_LOG(unknown FCoE version %x,
+  FC_FCOE_DECAPS_VER(hp));
stats-ErrorFrames++;
kfree_skb(skb);
continue;
@@ -505,20 +506,25 @@ int fcoe_percpu_receive_thread(void *arg)
skb_pull(skb, sizeof(*fchp));
fr_len = FC_FCOE_DECAPS_LEN(len);
fr_len = fr_len * FCOE_WORD_TO_BYTE;
+   if (unlikely(fr_len  sizeof(struct fc_frame_header) +
+   sizeof(cp-fcoe_crc32))) {
+   if (stats-ErrorFrames  5)
+   SA_LOG(length error: len_sof %x, len);
+   stats-ErrorFrames++;
+   kfree_skb(skb);
+   continue;
+   }
sof = FC_FCOE_DECAPS_SOF(len);
fr_len -= sizeof(cp-fcoe_crc32);
tlen = sizeof(struct fcoe_crc_eof_old);
}
 
if (skb_is_nonlinear(skb))
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,18)
-   skb_linearize(skb, GFP_KERNEL); /* not ideal */
-#else
skb_linearize(skb); /* not ideal */
-#endif
if (unlikely(fr_len + tlen  skb-len)) {
-   SA_LOG(short frame fr_len %x skb-len %x\n,
-  fr_len + tlen, skb-len);
+   if (stats-ErrorFrames  5)
+   SA_LOG(length error fr_len 0x%x skb-len 0x%x,
+  fr_len + tlen, skb-len);
stats-ErrorFrames++;
kfree_skb(skb);
continue;
@@ -540,6 +546,7 @@ int fcoe_percpu_receive_thread(void *arg)
 * and it'll be more cache-efficient.
 */
fh = fc_frame_header_get(fp);
+   ASSERT(fh);
if (fh-fh_r_ctl == FC_RCTL_DD_SOL_DATA 
fh-fh_type == FC_TYPE_FCP) {
fp-fr_flags |= FCPHF_CRC_UNCHECKED;


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE PATCH] [PATCH] Performance improvement, combine received data copy with CRC.

2007-12-04 Thread Joe Eykholt
[PATCH] Performance improvement, combine received data copy with CRC.



Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/openfc/openfc_scsi.c |  130 +++--
 1 files changed, 90 insertions(+), 40 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c 
b/drivers/scsi/ofc/openfc/openfc_scsi.c
index 5fa0ad6..b5fc393 100644
--- a/drivers/scsi/ofc/openfc/openfc_scsi.c
+++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
@@ -62,7 +62,6 @@ static void openfc_tm_done(struct fc_seq *, struct fc_frame 
*, void *);
 static void openfc_scsi_error(enum fc_event, void *);
 static int openfc_abort_internal(struct fcdev *, struct fc_scsi_pkt *,
 struct fc_frame *);
-int openfc_cp_to_user(struct fc_scsi_pkt *, uint, void *, int);
 void openfc_scsi_cleanup(struct fc_scsi_pkt *);
 static void openfc_timeout_error(struct fc_scsi_pkt *);
 void openfc_scsi_rec_rcv(struct fc_seq *, struct fc_frame *, void *);
@@ -102,9 +101,13 @@ static void openfc_scsi_recv_data(struct fc_scsi_pkt *fsp, 
struct fc_frame *fp)
struct fcoe_dev_stats *sp;
struct fc_frame_header *fh;
size_t offset;
+   u32 crc;
+   u32 copy_len = 0;
size_t len;
void *buf;
 
+   if (!sc-request_buffer)
+   return; /* XXX possible? */
fh = fc_frame_header_get(fp);
offset = net32_get(fh-fh_parm_offset);
len = fp-fr_len - sizeof(*fh);
@@ -115,13 +118,8 @@ static void openfc_scsi_recv_data(struct fc_scsi_pkt *fsp, 
struct fc_frame *fp)
 * this should never happen
 */
if ((fp-fr_flags  FCPHF_CRC_UNCHECKED) 
-   fc_frame_crc_check(fp)) {
-   sp = openfcp-fd.dev_stats[smp_processor_id()];
-   sp-ErrorFrames++;
-   if (sp-InvalidCRCCount++  5)
-   SA_LOG(CRC error on data frame);
-   return; /* just ignore the frame */
-   }
+   fc_frame_crc_check(fp))
+   goto crc_err;
if (openfc_debug) {
SA_LOG(data received past end.  
   len %zx offset %zx 
@@ -130,42 +128,95 @@ static void openfc_scsi_recv_data(struct fc_scsi_pkt 
*fsp, struct fc_frame *fp)
openfc_scsi_retry(fsp);
return;
}
-
-   /*
-* Eventually, do scatter/gather buffer system to avoid
-* this copy.  A NULL buffer means we discard the data.
-*/
+   crc = 0;
if (sc-use_sg) {
-   len = openfc_cp_to_user(fsp, offset, buf, len);
-   ASSERT_NOTIMPL(len  0);
-   } else if (sc-request_buffer != NULL) {
-   __memcpy((void *)sc-request_buffer + offset, buf, len);
-   }
+   struct scatterlist *sg;
+   struct scatterlist *sg_limit;
+   size_t remaining, sg_bytes;
+   size_t off;
+   void *page_addr;
 
-   /*
-* If the lower layer didn't do the CRC check, do it here.
-* This is the only type of frame the transport might not check.
-* Eventually we could do the CRC calculation during the copy above.
-*/
-   if ((fp-fr_flags  FCPHF_CRC_UNCHECKED)  fc_frame_crc_check(fp)) {
-   sp = openfcp-fd.dev_stats[smp_processor_id()];
-   sp-ErrorFrames++;
-   if (sp-InvalidCRCCount++  5)
-   SA_LOG(CRC error on data frame);
+   if (fp-fr_flags  FCPHF_CRC_UNCHECKED)
+   crc = crc32_sb8_64_bit(~0, (u8 *) fh, sizeof(*fh));
 
-   /*
-* Assume the frame is total garbage.
-* We may have copied it over the good part of the buffer.
-* If so, we need to retry the entire operation.
-* Otherwise, ignore it.
-*/
-   if (offset  fsp-xfer_len)
-   openfc_scsi_retry(fsp);
-   return;
-   }
+   sg = (struct scatterlist *)sc-request_buffer;
+   sg_limit = sg + sc-use_sg;
+   remaining = len;
 
-   fsp-xfer_len += len;
+   while (remaining  0  sg  sg_limit) {
+   if (offset = sg-length) {
+   offset -= sg-length;
+   sg++;
+   continue;
+   }
+   sg_bytes = min(remaining, sg-length - offset);
 
+   /*
+* The scatterlist item may be bigger than PAGE_SIZE,
+* but we are limited to mapping PAGE_SIZE at a time.
+*/
+   off = offset + sg-offset;
+   sg_bytes = min(sg_bytes,
+  (PAGE_SIZE - (off

[OpenFCoE PATCH] Don't use netdev for FCoE if pause is not correctly set, even for VLANs.

2007-12-04 Thread Joe Eykholt
Don't use netdev for FCoE if pause is not correctly set, even for VLANs.

This modifies the previous tests to require that the underlying net-dev
supports the ethtool get_pauseparam operation.

NICs that are 10/100/1000 must have pause autonegotiation turned on.
All NICs must have RX and TX pause on.  If not, they are treated as if
there is no link.

Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/fcoe/fcoe_def.h |1 
 drivers/scsi/ofc/fcoe/fcoe_if.c  |   90 ++
 drivers/scsi/ofc/fcoe/fcoeinit.c |   66 
 3 files changed, 71 insertions(+), 86 deletions(-)

diff --git a/drivers/scsi/ofc/fcoe/fcoe_def.h b/drivers/scsi/ofc/fcoe/fcoe_def.h
index 0c71dc7..6550c73 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_def.h
+++ b/drivers/scsi/ofc/fcoe/fcoe_def.h
@@ -109,6 +109,7 @@ int fcoe_create_interface(struct fcoe_info *, void 
*);
 intfcoe_xmit(struct fcdev *, struct fc_frame *);
 intfcoe_rcv(struct sk_buff *, struct net_device *,
 struct packet_type *, struct net_device *);
+intfcoe_link_ok(struct fcdev *);
 struct fc_frame *fcoe_frame_alloc(size_t);
 void fcoe_put_dev(struct fcdev *dev);
 struct fcoe_softc *fcoe_find_fcdev(char *);
diff --git a/drivers/scsi/ofc/fcoe/fcoe_if.c b/drivers/scsi/ofc/fcoe/fcoe_if.c
index d87ede1..fd3c7a7 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_if.c
+++ b/drivers/scsi/ofc/fcoe/fcoe_if.c
@@ -160,6 +160,48 @@ int fcoe_destroy_interface(struct fcdev *fd)
 }
 
 /*
+ * Return non-zero if link is OK for use by FCoE.
+ * Any permanently-disqualifying conditions have been previously checked.
+ * This checks pause settings, which can change with link.
+ * This also updates the speed setting, which may change with link for 
100/1000.
+ */
+int fcoe_link_ok(struct fcdev *fdev)
+{
+   struct fcoe_softc *fc = (struct fcoe_softc *)fdev-drv_priv;
+   struct net_device *dev = fc-real_dev;
+   struct ethtool_pauseparam pause = { ETHTOOL_GPAUSEPARAM };
+   struct ethtool_cmd ecmd = { ETHTOOL_GSET };
+   int rc = 0;
+
+   if ((dev-flags  IFF_UP)  netif_carrier_ok(dev)) {
+   dev-ethtool_ops-get_pauseparam(dev, pause);
+   if (dev-ethtool_ops-get_settings) {
+   dev-ethtool_ops-get_settings(dev, ecmd);
+   fdev-fd_speed_support =
+   ~(OFC_SPEED_1GBIT | OFC_SPEED_10GBIT);
+   if (ecmd.supported  (SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full))
+   fdev-fd_speed_support |= OFC_SPEED_1GBIT;
+   if (ecmd.supported  SUPPORTED_1baseT_Full)
+   fdev-fd_speed_support |= OFC_SPEED_10GBIT;
+   if (ecmd.speed == SPEED_1000)
+   fdev-fd_speed = OFC_SPEED_1GBIT;
+   if (ecmd.speed == SPEED_1)
+   fdev-fd_speed = OFC_SPEED_10GBIT;
+
+   /*
+* for 10 G (and faster), ignore autoneg requirement.
+*/
+   if (ecmd.speed = SPEED_1)
+   pause.autoneg = 1;
+   }
+   if (pause.autoneg  pause.tx_pause  pause.rx_pause)
+   rc = 1;
+   }
+   return rc;
+}
+
+/*
  * This function creates the fcoe interface
  * create struct fcdev which is a shared structure between opefc
  * and transport level protocol.
@@ -171,8 +213,6 @@ int fcoe_create_interface(struct fcoe_info *fci, void *ptr)
struct fcoe_cfg *cfg = ptr;
struct fcoe_softc *fc;
struct fcoe_dev_stats *p;
-   struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
-   struct ethtool_cmd ecmd = { ETHTOOL_GSET };
int rc = 0;
int i;
 #ifdef HAVE_SET_RX_MODE
@@ -207,12 +247,6 @@ int fcoe_create_interface(struct fcoe_info *fci, void *ptr)
goto out;
}
 
-   fdev-fd_link_status = TRANS_LINK_DOWN;
-   if ((fc-real_dev-flags  IFF_UP) != 0 
-   netif_carrier_ok(fc-real_dev)) {
-   fdev-fd_link_status = TRANS_LINK_UP;
-   }
-
/*
 * Do not support for bonding device
 */
@@ -224,38 +258,16 @@ int fcoe_create_interface(struct fcoe_info *fci, void 
*ptr)
}
 
/*
-* if it is not a vlan driver then do more check */
-   if (!(fc-real_dev-priv_flags  IFF_802_1Q_VLAN)) {
-
-   if (!fc-real_dev-ethtool_ops) {
-   rc = -EOPNOTSUPP;
-   goto out;
-   }
-   if (!fc-real_dev-ethtool_ops-get_pauseparam) {
-   rc = -EOPNOTSUPP;
-   goto out;
-   }
-   fc-real_dev-ethtool_ops-get_pauseparam(fc-real_dev

Re: [OpenFCoE PATCH] Add a missing spin_unlock() found when a BLS frame was mis-delivered.

2007-12-04 Thread Joe Eykholt
Joe Eykholt wrote:
 Add a missing spin_unlock() found when a BLS frame was mis-delivered.

Please disregard this patch.  It got merged into the wrong function.  A better 
one is coming.

Joe

 Signed-off-by: Joe Eykholt [EMAIL PROTECTED]
 
 ---
  drivers/scsi/ofc/openfc/openfc_scsi.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c 
 b/drivers/scsi/ofc/openfc/openfc_scsi.c
 index 86e6895..5fa0ad6 100644
 --- a/drivers/scsi/ofc/openfc/openfc_scsi.c
 +++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
 @@ -548,6 +548,8 @@ void openfc_scsi_abort_iocontext(struct fc_scsi_pkt *fsp)
   fsp-status_code = OPENFC_ERROR;
   fsp-io_status = (SUGGEST_RETRY  24);
   (*fsp-done) (fsp);
 + } else {
 + spin_unlock(qp-scsi_pkt_lock);
   }
  }
  
 
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-scsi in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
 

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE PATCH] Add a missing spin_unlock() found when a BLS frame was mis-delivered.

2007-12-04 Thread Joe Eykholt
Add a missing spin_unlock() found when a BLS frame was mis-delivered.



Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 drivers/scsi/ofc/openfc/openfc_scsi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c 
b/drivers/scsi/ofc/openfc/openfc_scsi.c
index 9e66c5f..6adfd59 100644
--- a/drivers/scsi/ofc/openfc/openfc_scsi.c
+++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
@@ -580,6 +580,8 @@ static void openfc_scsi_rcv(struct fc_seq *sp, struct 
fc_frame *fp, void *arg)
fc_seq_exch_complete(sp);
fsp-state = OPENFC_SRB_RCV_STATUS;
(*fsp-done) (fsp);
+   } else {
+   spin_unlock(qp-scsi_pkt_lock);
}
 out:
fc_frame_free(fp);


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE usr PATCH] Don't deliver BLS frames to the fast path.

2007-12-04 Thread Joe Eykholt
Don't deliver BLS frames to the fast path.



Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 usr/common/libfc/src/fc/fc_local_port.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/usr/common/libfc/src/fc/fc_local_port.c 
b/usr/common/libfc/src/fc/fc_local_port.c
index ba909d0..a798765 100644
--- a/usr/common/libfc/src/fc/fc_local_port.c
+++ b/usr/common/libfc/src/fc/fc_local_port.c
@@ -1611,7 +1611,8 @@ void fc_local_port_recv(struct fc_local_port *lp, struct 
fc_frame *fp)
/* fall through */
case FC_EOF_N:
mp = lp-fl_vf-vf_exch_mgr;
-   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX) {
+   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX 
+   fh-fh_type != FC_TYPE_BLS) {
fc_exch_recv_seq_resp(mp, fp);
} else if (f_ctl  FC_FC_SEQ_CTX) {
fc_exch_recv_resp(mp, fp);


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE usr PATCH] Change the default FCoE protocol version to the T11 standard-track one.

2007-12-04 Thread Joe Eykholt
Change the default FCoE protocol version to the T11 standard-track one.

The old version can still be selected using 'fcconf ethX fcoe_version old'.

Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 usr/ofc/tools/fcconf/src/fcc_adapt.c |1 +
 usr/ofc/tools/fcconf/src/fcc_eth.c   |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/usr/ofc/tools/fcconf/src/fcc_adapt.c 
b/usr/ofc/tools/fcconf/src/fcc_adapt.c
index eca2d1d..e0fae76 100644
--- a/usr/ofc/tools/fcconf/src/fcc_adapt.c
+++ b/usr/ofc/tools/fcconf/src/fcc_adapt.c
@@ -335,6 +335,7 @@ fcc_adapt_hba_get(void)
 snprintf(pp-fp_name, sizeof (pp-fp_name), %s,
   pp-fp_attr.OSDeviceName);
 pp-fp_fcoe = 1;
+pp-fp_fcoe_t11 = 1;
 } else {
 if (strstr(ap-fa_attr.Manufacturer, QLogic) != NULL) {
 pp-fp_fid_alt_format = 1;
diff --git a/usr/ofc/tools/fcconf/src/fcc_eth.c 
b/usr/ofc/tools/fcconf/src/fcc_eth.c
index f1d4bf9..863a4ba 100644
--- a/usr/ofc/tools/fcconf/src/fcc_eth.c
+++ b/usr/ofc/tools/fcconf/src/fcc_eth.c
@@ -231,6 +231,7 @@ fcc_eth_init_dev(struct dirent *dp, void *arg)
 }
 
 pp-fp_fcoe = 1;
+pp-fp_fcoe_t11 = 1;
 snprintf(ap-fa_attr.Model, sizeof (ap-fa_attr.Model),
   %s, FCC_FCOE_ADAPT_MODEL);
 ap-fa_attr.NodeWWN = pp-fp_attr.NodeWWN;


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE usr PATCH] Change the default FCoE protocol version to the T11 (Aug. 2007) version.

2007-12-04 Thread Joe Eykholt
Change the default FCoE protocol version to the T11 (Aug. 2007) version.

Use environment to override:  export FCOE_OLD_ALL=1 to use the old protocol
on all interfaces, or FCOE_OLD_eth0=1 to use it on eth0.

Signed-off-by: Joe Eykholt [EMAIL PROTECTED]

---
 usr/common/libfc/src/encaps/fcoe.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/usr/common/libfc/src/encaps/fcoe.c 
b/usr/common/libfc/src/encaps/fcoe.c
index 017e41e..4a0d9f0 100644
--- a/usr/common/libfc/src/encaps/fcoe.c
+++ b/usr/common/libfc/src/encaps/fcoe.c
@@ -60,8 +60,8 @@
 
 #define FCOE_ET_VAR FCOE_ETHERTYPE/* env. var. for ethertype */
 #define FCOE_OUI_VARFCOE_OUI  /* env. var. for OUI */
-#define FCOE_NEW_VARFCOE_NEW_%s   /* env. var. for new version */
-#define FCOE_NEW_ALL_VAR FCOE_NEW_ALL /* env. var. for new version */
+#define FCOE_OLD_VARFCOE_OLD_%s   /* env. var. for old version */
+#define FCOE_OLD_ALL_VAR FCOE_OLD_ALL /* env. var. for old version */
 
 #define FC_FCOE_BUFLEN  2200/* buffer size for reads */
 #define FC_FCOE_SOCKBUF_LEN (512 * 1024) /* requested receive socket buf size 
*/
@@ -158,11 +158,11 @@ fc_fcoe_create(const char *ifname, u_int vlan,
 charbuf[40];
 
 /*
- * Test for presense of env. variables FCOE_NEW_ifname or FCOE_NEW.
- * If these are not there, the older version is used.
+ * Test for presense of env. variables FCOE_OLD_ifname or FCOE_OLD_ALL.
+ * If any of these are there, the older protocol version is used.
  */
-snprintf(buf, sizeof (buf), FCOE_NEW_VAR, ifname);
-if ((getenv(buf) == NULL  getenv(FCOE_NEW_ALL_VAR) == NULL) ||
+snprintf(buf, sizeof (buf), FCOE_OLD_VAR, ifname);
+if (getenv(buf) != NULL || getenv(FCOE_OLD_ALL_VAR) != NULL ||
   (options  FC_OPT_FCOE_OLD) != 0) {
 return (fc_fcoe_create_old(ifname, vlan, src_mac, dest_mac, options));
 }


-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE] [PATCH] Add a missing spin_unlock() found when a BLS frame was mis-delivered.

2007-11-30 Thread Joe Eykholt
Add a missing spin_unlock() found when a BLS frame was mis-delivered.

---
 drivers/scsi/ofc/openfc/openfc_scsi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c 
b/drivers/scsi/ofc/openfc/openfc_scsi.c
index 86e6895..5fa0ad6 100644
--- a/drivers/scsi/ofc/openfc/openfc_scsi.c
+++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
@@ -548,6 +548,8 @@ void openfc_scsi_abort_iocontext(struct fc_scsi_pkt *fsp)
fsp-status_code = OPENFC_ERROR;
fsp-io_status = (SUGGEST_RETRY  24);
(*fsp-done) (fsp);
+   } else {
+   spin_unlock(qp-scsi_pkt_lock);
}
 }

--
1.5.3.6
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE] [PATCH] (user) Change the default FCoE protocol version to the T11 standard-track one.

2007-11-30 Thread Joe Eykholt
Change the default FCoE protocol version to the T11 standard-track one.

The old version can still be selected using 'fcconf ethX fcoe_version old'.
---
 usr/ofc/tools/fcconf/src/fcc_adapt.c |1 +
 usr/ofc/tools/fcconf/src/fcc_eth.c   |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/usr/ofc/tools/fcconf/src/fcc_adapt.c 
b/usr/ofc/tools/fcconf/src/fcc_adapt.c
index eca2d1d..e0fae76 100644
--- a/usr/ofc/tools/fcconf/src/fcc_adapt.c
+++ b/usr/ofc/tools/fcconf/src/fcc_adapt.c
@@ -335,6 +335,7 @@ fcc_adapt_hba_get(void)
 snprintf(pp-fp_name, sizeof (pp-fp_name), %s,
   pp-fp_attr.OSDeviceName);
 pp-fp_fcoe = 1;
+pp-fp_fcoe_t11 = 1;
 } else {
 if (strstr(ap-fa_attr.Manufacturer, QLogic) != NULL) {
 pp-fp_fid_alt_format = 1;
diff --git a/usr/ofc/tools/fcconf/src/fcc_eth.c 
b/usr/ofc/tools/fcconf/src/fcc_eth.c
index f1d4bf9..863a4ba 100644
--- a/usr/ofc/tools/fcconf/src/fcc_eth.c
+++ b/usr/ofc/tools/fcconf/src/fcc_eth.c
@@ -231,6 +231,7 @@ fcc_eth_init_dev(struct dirent *dp, void *arg)
 }

 pp-fp_fcoe = 1;
+pp-fp_fcoe_t11 = 1;
 snprintf(ap-fa_attr.Model, sizeof (ap-fa_attr.Model),
   %s, FCC_FCOE_ADAPT_MODEL);
 ap-fa_attr.NodeWWN = pp-fp_attr.NodeWWN;
--
1.5.3.6
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE] [PATCH] (user-level) Don't deliver BLS frames to the fast path.

2007-11-30 Thread Joe Eykholt
Don't deliver BLS frames to the fast path.

---
 usr/common/libfc/src/fc/fc_local_port.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/usr/common/libfc/src/fc/fc_local_port.c 
b/usr/common/libfc/src/fc/fc_local_port.c
index ba909d0..a798765 100644
--- a/usr/common/libfc/src/fc/fc_local_port.c
+++ b/usr/common/libfc/src/fc/fc_local_port.c
@@ -1611,7 +1611,8 @@ void fc_local_port_recv(struct fc_local_port *lp, struct 
fc_frame *fp)
/* fall through */
case FC_EOF_N:
mp = lp-fl_vf-vf_exch_mgr;
-   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX) {
+   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX 
+   fh-fh_type != FC_TYPE_BLS) {
fc_exch_recv_seq_resp(mp, fp);
} else if (f_ctl  FC_FC_SEQ_CTX) {
fc_exch_recv_resp(mp, fp);
--
1.5.3.6
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE] [PATCH] Don't deliver BLS frames to the fast path.

2007-11-30 Thread Joe Eykholt
Don't deliver BLS frames to the fast path.

---
 drivers/scsi/ofc/libfc/fc_local_port.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/ofc/libfc/fc_local_port.c 
b/drivers/scsi/ofc/libfc/fc_local_port.c
index 55de5d3..66a1d47 100644
--- a/drivers/scsi/ofc/libfc/fc_local_port.c
+++ b/drivers/scsi/ofc/libfc/fc_local_port.c
@@ -1607,7 +1607,8 @@ void fc_local_port_recv(struct fc_local_port *lp, struct 
fc_frame *fp)
/* fall through */
case FC_EOF_N:
mp = lp-fl_vf-vf_exch_mgr;
-   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX) {
+   if ((f_ctl  (FC_FC_EX_CTX | FC_FC_SEQ_CTX)) == FC_FC_EX_CTX 
+   fh-fh_type != FC_TYPE_BLS) {
fc_exch_recv_seq_resp(mp, fp);
} else if (f_ctl  FC_FC_SEQ_CTX) {
fc_exch_recv_resp(mp, fp);
--
1.5.3.6

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE] [PATCH] (user-libfc) Change the default FCoE protocol version to the T11 (Aug. 2007) version.

2007-11-30 Thread Joe Eykholt
Change the default FCoE protocol version to the T11 (Aug. 2007) version.

Use environment to override:  export FCOE_OLD_ALL=1 to use the old protocol
on all interfaces, or FCOE_OLD_eth0=1 to use it on eth0.
---
 usr/common/libfc/src/encaps/fcoe.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/usr/common/libfc/src/encaps/fcoe.c 
b/usr/common/libfc/src/encaps/fcoe.c
index 017e41e..4a0d9f0 100644
--- a/usr/common/libfc/src/encaps/fcoe.c
+++ b/usr/common/libfc/src/encaps/fcoe.c
@@ -60,8 +60,8 @@

 #define FCOE_ET_VAR FCOE_ETHERTYPE/* env. var. for ethertype */
 #define FCOE_OUI_VARFCOE_OUI  /* env. var. for OUI */
-#define FCOE_NEW_VARFCOE_NEW_%s   /* env. var. for new version */
-#define FCOE_NEW_ALL_VAR FCOE_NEW_ALL /* env. var. for new version */
+#define FCOE_OLD_VARFCOE_OLD_%s   /* env. var. for old version */
+#define FCOE_OLD_ALL_VAR FCOE_OLD_ALL /* env. var. for old version */

 #define FC_FCOE_BUFLEN  2200/* buffer size for reads */
 #define FC_FCOE_SOCKBUF_LEN (512 * 1024) /* requested receive socket buf size 
*/
@@ -158,11 +158,11 @@ fc_fcoe_create(const char *ifname, u_int vlan,
 charbuf[40];

 /*
- * Test for presense of env. variables FCOE_NEW_ifname or FCOE_NEW.
- * If these are not there, the older version is used.
+ * Test for presense of env. variables FCOE_OLD_ifname or FCOE_OLD_ALL.
+ * If any of these are there, the older protocol version is used.
  */
-snprintf(buf, sizeof (buf), FCOE_NEW_VAR, ifname);
-if ((getenv(buf) == NULL  getenv(FCOE_NEW_ALL_VAR) == NULL) ||
+snprintf(buf, sizeof (buf), FCOE_OLD_VAR, ifname);
+if (getenv(buf) != NULL || getenv(FCOE_OLD_ALL_VAR) != NULL ||
   (options  FC_OPT_FCOE_OLD) != 0) {
 return (fc_fcoe_create_old(ifname, vlan, src_mac, dest_mac, options));
 }
--
1.5.3.6

-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[OpenFCoE] [PATCH] Performance improvement, combine received data copy with CRC.

2007-11-30 Thread Joe Eykholt
Performance improvement, combine received data copy with CRC.

---
 drivers/scsi/ofc/openfc/openfc_scsi.c |  130 +++--
 1 files changed, 90 insertions(+), 40 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_scsi.c 
b/drivers/scsi/ofc/openfc/openfc_scsi.c
index 5fa0ad6..51ca6ee 100644
--- a/drivers/scsi/ofc/openfc/openfc_scsi.c
+++ b/drivers/scsi/ofc/openfc/openfc_scsi.c
@@ -62,7 +62,6 @@ static void openfc_tm_done(struct fc_seq *, struct fc_frame 
*, void *);
 static void openfc_scsi_error(enum fc_event, void *);
 static int openfc_abort_internal(struct fcdev *, struct fc_scsi_pkt *,
 struct fc_frame *);
-int openfc_cp_to_user(struct fc_scsi_pkt *, uint, void *, int);
 void openfc_scsi_cleanup(struct fc_scsi_pkt *);
 static void openfc_timeout_error(struct fc_scsi_pkt *);
 void openfc_scsi_rec_rcv(struct fc_seq *, struct fc_frame *, void *);
@@ -102,9 +101,13 @@ static void openfc_scsi_recv_data(struct fc_scsi_pkt *fsp, 
struct fc_frame *fp)
struct fcoe_dev_stats *sp;
struct fc_frame_header *fh;
size_t offset;
+   u32 crc;
+   u32 copy_len = 0;
size_t len;
void *buf;

+   if (!sc-request_buffer)
+   return; /* XXX possible? */
fh = fc_frame_header_get(fp);
offset = net32_get(fh-fh_parm_offset);
len = fp-fr_len - sizeof(*fh);
@@ -115,13 +118,8 @@ static void openfc_scsi_recv_data(struct fc_scsi_pkt *fsp, 
struct fc_frame *fp)
 * this should never happen
 */
if ((fp-fr_flags  FCPHF_CRC_UNCHECKED) 
-   fc_frame_crc_check(fp)) {
-   sp = openfcp-fd.dev_stats[smp_processor_id()];
-   sp-ErrorFrames++;
-   if (sp-InvalidCRCCount++  5)
-   SA_LOG(CRC error on data frame);
-   return; /* just ignore the frame */
-   }
+   fc_frame_crc_check(fp))
+   goto crc_err;
if (openfc_debug) {
SA_LOG(data received past end.  
   len %zx offset %zx 
@@ -130,42 +128,95 @@ static void openfc_scsi_recv_data(struct fc_scsi_pkt 
*fsp, struct fc_frame *fp)
openfc_scsi_retry(fsp);
return;
}
-
-   /*
-* Eventually, do scatter/gather buffer system to avoid
-* this copy.  A NULL buffer means we discard the data.
-*/
+   crc = 0;
if (sc-use_sg) {
-   len = openfc_cp_to_user(fsp, offset, buf, len);
-   ASSERT_NOTIMPL(len  0);
-   } else if (sc-request_buffer != NULL) {
-   __memcpy((void *)sc-request_buffer + offset, buf, len);
-   }
+   struct scatterlist *sg;
+   struct scatterlist *sg_limit;
+   size_t remaining, sg_bytes;
+   size_t off;
+   void *page_addr;

-   /*
-* If the lower layer didn't do the CRC check, do it here.
-* This is the only type of frame the transport might not check.
-* Eventually we could do the CRC calculation during the copy above.
-*/
-   if ((fp-fr_flags  FCPHF_CRC_UNCHECKED)  fc_frame_crc_check(fp)) {
-   sp = openfcp-fd.dev_stats[smp_processor_id()];
-   sp-ErrorFrames++;
-   if (sp-InvalidCRCCount++  5)
-   SA_LOG(CRC error on data frame);
+   if (fp-fr_flags  FCPHF_CRC_UNCHECKED)
+   crc = crc32_sb8_64_bit(~0, (u8 *) fh, sizeof(*fh));

-   /*
-* Assume the frame is total garbage.
-* We may have copied it over the good part of the buffer.
-* If so, we need to retry the entire operation.
-* Otherwise, ignore it.
-*/
-   if (offset  fsp-xfer_len)
-   openfc_scsi_retry(fsp);
-   return;
-   }
+   sg = (struct scatterlist *)sc-request_buffer;
+   sg_limit = sg + sc-use_sg;
+   remaining = len;

-   fsp-xfer_len += len;
+   while (remaining  0  sg  sg_limit) {
+   if (offset = sg-length) {
+   offset -= sg-length;
+   sg++;
+   continue;
+   }
+   sg_bytes = min(remaining, sg-length - offset);

+   /*
+* The scatterlist item may be bigger than PAGE_SIZE,
+* but we are limited to mapping PAGE_SIZE at a time.
+*/
+   off = offset + sg-offset;
+   sg_bytes = min(sg_bytes,
+  (PAGE_SIZE - (off  ~PAGE_MASK)));
+   page_addr = 

[OpenFCoE] [PATCH] fcoe_create() fails without destroying the kmem slab.

2007-11-30 Thread Joe Eykholt
fcoe_create() fails without destroying the kmem slab.

This causes the next create to panic.
The destroy should be done in openfc_put_dev.
---
 drivers/scsi/ofc/openfc/openfc_if.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ofc/openfc/openfc_if.c 
b/drivers/scsi/ofc/openfc/openfc_if.c
index 0d9c370..6f9a276 100644
--- a/drivers/scsi/ofc/openfc/openfc_if.c
+++ b/drivers/scsi/ofc/openfc/openfc_if.c
@@ -1115,7 +1115,6 @@ void openfc_unregister(struct fcdev *dev)
fc_remove_host(openfcp-host);
scsi_remove_host(openfcp-host);
fcs_destroy(openfcp-fcs_state);
-   openfc_destroy_scsi_slab(openfcp);
 }
 EXPORT_SYMBOL(openfc_unregister);

@@ -1127,9 +1126,7 @@ void openfc_put_dev(struct fcdev *dev)
 {
struct openfc_softc *openfcp = openfc_get_softc(dev);

-   /*
-* put back the scsi host structure
-*/
+   openfc_destroy_scsi_slab(openfcp);
scsi_host_put(openfcp-host);
 }
 EXPORT_SYMBOL(openfc_put_dev);
--
1.5.3.6
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Open-FCoE] [PATCH] If expecting pre-T11 frames, a T11 frame caused a data fault.

2007-11-29 Thread Joe Eykholt
From: Joe Eykholt [EMAIL PROTECTED]
Date: Mon, 26 Nov 2007 18:51:01 -0800
If expecting pre-T11 frames, a T11 frame caused a data fault.

This is because the T11 frames have zeros where the old length/SOF
field was, and a length of less than the size of the FC header was
not checked for.

Also limit length error messages to 5 frames (per-CPU actually).
---
 drivers/scsi/ofc/fcoe/fcoe_dev.c |   23 +++
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/ofc/fcoe/fcoe_dev.c b/drivers/scsi/ofc/fcoe/fcoe_dev.c
index df652b6..f5b5eed 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_dev.c
+++ b/drivers/scsi/ofc/fcoe/fcoe_dev.c
@@ -485,8 +485,9 @@ int fcoe_percpu_receive_thread(void *arg)

hp = (struct fcoe_hdr *)skb-data;
if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) {
-   SA_LOG(unknown FCoE version %x,
-  FC_FCOE_DECAPS_VER(hp));
+   if (stats-ErrorFrames  5)
+   SA_LOG(unknown FCoE version %x,
+  FC_FCOE_DECAPS_VER(hp));
stats-ErrorFrames++;
kfree_skb(skb);
continue;
@@ -505,20 +506,25 @@ int fcoe_percpu_receive_thread(void *arg)
skb_pull(skb, sizeof(*fchp));
fr_len = FC_FCOE_DECAPS_LEN(len);
fr_len = fr_len * FCOE_WORD_TO_BYTE;
+   if (unlikely(fr_len  sizeof (struct fc_frame_header) +
+   sizeof (cp-fcoe_crc32))) {
+   if (stats-ErrorFrames  5)
+   SA_LOG(length error: len_sof %x, len);
+   stats-ErrorFrames++;
+   kfree_skb(skb);
+   continue;
+   }
sof = FC_FCOE_DECAPS_SOF(len);
fr_len -= sizeof(cp-fcoe_crc32);
tlen = sizeof(struct fcoe_crc_eof_old);
}

if (skb_is_nonlinear(skb))
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,18)
-   skb_linearize(skb, GFP_KERNEL); /* not ideal */
-#else
skb_linearize(skb); /* not ideal */
-#endif
if (unlikely(fr_len + tlen  skb-len)) {
-   SA_LOG(short frame fr_len %x skb-len %x\n,
-  fr_len + tlen, skb-len);
+   if (stats-ErrorFrames  5)
+   SA_LOG(length error fr_len 0x%x skb-len 0x%x,
+  fr_len + tlen, skb-len);
stats-ErrorFrames++;
kfree_skb(skb);
continue;
@@ -540,6 +546,7 @@ int fcoe_percpu_receive_thread(void *arg)
 * and it'll be more cache-efficient.
 */
fh = fc_frame_header_get(fp);
+   ASSERT(fh);
if (fh-fh_r_ctl == FC_RCTL_DD_SOL_DATA 
fh-fh_type == FC_TYPE_FCP) {
fp-fr_flags |= FCPHF_CRC_UNCHECKED;
--
1.5.3.6
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Open-FCoE] [ANNOUNCE] Open-FCoE - Fibre Channel over Ethernet Project

2007-11-28 Thread Joe Eykholt
Chris Leech wrote:
 Christoph Hellwig wrote:
   
 I just did a very quick glance over the tree.  Some extremly highlevel
 comments to start with before actually starting the source review:
 

 Thanks for taking a look Christoph

   
  - why do you need your own libcrc?  lib/crc32.c has a crc32_le
 

 We shouldn't, but we may want to add a CRC and copy routine.

   
  - libsa should go.  Much of it is just wrappers of kernel functions
that should be used directly.  Other like that hash, even or state
helpers might either be opencoded in the caller or made completely
generic in lib/.  Probably the former but we'll have to see.
 

 Yes, and along with it the last use of the BSD TAILQ macros.  Just 
 before Rob set up the open repos I finished converting most of those to 
 list_head, the only one left is in the sa_event mechanism.  Rather than 
 convert it I'd like to replace the use of sa_event with notifier call 
 chains.  I just need to finish auditing the use to make sure the 
 differences won't cause unexpected problems.

 After than and unwrapping kernel functions, I think the only thing left 
 before completly removing libsa is to open code the state machines.

 Similarly I think net_types.h need to go.

   
Hi All,

[resending as plain text -sorry].

I've had a start at getting rid of sa_state, but I haven't tested it
yet.  It's a pretty straightforward change to just call the new state
routine directly instead of going through the table.  I'll submit that
in the next week or so, or if desired, someone else can take over the
work from the code I have.

   Joe
-
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html