* fcoe cleanups and fcoe TODO
@ 2008-06-29 18:23 michaelc
2008-06-29 18:23 ` [PATCH 01/13] set proc name michaelc
` (2 more replies)
0 siblings, 3 replies; 22+ messages in thread
From: michaelc @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi, devel
Hey,
Following are some cleanup patches for things I found while trying
to get setup. I did not get to test the patches well, because
the rearch code does not seem to work every well the software
target. I basically loaded the driver and made sure I could login
and find storage. Trying to do heavy READ and WRITE IO lead to problems.
The patches are made over the re-arch git tree.
Below are some notes for things I am working on and that we may want to
talk about or you may want to hack on. It is not a complete list. Just
some stuff I noticed on the first pass.
My TODO:
- Replace fc_scsi.c's outstanding array with scsi host shared tag map
(scsi_init_shared_tag_map).
- Fix locking and document it:
fc_scsi.c: The fc_scsi_pkt done function can be called with spin
locks held so at first glance we should not call del_timer_sync
because it can sleep.
Other libfc code's fl_lock, rp_lock and em_lock and ex_lock is
really complicated. It needs some documentation. I hit the
locking bug fixed with
0003-libfc-fix-locking-in-tt.rport_lookup_create-paths.patch
and it turns out we can call functions with different locks held.
For example we call the frame_send callout with the fl_lock
sometimes and other times with another lock. And sometimes bhs
are disabled and sometimes they are not.
Will libfc code be used by drivers that work more like
traditional drivers where they have a interrupt handler and
do not hook into the network layer? If so then it seems
like we want to the irq spin locks instead of the bh ones.
Also remove fl_lock and rp_lock wrappers.
The per scsi packet locking looks a little too complicated.
How much of a performance boost do we get from this?
- Some of the host lib re-arch seems akward (maybe it was like this before).
The LLD allocates and adds the scsi host, but fc_lport_destroy removes
the host and the driver only does the last put. We should probably
make this more symmetrical. Was this done to fix the sync cache
command and logout processing?
- I am not sure if the setup functions like fc_lport_init are nice
in how it sets the transport functions pointers for you or if it will lead
to problems for drivers that want to partially hook in, but find
out that the lib has set some functions it did not want. Maybe we want
to set the libfc functions in the LLD like is done for the scsi_host_template.
I think we need to see more hardware in the end. For now since there is only
software fcoe that is out, this could probably be ok and as we see more
drivers we can evolve the split for the hardware like was done with iscsi.
For iscsi we ended up with 4 different offload modules so there was no way
we could have designed for all of them and the hardware/firmware
guys's quirks :)
- In general without knowing how hardware is really going to hook into
the lib it is hard to say how the rearch is going :) If we cannot
move more of the fc_remote_port to the rport (or if we just do not
want to move it all there because other drivers like lpfc and qla2xxx
will never use it) then we might want to rename the fc_remote_port
to avoid confusion with the rport and make it clear that the libfc remote
port is only needed for libfc operations.
Should the fc_transport_template be merged with the fc_function_template?
The function callouts to do things lke abort IO or cleanup commands look
similar. But in general should the fc_function_template be common for all
fc drivers and should the fc_transport_template be just for the ones that are
going to hook into the libfc? If the latter maybe we want to rename this to
make the visibility clear.
- How much of the drivers/scsi/fcoe driver should be common? The start and
stop interface seems like it should be common for all fc drivers. But will
some things like passing in the network device to use be fcoe module specific?
Will other drivers load like a more traditional driver with a pci_driver,
or will this be a mess like iscsi where some do, but others bind to
network devices (netdevs) that also have fcoe engines. The pci_driver
case would mean that we do not need a common interface for this,
but for the netdev with fcoe engine then it seems like we want a common
inteface like we have with iscsi.
Do we want a common userspace interface for the setup like we have with
iscsi for the initial merge? If so, we can say the interface is unstable
for now, because we just do not know how the hardware is going to work or
we can try and design a interface based on what we learned from iscsi. The
latter will probably result in a incorrct design since we are only
lowly driver engineers and do not know the fun the firmware guys
have for us :) However breaking userspace interfaces is a real pain
for users. When we did the latter for iscsi it was a tremendous pain for
users and distro integrators.
- Should discovery be done in userspace? For iscsi we put things like iSNS
in userspace and even sendtargets which is not that big. iSNS is big and
clunky. It looks like 10 thousand lines from doing a wc on some of the
open-isns code, but could be smaller if we limit the features (the native
iSNS code in open-iscsi's userspace daemon is only a couple thousand lines
but that only does discovery). Are we going to have something similar for
fcoe? If so then we might want to keep all discovery in userspace and
create a interface similar to iscsi where discovery is done in userspace
and then tells the kernel to create objects like rports for only the targets.
Going to userspace on the other hand is a major pain in the butt when
it comes to distro integration and error handling. For an RCSN would
we have to kick back out to userspace then come back to the kernel?
If so for iscsi it turns out to be a lot more complicated to do the
equivalent when you move discovery to userspace. And for boot it gets messy
to get this all to work right.
- For storage drivers are we using the be/le cpu functions instead
of the hton/ntoh? I think Christoph asked us to do that for iscsi.
- A lot of the goto error paths are broken. The fcoe module init for
example leaks when some functions fail (probably due to rearch and this
being more temp code).
- Add some mempools or reserve just enough scsi pkt and em resources so we
can make forward progress on at least one command per host.
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 01/13] set proc name
2008-06-29 18:23 fcoe cleanups and fcoe TODO michaelc
@ 2008-06-29 18:23 ` michaelc
[not found] ` <1214763843-5548-2-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-30 20:33 ` fcoe cleanups and fcoe TODO Love, Robert W
2008-07-03 0:13 ` [Open-FCoE] " Leech, Christopher
2 siblings, 1 reply; 22+ messages in thread
From: michaelc @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
1. Set proc name to fcoe so we can id from userspace.
2. rearrange includes in fcoe_if.c scsi comes after linux ones,
and drop unused includes like the cam and tcq ones.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/fcoe/fcoe_if.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
index e92a354..24efe01 100644
--- a/drivers/scsi/fcoe/fcoe_if.c
+++ b/drivers/scsi/fcoe/fcoe_if.c
@@ -26,10 +26,6 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/spinlock.h>
-#include <scsi/scsi_tcq.h>
-#include <scsi/scsicam.h>
-#include <scsi/scsi_transport.h>
-#include <scsi/scsi_transport_fc.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -40,6 +36,8 @@
#include <scsi/fc/fc_els.h>
#include <scsi/fc/fc_encaps.h>
#include <scsi/fc/fc_fs.h>
+#include <scsi/scsi_transport.h>
+#include <scsi/scsi_transport_fc.h>
#include <scsi/libfc/libfc.h>
#include <scsi/libfc/fc_dbg.h>
@@ -263,6 +261,7 @@ struct device_attribute *fcoe_host_attrs[] = {
static struct scsi_host_template fcoe_driver_template = {
.module = THIS_MODULE,
.name = "FCoE Driver",
+ .proc_name = FCOE_DRIVER_NAME,
.queuecommand = fc_queuecommand,
.eh_abort_handler = fc_eh_abort,
.eh_device_reset_handler = fc_eh_device_reset,
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/13] libfc: remove libfc scan_host
[not found] ` <1214763843-5548-2-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-29 18:23 ` michaelc-hcNo3dDEHLuVc3sceRu5cw
2008-06-29 18:23 ` [PATCH 03/13] libfc: fix locking in tt.rport_lookup_create paths michaelc
0 siblings, 1 reply; 22+ messages in thread
From: michaelc-hcNo3dDEHLuVc3sceRu5cw @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw
From: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
We only want to call scsi_scan_host if we are hooked into the async
scanning correctly, because the fc class does a scan from the rport
workqueue. If we actually call scsi_scan_host from where scsi_scan
is being called some bad things can happen because it will sleep
while the scanning is being performed and we need to use those threads
for the IO traffic.
Signed-off-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
---
drivers/scsi/libfc/fc_disc.c | 7 +------
drivers/scsi/libfc/fc_scsi.c | 10 ----------
include/scsi/libfc/libfc.h | 5 -----
3 files changed, 1 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 67e8c24..45210c3 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -444,11 +444,8 @@ static int fcdt_new_target(struct fc_lport *lp,
if (rp->rp_disc_ver == 0 || rp->rp_sess_ready == 0) {
rp->rp_local_fcp_parm = lp->service_params;
lp->tt.rport_login(rp);
- } else {
- if (!lp->fs_disc_done)
- lp->tt.scan_host(lp);
+ } else
lp->fs_disc_done = 1;
- }
}
}
return error;
@@ -506,8 +503,6 @@ static void fcdt_done(struct fc_lport *lp)
}
WARN_ON(held);
fc_rp_list_unlock(lp);
- if (!lp->fs_disc_done)
- lp->tt.scan_host(lp);
lp->fs_disc_done = 1;
lp->fl_disc_in_prog = 0;
if (lp->fl_disc_req)
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index e881589..b877daa 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -2252,13 +2252,6 @@ void fc_put_dev(struct fc_lport *lp)
}
EXPORT_SYMBOL(fc_put_dev);
-void fc_scan_host(struct fc_lport *lp)
-{
- if (lp->state != FC_INITIALIZATION)
- scsi_scan_host(lp->host);
-}
-EXPORT_SYMBOL(fc_scan_host);
-
int fc_scsi_init(struct fc_lport *lp,
struct fc_transport_template *tmpl)
{
@@ -2271,9 +2264,6 @@ int fc_scsi_init(struct fc_lport *lp,
if (!lp->tt.scsi_abort_io)
lp->tt.scsi_abort_io = fc_scsi_abort_io;
- if (!lp->tt.scan_host)
- lp->tt.scan_host = fc_scan_host;
-
si = (struct fc_scsi_internal*)kzalloc(sizeof(struct fc_scsi_internal), GFP_ATOMIC);
lp->scsi_priv = (void*)si;
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index b87d404..68ea82f 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -437,11 +437,6 @@ struct fc_transport_template {
*/
void (*scsi_abort_io)(struct fc_lport *);
- /*
- * Tell the SCSI block to let the SCSI-ml scan the host.
- */
- void (*scan_host)(struct fc_lport *);
-
/**
* Discovery interfaces
*/
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/13] libfc: fix locking in tt.rport_lookup_create paths
2008-06-29 18:23 ` [PATCH 02/13] libfc: remove libfc scan_host michaelc-hcNo3dDEHLuVc3sceRu5cw
@ 2008-06-29 18:23 ` michaelc
[not found] ` <1214763843-5548-4-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
0 siblings, 1 reply; 22+ messages in thread
From: michaelc @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
In some code paths we had the fl_lock when calling
tt.rport_lookup_create. tt.rport_lookup_create can sleep if
it needs to create a new rport (fc class uses GFP_KERNEL
for example), so we need to have the spin locks dropped.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/libfc/fc_disc.c | 7 +++++++
drivers/scsi/libfc/fc_lport.c | 7 +++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 45210c3..a1b5171 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -907,7 +907,14 @@ static void fc_disc_enter_dns(struct fc_lport *lp)
/*
* Set up remote port to directory server.
*/
+
+ /*
+ * we are called with the fl_lock, but if rport_lookup_create
+ * needs to create a rport then it will sleep.
+ */
+ spin_unlock_bh(&lp->fl_lock);
rp = lp->tt.rport_lookup_create(lp, &ids);
+ spin_lock_bh(&lp->fl_lock);
if (!rp)
goto err;
lp->tt.sess_init(lp, rp);
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index e3eae92..a7ffab7 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -177,7 +177,14 @@ static void fc_lport_ptp_setup(struct fc_lport *lp,
.node_name = remote_wwnn,
};
+
+ /*
+ * if we have to create a rport the fc class can sleep so we must
+ * drop the lock here
+ */
+ spin_unlock_bh(&lp->fl_lock);
rp = lp->tt.rport_lookup_create(lp, &ids);
+ spin_lock_bh(&lp->fl_lock);
if (rp) {
if (lp->fl_ptp_rp)
lp->tt.rport_release(lp->fl_ptp_rp);
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/13] fcoe: fix fcoe_create_interface goto paths
[not found] ` <1214763843-5548-4-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-29 18:23 ` michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-5-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
0 siblings, 1 reply; 22+ messages in thread
From: michaelc-hcNo3dDEHLuVc3sceRu5cw @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw
From: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
1. If fc_scsi_init fails no one noticed.
2. fcoe_find_fc_lport was called before real_dev was set
so were hitting a null ptr.
3. On the cleanup paths, fc_put_dev does a put on the host so there
was not need to do it again in the out_host_put. fc_lport_destroy removed
the host so no need to do it in out_host_rem.
And fc_put_dev does the host put was sort of wierd because the driver
called host alloc, so this moves that call the driver (maybe this
should be done for the host remove call too).
Signed-off-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
---
drivers/scsi/fcoe/fcoe_if.c | 70 ++++++++++++++++++++++++------------------
drivers/scsi/libfc/fc_exch.c | 1 +
drivers/scsi/libfc/fc_scsi.c | 1 -
3 files changed, 41 insertions(+), 31 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
index 24efe01..1f32743 100644
--- a/drivers/scsi/fcoe/fcoe_if.c
+++ b/drivers/scsi/fcoe/fcoe_if.c
@@ -375,6 +375,7 @@ int fcoe_destroy_interface(const char *ifname)
}
fcoe_put_dev(lp);
+ scsi_host_put(lp->host);
return 0;
}
@@ -446,13 +447,26 @@ int fcoe_create_interface(const char *ifname)
u8 flogi_maddr[ETH_ALEN];
#endif
+ net_dev = (void *)dev_get_by_name(&init_net, ifname);
+ if (net_dev == NULL) {
+ FC_DBG("could not get network device for %s",
+ ifname);
+ return -ENODEV;
+ }
+
+ if (fcoe_find_fc_lport(net_dev->name) != NULL) {
+ rc = -EEXIST;
+ goto out_put_dev;
+ }
+
host = scsi_host_alloc(&fcoe_driver_template,
sizeof(struct fc_lport) +
sizeof(struct fcoe_softc));
if (host == NULL) {
FC_DBG("openfc: Could not allocate host structure\n");
- goto out;
+ rc = -ENOMEM;
+ goto out_put_dev;
}
host->transportt = fcoe_transport_template;
@@ -465,6 +479,7 @@ int fcoe_create_interface(const char *ifname)
fc = (struct fcoe_softc *)lp->drv_priv;
memset(fc, 0, sizeof(struct fcoe_softc));
fc->lp = lp;
+ fc->real_dev = net_dev;
/* Set the function pointers set by the LLDD */
memcpy(&lp->tt, &fcoe_libfc_transport_template, sizeof(struct fc_transport_template));
@@ -474,17 +489,16 @@ int fcoe_create_interface(const char *ifname)
host->max_id = FC_MAX_FCP_TARGET;
host->max_channel = 0;
- /* Add the new host to the SCSI-ml */
- rc = scsi_add_host(lp->host, NULL);
- if (rc) {
- FC_DBG("error on scsi_add_host\n");
- goto out_host_put;
- }
-
/* Allocate an EM for this driver */
lp->emp = fc_exch_mgr_alloc(FC_CLASS_3, 0, 0);
if (!lp->emp)
- goto out_host_rem;
+ goto out_host_put;
+
+ /* Initialize the scsi block */
+ if (fc_scsi_init(lp, &fcoe_libfc_transport_template)) {
+ rc = -ENOMEM;
+ goto out_exch_free;
+ }
/* Configure the fc_lport for this host */
lp->state = FC_INITIALIZATION;
@@ -495,6 +509,13 @@ int fcoe_create_interface(const char *ifname)
lp->service_params = (FCP_SPPF_INIT_FCN | FCP_SPPF_RD_XRDY_DIS |
FCP_SPPF_RETRY | FCP_SPPF_CONF_COMPL);
+ /* Add the new host to the SCSI-ml */
+ rc = scsi_add_host(lp->host, NULL);
+ if (rc) {
+ FC_DBG("error on scsi_add_host\n");
+ goto out_scsi_free;
+ }
+
/* Initialize most of libfc */
fc_exch_init(lp, &fcoe_libfc_transport_template);
fc_lport_init(lp, &fcoe_libfc_transport_template);
@@ -505,9 +526,6 @@ int fcoe_create_interface(const char *ifname)
/* Finish fc_lport configuration */
fc_lport_config(lp);
- /* Initialize the scsi block */
- fc_scsi_init(lp, &fcoe_libfc_transport_template);
-
/* XXX - Can this be moved into fabric_login()? */
if (lp->link_status == TRANS_LINK_DOWN) {
lp->fl_logon_req = 0;
@@ -519,19 +537,6 @@ int fcoe_create_interface(const char *ifname)
lp->fc_boot_time = jiffies;
lp->state = FC_RUNNING;
- if (fcoe_find_fc_lport(fc->real_dev->name) != NULL) {
- rc = -EEXIST;
- goto out;
- }
-
- fc->real_dev = (void *)dev_get_by_name(&init_net, ifname);
- if (fc->real_dev == NULL) {
- FC_DBG("could not get network device for %s",
- ifname);
- rc = -ENODEV;
- goto out;
- }
-
/* Do not support for bonding device */
if ((fc->real_dev->priv_flags & IFF_MASTER_ALB) ||
(fc->real_dev->priv_flags & IFF_SLAVE_INACTIVE) ||
@@ -634,15 +639,20 @@ int fcoe_create_interface(const char *ifname)
return rc;
out:
- fcoe_put_dev(lp);
fc_rport_destroy(lp);
fc_lport_destroy(lp); /* also closes port */
-out_host_rem:
- scsi_remove_host(lp->host);
-out_host_put:
+ fcoe_put_dev(lp);
scsi_host_put(lp->host);
- WARN_ON(1);
+ return rc;
+out_scsi_free:
+ fc_put_dev(lp);
+out_exch_free:
+ fc_exch_mgr_free(lp->emp);
+out_host_put:
+ scsi_host_put(lp->host);
+out_put_dev:
+ dev_put(net_dev);
return rc;
}
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 9333999..a663442 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1701,6 +1701,7 @@ void fc_exch_mgr_free(struct fc_exch_mgr *mp)
kmem_cache_destroy(mp->em_cp);
kfree(mp);
}
+EXPORT_SYMBOL(fc_exch_mgr_free);
struct fc_exch *fc_exch_alloc(struct fc_exch_mgr *mp, fc_xid_t ex_id)
{
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index b877daa..a438aa0 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -2248,7 +2248,6 @@ void fc_put_dev(struct fc_lport *lp)
fc_destroy_scsi_slab(lp);
kfree(fc_get_scsi_internal(lp));
lp->scsi_priv = NULL;
- scsi_host_put(lp->host);
}
EXPORT_SYMBOL(fc_put_dev);
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/13] libfc: rename target reset
[not found] ` <1214763843-5548-5-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-29 18:23 ` michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-6-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
0 siblings, 1 reply; 22+ messages in thread
From: michaelc-hcNo3dDEHLuVc3sceRu5cw @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw
From: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
Rename target reset function to lun reset because that is what it sends.
Also make it static because it is not exported and not used in other
files.
Signed-off-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
---
drivers/scsi/libfc/fc_scsi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index a438aa0..ec7f3dd 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -1128,10 +1128,10 @@ retry:
}
/*
- * Scsi target reset handler- send a LUN RESET to the device
+ * Scsi device reset handler- send a LUN RESET to the device
* and wait for reset reply
*/
-int fc_target_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
+static int fc_lun_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
{
unsigned long flags;
u32 idx;
@@ -2115,7 +2115,7 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
/*
* flush outstanding commands
*/
- rc = fc_target_reset(lp, sp);
+ rc = fc_lun_reset(lp, sp);
sp->state = FC_SRB_FREE;
fc_scsi_pkt_free(sp);
}
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/13] libfc: trivial fc_scsi cleanup
[not found] ` <1214763843-5548-6-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-29 18:23 ` michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-7-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
0 siblings, 1 reply; 22+ messages in thread
From: michaelc-hcNo3dDEHLuVc3sceRu5cw @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw
From: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
Just mostly static stuff.
1. change allocation flag in fc_scsi_init to GFP_KERNEL since it
has process context.
2. Make functions static when only used in this file.
3. Remove unncessary function declarations - it would be nice to remove
all of them because they are such a pain in the ass to maintain.
4. rename openfc_io_compl to just fc_io_compl.
Signed-off-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
---
drivers/scsi/libfc/fc_scsi.c | 39 ++++++++++++++++++---------------------
1 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index ec7f3dd..b9487bf 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -163,15 +163,12 @@ static void fc_scsi_timeout(struct fc_scsi_pkt *);
static void fc_scsi_rec(struct fc_scsi_pkt *);
static void fc_scsi_rec_error(struct fc_scsi_pkt *, struct fc_frame *);
static void fc_scsi_rec_resp(struct fc_seq *, struct fc_frame *, void *);
+static void fc_io_compl(struct fc_scsi_pkt *);
static void fc_scsi_srr(struct fc_scsi_pkt *, enum fc_rctl, u32);
static void fc_scsi_srr_resp(struct fc_seq *, struct fc_frame *, void *);
static void fc_scsi_srr_error(struct fc_scsi_pkt *, struct fc_frame *);
-static void fc_scsi_pkt_hold(struct fc_scsi_pkt *);
-static void fc_scsi_pkt_release(struct fc_scsi_pkt *);
-static int fc_destroy_scsi_slab(struct fc_lport *);
-
/*
* command status codes
*/
@@ -199,8 +196,6 @@ static int fc_destroy_scsi_slab(struct fc_lport *);
#define OPENFC_DFLT_QUEUE_DEPTH 32
-static void openfc_io_compl(struct fc_scsi_pkt *);
-
/*
* function prototypes
* FC scsi I/O related functions
@@ -253,18 +248,18 @@ static int fc_scsi_pkt_free(struct fc_scsi_pkt *sp)
return 0;
}
-void fc_scsi_pkt_hold(struct fc_scsi_pkt *sp)
+static void fc_scsi_pkt_hold(struct fc_scsi_pkt *sp)
{
atomic_inc(&sp->ref_cnt);
}
-void fc_scsi_pkt_release(struct fc_scsi_pkt *sp)
+static void fc_scsi_pkt_release(struct fc_scsi_pkt *sp)
{
fc_scsi_pkt_free(sp);
}
-int fc_destroy_scsi_slab(struct fc_lport *lp)
+static int fc_destroy_scsi_slab(struct fc_lport *lp)
{
int rc = -1;
struct fc_scsi_internal *si = fc_get_scsi_internal(lp);
@@ -922,7 +917,7 @@ static void fc_scsi_abort_io(struct fc_lport *lp)
* Context : called from process context or timer context
* must not be called holding list lock
*/
-int fc_scsi_pkt_send(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
+static int fc_scsi_pkt_send(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
{
u32 idx, i;
unsigned long flags;
@@ -1057,7 +1052,7 @@ static void fc_abort_internal(struct fc_scsi_pkt *fsp)
* Scsi abort handler- calls fcs to send an abort
* and then wait for abort completion
*/
-int fc_scsi_pkt_abort(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
+static int fc_scsi_pkt_abort(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
{
int rc = FAILED;
@@ -1218,7 +1213,7 @@ out:
* this routine will assume that flogo has happened
* end we are cleaning all the commands.
*/
-int fc_inf_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
+static int fc_inf_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
{
int idx;
unsigned long flags;
@@ -1266,7 +1261,7 @@ static void fc_tm_done(struct fc_seq *sp, struct fc_frame *fp, void *arg)
}
}
-void fc_scsi_cleanup(struct fc_lport *lp)
+static void fc_scsi_cleanup(struct fc_lport *lp)
{
int idx;
unsigned long flags;
@@ -1329,7 +1324,7 @@ static void fc_scsi_timeout(struct fc_scsi_pkt *fsp)
/*
* Send a REC ELS request
*/
-void fc_scsi_rec(struct fc_scsi_pkt *fsp)
+static void fc_scsi_rec(struct fc_scsi_pkt *fsp)
{
struct fc_lport *lp;
struct fc_seq *sp;
@@ -1761,7 +1756,7 @@ out:
}
/**
- * fc_queuecommand: - The queuecommand function of the scsi template
+ * fc_queuecommand - The queuecommand function of the scsi template
* @cmd: struct scsi_cmnd to be executed
* @done: Callback function to be called when cmd is completed
*
@@ -1875,7 +1870,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
stats->ControlRequests++;
}
- sp->done = openfc_io_compl;
+ sp->done = fc_io_compl;
sp->tgt_flags = rp->tgt_flags;
init_timer(&sp->timer);
@@ -1900,11 +1895,12 @@ out:
EXPORT_SYMBOL(fc_queuecommand);
/**
- * openfc_io_compl: - Handle responses for completed commands
+ * fc_io_compl - Handle responses for completed commands
+ * @sp: scsi packet
*
* Translates a openfc error to a Linux SCSI error
*/
-static void openfc_io_compl(struct fc_scsi_pkt *sp)
+static void fc_io_compl(struct fc_scsi_pkt *sp)
{
struct scsi_cmnd *sc_cmd;
struct fc_lport *lp;
@@ -2241,8 +2237,8 @@ EXPORT_SYMBOL(fc_change_queue_type);
/**
* fc_put_dev - dec the fc_lport ref count
- * @dev: Pointer to fc_lport to dec.
- **/
+ * @lp: Pointer to fc_lport to dec.
+ */
void fc_put_dev(struct fc_lport *lp)
{
fc_destroy_scsi_slab(lp);
@@ -2263,7 +2259,8 @@ int fc_scsi_init(struct fc_lport *lp,
if (!lp->tt.scsi_abort_io)
lp->tt.scsi_abort_io = fc_scsi_abort_io;
- si = (struct fc_scsi_internal*)kzalloc(sizeof(struct fc_scsi_internal), GFP_ATOMIC);
+ si = (struct fc_scsi_internal*)kzalloc(sizeof(struct fc_scsi_internal),
+ GFP_KERNEL);
lp->scsi_priv = (void*)si;
/*
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/13] libfc: remove os_lun
[not found] ` <1214763843-5548-7-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-29 18:23 ` michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-8-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
0 siblings, 1 reply; 22+ messages in thread
From: michaelc-hcNo3dDEHLuVc3sceRu5cw @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw
From: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
The FC layer is primarily concerned with the transport, so the os_lun
tracking is a little akward because if we want to track something at the
device level then scsi-ml should do this.
Some of those errors, like dropped packets, it handled seemed like it
would could be handled better at the port level. This would also be useful
if we put it in the fc class so we could have port level erros for lpfc
and qla2xxx too (could use it to fix the underrun type of errors that
get reported when frames are dropped, but we want to retry on
the same path).
This patch also has us use int_to_scsilun instead of the htonl and
shift junk.
Signed-off-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
---
drivers/scsi/fcoe/fcoe_if.c | 1 -
drivers/scsi/libfc/fc_scsi.c | 146 ++++++------------------------------------
include/scsi/libfc/libfc.h | 8 +--
3 files changed, 22 insertions(+), 133 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
index 1f32743..a955994 100644
--- a/drivers/scsi/fcoe/fcoe_if.c
+++ b/drivers/scsi/fcoe/fcoe_if.c
@@ -268,7 +268,6 @@ static struct scsi_host_template fcoe_driver_template = {
.eh_host_reset_handler = fc_eh_host_reset,
.slave_configure = fc_slave_configure,
.slave_alloc = fc_slave_alloc,
- .slave_destroy = fc_slave_destroy,
.change_queue_depth = fc_change_queue_depth,
.change_queue_type = fc_change_queue_type,
.this_id = -1,
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index b9487bf..e9a704d 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -45,25 +45,6 @@ int openfc_debug;
#define CMD_SCSI_STATUS(Cmnd) ((Cmnd)->SCp.Status)
#define CMD_RESID_LEN(Cmnd) ((Cmnd)->SCp.buffers_residual)
-enum os_lun_state {
- FC_LUN_READY,
- FC_LUN_OFFLINE, /* taken offline by user */
- FC_LUN_ERR,
- FC_LUN_UNKNW,
-};
-
-/*
- * Openfc data struct per lun
- */
-struct os_lun {
- struct scsi_device *sdev;
- struct fc_remote_port *rp; /* pointer to the target */
- uint32_t lun_number; /* lun number */
- enum os_lun_state state;
- int error_cnt; /* consecutive error count */
- unsigned long avg_time; /* average read/write time */
-};
-
/*
* scsi request structure, one for each scsi request
*/
@@ -79,7 +60,6 @@ struct fc_scsi_pkt {
/*
* SCSI I/O related stuff
*/
- uint64_t lun;
void (*done) (struct fc_scsi_pkt *);
struct scsi_cmnd *cmd; /* scsi command pointer */
/*
@@ -119,7 +99,6 @@ struct fc_scsi_pkt {
*/
struct fc_remote_port *rp; /* remote port pointer */
struct fc_seq *seq_ptr; /* current sequence pointer */
- struct os_lun *disk; /* ptr to the Lun structure */
/*
* Error Processing
*/
@@ -663,7 +642,6 @@ static void fc_scsi_recv(struct fc_seq *sp, struct fc_frame *fp, void *arg)
struct fc_cmdq *qp;
struct fc_lport *lp;
struct fc_frame_header *fh;
- struct os_lun *lun;
struct fc_data_desc *dd;
u8 r_ctl;
u8 sg_supp;
@@ -682,12 +660,6 @@ static void fc_scsi_recv(struct fc_seq *sp, struct fc_frame *fp, void *arg)
goto out;
fsp->last_pkt_time = jiffies;
- lun = fsp->disk;
- if (lun && lun->error_cnt) {
- lun->state = FC_LUN_READY;
- lun->error_cnt = 0;
- }
-
if (r_ctl == FC_RCTL_DD_DATA_DESC) {
/*
* received XFER RDY from the target
@@ -972,8 +944,8 @@ static int fc_scsi_pkt_send(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
p = xchg(&((CMD_SP(fsp->cmd))), &si->outstandingcmd[i]);
fsp->cdb_cmd.fc_dl = htonl(fsp->data_len);
fsp->cdb_cmd.fc_flags = fsp->req_flags & ~FCP_CFL_LEN_MASK;
-
- *((__be64 *) fsp->cdb_cmd.fc_lun) = htonll(fsp->lun << 48);
+ int_to_scsilun(fsp->cmd->device->lun,
+ (struct scsi_lun *)fsp->cdb_cmd.fc_lun);
memcpy(fsp->cdb_cmd.fc_cdb, fsp->cmd->cmnd, fsp->cmd->cmd_len);
return fc_scsi_send_cmd(fsp);
}
@@ -1139,8 +1111,8 @@ static int fc_lun_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
fsp->idx = 0;
fsp->cdb_cmd.fc_dl = htonl(fsp->data_len);
fsp->cdb_cmd.fc_tm_flags = FCP_TMF_LUN_RESET;
- *((__be64 *) fsp->cdb_cmd.fc_lun) = htonll(fsp->lun << 48);
-
+ int_to_scsilun(fsp->cmd->device->lun,
+ (struct scsi_lun *)fsp->cdb_cmd.fc_lun);
fsp->wait_for_comp = 1;
init_completion(&fsp->tm_done);
@@ -1159,7 +1131,7 @@ static int fc_lun_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp)
* Acquire the list lock
*/
tid = fsp->cmd->device->id;
- lun = fsp->lun;
+ lun = fsp->cmd->device->lun;
spin_lock_irqsave(&si->outstandingcmd_lock, flags);
for (idx = 1; idx < FC_MAX_OUTSTANDING_COMMANDS; idx++) {
spin_lock(&si->outstandingcmd[idx].scsi_pkt_lock);
@@ -1309,7 +1281,7 @@ static void fc_scsi_timeout(struct fc_scsi_pkt *fsp)
return;
cdb_op = fsp->cdb_cmd.fc_cdb[0];
- if (fsp->disk->rp->tgt_flags & FC_TGT_REC_SUPPORTED)
+ if (fsp->rp->tgt_flags & FC_TGT_REC_SUPPORTED)
fc_scsi_rec(fsp);
else if (jiffies - fsp->last_pkt_time < FC_SCSI_ER_TIMEOUT / 2)
fc_scsi_timer_set(fsp, FC_SCSI_ER_TIMEOUT);
@@ -1419,7 +1391,7 @@ static void fc_scsi_rec_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg)
case ELS_RJT_UNSUP:
if (openfc_debug)
FC_DBG("device does not support REC\n");
- fsp->disk->rp->tgt_flags &= ~FC_TGT_REC_SUPPORTED;
+ fsp->rp->tgt_flags &= ~FC_TGT_REC_SUPPORTED;
/* fall through */
case ELS_RJT_LOGIC:
@@ -1567,7 +1539,6 @@ out:
*/
static void fc_timeout_error(struct fc_scsi_pkt *fsp)
{
- struct os_lun *lun;
struct fc_cmdq *qp;
struct fc_lport *lp = fsp->lp;
struct fc_scsi_internal *si = fc_get_scsi_internal(lp);
@@ -1586,50 +1557,33 @@ static void fc_timeout_error(struct fc_scsi_pkt *fsp)
fsp->status_code = FC_CMD_TIME_OUT;
fsp->cdb_status = 0;
fsp->io_status = 0;
- lun = fsp->disk;
- lun->error_cnt++;
- /*
- * if we get 5 consecutive errors
- * for the same command then offline the device.
- */
- if (lun->error_cnt >= FC_MAX_ERROR_CNT) {
- lun->state = FC_LUN_ERR;
- fsp->status_code = FC_HRD_ERROR;
- } else {
- fsp->io_status = (SUGGEST_RETRY << 24);
- }
+
if (fsp->done)
fsp->done(fsp);
}
/*
* Retry command.
- * An abort isn't needed. This is presumably due to cmd packet loss.
+ * An abort isn't needed.
*
- * If we deliver an error persistently on the same LUN, then report it
- * as a hard error.
+ * We treat it like a timeout because the command did not complete -
+ * presumably due to cmd packet loss. We will fail the command and
+ * have scsi-ml decide if we should retry or not.
+ *
+ * TODO: Instead we could continue to retry the command until the scsi
+ * command fires, or add port level counters to determine
+ * when to mark it as failed (the latter would be useful in the class eh
+ * for lpfc and qla2xxx).
*/
static void fc_scsi_retry_cmd(struct fc_scsi_pkt *fsp)
{
- struct os_lun *lun;
-
if (fsp->seq_ptr) {
fsp->lp->tt.seq_exch_complete(fsp->seq_ptr);
fsp->seq_ptr = NULL;
}
- lun = fsp->disk;
- lun->error_cnt++;
- /*
- * if we get 5 consecutive errors
- * for the same command then offline the device.
- */
- if (lun->error_cnt >= FC_MAX_ERROR_CNT) {
- fsp->status_code = FC_HRD_ERROR;
- fc_scsi_complete(fsp);
- } else {
- fc_scsi_send_cmd(fsp);
- }
+ fsp->status_code = FC_CMD_TIME_OUT;
+ fc_scsi_complete(fsp);
}
/*
@@ -1769,7 +1723,6 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
struct fc_scsi_pkt *sp;
struct fc_remote_port *rp;
- struct os_lun *disk;
int rval;
int rc = 0;
struct fcoe_dev_stats *stats;
@@ -1816,17 +1769,6 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
done(sc_cmd);
goto out;
}
- disk = sc_cmd->device->hostdata;
- if (!disk) {
- sc_cmd->result = DID_NO_CONNECT << 16;
- done(sc_cmd);
- goto out;
- }
- if (disk->state == FC_LUN_OFFLINE) {
- sc_cmd->result = DID_NO_CONNECT << 16;
- done(sc_cmd);
- goto out;
- }
/* after finding target we wil release the lock */
spin_unlock_irq(lp->host->host_lock);
@@ -1843,7 +1785,6 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
sp->cmd = sc_cmd; /* save the cmd */
sp->lp = lp; /* save the softc ptr */
sp->rp = rp; /* set the remote port ptr */
- sp->disk = (void *)disk;
sc_cmd->scsi_done = done;
/*
@@ -1853,9 +1794,8 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
sp->xfer_len = 0;
/*
- * setup the lun number and data direction
+ * setup the data direction
*/
- sp->lun = sc_cmd->device->lun;
stats = lp->dev_stats[smp_processor_id()];
if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) {
sp->req_flags = FC_SRB_READ;
@@ -1994,7 +1934,7 @@ static void fc_io_compl(struct fc_scsi_pkt *sp)
sc_cmd->result = (DID_ABORT << 16) | sp->io_status;
break;
case FC_CMD_TIME_OUT:
- sc_cmd->result = (DID_TIME_OUT << 16) | sp->io_status;
+ sc_cmd->result = (DID_BUS_BUSY << 16) | sp->io_status;
break;
case FC_CMD_RESET:
sc_cmd->result = (DID_RESET << 16);
@@ -2106,8 +2046,6 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
sp->lp = lp; /* save the softc ptr */
sp->rp = rp; /* set the remote port ptr */
- sp->lun = sc_cmd->device->lun;
-
/*
* flush outstanding commands
*/
@@ -2163,56 +2101,14 @@ EXPORT_SYMBOL(fc_slave_configure);
int fc_slave_alloc(struct scsi_device *sdev)
{
- struct fc_remote_port *rp;
- struct os_lun *disk;
struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
if (!rport || fc_remote_port_chkready(rport))
return -ENXIO;
-
- rp = rport->dd_data;
- disk = kzalloc(sizeof(struct os_lun), GFP_KERNEL);
- if (!disk) {
- FC_DBG("could not allocate lun structure\n");
- return -ENOMEM;
- }
- disk->lun_number = sdev->lun;
- disk->state = FC_LUN_READY;
- sdev->hostdata = disk;
- disk->rp = rp;
- disk->sdev = sdev;
return 0;
}
EXPORT_SYMBOL(fc_slave_alloc);
-void fc_slave_destroy(struct scsi_device *sdev)
-{
- struct fc_remote_port *rp;
- struct os_lun *disk;
- struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
-
- if (rport) {
- rp = rport->dd_data;
- if (!rp) {
- /*
- * we should not be here
- * Most likely RSCN cleaned up the
- * target structure. so return;
- */
- sdev->hostdata = NULL;
- return;
- }
- disk = sdev->hostdata;
- if (!disk)
- return;
-
- sdev->hostdata = NULL;
- kfree(disk);
- }
-}
-EXPORT_SYMBOL(fc_slave_destroy);
-
-
int fc_change_queue_depth(struct scsi_device *sdev, int qdepth)
{
scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), qdepth);
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 68ea82f..55ccace 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -705,7 +705,7 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd);
int fc_eh_host_reset(struct scsi_cmnd *sc_cmd);
/*
- * Create a os_lun object and set its state to READY.
+ * Check rport status.
*/
int fc_slave_alloc(struct scsi_device *sdev);
@@ -715,12 +715,6 @@ int fc_slave_alloc(struct scsi_device *sdev);
int fc_slave_configure(struct scsi_device *sdev);
/*
- * Free the memory allocated for a os_lun object created
- * by fc_slave_alloc().
- */
-void fc_slave_destroy(struct scsi_device *sdev);
-
-/*
* Adjust the queue depth.
*/
int fc_change_queue_depth(struct scsi_device *sdev, int qdepth);
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/13] libfc fcoe: use shost_priv
[not found] ` <1214763843-5548-8-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-29 18:23 ` michaelc-hcNo3dDEHLuVc3sceRu5cw
2008-06-29 18:23 ` [PATCH 09/13] libfc: use get/put_aligned_be helpers michaelc
0 siblings, 1 reply; 22+ messages in thread
From: michaelc-hcNo3dDEHLuVc3sceRu5cw @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw
From: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
Use shost_priv.
Signed-off-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
---
drivers/scsi/fcoe/fcoe_if.c | 46 +++++++++++++++++++++---------------------
drivers/scsi/libfc/fc_attr.c | 8 +++---
drivers/scsi/libfc/fc_scsi.c | 8 +++---
3 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
index a955994..3c21e05 100644
--- a/drivers/scsi/fcoe/fcoe_if.c
+++ b/drivers/scsi/fcoe/fcoe_if.c
@@ -94,9 +94,9 @@ fc_wwn_t fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], uint scheme,
/*
* Scsi_Host class Attributes helper functions
*/
-char *fcoe_info(struct Scsi_Host *host)
+char *fcoe_info(struct Scsi_Host *shost)
{
- struct fc_lport *lp = (struct fc_lport *)host->hostdata;
+ struct fc_lport *lp = shost_priv(shost);
static char buf[256];
int len = 0;
@@ -125,23 +125,23 @@ static ssize_t fcoe_name_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct Scsi_Host *host = class_to_shost(dev);
+ struct Scsi_Host *shost = class_to_shost(dev);
- return snprintf(buf, PAGE_SIZE, "FCOEHBA%d\n", host->host_no);
+ return snprintf(buf, PAGE_SIZE, "FCOEHBA%d\n", shost->host_no);
}
static ssize_t fcoe_info_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct Scsi_Host *host = class_to_shost(dev);
- return snprintf(buf, PAGE_SIZE, "%s", fcoe_info(host));
+ struct Scsi_Host *shost = class_to_shost(dev);
+ return snprintf(buf, PAGE_SIZE, "%s", fcoe_info(shost));
}
static ssize_t fcoe_state_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct Scsi_Host *host = class_to_shost(dev);
- struct fc_lport *lp = (struct fc_lport *)host->hostdata;
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct fc_lport *lp = shost_priv(shost);
ssize_t len;
switch (lp->state) {
@@ -173,8 +173,8 @@ static ssize_t fcoe_stop(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t size)
{
- struct Scsi_Host *host = class_to_shost(dev);
- struct fc_lport *lp = (struct fc_lport *)host->hostdata;
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct fc_lport *lp = shost_priv(shost);
if (buffer == NULL)
return size;
@@ -195,8 +195,8 @@ static ssize_t fcoe_start(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t size)
{
- struct Scsi_Host *host = class_to_shost(dev);
- struct fc_lport *lp = (struct fc_lport *)host->hostdata;
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct fc_lport *lp = shost_priv(shost);
if (buffer == NULL)
return size;
@@ -217,8 +217,8 @@ static ssize_t fcoe_reset(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t size)
{
- struct Scsi_Host *host = class_to_shost(dev);
- struct fc_lport *lp = (struct fc_lport *)host->hostdata;
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct fc_lport *lp = shost_priv(shost);
if (buffer == NULL)
return size;
@@ -436,7 +436,7 @@ int fcoe_create_interface(const char *ifname)
struct fcoe_softc *fc;
struct fcoe_dev_stats *p;
struct net_device *net_dev;
- struct Scsi_Host *host;
+ struct Scsi_Host *shost;
struct fcoe_info *fci = &fcoei;
u32 mfs;
@@ -458,22 +458,22 @@ int fcoe_create_interface(const char *ifname)
goto out_put_dev;
}
- host = scsi_host_alloc(&fcoe_driver_template,
+ shost = scsi_host_alloc(&fcoe_driver_template,
sizeof(struct fc_lport) +
sizeof(struct fcoe_softc));
- if (host == NULL) {
+ if (shost == NULL) {
FC_DBG("openfc: Could not allocate host structure\n");
rc = -ENOMEM;
goto out_put_dev;
}
- host->transportt = fcoe_transport_template;
+ shost->transportt = fcoe_transport_template;
/* Set structure relationships */
- lp = (struct fc_lport *)host->hostdata;
+ lp = shost_priv(shost);
memset(lp, 0, sizeof(struct fc_lport));
- lp->host = host;
+ lp->host = shost;
lp->drv_priv = (void *)(lp + 1);
fc = (struct fcoe_softc *)lp->drv_priv;
memset(fc, 0, sizeof(struct fcoe_softc));
@@ -484,9 +484,9 @@ int fcoe_create_interface(const char *ifname)
memcpy(&lp->tt, &fcoe_libfc_transport_template, sizeof(struct fc_transport_template));
/* Configure the scsi_host */
- host->max_lun = FC_MAX_LUN;
- host->max_id = FC_MAX_FCP_TARGET;
- host->max_channel = 0;
+ shost->max_lun = FC_MAX_LUN;
+ shost->max_id = FC_MAX_FCP_TARGET;
+ shost->max_channel = 0;
/* Allocate an EM for this driver */
lp->emp = fc_exch_mgr_alloc(FC_CLASS_3, 0, 0);
diff --git a/drivers/scsi/libfc/fc_attr.c b/drivers/scsi/libfc/fc_attr.c
index 97cd1a9..23ecad6 100644
--- a/drivers/scsi/libfc/fc_attr.c
+++ b/drivers/scsi/libfc/fc_attr.c
@@ -31,7 +31,7 @@ MODULE_LICENSE("GPL");
void fc_get_host_port_id(struct Scsi_Host *shost)
{
- struct fc_lport *lp = (struct fc_lport *)shost->hostdata;
+ struct fc_lport *lp = shost_priv(shost);
fc_host_port_id(shost) = fc_lport_get_fid(lp);
}
@@ -54,7 +54,7 @@ EXPORT_SYMBOL(fc_get_host_port_type);
void fc_get_host_fabric_name(struct Scsi_Host *shost)
{
- struct fc_lport *lp = (struct fc_lport *)shost->hostdata;
+ struct fc_lport *lp = shost_priv(shost);
fc_host_fabric_name(shost) = lp->wwnn;
}
@@ -94,11 +94,11 @@ void fc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
}
EXPORT_SYMBOL(fc_set_rport_loss_tmo);
-struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shp)
+struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost)
{
int i;
struct fc_host_statistics *fcoe_stats;
- struct fc_lport *lp = (struct fc_lport *)shp->hostdata;
+ struct fc_lport *lp = shost_priv(shost);
struct timespec v0, v1;
fcoe_stats = &lp->openfc_host_stat;
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index e9a704d..bc2f1ac 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -1727,7 +1727,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
int rc = 0;
struct fcoe_dev_stats *stats;
- lp = (struct fc_lport *)sc_cmd->device->host->hostdata;
+ lp = shost_priv(sc_cmd->device->host);
if (lp->state != FC_RUNNING) {
if (lp->status & FC_PAUSE) {
@@ -1970,8 +1970,8 @@ int fc_eh_abort(struct scsi_cmnd *sc_cmd)
struct fc_scsi_pkt *sp;
struct fc_lport *lp;
int rc = FAILED;
- lp = (struct fc_lport *)sc_cmd->device->host->hostdata;
+ lp = shost_priv(sc_cmd->device->host);
if (lp->state != FC_RUNNING) {
return rc;
} else if (!(lp->status & FC_LINK_UP)) {
@@ -2027,7 +2027,7 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
rp = rport->dd_data;
if (rp != NULL) {
- lp = (struct fc_lport *)sc_cmd->device->host->hostdata;
+ lp = shost_priv(sc_cmd->device->host);
if (lp->state != FC_RUNNING)
return rc;
@@ -2066,7 +2066,7 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
{
struct fc_lport *lp;
- lp = (struct fc_lport *)sc_cmd->device->host->hostdata;
+ lp = shost_priv(sc_cmd->device->host);
return (lp->tt.reset_if(lp));
}
EXPORT_SYMBOL(fc_eh_host_reset);
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/13] libfc: use get/put_aligned_be helpers
2008-06-29 18:23 ` [PATCH 08/13] libfc fcoe: use shost_priv michaelc-hcNo3dDEHLuVc3sceRu5cw
@ 2008-06-29 18:23 ` michaelc
2008-06-29 18:24 ` [PATCH 10/13] libfc fcoe: coding style fixups - use uX for definitions michaelc
0 siblings, 1 reply; 22+ messages in thread
From: michaelc @ 2008-06-29 18:23 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
Use get/put_alignged_be helpers.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/libfc/fc_disc.c | 2 +-
drivers/scsi/libfc/fc_lport.c | 13 ++++++-------
drivers/scsi/libfc/fc_rport.c | 13 +++++++------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index a1b5171..fe50388 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -996,7 +996,7 @@ static void fc_disc_enter_reg_pn(struct fc_lport *lp)
memset(req, 0, sizeof(*req));
fc_lport_fill_dns_hdr(lp, &req->ct, FC_NS_RPN_ID, sizeof(req->rn));
req->rn.fr_fid.fp_fid = hton24(lp->fl_fid);
- put_unaligned(htonll(lp->wwpn), &req->rn.fr_wwn);
+ put_unaligned_be64(lp->wwpn, &req->rn.fr_wwn);
fc_frame_setup(fp, FC_RCTL_DD_UNSOL_CTL, FC_TYPE_CT);
dns_rp = lp->fl_dns_rp;
if (!lp->tt.exch_seq_send(lp, fp,
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index a7ffab7..805cb71 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -242,9 +242,8 @@ fc_lport_flogi_fill(struct fc_lport *lp,
memset(flogi, 0, sizeof(*flogi));
flogi->fl_cmd = (u8) op;
- put_unaligned(htonll(lp->wwpn), &flogi->fl_wwpn);
- put_unaligned(htonll(lp->wwnn), &flogi->fl_wwnn);
-
+ put_unaligned_be64(lp->wwpn, &flogi->fl_wwpn);
+ put_unaligned_be64(lp->wwnn, &flogi->fl_wwnn);
sp = &flogi->fl_csp;
sp->sp_hi_ver = 0x20;
sp->sp_lo_ver = 0x20;
@@ -310,8 +309,8 @@ fc_lport_flogi_resp(struct fc_seq *sp,
lp->fl_r_a_tov = 2 * e_d_tov;
FC_DBG("point-to-point mode");
fc_lport_ptp_setup(lp, ntoh24(fh->fh_s_id),
- ntohll(get_unaligned(&flp->fl_wwpn)),
- ntohll(get_unaligned(&flp->fl_wwnn)));
+ get_unaligned_be64(&flp->fl_wwpn),
+ get_unaligned_be64(&flp->fl_wwnn));
} else {
lp->fl_e_d_tov = e_d_tov;
lp->fl_r_a_tov = r_a_tov;
@@ -384,7 +383,7 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
flp = fc_frame_payload_get(rx_fp, sizeof(*flp));
if (!flp)
goto out;
- remote_wwpn = ntohll(get_unaligned(&flp->fl_wwpn));
+ remote_wwpn = get_unaligned_be64(&flp->fl_wwpn);
if (remote_wwpn == lp->wwpn) {
FC_DBG("FLOGI from port with same WWPN %llx "
"possible configuration error.", remote_wwpn);
@@ -435,7 +434,7 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
fc_lport_retry(lp);
}
fc_lport_ptp_setup(lp, remote_fid, remote_wwpn,
- ntohll(get_unaligned(&flp->fl_wwnn)));
+ get_unaligned_be64(&flp->fl_wwnn));
fc_lport_unlock(lp);
if (!lp->tt.disc_start(lp))
FC_DBG("target discovery start error\n");
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 8b0e839..b121981 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -375,8 +375,8 @@ fc_lport_plogi_fill(struct fc_lport *lp,
memset(flogi, 0, sizeof(*flogi));
flogi->fl_cmd = (u8) op;
- put_unaligned(htonll(lp->wwpn), &flogi->fl_wwpn);
- put_unaligned(htonll(lp->wwnn), &flogi->fl_wwnn);
+ put_unaligned_be64(lp->wwpn, &flogi->fl_wwpn);
+ put_unaligned_be64(lp->wwnn, &flogi->fl_wwnn);
sp = &flogi->fl_csp;
sp->sp_hi_ver = 0x20;
@@ -809,8 +809,9 @@ static void fc_rport_plogi_recv_resp(struct fc_seq *sp, struct fc_frame *fp,
fc_sess_lock(rp);
if (op == ELS_LS_ACC &&
(plp = fc_frame_payload_get(fp, sizeof(*plp))) != NULL) {
- wwpn = ntohll(get_unaligned(&plp->fl_wwpn));
- wwnn = ntohll(get_unaligned(&plp->fl_wwnn));
+ wwpn = get_unaligned_be64(&plp->fl_wwpn);
+ wwnn = get_unaligned_be64(&plp->fl_wwnn);
+
fc_rport_set_name(rp, wwpn, wwnn);
tov = ntohl(plp->fl_csp.sp_e_d_tov);
if (ntohs(plp->fl_csp.sp_features) & FC_SP_FT_EDTR)
@@ -1194,8 +1195,8 @@ static void fc_rport_recv_plogi_req(struct fc_remote_port *rp,
fc_frame_free(fp);
return;
}
- wwpn = ntohll(get_unaligned(&pl->fl_wwpn));
- wwnn = ntohll(get_unaligned(&pl->fl_wwnn));
+ wwpn = get_unaligned_be64(&pl->fl_wwpn);
+ wwnn = get_unaligned_be64(&pl->fl_wwnn);
fc_sess_lock(rp);
lp = rp->local_port;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/13] libfc fcoe: coding style fixups - use uX for definitions
2008-06-29 18:23 ` [PATCH 09/13] libfc: use get/put_aligned_be helpers michaelc
@ 2008-06-29 18:24 ` michaelc
2008-06-29 18:24 ` [PATCH 11/13] libfc: mv scsi pkt cache to module michaelc
0 siblings, 1 reply; 22+ messages in thread
From: michaelc @ 2008-06-29 18:24 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
I never knew there were so many ways to define a int. This driver
probably uses them all which makes my eyes hurt. This patch has us
use the uX/__uX definitions or unsigned int/long instead of the
bsd or sys way of defining them (yeah we actually use them both).
This patch also fixes some tabbing in the includes where we were
using spaces instead of tabs.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/fcoe/fcoe_def.h | 30 +++---
drivers/scsi/fcoe/fcoe_dev.c | 18 ++--
drivers/scsi/libfc/fc_disc.c | 11 +--
drivers/scsi/libfc/fc_exch.c | 63 +++++++-------
drivers/scsi/libfc/fc_frame.c | 16 ++--
drivers/scsi/libfc/fc_lport.c | 19 ++---
drivers/scsi/libfc/fc_rport.c | 13 ++--
drivers/scsi/libfc/fc_scsi.c | 22 +++---
include/scsi/fc/fc_els.h | 6 +-
include/scsi/fc/fc_encaps.h | 110 +++++++++++------------
include/scsi/fc/fc_fc2.h | 40 ++++----
include/scsi/libfc/fc_frame.h | 4 +-
include/scsi/libfc/libfc.h | 192 ++++++++++++++++++++--------------------
13 files changed, 268 insertions(+), 276 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_def.h b/drivers/scsi/fcoe/fcoe_def.h
index f8b2237..f053b50 100644
--- a/drivers/scsi/fcoe/fcoe_def.h
+++ b/drivers/scsi/fcoe/fcoe_def.h
@@ -66,17 +66,17 @@ struct fcoe_softc {
struct net_device *phys_dev; /* device with ethtool_ops */
struct packet_type fcoe_packet_type;
struct sk_buff_head fcoe_pending_queue;
- uint16_t user_mfs; /* configured max frame size */
+ u16 user_mfs; /* configured max frame size */
- uint8_t dest_addr[ETH_ALEN];
- uint8_t ctl_src_addr[ETH_ALEN];
- uint8_t data_src_addr[ETH_ALEN];
+ u8 dest_addr[ETH_ALEN];
+ u8 ctl_src_addr[ETH_ALEN];
+ u8 data_src_addr[ETH_ALEN];
/*
* fcoe protocol address learning related stuff
*/
- uint16_t flogi_oxid;
- uint8_t flogi_progress;
- uint8_t address_mode;
+ u16 flogi_oxid;
+ u8 flogi_progress;
+ u8 address_mode;
};
/*
@@ -84,14 +84,14 @@ struct fcoe_softc {
*/
extern struct fcoe_info fcoei;
-void fcoe_clean_pending_queue(struct fc_lport *fd);
-void fcoe_watchdog(ulong vp);
-int fcoe_destroy_interface(const char *ifname);
-int fcoe_create_interface(const char *ifname);
-int fcoe_xmit(struct fc_lport *, struct fc_frame *);
-int fcoe_rcv(struct sk_buff *, struct net_device *,
- struct packet_type *, struct net_device *);
-int fcoe_link_ok(struct fc_lport *);
+void fcoe_clean_pending_queue(struct fc_lport *fd);
+void fcoe_watchdog(ulong vp);
+int fcoe_destroy_interface(const char *ifname);
+int fcoe_create_interface(const char *ifname);
+int fcoe_xmit(struct fc_lport *, struct fc_frame *);
+int fcoe_rcv(struct sk_buff *, struct net_device *,
+ struct packet_type *, struct net_device *);
+int fcoe_link_ok(struct fc_lport *);
void fcoe_put_dev(struct fc_lport *dev);
struct fcoe_softc *fcoe_find_fc_lport(const char *);
#endif /* _FCOE_DEF_H_ */
diff --git a/drivers/scsi/fcoe/fcoe_dev.c b/drivers/scsi/fcoe/fcoe_dev.c
index 532092b..c0fc370 100644
--- a/drivers/scsi/fcoe/fcoe_dev.c
+++ b/drivers/scsi/fcoe/fcoe_dev.c
@@ -72,9 +72,9 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *dev,
struct fcoe_rcv_info *fr;
struct fcoe_softc *fc;
struct fcoe_dev_stats *stats;
- u_int8_t *data;
+ u8 *data;
struct fc_frame_header *fh;
- ushort oxid;
+ unsigned short oxid;
int cpu_idx;
struct fcoe_percpu_s *fps;
struct fcoe_info *fci = &fcoei;
@@ -199,18 +199,18 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
{
int indx;
int wlen, rc = 0;
- u_int32_t crc;
+ u32 crc;
struct ethhdr *eh;
struct fcoe_crc_eof *cp;
struct sk_buff *skb;
struct fcoe_dev_stats *stats;
struct fc_frame_header *fh;
- u_int hlen; /* header length implies the version */
- u_int tlen; /* trailer length */
+ unsigned int hlen; /* header length implies the version */
+ unsigned int tlen; /* trailer length */
int flogi_in_progress = 0;
struct fcoe_softc *fc;
void *data;
- uint8_t sof, eof;
+ u8 sof, eof;
struct fcoe_hdr *hp;
WARN_ON((fr_len(fp) % sizeof(uint32_t)) != 0);
@@ -358,9 +358,9 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
int fcoe_percpu_receive_thread(void *arg)
{
struct fcoe_percpu_s *p = arg;
- u_int32_t fr_len;
- u_int hlen;
- u_int tlen;
+ u32 fr_len;
+ unsigned int hlen;
+ unsigned int tlen;
struct fc_lport *lp;
struct fcoe_rcv_info *fr;
struct fcoe_dev_stats *stats;
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index fe50388..bccfd24 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -341,7 +341,7 @@ static void fc_disc_error(struct fc_lport *lp, struct fc_frame *fp)
*/
static void fcdt_retry(struct fc_lport *lp)
{
- u_long delay = FCDT_RETRY_DELAY;
+ unsigned long delay = FCDT_RETRY_DELAY;
if (!lp->fl_disc_retries)
delay /= 4; /* timeout faster first time */
@@ -471,7 +471,7 @@ static void fcdt_done(struct fc_lport *lp)
struct fc_remote_port *rp;
struct fc_remote_port *next;
struct fc_remote_port *held;
- u_int disc_ver;
+ unsigned int disc_ver;
/*
* Go through all remote_ports on the fabric which were not touched
@@ -594,7 +594,6 @@ static int fcdt_gpn_ft_parse(struct fc_lport *lp, void *buf, size_t len)
size_t plen;
size_t tlen;
int error = 0;
-
struct fc_disc_port *dp;
/*
@@ -692,9 +691,9 @@ static void fcdt_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
struct fc_lport *lp = lp_arg;
struct fc_ct_hdr *cp;
struct fc_frame_header *fh;
- u_int seq_cnt;
+ unsigned int seq_cnt;
void *buf = NULL;
- u_int len;
+ unsigned int len;
int error;
if (IS_ERR(fp)) {
@@ -1078,7 +1077,7 @@ static void fcdt_gnn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
struct fc_ct_hdr ct;
__be64 wwn;
} *cp;
- u_int cmd;
+ unsigned int cmd;
if (IS_ERR(fp)) {
fcdt_gnn_id_error(dp, fp);
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index a663442..d861963 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -56,13 +56,13 @@ static int fc_exch_debug;
* Sequence.
*/
struct fc_seq {
- uint8_t seq_id; /* seq ID */
- uint8_t seq_active; /* active flag */
- uint16_t seq_s_stat; /* flags for sequence status block */
- uint16_t seq_cnt; /* frames sent so far on sequence */
+ u8 seq_id; /* seq ID */
+ u8 seq_active; /* active flag */
+ u16 seq_s_stat; /* flags for sequence status block */
+ u16 seq_cnt; /* frames sent so far on sequence */
atomic_t seq_refcnt; /* reference counter */
- uint32_t seq_f_ctl; /* F_CTL flags for frames */
- uint32_t seq_rec_data; /* FC-4 value for REC */
+ u32 seq_f_ctl; /* F_CTL flags for frames */
+ u32 seq_rec_data; /* FC-4 value for REC */
};
/*
@@ -77,8 +77,8 @@ struct fc_exch {
struct fc_exch_mgr *ex_mp; /* exchange manager */
fc_xid_t ex_xid; /* our exchange ID */
struct list_head ex_list; /* free or busy list linkage */
- spinlock_t ex_lock; /* lock covering exchange state */
- atomic_t ex_refcnt; /* reference counter */
+ spinlock_t ex_lock; /* lock covering exchange state */
+ atomic_t ex_refcnt; /* reference counter */
struct timer_list ex_timer; /* timer for upper level protocols */
/*
@@ -90,10 +90,10 @@ struct fc_exch {
fc_fid_t ex_orig_fid; /* originator's FCID */
fc_fid_t ex_s_id; /* source ID */
fc_fid_t ex_d_id; /* destination ID */
- uint32_t ex_e_stat; /* exchange status for ESB */
- uint32_t ex_r_a_tov; /* r_a_tov from session (msec) */
- uint8_t ex_seq_id; /* next sequence ID to use */
- uint32_t ex_f_ctl; /* F_CTL flags for sequences */
+ u32 ex_e_stat; /* exchange status for ESB */
+ u32 ex_r_a_tov; /* r_a_tov from session (msec) */
+ u8 ex_seq_id; /* next sequence ID to use */
+ u32 ex_f_ctl; /* F_CTL flags for sequences */
enum fc_class ex_class; /* class of service */
struct fc_seq ex_seq; /* single sequence */
@@ -255,8 +255,8 @@ static char *fc_exch_rctl_names[] = FC_RCTL_NAMES_INIT;
#define FC_TABLE_SIZE(x) (sizeof (x) / sizeof (x[0]))
-static inline const char *fc_exch_name_lookup(u_int op, char **table,
- u_int max_index)
+static inline const char *fc_exch_name_lookup(unsigned int op, char **table,
+ unsigned int max_index)
{
const char *name = NULL;
@@ -267,7 +267,7 @@ static inline const char *fc_exch_name_lookup(u_int op, char **table,
return name;
}
-static const char *fc_exch_rctl_name(u_int op)
+static const char *fc_exch_rctl_name(unsigned int op)
{
return fc_exch_name_lookup(op, fc_exch_rctl_names,
FC_TABLE_SIZE(fc_exch_rctl_names));
@@ -296,7 +296,7 @@ inline void fc_seq_hold(struct fc_seq *sp)
* By implication, any previously originated sequence on this exchange
* is complete, and we reallocate the same sequence.
*/
-static struct fc_seq *fc_seq_alloc(struct fc_exch *ep, u_int8_t seq_id)
+static struct fc_seq *fc_seq_alloc(struct fc_exch *ep, u8 seq_id)
{
struct fc_seq *sp;
@@ -378,7 +378,8 @@ static void fc_exch_timeout(unsigned long ep_arg)
/*
* Internal version of fc_exch_timer_set - used with lock held.
*/
-static void fc_exch_timer_set_locked(struct fc_exch *ep, u_int timer_msec)
+static void fc_exch_timer_set_locked(struct fc_exch *ep,
+ unsigned int timer_msec)
{
if (!timer_pending(&ep->ex_timer))
fc_exch_hold(ep); /* hold for timer */
@@ -392,7 +393,7 @@ static void fc_exch_timer_set_locked(struct fc_exch *ep, u_int timer_msec)
* The timer is cancelled when it fires or when the exchange completes.
* Returns non-zero if a timer couldn't be allocated.
*/
-void fc_exch_timer_set(struct fc_exch *ep, u_int timer_msec)
+void fc_exch_timer_set(struct fc_exch *ep, unsigned int timer_msec)
{
spin_lock_bh(&ep->ex_lock);
fc_exch_timer_set_locked(ep, timer_msec);
@@ -496,7 +497,7 @@ static struct fc_exch *fc_exch_resp(struct fc_exch_mgr *mp,
{
struct fc_exch *ep;
struct fc_frame_header *fh;
- u_int16_t rx_id;
+ u16 rx_id;
ep = fc_exch_alloc(mp, 0);
if (ep) {
@@ -550,7 +551,7 @@ fc_seq_lookup_recip(struct fc_exch_mgr *mp, struct fc_frame *fp)
struct fc_exch *ep = NULL;
struct fc_seq *sp = NULL;
enum fc_pf_rjt_reason reject = FC_RJT_NONE;
- u_int32_t f_ctl;
+ u32 f_ctl;
fc_xid_t xid;
f_ctl = ntoh24(fh->fh_f_ctl);
@@ -658,7 +659,7 @@ static struct fc_seq *fc_seq_lookup_orig(struct fc_exch_mgr *mp,
struct fc_frame_header *fh = fc_frame_header_get(fp);
struct fc_exch *ep;
struct fc_seq *sp = NULL;
- u_int32_t f_ctl;
+ u32 f_ctl;
fc_xid_t xid;
f_ctl = ntoh24(fh->fh_f_ctl);
@@ -733,7 +734,7 @@ int fc_seq_send(struct fc_lport *lp, struct fc_seq *sp,
struct fc_exch *ep;
struct fc_frame_header *fh;
enum fc_class class;
- u_int16_t fill = 0;
+ u16 fill = 0;
int error;
ep = fc_seq_exch(sp);
@@ -847,7 +848,7 @@ static void fc_seq_send_ack(struct fc_seq *sp, const struct fc_frame *rx_fp)
struct fc_frame_header *rx_fh;
struct fc_frame_header *fh;
struct fc_lport *lp;
- u_int f_ctl;
+ unsigned int f_ctl;
/*
* Don't send ACKs for class 3.
@@ -962,7 +963,7 @@ fc_exch_send_ba_rjt(struct fc_frame *rx_fp, enum fc_ba_rjt_reason reason,
struct fc_frame_header *fh;
struct fc_ba_rjt *rp;
struct fc_lport *lp;
- u_int f_ctl;
+ unsigned int f_ctl;
lp = fr_dev(rx_fp);
fp = fc_frame_alloc(lp, sizeof(*rp));
@@ -1024,7 +1025,7 @@ static void fc_exch_recv_req(struct fc_lport *lp, struct fc_exch_mgr *mp,
struct fc_exch *ep = NULL;
enum fc_sof sof;
enum fc_eof eof;
- u_int32_t f_ctl;
+ u32 f_ctl;
enum fc_pf_rjt_reason reject;
void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg);
void *ex_arg;
@@ -1089,7 +1090,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
struct fc_seq *sp;
struct fc_exch *ep;
enum fc_sof sof;
- u_int32_t f_ctl;
+ u32 f_ctl;
void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg);
void *ex_arg;
@@ -1199,8 +1200,8 @@ static void fc_exch_abts_resp(struct fc_exch *ep, struct fc_frame *fp)
{
struct fc_frame_header *fh;
struct fc_ba_acc *ap;
- uint16_t low;
- uint16_t high;
+ u16 low;
+ u16 high;
fh = fc_frame_header_get(fp);
if (fc_exch_debug)
@@ -1251,7 +1252,7 @@ static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp)
struct fc_frame_header *fh;
struct fc_seq *sp;
struct fc_exch *ep;
- uint32_t f_ctl;
+ u32 f_ctl;
fh = fc_frame_header_get(fp);
f_ctl = ntoh24(fh->fh_f_ctl);
@@ -1826,7 +1827,7 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lp,
struct fc_exch *ep;
struct fc_seq *sp = NULL;
struct fc_frame_header *fh;
- u_int16_t fill;
+ u16 fill;
ep = lp->tt.exch_get(lp);
if (!ep) {
@@ -1898,7 +1899,7 @@ void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp,
struct fc_frame *fp)
{
struct fc_frame_header *fh = fc_frame_header_get(fp);
- u_int32_t f_ctl;
+ u32 f_ctl;
if (!lp) {
FC_DBG("fcs_local_port_config needed before receiving");
diff --git a/drivers/scsi/libfc/fc_frame.c b/drivers/scsi/libfc/fc_frame.c
index e101eeb..1838c40 100644
--- a/drivers/scsi/libfc/fc_frame.c
+++ b/drivers/scsi/libfc/fc_frame.c
@@ -36,20 +36,20 @@
/*
* Check the CRC in a frame.
*/
-u_int32_t fc_frame_crc_check(struct fc_frame *fp)
+u32 fc_frame_crc_check(struct fc_frame *fp)
{
- u_int32_t crc;
- u_int32_t error;
+ u32 crc;
+ u32 error;
const u_int8_t *bp;
- u_int len;
+ unsigned int len;
WARN_ON(!fc_frame_is_linear(fp));
fr_flags(fp) &= ~FCPHF_CRC_UNCHECKED;
len = (fr_len(fp) + 3) & ~3; /* round up length to include fill */
- bp = (const u_int8_t *) fr_hdr(fp);
+ bp = (const u8 *) fr_hdr(fp);
crc = ~crc32(~0, bp, len);
- error = crc ^ *(u_int32_t *) (bp + len);
- return (error);
+ error = crc ^ *(u32 *) (bp + len);
+ return error;
}
EXPORT_SYMBOL(fc_frame_crc_check);
@@ -62,7 +62,7 @@ struct fc_frame *__fc_frame_alloc(size_t len)
struct fc_frame *fp;
struct sk_buff *skb;
- WARN_ON((len % sizeof(uint32_t)) != 0);
+ WARN_ON((len % sizeof(u32)) != 0);
len += sizeof(struct fc_frame_header);
skb = dev_alloc_skb(len + FC_FRAME_HEADROOM + FC_FRAME_TAILROOM);
if (!skb)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 805cb71..bc52bca 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -268,18 +268,16 @@ fc_lport_flogi_fill(struct fc_lport *lp,
* Save parameters of remote switch. Finish exchange.
*/
static void
-fc_lport_flogi_resp(struct fc_seq *sp,
- struct fc_frame *fp,
- void *lp_arg)
+fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, void *lp_arg)
{
struct fc_lport *lp = lp_arg;
struct fc_frame_header *fh;
struct fc_els_flogi *flp;
fc_fid_t did;
- u_int16_t csp_flags;
- u_int r_a_tov;
- u_int e_d_tov;
- uint16_t mfs;
+ u16 csp_flags;
+ unsigned int r_a_tov;
+ unsigned int e_d_tov;
+ u16 mfs;
if (IS_ERR(fp))
goto out;
@@ -733,7 +731,7 @@ static void fc_lport_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
{
struct fc_lport *lp = lp_arg;
struct fc_frame *fp;
- u_int len;
+ unsigned int len;
void *pp;
void *dp;
u32 f_ctl;
@@ -773,7 +771,7 @@ static void fc_lport_rnid_req(struct fc_seq *sp, struct fc_frame *in_fp,
struct fc_els_rnid_gen gen;
} *rp;
struct fc_seq_els_data rjt_data;
- u_int8_t fmt;
+ u8 fmt;
size_t len;
u32 f_ctl;
@@ -1098,8 +1096,7 @@ int fc_set_mfs(struct fc_lport *lp, u32 mfs)
}
EXPORT_SYMBOL(fc_set_mfs);
-int fc_lport_init(struct fc_lport *lp,
- struct fc_transport_template *tmpl)
+int fc_lport_init(struct fc_lport *lp, struct fc_transport_template *tmpl)
{
// if (!lp->tt.lp_event)
// lp->tt.lp_event = fc_lp_event;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index b121981..87d0469 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -74,7 +74,7 @@ static struct fc_remote_port *fc_remote_port_create(struct fc_lport *, struct fc
* @rp: the ptr to the remote port to be matched
*/
static inline int fc_remote_port_fid_match(fc_fid_t fid,
- const struct fc_remote_port *rp)
+ const struct fc_remote_port *rp)
{
return fid == rp->rport->port_id;
}
@@ -258,7 +258,6 @@ static void libfc_remote_port_delete(struct fc_remote_port *rp)
struct fc_remote_port *found;
struct fc_lport *lp;
-
lp = rp->local_port;
fc_rp_list_lock(lp);
if (rp->rport->port_id != -1) {
@@ -798,9 +797,9 @@ static void fc_rport_plogi_recv_resp(struct fc_seq *sp, struct fc_frame *fp,
struct fc_els_ls_rjt *rjp;
struct fc_els_flogi *plp;
fc_wwn_t wwpn, wwnn;
- u_int tov;
- uint16_t csp_seq;
- uint16_t cssp_seq;
+ unsigned int tov;
+ u16 csp_seq;
+ u16 cssp_seq;
u8 op;
struct fc_remote_port *rp = rp_arg;
@@ -1311,8 +1310,8 @@ static void fc_rport_recv_prli_req(struct fc_remote_port *rp,
} *pp;
struct fc_els_spp *rspp; /* request service param page */
struct fc_els_spp *spp; /* response spp */
- u_int len;
- u_int plen;
+ unsigned int len;
+ unsigned int plen;
enum fc_els_rjt_reason reason = ELS_RJT_UNAB;
enum fc_els_rjt_explan explan = ELS_EXPL_NONE;
enum fc_els_spp_resp resp;
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index bc2f1ac..c41807b 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -53,10 +53,10 @@ struct fc_scsi_pkt {
* housekeeping stuff
*/
struct fc_lport *lp; /* handle to hba struct */
- uint16_t state; /* scsi_pkt state state */
- uint16_t tgt_flags; /* target flags */
+ u16 state; /* scsi_pkt state state */
+ u16 tgt_flags; /* target flags */
atomic_t ref_cnt; /* only used byr REC ELS */
- uint32_t idx; /* host given value */
+ u32 idx; /* host given value */
/*
* SCSI I/O related stuff
*/
@@ -75,7 +75,7 @@ struct fc_scsi_pkt {
/*
* scsi cmd and data transfer information
*/
- uint32_t data_len;
+ u32 data_len;
/*
* transport related veriables
*/
@@ -87,13 +87,13 @@ struct fc_scsi_pkt {
/*
* scsi/fcp return status
*/
- uint32_t io_status; /* SCSI result upper 24 bits */
- uint8_t cdb_status;
- uint8_t status_code; /* OPENFC I/O status */
+ u32 io_status; /* SCSI result upper 24 bits */
+ u8 cdb_status;
+ u8 status_code; /* OPENFC I/O status */
/* bit 3 Underrun bit 2: overrun */
- uint8_t scsi_comp_flags;
- uint32_t req_flags; /* bit 0: read bit:1 write */
- uint32_t scsi_resid; /* residule length */
+ u8 scsi_comp_flags;
+ u32 req_flags; /* bit 0: read bit:1 write */
+ u32 scsi_resid; /* residule length */
/*
* FCS related data struct
*/
@@ -102,7 +102,7 @@ struct fc_scsi_pkt {
/*
* Error Processing
*/
- uint8_t recov_retry; /* count of recovery retries */
+ u8 recov_retry; /* count of recovery retries */
struct fc_seq *recov_seq; /* sequence for REC or SRR */
};
diff --git a/include/scsi/fc/fc_els.h b/include/scsi/fc/fc_els.h
index 8130b14..e90ddbf 100644
--- a/include/scsi/fc/fc_els.h
+++ b/include/scsi/fc/fc_els.h
@@ -278,9 +278,9 @@ struct fc_els_cssp {
__be16 cp_rdfs; /* receive data field size */
__be16 cp_con_seq; /* concurrent sequences */
__be16 cp_ee_cred; /* N-port end-to-end credit */
- u_int8_t _cp_resv1; /* reserved */
- u_int8_t cp_open_seq; /* open sequences per exchange */
- u_int8_t _cp_resv2[2]; /* reserved */
+ __u8 cp_resv1; /* reserved */
+ __u8 cp_open_seq; /* open sequences per exchange */
+ __u8 _cp_resv2[2]; /* reserved */
};
/*
diff --git a/include/scsi/fc/fc_encaps.h b/include/scsi/fc/fc_encaps.h
index a5116c6..f910708 100644
--- a/include/scsi/fc/fc_encaps.h
+++ b/include/scsi/fc/fc_encaps.h
@@ -27,116 +27,112 @@
* The minimum frame length value in bytes is (32 + 24 + 4 + 4) * 4 = 64.
* The maximum frame length value in bytes is (32 + 24 + 2112 + 4 + 4) = 2172.
*/
-#define FC_ENCAPS_MIN_FRAME_LEN 64 /* min frame len (bytes) (see above) */
-#define FC_ENCAPS_MAX_FRAME_LEN (FC_ENCAPS_MIN_FRAME_LEN + FC_MAX_PAYLOAD)
+#define FC_ENCAPS_MIN_FRAME_LEN 64 /* min frame len (bytes) (see above) */
+#define FC_ENCAPS_MAX_FRAME_LEN (FC_ENCAPS_MIN_FRAME_LEN + FC_MAX_PAYLOAD)
#define FC_ENCAPS_VER 1 /* current version number */
struct fc_encaps_hdr {
- __u8 fc_proto; /* protocol number */
- __u8 fc_ver; /* version of encapsulation */
- __u8 fc_proto_n; /* ones complement of protocol */
- __u8 fc_ver_n; /* ones complement of version */
+ __u8 fc_proto; /* protocol number */
+ __u8 fc_ver; /* version of encapsulation */
+ __u8 fc_proto_n; /* ones complement of protocol */
+ __u8 fc_ver_n; /* ones complement of version */
- u_char fc_proto_data[8]; /* protocol specific data */
+ unsigned char fc_proto_data[8]; /* protocol specific data */
- __be16 fc_len_flags; /* 10-bit length/4 w/ 6 flag bits */
- __be16 fc_len_flags_n; /* ones complement of length / flags */
+ __be16 fc_len_flags; /* 10-bit length/4 w/ 6 flag bits */
+ __be16 fc_len_flags_n; /* ones complement of length / flags */
- /*
- * Offset 0x10
- */
- __be32 fc_time[2]; /* time stamp: seconds and fraction */
- __be32 fc_crc; /* CRC */
- __be32 fc_sof; /* start of frame (see FC_SOF below) */
+ /*
+ * Offset 0x10
+ */
+ __be32 fc_time[2]; /* time stamp: seconds and fraction */
+ __be32 fc_crc; /* CRC */
+ __be32 fc_sof; /* start of frame (see FC_SOF below) */
- /* 0x20 - FC frame content followed by EOF word */
+ /* 0x20 - FC frame content followed by EOF word */
};
-#define FCIP_ENCAPS_HDR_LEN 0x20 /* expected length for asserts */
+#define FCIP_ENCAPS_HDR_LEN 0x20 /* expected length for asserts */
/*
* Macro's for making redundant copies of EOF and SOF.
*/
-#define FC_XY(x, y) ((((x) & 0xff) << 8) | ((y) & 0xff))
-#define FC_XYXY(x, y) ((FCIP_XY(x, y) << 16) | FCIP_XY(x, y))
-#define FC_XYNN(x, y) (FCIP_XYXY(x, y) ^ 0xffff)
+#define FC_XY(x, y) ((((x) & 0xff) << 8) | ((y) & 0xff))
+#define FC_XYXY(x, y) ((FCIP_XY(x, y) << 16) | FCIP_XY(x, y))
+#define FC_XYNN(x, y) (FCIP_XYXY(x, y) ^ 0xffff)
-#define FC_SOF_ENCODE(n) FC_XYNN(n, n)
-#define FC_EOF_ENCODE(n) FC_XYNN(n, n)
+#define FC_SOF_ENCODE(n) FC_XYNN(n, n)
+#define FC_EOF_ENCODE(n) FC_XYNN(n, n)
/*
* SOF / EOF bytes.
*/
enum fc_sof {
- FC_SOF_F = 0x28, /* fabric */
- FC_SOF_I4 = 0x29, /* initiate class 4 */
- FC_SOF_I2 = 0x2d, /* initiate class 2 */
- FC_SOF_I3 = 0x2e, /* initiate class 3 */
- FC_SOF_N4 = 0x31, /* normal class 4 */
- FC_SOF_N2 = 0x35, /* normal class 2 */
- FC_SOF_N3 = 0x36, /* normal class 3 */
- FC_SOF_C4 = 0x39, /* activate class 4 */
+ FC_SOF_F = 0x28, /* fabric */
+ FC_SOF_I4 = 0x29, /* initiate class 4 */
+ FC_SOF_I2 = 0x2d, /* initiate class 2 */
+ FC_SOF_I3 = 0x2e, /* initiate class 3 */
+ FC_SOF_N4 = 0x31, /* normal class 4 */
+ FC_SOF_N2 = 0x35, /* normal class 2 */
+ FC_SOF_N3 = 0x36, /* normal class 3 */
+ FC_SOF_C4 = 0x39, /* activate class 4 */
} __attribute__((packed));
enum fc_eof {
- FC_EOF_N = 0x41, /* normal (not last frame of seq) */
- FC_EOF_T = 0x42, /* terminate (last frame of sequence) */
- FC_EOF_RT = 0x44,
- FC_EOF_DT = 0x46, /* disconnect-terminate class-1 */
- FC_EOF_NI = 0x49, /* normal-invalid */
- FC_EOF_DTI = 0x4e, /* disconnect-terminate-invalid */
- FC_EOF_RTI = 0x4f,
- FC_EOF_A = 0x50, /* abort */
+ FC_EOF_N = 0x41, /* normal (not last frame of seq) */
+ FC_EOF_T = 0x42, /* terminate (last frame of sequence) */
+ FC_EOF_RT = 0x44,
+ FC_EOF_DT = 0x46, /* disconnect-terminate class-1 */
+ FC_EOF_NI = 0x49, /* normal-invalid */
+ FC_EOF_DTI = 0x4e, /* disconnect-terminate-invalid */
+ FC_EOF_RTI = 0x4f,
+ FC_EOF_A = 0x50, /* abort */
} __attribute__((packed));
-#define FC_SOF_CLASS_MASK 0x06 /* mask for class of service in SOF */
+#define FC_SOF_CLASS_MASK 0x06 /* mask for class of service in SOF */
/*
* Define classes in terms of the SOF code (initial).
*/
enum fc_class {
- FC_CLASS_NONE = 0, /* software value indicating no class */
- FC_CLASS_2 = FC_SOF_I2,
- FC_CLASS_3 = FC_SOF_I3,
- FC_CLASS_4 = FC_SOF_I4,
- FC_CLASS_F = FC_SOF_F,
-} __attribute__((packed));
+ FC_CLASS_NONE = 0, /* software value indicating no class */
+ FC_CLASS_2 = FC_SOF_I2,
+ FC_CLASS_3 = FC_SOF_I3,
+ FC_CLASS_4 = FC_SOF_I4,
+ FC_CLASS_F = FC_SOF_F,
+};
/*
* Determine whether SOF code indicates the need for a BLS ACK.
*/
-static inline int
-fc_sof_needs_ack(enum fc_sof sof)
+static inline int fc_sof_needs_ack(enum fc_sof sof)
{
- return ((~sof) & 0x02); /* true for class 1, 2, 4, 6, or F */
+ return ((~sof) & 0x02); /* true for class 1, 2, 4, 6, or F */
}
/*
* Given an fc_class, return the normal (non-initial) SOF value.
*/
-static inline enum fc_sof
-fc_sof_normal(enum fc_class class)
+static inline enum fc_sof fc_sof_normal(enum fc_class class)
{
- return (class + FC_SOF_N3 - FC_SOF_I3); /* diff is always 8 */
+ return (class + FC_SOF_N3 - FC_SOF_I3); /* diff is always 8 */
}
/*
* Compute class from SOF value.
*/
-static inline enum fc_class
-fc_sof_class(enum fc_sof sof)
+static inline enum fc_class fc_sof_class(enum fc_sof sof)
{
- return ((sof & 0x7) | FC_SOF_F);
+ return ((sof & 0x7) | FC_SOF_F);
}
/*
* Determine whether SOF is for the initial frame of a sequence.
*/
-static inline int
-fc_sof_is_init(enum fc_sof sof)
+static inline int fc_sof_is_init(enum fc_sof sof)
{
- return (sof < 0x30);
+ return (sof < 0x30);
}
#endif /* _FC_ENCAPS_H_ */
diff --git a/include/scsi/fc/fc_fc2.h b/include/scsi/fc/fc_fc2.h
index 38a2ab5..cff8a8c 100644
--- a/include/scsi/fc/fc_fc2.h
+++ b/include/scsi/fc/fc_fc2.h
@@ -34,18 +34,18 @@
* Note that the fields aren't all naturally aligned.
*/
struct fc_ssb {
- u_int8_t ssb_seq_id; /* sequence ID */
- u_int8_t _ssb_resvd;
- u_int16_t ssb_low_seq_cnt; /* lowest SEQ_CNT */
-
- u_int16_t ssb_high_seq_cnt; /* highest SEQ_CNT */
- u_int16_t ssb_s_stat; /* sequence status flags */
-
- u_int16_t ssb_err_seq_cnt; /* error SEQ_CNT */
- u_int8_t ssb_fh_cs_ctl; /* frame header CS_CTL */
- u_int16_t ssb_fh_ox_id; /* frame header OX_ID */
- u_int16_t ssb_rx_id; /* responder's exchange ID */
- u_int8_t _ssb_resvd2[2];
+ __u8 ssb_seq_id; /* sequence ID */
+ __u8 _ssb_resvd;
+ __be16 ssb_low_seq_cnt; /* lowest SEQ_CNT */
+
+ __be16 ssb_high_seq_cnt; /* highest SEQ_CNT */
+ __be16 ssb_s_stat; /* sequence status flags */
+
+ __be16 ssb_err_seq_cnt; /* error SEQ_CNT */
+ __u8 ssb_fh_cs_ctl; /* frame header CS_CTL */
+ __be16 ssb_fh_ox_id; /* frame header OX_ID */
+ __be16 ssb_rx_id; /* responder's exchange ID */
+ __u8 _ssb_resvd2[2];
} PACKED;
/*
@@ -83,16 +83,16 @@ struct fc_ssb {
* Note that the fields aren't all naturally aligned.
*/
struct fc_esb {
- u_int8_t esb_cs_ctl; /* CS_CTL for frame header */
- u_int16_t esb_ox_id; /* originator exchange ID */
- u_int16_t esb_rx_id; /* responder exchange ID */
- u_int32_t esb_orig_fid; /* fabric ID of originator */
- u_int32_t esb_resp_fid; /* fabric ID of responder */
- u_int32_t esb_e_stat; /* status */
- u_int8_t _esb_resvd[4];
- u_int8_t esb_service_params[112]; /* TBD */
- u_int8_t esb_seq_status[8]; /* sequence statuses, 8 bytes each */
-} PACKED;
+ __u8 esb_cs_ctl; /* CS_CTL for frame header */
+ __be16 esb_ox_id; /* originator exchange ID */
+ __be16 esb_rx_id; /* responder exchange ID */
+ __be32 esb_orig_fid; /* fabric ID of originator */
+ __be32 esb_resp_fid; /* fabric ID of responder */
+ __be32 esb_e_stat; /* status */
+ __u8 _esb_resvd[4];
+ __u8 esb_service_params[112]; /* TBD */
+ __u8 esb_seq_status[8]; /* sequence statuses, 8 bytes each */
+} __attribute__((packed));;
/*
diff --git a/include/scsi/libfc/fc_frame.h b/include/scsi/libfc/fc_frame.h
index 1efb3d0..1aa303e 100644
--- a/include/scsi/libfc/fc_frame.h
+++ b/include/scsi/libfc/fc_frame.h
@@ -62,7 +62,7 @@ struct fcoe_rcv_info {
struct fc_seq *fr_seq; /* for use with exchange manager */
enum fc_sof fr_sof; /* start of frame delimiter */
enum fc_eof fr_eof; /* end of frame delimiter */
- u_int8_t fr_flags; /* flags - see below */
+ u8 fr_flags; /* flags - see below */
};
/*
@@ -224,7 +224,7 @@ fc_frame_set_offset(struct fc_frame *fp, u_int32_t offset)
* The CRC immediately follows the last data item *AFTER* the length.
* The return value is zero if the CRC matches.
*/
-u_int32_t fc_frame_crc_check(struct fc_frame *);
+u32 fc_frame_crc_check(struct fc_frame *);
/*
* Check for leaks.
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 55ccace..49cabad 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -113,8 +113,8 @@ struct fc_exch_mgr;
* it cannot be declared as uint64_t.
*/
typedef unsigned long long fc_wwn_t; /* world-wide name */
-typedef uint32_t fc_fid_t; /* fabric address */
-typedef uint16_t fc_xid_t; /* exchange ID */
+typedef u32 fc_fid_t; /* fabric address */
+typedef u16 fc_xid_t; /* exchange ID */
enum ofc_io_speed {
OFC_SPEED_UNK = 0,
@@ -158,35 +158,35 @@ enum fc_sess_state {
* Fibre Channel information about remote N port.
*/
struct fc_remote_port {
- struct list_head rp_list; /* list under fc_virt_fab */
- atomic_t rp_refcnt; /* reference count */
- u_int rp_disc_ver; /* discovery instance */
- u_int rp_fcp_parm; /* remote FCP service parameters */
- u_int rp_local_fcp_parm; /* local FCP service parameters */
- struct fc_rport *rport;
- uint16_t tgt_flags;
+ struct list_head rp_list; /* list under fc_virt_fab */
+ atomic_t rp_refcnt; /* reference count */
+ unsigned int rp_disc_ver; /* discovery instance */
+ unsigned int rp_fcp_parm; /* remote FCP service parameters */
+ unsigned int rp_local_fcp_parm; /* local FCP service parameters */
+ struct fc_rport *rport;
+ u16 tgt_flags;
struct hlist_node rp_fid_hash_link;
/*
* For now, there's just one session per remote port.
* Eventually, for multipathing, there will be more.
*/
- u_char rp_sess_ready; /* session ready to be used */
- void *dns_lookup; /* private dns lookup */
- int dns_lookup_count; /* number of attempted lookups */
+ unsigned char rp_sess_ready; /* session ready to be used */
+ void *dns_lookup; /* private dns lookup */
+ int dns_lookup_count; /* number of attempted lookups */
/* fc_sess fields */
- struct fc_lport *local_port; /* local port (aka LIF) */
- enum fc_sess_state fs_state; /* session state */
- fc_fid_t fs_local_fid; /* local port fabric ID at create */
- fc_fid_t fs_remote_fid; /* remote port fabric ID */
- uint fs_retries; /* retry count in current state */
- struct timer_list fs_timer; /* retry timer */
- uint16_t fs_max_payload; /* max payload size in bytes */
- uint16_t fs_max_seq; /* max concurrent sequences */
- uint fs_e_d_tov; /* negotiated e_d_tov (msec) */
- uint fs_r_a_tov; /* received r_a_tov (msec) */
- spinlock_t fs_lock; /* lock on state changes */
+ struct fc_lport *local_port; /* local port (aka LIF) */
+ enum fc_sess_state fs_state; /* session state */
+ fc_fid_t fs_local_fid; /* local port fabric ID at create */
+ fc_fid_t fs_remote_fid; /* remote port fabric ID */
+ unsigned int fs_retries; /* retry count in current state */
+ struct timer_list fs_timer; /* retry timer */
+ u16 fs_max_payload; /* max payload size in bytes */
+ u16 fs_max_seq; /* max concurrent sequences */
+ unsigned int fs_e_d_tov; /* negotiated e_d_tov (msec) */
+ unsigned int fs_r_a_tov; /* received r_a_tov (msec) */
+ spinlock_t fs_lock; /* lock on state changes */
};
static inline void fc_rport_set_name(struct fc_remote_port *rp, fc_wwn_t wwpn,
@@ -200,37 +200,37 @@ static inline void fc_rport_set_name(struct fc_remote_port *rp, fc_wwn_t wwpn,
* device specific information
*/
struct fc_drv_info {
- char model[64];
- char vendor[64];
- char sn[64];
- char model_desc[256];
- char hw_version[256];
- char fw_version[256];
- char opt_rom_version[256];
- char drv_version[128];
- char drv_name[128];
+ char model[64];
+ char vendor[64];
+ char sn[64];
+ char model_desc[256];
+ char hw_version[256];
+ char fw_version[256];
+ char opt_rom_version[256];
+ char drv_version[128];
+ char drv_name[128];
};
/*
* fcoe stats structure
*/
struct fcoe_dev_stats {
- uint64_t SecondsSinceLastReset;
- uint64_t TxFrames;
- uint64_t TxWords;
- uint64_t RxFrames;
- uint64_t RxWords;
- uint64_t ErrorFrames;
- uint64_t DumpedFrames;
- uint64_t LinkFailureCount;
- uint64_t LossOfSignalCount;
- uint64_t InvalidTxWordCount;
- uint64_t InvalidCRCCount;
- uint64_t InputRequests;
- uint64_t OutputRequests;
- uint64_t ControlRequests;
- uint64_t InputMegabytes;
- uint64_t OutputMegabytes;
+ u64 SecondsSinceLastReset;
+ u64 TxFrames;
+ u64 TxWords;
+ u64 RxFrames;
+ u64 RxWords;
+ u64 ErrorFrames;
+ u64 DumpedFrames;
+ u64 LinkFailureCount;
+ u64 LossOfSignalCount;
+ u64 InvalidTxWordCount;
+ u64 InvalidCRCCount;
+ u64 InputRequests;
+ u64 OutputRequests;
+ u64 ControlRequests;
+ u64 InputMegabytes;
+ u64 OutputMegabytes;
};
/*
@@ -312,7 +312,7 @@ struct fc_transport_template {
void (*resp)(struct fc_seq *,
struct fc_frame *fp,
void *arg),
- void *resp_arg, u_int timer_msec,
+ void *resp_arg, unsigned int timer_msec,
fc_fid_t sid, fc_fid_t did, u32 f_ctl);
/*
@@ -464,66 +464,66 @@ struct fc_lport {
struct list_head list;
/* Associations */
- struct Scsi_Host *host;
- struct device fc_device;
- struct fc_exch_mgr *emp;
- struct fc_remote_port *fl_dns_rp;
- struct fc_remote_port *fl_ptp_rp;
- struct list_head vf_remote_ports; /* remote ports */
- void *scsi_priv;
+ struct Scsi_Host *host;
+ struct device fc_device;
+ struct fc_exch_mgr *emp;
+ struct fc_remote_port *fl_dns_rp;
+ struct fc_remote_port *fl_ptp_rp;
+ struct list_head vf_remote_ports; /* remote ports */
+ void *scsi_priv;
/* Operational Information */
struct fc_transport_template tt;
- uint16_t state;
- uint16_t status;
- atomic_t fcs_status;
- uint8_t fs_disc_done; /* discovery complete */
- enum fc_lport_state fl_state; /* state of FLOGI and dNS */
- ulong fc_boot_time;
+ u16 state;
+ u16 status;
+ atomic_t fcs_status;
+ u8 fs_disc_done; /* discovery complete */
+ enum fc_lport_state fl_state; /* state of FLOGI and dNS */
+ unsigned long fc_boot_time;
struct fc_host_statistics openfc_host_stat;
- struct fcoe_dev_stats *dev_stats[NR_CPUS];
-
- fc_wwn_t wwpn;
- fc_wwn_t wwnn;
- fc_fid_t fl_fid;
- uint8_t fl_retry_count;
- uint8_t fl_logon_req;
- u_int fl_disc_ver;
- u_char fl_disc_retries;
- u_char fl_disc_holdoff;
- u_char fl_disc_in_prog;
- u_char fl_disc_req;
- u_short fl_disc_seq_cnt;
- u_char fl_disc_buf_len;
+ struct fcoe_dev_stats *dev_stats[NR_CPUS];
+
+ fc_wwn_t wwpn;
+ fc_wwn_t wwnn;
+ fc_fid_t fl_fid;
+ u8 fl_retry_count;
+ u8 fl_logon_req;
+ unsigned int fl_disc_ver;
+ unsigned char fl_disc_retries;
+ unsigned char fl_disc_holdoff;
+ unsigned char fl_disc_in_prog;
+ unsigned char fl_disc_req;
+ unsigned short fl_disc_seq_cnt;
+ unsigned char fl_disc_buf_len;
/* Capabilities */
- char ifname[IFNAMSIZ];
- uint32_t capabilities;
- ulong qdepth;
- u32 mfs; /* max FC payload size */
- u_int service_params;
- u_int fl_e_d_tov;
- u_int fl_r_a_tov;
- uint8_t fl_retry_limit;
- int link_status;
- u16 link_speed;
- u16 link_supported_speeds;
- struct fc_ns_fts fl_ns_fts; /* FC-4 type masks */
- struct fc_els_rnid_gen fl_rnid_gen; /* RNID information */
+ char ifname[IFNAMSIZ];
+ u32 capabilities;
+ unsigned long qdepth;
+ u32 mfs; /* max FC payload size */
+ unsigned int service_params;
+ unsigned int fl_e_d_tov;
+ unsigned int fl_r_a_tov;
+ u8 fl_retry_limit;
+ int link_status;
+ u16 link_speed;
+ u16 link_supported_speeds;
+ struct fc_ns_fts fl_ns_fts; /* FC-4 type masks */
+ struct fc_els_rnid_gen fl_rnid_gen; /* RNID information */
/* Locks */
- spinlock_t fl_lock; /* serializes state changes */
- spinlock_t rp_lock; /* lock for list of fc_rports */
+ spinlock_t fl_lock; /* serializes state changes */
+ spinlock_t rp_lock; /* lock for list of fc_rports */
- struct hlist_head *vf_rport_by_fid; /* remote ports by FCID */
+ struct hlist_head *vf_rport_by_fid; /* remote ports by FCID */
/* Miscellaneous */
- struct fc_gpn_ft_resp fl_disc_buf; /* partial name buffer */
- struct timer_list fl_timer; /* timer for state events */
- struct timer_list fl_disc_timer; /* timer for continuing */
+ struct fc_gpn_ft_resp fl_disc_buf; /* partial name buffer */
+ struct timer_list fl_timer; /* timer for state events */
+ struct timer_list fl_disc_timer; /* timer for continuing */
- void *drv_priv;
+ void *drv_priv;
struct fc_drv_info drv_info;
};
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 11/13] libfc: mv scsi pkt cache to module
2008-06-29 18:24 ` [PATCH 10/13] libfc fcoe: coding style fixups - use uX for definitions michaelc
@ 2008-06-29 18:24 ` michaelc
2008-06-29 18:24 ` [PATCH 12/13] libfc: mv em exch " michaelc
0 siblings, 1 reply; 22+ messages in thread
From: michaelc @ 2008-06-29 18:24 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
A per host cache is overkill. For other storage drivers we do
a cache per module. This moves the scsi pkt cache to the module
instead of per host.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/libfc/fc_scsi.c | 78 +++++++++++++----------------------------
1 files changed, 25 insertions(+), 53 deletions(-)
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index c41807b..257962a 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -38,6 +38,7 @@
#include <scsi/libfc/fc_dbg.h>
int openfc_debug;
+static struct kmem_cache *scsi_pkt_cachep;
#define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr)
#define CMD_ENTRY_STATUS(Cmnd) ((Cmnd)->SCp.have_data_in)
@@ -115,7 +116,6 @@ struct fc_cmdq {
};
struct fc_scsi_internal {
- struct kmem_cache *scsi_pkt_cachep;
struct fc_cmdq outstandingcmd[FC_MAX_OUTSTANDING_COMMANDS];
int current_cmd_indx;
____cacheline_aligned spinlock_t outstandingcmd_lock;
@@ -192,9 +192,8 @@ static void fc_scsi_srr_error(struct fc_scsi_pkt *, struct fc_frame *);
static struct fc_scsi_pkt *fc_scsi_pkt_alloc(struct fc_lport *lp)
{
struct fc_scsi_pkt *sp;
- struct fc_scsi_internal *si = fc_get_scsi_internal(lp);
- sp = kmem_cache_zalloc(si->scsi_pkt_cachep, 0);
+ sp = kmem_cache_zalloc(scsi_pkt_cachep, 0);
if (sp) {
sp->lp = (void *)lp;
atomic_set(&sp->ref_cnt, 1);
@@ -214,15 +213,11 @@ static struct fc_scsi_pkt *fc_scsi_pkt_alloc(struct fc_lport *lp)
*/
static int fc_scsi_pkt_free(struct fc_scsi_pkt *sp)
{
- struct fc_lport *lp = sp->lp;
- struct fc_scsi_internal *si = fc_get_scsi_internal(lp);
-
if (atomic_dec_and_test(&sp->ref_cnt)) {
- if (sp->state == FC_SRB_FREE) {
- kmem_cache_free(si->scsi_pkt_cachep, sp);
- } else {
+ if (sp->state == FC_SRB_FREE)
+ kmem_cache_free(scsi_pkt_cachep, sp);
+ else
FC_DBG("freeing scsi_pkt not marked free\n");
- }
}
return 0;
}
@@ -237,40 +232,6 @@ static void fc_scsi_pkt_release(struct fc_scsi_pkt *sp)
fc_scsi_pkt_free(sp);
}
-
-static int fc_destroy_scsi_slab(struct fc_lport *lp)
-{
- int rc = -1;
- struct fc_scsi_internal *si = fc_get_scsi_internal(lp);
-
- if (si->scsi_pkt_cachep != NULL) {
- kmem_cache_destroy(si->scsi_pkt_cachep);
- si->scsi_pkt_cachep = NULL;
- rc = 0;
- }
- return rc;
-}
-
-static int fc_create_scsi_slab(struct fc_lport *lp)
-{
- struct fc_scsi_internal *si = fc_get_scsi_internal(lp);
- char scsi_pkt_cachep_name[FC_SRB_CACHEP_NAME];
-
- sprintf(scsi_pkt_cachep_name, "openfc%d", lp->host->host_no);
-
- si->scsi_pkt_cachep =
- kmem_cache_create(scsi_pkt_cachep_name,
- sizeof(struct fc_scsi_pkt) +
- 0, 0, SLAB_HWCACHE_ALIGN,
- NULL);
-
- if (si->scsi_pkt_cachep == NULL) {
- FC_DBG("Unable to allocate SRB cache...module load failed!");
- return -ENOMEM;
- }
- return 0;
-}
-
/*
* Lock fc_scsi_pkt.
* The outstandingcmd queue lock is used to serialize access to the fc_scsi_pkt.
@@ -2137,7 +2098,6 @@ EXPORT_SYMBOL(fc_change_queue_type);
*/
void fc_put_dev(struct fc_lport *lp)
{
- fc_destroy_scsi_slab(lp);
kfree(fc_get_scsi_internal(lp));
lp->scsi_priv = NULL;
}
@@ -2160,14 +2120,6 @@ int fc_scsi_init(struct fc_lport *lp,
lp->scsi_priv = (void*)si;
/*
- * create slab for pkt buffer
- */
- if (fc_create_scsi_slab(lp) < 0) {
- FC_DBG("scsi pkt slab create failed");
- return -1;
- }
-
- /*
* we will use openfc's scsi i/f only when lower level driver
* does not have a fast path.
*/
@@ -2184,3 +2136,23 @@ int fc_scsi_init(struct fc_lport *lp,
return 0;
}
EXPORT_SYMBOL(fc_scsi_init);
+
+static int __init libfc_init(void)
+{
+ scsi_pkt_cachep = kmem_cache_create("libfc_scsi_pkt",
+ sizeof(struct fc_scsi_pkt),
+ 0, SLAB_HWCACHE_ALIGN, NULL);
+ if (scsi_pkt_cachep == NULL) {
+ FC_DBG("Unable to allocate SRB cache...module load failed!");
+ return -ENOMEM;
+ }
+ return 0;
+}
+
+static void __exit libfc_exit(void)
+{
+ kmem_cache_destroy(scsi_pkt_cachep);
+}
+
+module_init(libfc_init);
+module_exit(libfc_exit);
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 12/13] libfc: mv em exch cache to module
2008-06-29 18:24 ` [PATCH 11/13] libfc: mv scsi pkt cache to module michaelc
@ 2008-06-29 18:24 ` michaelc
2008-06-29 18:24 ` [PATCH 13/13] libfc: remove unnessary casts michaelc
2008-06-30 23:35 ` [Open-FCoE] [PATCH 12/13] libfc: mv em exch cache to module Dev, Vasu
0 siblings, 2 replies; 22+ messages in thread
From: michaelc @ 2008-06-29 18:24 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
A per host cache is overkill. For other storage drivers we do
a cache per module. This moves the em exch cache to the module
instead of per host.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/fcoe/fcoe_if.c | 2 +-
drivers/scsi/libfc/fc_exch.c | 35 +++++++++++++++++------------------
drivers/scsi/libfc/fc_scsi.c | 9 ++++++++-
include/scsi/libfc/libfc.h | 7 ++++++-
4 files changed, 32 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
index 3c21e05..fe9364f 100644
--- a/drivers/scsi/fcoe/fcoe_if.c
+++ b/drivers/scsi/fcoe/fcoe_if.c
@@ -489,7 +489,7 @@ int fcoe_create_interface(const char *ifname)
shost->max_channel = 0;
/* Allocate an EM for this driver */
- lp->emp = fc_exch_mgr_alloc(FC_CLASS_3, 0, 0);
+ lp->emp = fc_exch_mgr_alloc(FC_CLASS_3, 0);
if (!lp->emp)
goto out_host_put;
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index d861963..5f2433c 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -37,7 +37,7 @@
* fc_exch_debug can be set in debugger or at compile time to get more logs.
*/
static int fc_exch_debug;
-
+static struct kmem_cache *em_cachep; /* cache for exchanges */
/*
* Structure and function definitions for managing Fibre Channel Exchanges
@@ -115,8 +115,6 @@ struct fc_exch_mgr {
enum fc_class em_class; /* default class for sequences */
spinlock_t em_lock; /* exchange manager lock */
fc_xid_t em_xid; /* default initiator exchange IDs */
- char em_name[16]; /* cache name string */
- struct kmem_cache *em_cp; /* cache for exchanges */
void *em_llddata; /* Points to LLD privdate data */
u32 em_exch_total; /* total allocated exchanges */
struct list_head em_exch_list; /* allocated exchanges list */
@@ -1662,7 +1660,6 @@ reject:
}
struct fc_exch_mgr *fc_exch_mgr_alloc(enum fc_class class,
- u32 em_idx,
u32 privsize)
{
struct fc_exch_mgr *mp;
@@ -1679,17 +1676,6 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(enum fc_class class,
INIT_LIST_HEAD(&mp->em_exch_list);
spin_lock_init(&mp->em_lock);
-
- sprintf(mp->em_name, "libfcEM%d", em_idx);
- mp->em_cp = kmem_cache_create(mp->em_name,
- sizeof(struct fc_exch),
- 0, SLAB_HWCACHE_ALIGN,
- NULL);
-
- if (!mp->em_cp) {
- kfree(mp);
- mp = NULL;
- }
}
return mp;
}
@@ -1699,7 +1685,6 @@ void fc_exch_mgr_free(struct fc_exch_mgr *mp)
{
WARN_ON(!mp);
- kmem_cache_destroy(mp->em_cp);
kfree(mp);
}
EXPORT_SYMBOL(fc_exch_mgr_free);
@@ -1708,7 +1693,7 @@ struct fc_exch *fc_exch_alloc(struct fc_exch_mgr *mp, fc_xid_t ex_id)
{
struct fc_exch *ep = NULL;
- ep = kmem_cache_zalloc(mp->em_cp, GFP_ATOMIC);
+ ep = kmem_cache_zalloc(em_cachep, GFP_ATOMIC);
if (ep) {
ep->ex_f_ctl = FC_FC_FIRST_SEQ; /* next seq is first seq */
ep->ex_rx_id = FC_XID_UNKNOWN;
@@ -1752,7 +1737,7 @@ static void fc_exch_release(struct fc_exch *ep)
mp->em_exch_total--;
list_del(&ep->ex_list);
spin_unlock_bh(&mp->em_lock);
- kmem_cache_free(mp->em_cp, ep);
+ kmem_cache_free(em_cachep, ep);
}
}
@@ -1984,3 +1969,17 @@ int fc_exch_init(struct fc_lport *lp,
return 0;
}
EXPORT_SYMBOL(fc_exch_init);
+
+int fc_setup_exch_mgr(void)
+{
+ em_cachep = kmem_cache_create("libfc_em", sizeof(struct fc_exch),
+ 0, SLAB_HWCACHE_ALIGN, NULL);
+ if (!em_cachep)
+ return -ENOMEM;
+ return 0;
+}
+
+void fc_destroy_exch_mgr(void)
+{
+ kmem_cache_destroy(em_cachep);
+}
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index 257962a..2ca1db2 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -2139,6 +2139,8 @@ EXPORT_SYMBOL(fc_scsi_init);
static int __init libfc_init(void)
{
+ int rc;
+
scsi_pkt_cachep = kmem_cache_create("libfc_scsi_pkt",
sizeof(struct fc_scsi_pkt),
0, SLAB_HWCACHE_ALIGN, NULL);
@@ -2146,12 +2148,17 @@ static int __init libfc_init(void)
FC_DBG("Unable to allocate SRB cache...module load failed!");
return -ENOMEM;
}
- return 0;
+
+ rc = fc_setup_exch_mgr();
+ if (rc)
+ kmem_cache_destroy(scsi_pkt_cachep);
+ return rc;
}
static void __exit libfc_exit(void)
{
kmem_cache_destroy(scsi_pkt_cachep);
+ fc_destroy_exch_mgr();
}
module_init(libfc_init);
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 49cabad..3014bb6 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -750,7 +750,6 @@ int fc_exch_init(struct fc_lport *lp,
* help the LLD manage the exchange ID allocation.
*/
struct fc_exch_mgr *fc_exch_mgr_alloc(enum fc_class class,
- u32 em_idx,
u32 privsize);
@@ -854,4 +853,10 @@ void fc_get_rport_loss_tmo(struct fc_rport *rport);
void fc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *);
+/*
+ * module setup functions.
+ */
+int fc_setup_exch_mgr(void);
+void fc_destroy_exch_mgr(void);
+
#endif /* _LIBFC_H_ */
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 13/13] libfc: remove unnessary casts
2008-06-29 18:24 ` [PATCH 12/13] libfc: mv em exch " michaelc
@ 2008-06-29 18:24 ` michaelc
2008-06-30 23:35 ` [Open-FCoE] [PATCH 12/13] libfc: mv em exch cache to module Dev, Vasu
1 sibling, 0 replies; 22+ messages in thread
From: michaelc @ 2008-06-29 18:24 UTC (permalink / raw)
To: linux-scsi, devel; +Cc: Mike Christie
From: Mike Christie <michaelc@cs.wisc.edu>
Trivial remove casts in fc_scsi.c. Just getting it out of the way
to make other patches smaller.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
---
drivers/scsi/libfc/fc_scsi.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c
index 2ca1db2..b9d0ec4 100644
--- a/drivers/scsi/libfc/fc_scsi.c
+++ b/drivers/scsi/libfc/fc_scsi.c
@@ -2028,7 +2028,7 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
struct fc_lport *lp;
lp = shost_priv(sc_cmd->device->host);
- return (lp->tt.reset_if(lp));
+ return lp->tt.reset_if(lp);
}
EXPORT_SYMBOL(fc_eh_host_reset);
@@ -2115,9 +2115,8 @@ int fc_scsi_init(struct fc_lport *lp,
if (!lp->tt.scsi_abort_io)
lp->tt.scsi_abort_io = fc_scsi_abort_io;
- si = (struct fc_scsi_internal*)kzalloc(sizeof(struct fc_scsi_internal),
- GFP_KERNEL);
- lp->scsi_priv = (void*)si;
+ si = kzalloc(sizeof(struct fc_scsi_internal), GFP_KERNEL);
+ lp->scsi_priv = si;
/*
* we will use openfc's scsi i/f only when lower level driver
--
1.5.4.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* RE: fcoe cleanups and fcoe TODO
2008-06-29 18:23 fcoe cleanups and fcoe TODO michaelc
2008-06-29 18:23 ` [PATCH 01/13] set proc name michaelc
@ 2008-06-30 20:33 ` Love, Robert W
[not found] ` <10A7D0016239E24092DEF05CCC582E4303FE4B55-6O2ePOu3Gqekrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2008-07-01 14:37 ` Andrew Vasquez
2008-07-03 0:13 ` [Open-FCoE] " Leech, Christopher
2 siblings, 2 replies; 22+ messages in thread
From: Love, Robert W @ 2008-06-30 20:33 UTC (permalink / raw)
To: michaelc, linux-scsi, devel
>Hey,
>
>Following are some cleanup patches for things I found while trying
>to get setup. I did not get to test the patches well, because
>the rearch code does not seem to work every well the software
>target. I basically loaded the driver and made sure I could login
>and find storage. Trying to do heavy READ and WRITE IO lead to
problems.
>
>The patches are made over the re-arch git tree.
>
Awesome, I've reviewed a few and will get them in shortly.
>Below are some notes for things I am working on and that we may want to
>talk about or you may want to hack on. It is not a complete list. Just
>some stuff I noticed on the first pass.
>
>My TODO:
>
>- Replace fc_scsi.c's outstanding array with scsi host shared tag map
>(scsi_init_shared_tag_map).
>
I'll have to read about this a bit more.
>- Fix locking and document it:
> fc_scsi.c: The fc_scsi_pkt done function can be called with
spin
> locks held so at first glance we should not call del_timer_sync
> because it can sleep.
>
> Other libfc code's fl_lock, rp_lock and em_lock and ex_lock is
> really complicated. It needs some documentation. I hit the
> locking bug fixed with
> 0003-libfc-fix-locking-in-tt.rport_lookup_create-paths.patch
> and it turns out we can call functions with different locks
held.
> For example we call the frame_send callout with the fl_lock
> sometimes and other times with another lock. And sometimes bhs
> are disabled and sometimes they are not.
>
Most of the locking problems are due to the convergence of previous
structures. We do need a comprehensive review of all of our locking and
reference counting.
> Will libfc code be used by drivers that work more like
> traditional drivers where they have a interrupt handler and
> do not hook into the network layer? If so then it seems
> like we want to the irq spin locks instead of the bh ones.
>
> Also remove fl_lock and rp_lock wrappers.
>
> The per scsi packet locking looks a little too complicated.
> How much of a performance boost do we get from this?
>
>- Some of the host lib re-arch seems akward (maybe it was like this
>before).
>The LLD allocates and adds the scsi host, but fc_lport_destroy removes
>the host and the driver only does the last put. We should probably
>make this more symmetrical. Was this done to fix the sync cache
>command and logout processing?
>
No, this is simply a result of the big transitions we've made and yes, I
agree, the creation/deletion needs to be symmetrical.
>- I am not sure if the setup functions like fc_lport_init are nice
>in how it sets the transport functions pointers for you or if it will
lead
>to problems for drivers that want to partially hook in, but find
>out that the lib has set some functions it did not want. Maybe we want
>to set the libfc functions in the LLD like is done for the
>scsi_host_template.
>
Yeah, we've debated whether we should have the lib init the pointers and
then have the LLD override them or have the LLD set them first and have
the lib fill in the un-initialized ones. The current design allows a LLD
to override the default functions with its own. Is your suggestion to
expose all of the functions that could satisfy the tt
(fc_transport_template) pointers through the libfc API and have the LLD
set them all?
Throughout this re-architecture the tt and libfc API have grown and
shrunk. Lately we've bloated the tt to expose functions that were
previously called directly from one UL system (fc_scsi, fc_lport,
fc_rport or fc_disc) to another. The number of functions needed in the
tt and also required in the libfc API seemed like too much and having a
little _init() function for each UL system seemed cleaner. We're getting
closer to having a cleaner API between each UL system so maybe we can
move the assignment of tt pointers back to the LLD.
>I think we need to see more hardware in the end. For now since there is
>only
>software fcoe that is out, this could probably be ok and as we see more
>drivers we can evolve the split for the hardware like was done with
iscsi.
>For iscsi we ended up with 4 different offload modules so there was no
way
>we could have designed for all of them and the hardware/firmware
>guys's quirks :)
>
We definitely expect this library to evolve as more LLDs use it.
>- In general without knowing how hardware is really going to hook into
>the lib it is hard to say how the rearch is going :) If we cannot
>move more of the fc_remote_port to the rport (or if we just do not
>want to move it all there because other drivers like lpfc and qla2xxx
>will never use it) then we might want to rename the fc_remote_port
>to avoid confusion with the rport and make it clear that the libfc
remote
>port is only needed for libfc operations.
>
We'd like to reduce fc_remote_port to nothing and only use fc_rport.
We're still not sure we can completely achieve this without either
having some private data or adding fields to the fc_rport.
>Should the fc_transport_template be merged with the
fc_function_template?
>The function callouts to do things lke abort IO or cleanup commands
look
>similar. But in general should the fc_function_template be common for
all
>fc drivers and should the fc_transport_template be just for the ones
that
>are
>going to hook into the libfc? If the latter maybe we want to rename
this to
>make the visibility clear.
>
So something like libfc_transport_template?
>- How much of the drivers/scsi/fcoe driver should be common? The start
and
>stop interface seems like it should be common for all fc drivers. But
will
>some things like passing in the network device to use be fcoe module
>specific?
>Will other drivers load like a more traditional driver with a
pci_driver,
>or will this be a mess like iscsi where some do, but others bind to
>network devices (netdevs) that also have fcoe engines. The pci_driver
>case would mean that we do not need a common interface for this,
>but for the netdev with fcoe engine then it seems like we want a common
>inteface like we have with iscsi.
>
>Do we want a common userspace interface for the setup like we have with
>iscsi for the initial merge? If so, we can say the interface is
unstable
>for now, because we just do not know how the hardware is going to work
or
>we can try and design a interface based on what we learned from iscsi.
The
>latter will probably result in a incorrct design since we are only
>lowly driver engineers and do not know the fun the firmware guys
>have for us :) However breaking userspace interfaces is a real pain
>for users. When we did the latter for iscsi it was a tremendous pain
for
>users and distro integrators.
>
>- Should discovery be done in userspace? For iscsi we put things like
iSNS
>in userspace and even sendtargets which is not that big. iSNS is big
and
>clunky. It looks like 10 thousand lines from doing a wc on some of the
>open-isns code, but could be smaller if we limit the features (the
native
>iSNS code in open-iscsi's userspace daemon is only a couple thousand
lines
>but that only does discovery). Are we going to have something similar
for
>fcoe? If so then we might want to keep all discovery in userspace and
>create a interface similar to iscsi where discovery is done in
userspace
>and then tells the kernel to create objects like rports for only the
>targets.
>
There are really two types of discovery related to fcoe- target
discovery using the name server and FIP (FCoE Initialization Protocol)
which allows various devices connected to a FCF fabric to discover each
other. So far we only have an implementation for the prior, in-kernel.
Loosely related, I was planning on renaming fc_disc.c to fc_dns.c to
reflect that it was interaction with the name server. Even less related
I plan to rename fc_scsi.c to fc_fcp.c as it's really doing FCP.
>Going to userspace on the other hand is a major pain in the butt when
>it comes to distro integration and error handling. For an RCSN would
>we have to kick back out to userspace then come back to the kernel?
>If so for iscsi it turns out to be a lot more complicated to do the
>equivalent when you move discovery to userspace. And for boot it gets
messy
>to get this all to work right.
>
>- For storage drivers are we using the be/le cpu functions instead
>of the hton/ntoh? I think Christoph asked us to do that for iscsi.
>
>- A lot of the goto error paths are broken. The fcoe module init for
>example leaks when some functions fail (probably due to rearch and this
>being more temp code).
>
Yes, that needs to be fixed. We've really spent a lot of time
simplifying and consolidating. There has been fallout as a result,
broken p2p, messy locking, and bad error handling. It took quite a bit
to get the code to where it is now and we're getting closer to a place
where we can review the code more comprehensively, work on known bad
spots and start fixing defects.
>- Add some mempools or reserve just enough scsi pkt and em resources so
we
>can make forward progress on at least one command per host.
>
Thanks for the patches and feedback!
>
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-scsi"
in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: fcoe cleanups and fcoe TODO
[not found] ` <10A7D0016239E24092DEF05CCC582E4303FE4B55-6O2ePOu3Gqekrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2008-06-30 21:43 ` Mike Christie
[not found] ` <4869539F.3070605-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
0 siblings, 1 reply; 22+ messages in thread
From: Mike Christie @ 2008-06-30 21:43 UTC (permalink / raw)
To: Love, Robert W
Cc: devel-s9riP+hp16TNLxjTenLetw, linux-scsi-u79uwXL29TY76Z2rM5mHXA
Love, Robert W wrote:
>> Hey,
>>
>> Following are some cleanup patches for things I found while trying
>> to get setup. I did not get to test the patches well, because
>> the rearch code does not seem to work every well the software
>> target. I basically loaded the driver and made sure I could login
>> and find storage. Trying to do heavy READ and WRITE IO lead to
> problems.
>> The patches are made over the re-arch git tree.
>>
> Awesome, I've reviewed a few and will get them in shortly.
Oh yeah, I just rebased my tree and saw all the checkins from the
weekend so my patches do not apply from a tree that is pulled today. Are
you going to fix that for me, or do you want me to rediff and resend
when you are done reviewing. I heard the iscsi maintainer is really nice
and will rediff for you :)
>> - I am not sure if the setup functions like fc_lport_init are nice
>> in how it sets the transport functions pointers for you or if it will
> lead
>> to problems for drivers that want to partially hook in, but find
>> out that the lib has set some functions it did not want. Maybe we want
>> to set the libfc functions in the LLD like is done for the
>> scsi_host_template.
>>
> Yeah, we've debated whether we should have the lib init the pointers and
> then have the LLD override them or have the LLD set them first and have
> the lib fill in the un-initialized ones. The current design allows a LLD
> to override the default functions with its own. Is your suggestion to
> expose all of the functions that could satisfy the tt
> (fc_transport_template) pointers through the libfc API and have the LLD
> set them all?
It was, but for now we probably do not need to change it unless someone
cares. I think it is best to do this last since it is not a big deal and
we still do not know what drivers are using and things are more stable.
>
> Throughout this re-architecture the tt and libfc API have grown and
> shrunk. Lately we've bloated the tt to expose functions that were
> previously called directly from one UL system (fc_scsi, fc_lport,
> fc_rport or fc_disc) to another. The number of functions needed in the
> tt and also required in the libfc API seemed like too much and having a
> little _init() function for each UL system seemed cleaner. We're getting
> closer to having a cleaner API between each UL system so maybe we can
> move the assignment of tt pointers back to the LLD.
>
>> I think we need to see more hardware in the end. For now since there is
>> only
>> software fcoe that is out, this could probably be ok and as we see more
>> drivers we can evolve the split for the hardware like was done with
> iscsi.
>> For iscsi we ended up with 4 different offload modules so there was no
> way
>> we could have designed for all of them and the hardware/firmware
>> guys's quirks :)
>>
> We definitely expect this library to evolve as more LLDs use it.
>
>> - In general without knowing how hardware is really going to hook into
>> the lib it is hard to say how the rearch is going :) If we cannot
>> move more of the fc_remote_port to the rport (or if we just do not
>> want to move it all there because other drivers like lpfc and qla2xxx
>> will never use it) then we might want to rename the fc_remote_port
>> to avoid confusion with the rport and make it clear that the libfc
> remote
>> port is only needed for libfc operations.
>>
> We'd like to reduce fc_remote_port to nothing and only use fc_rport.
> We're still not sure we can completely achieve this without either
> having some private data or adding fields to the fc_rport.
On a related note, are there going to be values that we need to export
in sysfs that are specific to fcoe? For remote port values are we going
to export them on the fc_rport (is the fc_rport for anything and
everything related to FC) or some new struct?
If it is a new struct, what if a driver does not use any
fc_transport_template callouts and does not hook into libfc?
>
>> Should the fc_transport_template be merged with the
> fc_function_template?
>> The function callouts to do things lke abort IO or cleanup commands
> look
>> similar. But in general should the fc_function_template be common for
> all
>> fc drivers and should the fc_transport_template be just for the ones
> that
>> are
>> going to hook into the libfc? If the latter maybe we want to rename
> this to
>> make the visibility clear.
>>
> So something like libfc_transport_template?
That makes it clear, but I do not know if it is a good name. It sounds
ugly like something I would name it (I am not good at naming as you can
tell from some of the iscsi function names). All I know is that the
original is not so clear :)
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: fcoe cleanups and fcoe TODO
[not found] ` <4869539F.3070605-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
@ 2008-06-30 21:47 ` Mike Christie
2008-06-30 23:33 ` Mike Christie
1 sibling, 0 replies; 22+ messages in thread
From: Mike Christie @ 2008-06-30 21:47 UTC (permalink / raw)
To: Love, Robert W
Cc: devel-s9riP+hp16TNLxjTenLetw, linux-scsi-u79uwXL29TY76Z2rM5mHXA
Mike Christie wrote:
>>> - In general without knowing how hardware is really going to hook into
>>> the lib it is hard to say how the rearch is going :) If we cannot
>>> move more of the fc_remote_port to the rport (or if we just do not
>>> want to move it all there because other drivers like lpfc and qla2xxx
>>> will never use it) then we might want to rename the fc_remote_port
>>> to avoid confusion with the rport and make it clear that the libfc
>> remote
>>> port is only needed for libfc operations.
>>>
>> We'd like to reduce fc_remote_port to nothing and only use fc_rport.
>> We're still not sure we can completely achieve this without either
>> having some private data or adding fields to the fc_rport.
>
>
>
> On a related note, are there going to be values that we need to export
> in sysfs that are specific to fcoe? For remote port values are we going
> to export them on the fc_rport (is the fc_rport for anything and
> everything related to FC) or some new struct?
>
> If it is a new struct, what if a driver does not use any
> fc_transport_template callouts and does not hook into libfc?
>
>>
>>> Should the fc_transport_template be merged with the
>> fc_function_template?
>>> The function callouts to do things lke abort IO or cleanup commands
>> look
>>> similar. But in general should the fc_function_template be common for
>> all
>>> fc drivers and should the fc_transport_template be just for the ones
>> that
>>> are
>>> going to hook into the libfc? If the latter maybe we want to rename
>> this to
>>> make the visibility clear.
>>>
>> So something like libfc_transport_template?
>
>
> That makes it clear, but I do not know if it is a good name. It sounds
> ugly like something I would name it (I am not good at naming as you can
> tell from some of the iscsi function names). All I know is that the
> original is not so clear :)
>
Oh yeah, sorry I did not give a good answer to this. I was thinking if
we are thowing everything (fcoe specific attrs) on the scsi_transport_fc
fc_rport or fc_host then we might as well throw the callouts on
fc_function_template.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: fcoe cleanups and fcoe TODO
[not found] ` <4869539F.3070605-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-30 21:47 ` Mike Christie
@ 2008-06-30 23:33 ` Mike Christie
1 sibling, 0 replies; 22+ messages in thread
From: Mike Christie @ 2008-06-30 23:33 UTC (permalink / raw)
To: Love, Robert W
Cc: devel-s9riP+hp16TNLxjTenLetw, linux-scsi-u79uwXL29TY76Z2rM5mHXA
Mike Christie wrote:
> Love, Robert W wrote:
>>> Hey,
>>>
>>> Following are some cleanup patches for things I found while trying
>>> to get setup. I did not get to test the patches well, because
>>> the rearch code does not seem to work every well the software
>>> target. I basically loaded the driver and made sure I could login
>>> and find storage. Trying to do heavy READ and WRITE IO lead to
>> problems.
>>> The patches are made over the re-arch git tree.
>>>
>> Awesome, I've reviewed a few and will get them in shortly.
>
>
> Oh yeah, I just rebased my tree and saw all the checkins from the
> weekend so my patches do not apply from a tree that is pulled today. Are
> you going to fix that for me, or do you want me to rediff and resend
> when you are done reviewing. I heard the iscsi maintainer is really nice
> and will rediff for you :)
Just kidding the iscsi maintainer is jerk and makes you rediff your
patches. Here are updated patches against a tree I just downloaded (the
last commit is cdf23e6d5ad1843054a70a1bcecbffbfd87935b0).
http://kernel.org/pub/linux/kernel/people/mnc/fcoe/6-30-08/
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [Open-FCoE] [PATCH 12/13] libfc: mv em exch cache to module
2008-06-29 18:24 ` [PATCH 12/13] libfc: mv em exch " michaelc
2008-06-29 18:24 ` [PATCH 13/13] libfc: remove unnessary casts michaelc
@ 2008-06-30 23:35 ` Dev, Vasu
1 sibling, 0 replies; 22+ messages in thread
From: Dev, Vasu @ 2008-06-30 23:35 UTC (permalink / raw)
To: michaelc, linux-scsi, devel
>-----Original Message-----
>From: devel-bounces@open-fcoe.org [mailto:devel-bounces@open-fcoe.org]
On
>Behalf Of michaelc@cs.wisc.edu
>Sent: Sunday, June 29, 2008 11:24 AM
>To: linux-scsi@vger.kernel.org; devel@open-fcoe.org
>Subject: [Open-FCoE] [PATCH 12/13] libfc: mv em exch cache to module
>
>From: Mike Christie <michaelc@cs.wisc.edu>
>
>A per host cache is overkill. For other storage drivers we do
>a cache per module. This moves the em exch cache to the module
>instead of per host.
>
Per EM cache would minimize locking contentions for exch alloc and free
if per CPU receive thread fcoe_percpu_receive_thread() have its own per
CPU EM instance. This patch won't impact ability to have EM instance
(struct fc_exch_mgr) per CPU for faster exch lookup within an EM but
having single EM cache means more contentions for exch allocation and
free once per CPU EM instance is created.
The receive flow is already distributing all received frames of a
exchange to same received thread but transmit side need to come up with
efficient ex id and EM allocation when per CPU EM instance is
implemented in FCoE module.
Given current code has only one EM instance, so moving this cache per
module wouldn't make any difference in number of EM cache for now.
>Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
>---
> drivers/scsi/fcoe/fcoe_if.c | 2 +-
> drivers/scsi/libfc/fc_exch.c | 35
+++++++++++++++++------------------
> drivers/scsi/libfc/fc_scsi.c | 9 ++++++++-
> include/scsi/libfc/libfc.h | 7 ++++++-
> 4 files changed, 32 insertions(+), 21 deletions(-)
>
>diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c
>index 3c21e05..fe9364f 100644
>--- a/drivers/scsi/fcoe/fcoe_if.c
>+++ b/drivers/scsi/fcoe/fcoe_if.c
>@@ -489,7 +489,7 @@ int fcoe_create_interface(const char *ifname)
> shost->max_channel = 0;
>
> /* Allocate an EM for this driver */
>- lp->emp = fc_exch_mgr_alloc(FC_CLASS_3, 0, 0);
>+ lp->emp = fc_exch_mgr_alloc(FC_CLASS_3, 0);
> if (!lp->emp)
> goto out_host_put;
>
>diff --git a/drivers/scsi/libfc/fc_exch.c
b/drivers/scsi/libfc/fc_exch.c
>index d861963..5f2433c 100644
>--- a/drivers/scsi/libfc/fc_exch.c
>+++ b/drivers/scsi/libfc/fc_exch.c
>@@ -37,7 +37,7 @@
> * fc_exch_debug can be set in debugger or at compile time to get more
logs.
> */
> static int fc_exch_debug;
>-
>+static struct kmem_cache *em_cachep; /* cache for exchanges */
>
Use fc_ prefix for global to easily identify libfc global symbols.
However few places are still using older openfc prefix and that need to
be fixed.
> /*
> * Structure and function definitions for managing Fibre Channel
Exchanges
>@@ -115,8 +115,6 @@ struct fc_exch_mgr {
> enum fc_class em_class; /* default class for sequences
*/
> spinlock_t em_lock; /* exchange manager lock */
> fc_xid_t em_xid; /* default initiator exchange
IDs */
>- char em_name[16]; /* cache name string */
>- struct kmem_cache *em_cp; /* cache for exchanges */
> void *em_llddata; /* Points to LLD privdate data
*/
> u32 em_exch_total; /* total allocated exchanges */
> struct list_head em_exch_list; /* allocated exchanges
list */
>@@ -1662,7 +1660,6 @@ reject:
> }
>
> struct fc_exch_mgr *fc_exch_mgr_alloc(enum fc_class class,
>- u32 em_idx,
> u32 privsize)
> {
> struct fc_exch_mgr *mp;
>@@ -1679,17 +1676,6 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(enum
fc_class
>class,
> INIT_LIST_HEAD(&mp->em_exch_list);
>
> spin_lock_init(&mp->em_lock);
>-
>- sprintf(mp->em_name, "libfcEM%d", em_idx);
>- mp->em_cp = kmem_cache_create(mp->em_name,
>- sizeof(struct fc_exch),
>- 0, SLAB_HWCACHE_ALIGN,
>- NULL);
>-
>- if (!mp->em_cp) {
>- kfree(mp);
>- mp = NULL;
>- }
> }
> return mp;
> }
>@@ -1699,7 +1685,6 @@ void fc_exch_mgr_free(struct fc_exch_mgr *mp)
> {
> WARN_ON(!mp);
>
>- kmem_cache_destroy(mp->em_cp);
> kfree(mp);
> }
> EXPORT_SYMBOL(fc_exch_mgr_free);
>@@ -1708,7 +1693,7 @@ struct fc_exch *fc_exch_alloc(struct fc_exch_mgr
*mp,
>fc_xid_t ex_id)
> {
> struct fc_exch *ep = NULL;
>
>- ep = kmem_cache_zalloc(mp->em_cp, GFP_ATOMIC);
>+ ep = kmem_cache_zalloc(em_cachep, GFP_ATOMIC);
> if (ep) {
> ep->ex_f_ctl = FC_FC_FIRST_SEQ; /* next seq is first seq
*/
> ep->ex_rx_id = FC_XID_UNKNOWN;
>@@ -1752,7 +1737,7 @@ static void fc_exch_release(struct fc_exch *ep)
> mp->em_exch_total--;
> list_del(&ep->ex_list);
> spin_unlock_bh(&mp->em_lock);
>- kmem_cache_free(mp->em_cp, ep);
>+ kmem_cache_free(em_cachep, ep);
> }
> }
>
>@@ -1984,3 +1969,17 @@ int fc_exch_init(struct fc_lport *lp,
> return 0;
> }
> EXPORT_SYMBOL(fc_exch_init);
>+
>+int fc_setup_exch_mgr(void)
>+{
>+ em_cachep = kmem_cache_create("libfc_em", sizeof(struct
fc_exch),
>+ 0, SLAB_HWCACHE_ALIGN, NULL);
>+ if (!em_cachep)
>+ return -ENOMEM;
>+ return 0;
>+}
>+
>+void fc_destroy_exch_mgr(void)
>+{
>+ kmem_cache_destroy(em_cachep);
>+}
>diff --git a/drivers/scsi/libfc/fc_scsi.c
b/drivers/scsi/libfc/fc_scsi.c
>index 257962a..2ca1db2 100644
>--- a/drivers/scsi/libfc/fc_scsi.c
>+++ b/drivers/scsi/libfc/fc_scsi.c
>@@ -2139,6 +2139,8 @@ EXPORT_SYMBOL(fc_scsi_init);
>
> static int __init libfc_init(void)
> {
>+ int rc;
>+
> scsi_pkt_cachep = kmem_cache_create("libfc_scsi_pkt",
> sizeof(struct fc_scsi_pkt),
> 0, SLAB_HWCACHE_ALIGN,
NULL);
>@@ -2146,12 +2148,17 @@ static int __init libfc_init(void)
> FC_DBG("Unable to allocate SRB cache...module load
failed!");
> return -ENOMEM;
> }
>- return 0;
>+
>+ rc = fc_setup_exch_mgr();
>+ if (rc)
>+ kmem_cache_destroy(scsi_pkt_cachep);
>+ return rc;
> }
>
> static void __exit libfc_exit(void)
> {
> kmem_cache_destroy(scsi_pkt_cachep);
>+ fc_destroy_exch_mgr();
> }
>
> module_init(libfc_init);
>diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
>index 49cabad..3014bb6 100644
>--- a/include/scsi/libfc/libfc.h
>+++ b/include/scsi/libfc/libfc.h
>@@ -750,7 +750,6 @@ int fc_exch_init(struct fc_lport *lp,
> * help the LLD manage the exchange ID allocation.
> */
> struct fc_exch_mgr *fc_exch_mgr_alloc(enum fc_class class,
>- u32 em_idx,
> u32 privsize);
>
>
>@@ -854,4 +853,10 @@ void fc_get_rport_loss_tmo(struct fc_rport
*rport);
> void fc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
> struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *);
>
>+/*
>+ * module setup functions.
>+ */
>+int fc_setup_exch_mgr(void);
>+void fc_destroy_exch_mgr(void);
>+
> #endif /* _LIBFC_H_ */
>--
>1.5.4.1
>
>_______________________________________________
>devel mailing list
>devel@open-fcoe.org
>http://www.open-fcoe.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: fcoe cleanups and fcoe TODO
2008-06-30 20:33 ` fcoe cleanups and fcoe TODO Love, Robert W
[not found] ` <10A7D0016239E24092DEF05CCC582E4303FE4B55-6O2ePOu3Gqekrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2008-07-01 14:37 ` Andrew Vasquez
1 sibling, 0 replies; 22+ messages in thread
From: Andrew Vasquez @ 2008-07-01 14:37 UTC (permalink / raw)
To: Love, Robert W; +Cc: michaelc, linux-scsi, devel
On Mon, 30 Jun 2008, Love, Robert W wrote:
...
> >I think we need to see more hardware in the end. For now since there is
> >only
> >software fcoe that is out, this could probably be ok and as we see more
> >drivers we can evolve the split for the hardware like was done with
> iscsi.
> >For iscsi we ended up with 4 different offload modules so there was no
> way
> >we could have designed for all of them and the hardware/firmware
> >guys's quirks :)
> >
> We definitely expect this library to evolve as more LLDs use it.
>
> >- In general without knowing how hardware is really going to hook into
> >the lib it is hard to say how the rearch is going :) If we cannot
> >move more of the fc_remote_port to the rport (or if we just do not
> >want to move it all there because other drivers like lpfc and qla2xxx
> >will never use it) then we might want to rename the fc_remote_port
> >to avoid confusion with the rport and make it clear that the libfc
> remote
> >port is only needed for libfc operations.
> >
> We'd like to reduce fc_remote_port to nothing and only use fc_rport.
> We're still not sure we can completely achieve this without either
> having some private data or adding fields to the fc_rport.
On the QLogic side, there are several FCoE hardware options for CNAs.
Each of these FCoe offerings will follow in essence software's (the
driver's) current interfaces with existing FC hardware and firmware.
Upstream already has support for one such adapter:
[SCSI] qla2xxx: Add ISP84XX support.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4d4df1932b6b116aecc81039066fec27f2050762
It's essentially a 1gb FCoE adapter based on our ISP24xx (4gb) FC
chip. Driver continues to use the standard FW interfaces used by 24xx
firmware. Future offerings will be similar, but based on more recent
FC chips.
Architecturally, the current FCoE adapters continue to abstract
software from the transport details (FC0/FC1 on FC, and ethernet on
FCoE), so, we forsee the driver continuing to use the currently
implemented 'level0' interfaces (as noted by James S.) of the
fc-transport.
As far as libfc interfacing, there's a few possible
points-of-intersection (this was true even before FCoE):
* generic N-port discovery (assist) -- managing SNS querying,
typically fairly generic, GID_PT/G_A_NXT.
* initiate logins (PLOGI/PRLI) -- still trying to wrap my hands
around openfc constructs, my guess would be its fc_remote_port
objects having similar mapping to the qla2xxx driver's fc_port_t
structure.
* initiate rport creation -- with login data.
Striking a balance here could be tricky, as qla2xxx is still a
fairly heavy firmware dependent driver (and not simply a
frame-shuttler), we'd need to ensure some sort of bi-directional
interfaces as the firmware is capable of handling implicit logins
outside of software processing.
<snip>
> >Do we want a common userspace interface for the setup like we have with
> >iscsi for the initial merge? If so, we can say the interface is
> unstable
> >for now, because we just do not know how the hardware is going to work
> or
> >we can try and design a interface based on what we learned from iscsi.
> The
> >latter will probably result in a incorrct design since we are only
> >lowly driver engineers and do not know the fun the firmware guys
> >have for us :) However breaking userspace interfaces is a real pain
> >for users. When we did the latter for iscsi it was a tremendous pain
> for
> >users and distro integrators.
I'm in the process of gathering specs on FCoE specific attributes our
hardware (will) export which may be useful from userspace, both
statistics and tuning-knobs...
--
av
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [Open-FCoE] fcoe cleanups and fcoe TODO
2008-06-29 18:23 fcoe cleanups and fcoe TODO michaelc
2008-06-29 18:23 ` [PATCH 01/13] set proc name michaelc
2008-06-30 20:33 ` fcoe cleanups and fcoe TODO Love, Robert W
@ 2008-07-03 0:13 ` Leech, Christopher
2008-07-03 17:18 ` Mike Christie
2 siblings, 1 reply; 22+ messages in thread
From: Leech, Christopher @ 2008-07-03 0:13 UTC (permalink / raw)
To: michaelc, linux-scsi, devel
michaelc@cs.wisc.edu wrote:
> - How much of the drivers/scsi/fcoe driver should be common? The
> start and stop interface seems like it should be common for all fc
> drivers. But will some things like passing in the network device to
> use be fcoe module specific? Will other drivers load like a more
> traditional driver with a pci_driver,
> or will this be a mess like iscsi where some do, but others bind to
> network devices (netdevs) that also have fcoe engines. The pci_driver
> case would mean that we do not need a common interface for this,
> but for the netdev with fcoe engine then it seems like we want a
> common inteface like we have with iscsi.
I think we're going to end up needing to support a mix of HBA PCI
drivers and network interfaces with offloads.
I've started thinking about supporting FCoE offloading devices, with the
libfc callouts as the main point to plug device specific functionality
into the stack, I've come to think of the fcoe module as 3 things in 1.
1) A library of reusable FCoE functionality. So I'd like to clean up
the FCoE encapsulation stuff and export it so it can be used by other
drivers.
2) The generic non-offload FCoE running on an Ethernet device
implementation. The glue code to setup a transport_fc/libfc instance on
an Ethernet port.
3) The communications endpoint for starting and stopping FCoE on an
Ethernet port. Today we only support the generic implementation, but
for offload devices the fcoe module should still handle taking commands
from userspace. That way you don't end up with a new userspace tool for
every vendor. This is for converged networking device that will wait
until told to start FCoE. The driver for an HBA like device, where the
PCI driver automatically starts FCoE when it loads, would bypass this.
I'm proposing that the fcoe module support device specific transports,
which will handle setting up the libfc callouts for that device. If no
device specific support is found then the non-offload code in the fcoe
module will be used. The device support could a module that stacks on
top of the base Ethernet driver, avoiding dependencies between the
driver and fcoe/libfc until it is loaded. I also think we can auto-load
the device transport modules as needed using aliases derived from the
PCI identifiers.
The device specific module would need to be able to match on network
interfaces, and create an FC instance using functionality in itself,
libfc, fcoe and the Ethernet driver.
With this mechanism in place, creating an FCoE instance on top of an
Ethernet port would look something like:
1) create command comes into the fcoe module from user space, with an
ethX name
2) lookup network interface by name
3) find parent PCI device for network interface
4) attempt to load device specific support module via alias
fcoe-pci:vXXXXdXXXX
5) if module was loaded, it registers with fcoe module
6) call the list of fcoe transports match functions for the device
7) if a match is found, call the setup routine, otherwise create a
non-offload instance
I'd be interested to hear what you think.
- Chris
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Open-FCoE] fcoe cleanups and fcoe TODO
2008-07-03 0:13 ` [Open-FCoE] " Leech, Christopher
@ 2008-07-03 17:18 ` Mike Christie
0 siblings, 0 replies; 22+ messages in thread
From: Mike Christie @ 2008-07-03 17:18 UTC (permalink / raw)
To: Leech, Christopher; +Cc: linux-scsi, devel
Leech, Christopher wrote:
> michaelc@cs.wisc.edu wrote:
>
>> - How much of the drivers/scsi/fcoe driver should be common? The
>> start and stop interface seems like it should be common for all fc
>> drivers. But will some things like passing in the network device to
>> use be fcoe module specific? Will other drivers load like a more
>> traditional driver with a pci_driver,
>> or will this be a mess like iscsi where some do, but others bind to
>> network devices (netdevs) that also have fcoe engines. The pci_driver
>> case would mean that we do not need a common interface for this,
>> but for the netdev with fcoe engine then it seems like we want a
>> common inteface like we have with iscsi.
>
> I think we're going to end up needing to support a mix of HBA PCI
> drivers and network interfaces with offloads.
>
> I've started thinking about supporting FCoE offloading devices, with the
> libfc callouts as the main point to plug device specific functionality
> into the stack, I've come to think of the fcoe module as 3 things in 1.
>
> 1) A library of reusable FCoE functionality. So I'd like to clean up
> the FCoE encapsulation stuff and export it so it can be used by other
> drivers.
>
> 2) The generic non-offload FCoE running on an Ethernet device
> implementation. The glue code to setup a transport_fc/libfc instance on
> an Ethernet port.
>
> 3) The communications endpoint for starting and stopping FCoE on an
> Ethernet port. Today we only support the generic implementation, but
> for offload devices the fcoe module should still handle taking commands
> from userspace. That way you don't end up with a new userspace tool for
> every vendor. This is for converged networking device that will wait
Yeah, I do not think the tool per driver will be acceptable to distros
anymore. On the target side there is one tool for all drivers, and for
iscsi there is one tool for all initiator drivers. qla4xxx is the
exception and they do not have any tool for upstream and are behind in
the iscsi class integration, but they will hook in completely one day
(only some operations are supported today).
One of the purposes of the transport classes is to provide a common
interface to userspace, so it is just natural that a new tool support
all the drivers hooking in the class.
In the end it would be nice if there was one tool for fcoe and fc, or
one tool for any block driver.
> until told to start FCoE. The driver for an HBA like device, where the
> PCI driver automatically starts FCoE when it loads, would bypass this.
>
> I'm proposing that the fcoe module support device specific transports,
> which will handle setting up the libfc callouts for that device. If no
> device specific support is found then the non-offload code in the fcoe
> module will be used. The device support could a module that stacks on
> top of the base Ethernet driver, avoiding dependencies between the
> driver and fcoe/libfc until it is loaded. I also think we can auto-load
> the device transport modules as needed using aliases derived from the
> PCI identifiers.
>
> The device specific module would need to be able to match on network
> interfaces, and create an FC instance using functionality in itself,
> libfc, fcoe and the Ethernet driver.
>
> With this mechanism in place, creating an FCoE instance on top of an
> Ethernet port would look something like:
> 1) create command comes into the fcoe module from user space, with an
> ethX name
> 2) lookup network interface by name
> 3) find parent PCI device for network interface
> 4) attempt to load device specific support module via alias
> fcoe-pci:vXXXXdXXXX
> 5) if module was loaded, it registers with fcoe module
> 6) call the list of fcoe transports match functions for the device
> 7) if a match is found, call the setup routine, otherwise create a
> non-offload instance
>
So we have
[fc class]
[libfc]
[fcoe] will load offload driver?
[offload driver]
[ethernet driver]
right?
For iscsi what are doing is:
[iscsi class]
[lib iscsi]
[iscsi_tcp (software iscsi)] [ib_iser (iser)] [bnx2i (broadcom offload)]
[network stuff (depending on if it is software or offload this can look
different]
When the lower level drivers (iscsi_tcp, iser, etc) load they will
register/attach themselves with the class (like how fcoe does a
fc_attach_transport). The offload engine low level drivers then create a
host per network device (if the network device is created after the
module load the hotplug code handles this). For software iscsi/iser we
have to do a host per session (I_T Nexus), but that is just a odd case
in general and for reasons you guys probably do not care about - we will
just ignore this weird case :)
There are things I do not like about what we did, but it was done so it
works like normal HBA/pci driver loading, and so we have a common path
and both drivers present themselves to userspace the same way. So if you
wanted to configure some host setting for a driver that did partial
offload and hooked into the lib it was the same as if configuring a
normal HBA's setting.
I am not tied to one way or the other. It seems weird with how the fc
class does the fc attach and how we might want to present host level
attrs though. With your model you probably want to make the fcoe module
just do the non offload fcoe processing. It would then normally be best
to put common interface stuff in the fc class, because the module
loading stuff you described seems generic enough for fcoe or fc (I guess
we probably will not see a fc driver like that though). Or maybe it
could be even more generic and be put in scsi-ml since iscsi could use
the same thing one day. If your model ends up working better I would
like to steal it :)
And then with your model you will probably want to separate the binding
of the module to hardware from the fc discovery, or add in some way to
configure the host level settings before fc discovery is done (was not
sure if #7's setup reference meant that it would do something like
fcoe's fc_fabric_login or just the hardware/firmware bring up).
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2008-07-03 17:18 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-29 18:23 fcoe cleanups and fcoe TODO michaelc
2008-06-29 18:23 ` [PATCH 01/13] set proc name michaelc
[not found] ` <1214763843-5548-2-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-29 18:23 ` [PATCH 02/13] libfc: remove libfc scan_host michaelc-hcNo3dDEHLuVc3sceRu5cw
2008-06-29 18:23 ` [PATCH 03/13] libfc: fix locking in tt.rport_lookup_create paths michaelc
[not found] ` <1214763843-5548-4-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-29 18:23 ` [PATCH 04/13] fcoe: fix fcoe_create_interface goto paths michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-5-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-29 18:23 ` [PATCH 05/13] libfc: rename target reset michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-6-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-29 18:23 ` [PATCH 06/13] libfc: trivial fc_scsi cleanup michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-7-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-29 18:23 ` [PATCH 07/13] libfc: remove os_lun michaelc-hcNo3dDEHLuVc3sceRu5cw
[not found] ` <1214763843-5548-8-git-send-email-michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-29 18:23 ` [PATCH 08/13] libfc fcoe: use shost_priv michaelc-hcNo3dDEHLuVc3sceRu5cw
2008-06-29 18:23 ` [PATCH 09/13] libfc: use get/put_aligned_be helpers michaelc
2008-06-29 18:24 ` [PATCH 10/13] libfc fcoe: coding style fixups - use uX for definitions michaelc
2008-06-29 18:24 ` [PATCH 11/13] libfc: mv scsi pkt cache to module michaelc
2008-06-29 18:24 ` [PATCH 12/13] libfc: mv em exch " michaelc
2008-06-29 18:24 ` [PATCH 13/13] libfc: remove unnessary casts michaelc
2008-06-30 23:35 ` [Open-FCoE] [PATCH 12/13] libfc: mv em exch cache to module Dev, Vasu
2008-06-30 20:33 ` fcoe cleanups and fcoe TODO Love, Robert W
[not found] ` <10A7D0016239E24092DEF05CCC582E4303FE4B55-6O2ePOu3Gqekrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2008-06-30 21:43 ` Mike Christie
[not found] ` <4869539F.3070605-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2008-06-30 21:47 ` Mike Christie
2008-06-30 23:33 ` Mike Christie
2008-07-01 14:37 ` Andrew Vasquez
2008-07-03 0:13 ` [Open-FCoE] " Leech, Christopher
2008-07-03 17:18 ` Mike Christie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).