* [PATCH 01/17] libfc: fixed a read IO data integrity issue when a IO data frame lost
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
@ 2009-02-06 18:55 ` Robert Love
2009-02-06 18:55 ` [PATCH 02/17] fcoe: exch mgr is freed while lport still retrying sequences Robert Love
` (16 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:55 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Vasu Dev, Robert Love
From: Vasu Dev <vasu.dev@intel.com>
The fc_fcp_complete_locked detected data underrun in this case and set
the FC_DATA_UNDRUN but that was ignored by fc_io_compl for all cases
including read underrun.
Added code to not to ignore FC_DATA_UNDRUN for read IO and instead
suggested scsi-ml to retry cmd to recover from lost data frame.
Not sure if it is okay to ignore FC_DATA_UNDRUN for other case, so let
code as is for other cases but removed or-ing with zero valued fsp->cdb_status
for those cases.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_fcp.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index f440aac..ecc7261 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1810,12 +1810,12 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
sc_cmd->result = DID_ERROR << 16;
break;
case FC_DATA_UNDRUN:
- if (fsp->cdb_status == 0) {
+ if ((fsp->cdb_status == 0) && !(fsp->req_flags & FC_SRB_READ)) {
/*
* scsi status is good but transport level
- * underrun. for read it should be an error??
+ * underrun.
*/
- sc_cmd->result = (DID_OK << 16) | fsp->cdb_status;
+ sc_cmd->result = DID_OK << 16;
} else {
/*
* scsi got underrun, this is an error
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 02/17] fcoe: exch mgr is freed while lport still retrying sequences
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
2009-02-06 18:55 ` [PATCH 01/17] libfc: fixed a read IO data integrity issue when a IO data frame lost Robert Love
@ 2009-02-06 18:55 ` Robert Love
2009-02-06 18:56 ` [PATCH 03/17] libfc: Don't violate transport template for rogue port creation Robert Love
` (15 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:55 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Steve Ma, Robert Love
From: Steve Ma <steve.ma@intel.com>
When a sequence cannot be delivered to the target, the local
port will schedule retries, While this process is in progress,
if we destroy the FCoE interface, the fcoe_sw_destroy routine is
entered, and the fc_exch_mgr_free(lp->emp) is called. Thus
if fc_exch_alloc() is called when retrying the sequence,
the mempool_alloc() will fail to allocate the exchange because
the mempool of the exchange manager has already been released.
This patch is to cancel any pending retry work of the local
port before we start to destroy the interface.
Also, when resetting the local port, we should also stop the
scheduled pending retries.
Signed-off-by: Steve Ma <steve.ma@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_lport.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index a6ab692..a60b919 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -617,6 +617,7 @@ int fc_fabric_logoff(struct fc_lport *lport)
{
lport->tt.disc_stop_final(lport);
mutex_lock(&lport->lp_mutex);
+ cancel_delayed_work_sync(&lport->retry_work);
fc_lport_enter_logo(lport);
mutex_unlock(&lport->lp_mutex);
return 0;
@@ -938,6 +939,7 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_RESET);
+ cancel_delayed_work_sync(&lport->retry_work);
if (lport->dns_rp)
lport->tt.rport_logoff(lport->dns_rp);
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 03/17] libfc: Don't violate transport template for rogue port creation
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
2009-02-06 18:55 ` [PATCH 01/17] libfc: fixed a read IO data integrity issue when a IO data frame lost Robert Love
2009-02-06 18:55 ` [PATCH 02/17] fcoe: exch mgr is freed while lport still retrying sequences Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 04/17] libfc: correct RPORT_TO_PRIV usage Robert Love
` (14 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_disc.c | 6 +++---
drivers/scsi/libfc/fc_lport.c | 4 ++--
drivers/scsi/libfc/fc_rport.c | 3 +++
include/scsi/libfc.h | 5 +++++
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index dd1564c..15e3f84 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -430,7 +430,7 @@ static int fc_disc_new_target(struct fc_disc *disc,
dp.ids.port_name = ids->port_name;
dp.ids.node_name = ids->node_name;
dp.ids.roles = ids->roles;
- rport = fc_rport_rogue_create(&dp);
+ rport = lport->tt.rport_create(&dp);
}
if (!rport)
error = -ENOMEM;
@@ -617,7 +617,7 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
if ((dp.ids.port_id != fc_host_port_id(lport->host)) &&
(dp.ids.port_name != lport->wwpn)) {
- rport = fc_rport_rogue_create(&dp);
+ rport = lport->tt.rport_create(&dp);
if (rport) {
rdata = rport->dd_data;
rdata->ops = &fc_disc_rport_ops;
@@ -769,7 +769,7 @@ static void fc_disc_single(struct fc_disc *disc, struct fc_disc_port *dp)
if (rport)
fc_disc_del_target(disc, rport);
- new_rport = fc_rport_rogue_create(dp);
+ new_rport = lport->tt.rport_create(dp);
if (new_rport) {
rdata = new_rport->dd_data;
rdata->ops = &fc_disc_rport_ops;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index a60b919..60ac36f 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -232,7 +232,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
lport->ptp_rp = NULL;
}
- lport->ptp_rp = fc_rport_rogue_create(&dp);
+ lport->ptp_rp = lport->tt.rport_create(&dp);
lport->tt.rport_login(lport->ptp_rp);
@@ -1282,7 +1282,7 @@ static void fc_lport_enter_dns(struct fc_lport *lport)
fc_lport_state_enter(lport, LPORT_ST_DNS);
- rport = fc_rport_rogue_create(&dp);
+ rport = lport->tt.rport_create(&dp);
if (!rport)
goto err;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 600a8ff..81b3ca1 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1271,6 +1271,9 @@ static void fc_rport_flush_queue(void)
int fc_rport_init(struct fc_lport *lport)
{
+ if (!lport->tt.rport_create)
+ lport->tt.rport_create = fc_rport_rogue_create;
+
if (!lport->tt.rport_login)
lport->tt.rport_login = fc_rport_login;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index b9e6c1c..37df48e 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -490,6 +490,11 @@ struct libfc_function_template {
*/
/*
+ * Create a remote port
+ */
+ struct fc_rport *(*rport_create)(struct fc_disc_port *);
+
+ /*
* Initiates the RP state machine. It is called from the LP module.
* This function will issue the following commands to the N_Port
* identified by the FC ID provided.
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 04/17] libfc: correct RPORT_TO_PRIV usage
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (2 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 03/17] libfc: Don't violate transport template for rogue port creation Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 05/17] libfc: rename rp to rdata in fc_disc_new_target() Robert Love
` (13 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
We only need to use this macro when assigning a value to
rport->dd_data. All other accesses should just use dd_data.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_disc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 15e3f84..9f4e408 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -246,7 +246,7 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
list_del(&dp->peers);
rport = lport->tt.rport_lookup(lport, dp->ids.port_id);
if (rport) {
- rdata = RPORT_TO_PRIV(rport);
+ rdata = rport->dd_data;
list_del(&rdata->peers);
lport->tt.rport_logoff(rport);
}
@@ -453,7 +453,7 @@ static int fc_disc_new_target(struct fc_disc *disc,
static void fc_disc_del_target(struct fc_disc *disc, struct fc_rport *rport)
{
struct fc_lport *lport = disc->lport;
- struct fc_rport_libfc_priv *rdata = RPORT_TO_PRIV(rport);
+ struct fc_rport_libfc_priv *rdata = rport->dd_data;
list_del(&rdata->peers);
lport->tt.rport_logoff(rport);
}
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 05/17] libfc: rename rp to rdata in fc_disc_new_target()
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (3 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 04/17] libfc: correct RPORT_TO_PRIV usage Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 06/17] libfc: check for err when recv and state is incorrect Robert Love
` (12 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
Just rename the variable as per our naming convention.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_disc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 9f4e408..cfbce89 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -396,7 +396,7 @@ static int fc_disc_new_target(struct fc_disc *disc,
struct fc_rport_identifiers *ids)
{
struct fc_lport *lport = disc->lport;
- struct fc_rport_libfc_priv *rp;
+ struct fc_rport_libfc_priv *rdata;
int error = 0;
if (rport && ids->port_name) {
@@ -436,9 +436,9 @@ static int fc_disc_new_target(struct fc_disc *disc,
error = -ENOMEM;
}
if (rport) {
- rp = rport->dd_data;
- rp->ops = &fc_disc_rport_ops;
- rp->rp_state = RPORT_ST_INIT;
+ rdata = rport->dd_data;
+ rdata->ops = &fc_disc_rport_ops;
+ rdata->rp_state = RPORT_ST_INIT;
lport->tt.rport_login(rport);
}
}
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 06/17] libfc: check for err when recv and state is incorrect
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (4 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 05/17] libfc: rename rp to rdata in fc_disc_new_target() Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 07/17] fcoe: runtime debugging with debug_logging module parameter Robert Love
` (11 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
If we've just created an interface and the an rport is
logging in we may have a request on the wire (say PRLI).
If we destroy the interface, we'll go through each rport
on the disc->rports list and set each rport's state to NONE.
Then the lport will reset the EM. The EM reset will send a
CLOSED event to the prli_resp() handler which will notice
that the state != PRLI. In this case it frees the frame
pointer, decrements the refcount and unlocks the rport.
The problem is that there isn't a frame in this case. It's
just a pointer with an embedded error code. The free causes
an Oops.
This patch moves the error checking to be before the state
checking.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_lport.c | 50 +++++++++++++++++++++--------------------
drivers/scsi/libfc/fc_rport.c | 30 ++++++++++++-------------
2 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 60ac36f..7dd433c 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -1031,17 +1031,17 @@ static void fc_lport_rft_id_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_LPORT("Received a RFT_ID response\n");
+ if (IS_ERR(fp)) {
+ fc_lport_error(lport, fp);
+ goto err;
+ }
+
if (lport->state != LPORT_ST_RFT_ID) {
FC_DBG("Received a RFT_ID response, but in state %s\n",
fc_lport_state(lport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_lport_error(lport, fp);
- goto err;
- }
-
fh = fc_frame_header_get(fp);
ct = fc_frame_payload_get(fp, sizeof(*ct));
@@ -1083,17 +1083,17 @@ static void fc_lport_rpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_LPORT("Received a RPN_ID response\n");
+ if (IS_ERR(fp)) {
+ fc_lport_error(lport, fp);
+ goto err;
+ }
+
if (lport->state != LPORT_ST_RPN_ID) {
FC_DBG("Received a RPN_ID response, but in state %s\n",
fc_lport_state(lport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_lport_error(lport, fp);
- goto err;
- }
-
fh = fc_frame_header_get(fp);
ct = fc_frame_payload_get(fp, sizeof(*ct));
if (fh && ct && fh->fh_type == FC_TYPE_CT &&
@@ -1133,17 +1133,17 @@ static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_LPORT("Received a SCR response\n");
+ if (IS_ERR(fp)) {
+ fc_lport_error(lport, fp);
+ goto err;
+ }
+
if (lport->state != LPORT_ST_SCR) {
FC_DBG("Received a SCR response, but in state %s\n",
fc_lport_state(lport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_lport_error(lport, fp);
- goto err;
- }
-
op = fc_frame_payload_op(fp);
if (op == ELS_LS_ACC)
fc_lport_enter_ready(lport);
@@ -1359,17 +1359,17 @@ static void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_LPORT("Received a LOGO response\n");
+ if (IS_ERR(fp)) {
+ fc_lport_error(lport, fp);
+ goto err;
+ }
+
if (lport->state != LPORT_ST_LOGO) {
FC_DBG("Received a LOGO response, but in state %s\n",
fc_lport_state(lport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_lport_error(lport, fp);
- goto err;
- }
-
op = fc_frame_payload_op(fp);
if (op == ELS_LS_ACC)
fc_lport_enter_reset(lport);
@@ -1443,17 +1443,17 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_LPORT("Received a FLOGI response\n");
+ if (IS_ERR(fp)) {
+ fc_lport_error(lport, fp);
+ goto err;
+ }
+
if (lport->state != LPORT_ST_FLOGI) {
FC_DBG("Received a FLOGI response, but in state %s\n",
fc_lport_state(lport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_lport_error(lport, fp);
- goto err;
- }
-
fh = fc_frame_header_get(fp);
did = ntoh24(fh->fh_d_id);
if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) {
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 81b3ca1..4f23a9b 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -505,17 +505,17 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_RPORT("Received a PLOGI response from port (%6x)\n",
rport->port_id);
+ if (IS_ERR(fp)) {
+ fc_rport_error_retry(rport, fp);
+ goto err;
+ }
+
if (rdata->rp_state != RPORT_ST_PLOGI) {
FC_DBG("Received a PLOGI response, but in state %s\n",
fc_rport_state(rport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_rport_error_retry(rport, fp);
- goto err;
- }
-
op = fc_frame_payload_op(fp);
if (op == ELS_LS_ACC &&
(plp = fc_frame_payload_get(fp, sizeof(*plp))) != NULL) {
@@ -614,17 +614,17 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_RPORT("Received a PRLI response from port (%6x)\n",
rport->port_id);
+ if (IS_ERR(fp)) {
+ fc_rport_error_retry(rport, fp);
+ goto err;
+ }
+
if (rdata->rp_state != RPORT_ST_PRLI) {
FC_DBG("Received a PRLI response, but in state %s\n",
fc_rport_state(rport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_rport_error_retry(rport, fp);
- goto err;
- }
-
op = fc_frame_payload_op(fp);
if (op == ELS_LS_ACC) {
pp = fc_frame_payload_get(fp, sizeof(*pp));
@@ -764,17 +764,17 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp,
FC_DEBUG_RPORT("Received a RTV response from port (%6x)\n",
rport->port_id);
+ if (IS_ERR(fp)) {
+ fc_rport_error(rport, fp);
+ goto err;
+ }
+
if (rdata->rp_state != RPORT_ST_RTV) {
FC_DBG("Received a RTV response, but in state %s\n",
fc_rport_state(rport));
goto out;
}
- if (IS_ERR(fp)) {
- fc_rport_error(rport, fp);
- goto err;
- }
-
op = fc_frame_payload_op(fp);
if (op == ELS_LS_ACC) {
struct fc_els_rtv_acc *rtv;
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 07/17] fcoe: runtime debugging with debug_logging module parameter
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (5 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 06/17] libfc: check for err when recv and state is incorrect Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 08/17] fcoe: Logging review changes Robert Love
` (10 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
This patch adds runtime debugging so that the user
can echo into /sys/module/fcoe/parameters/debug_logging
to enable or disable debug logging for fcoe.
Currently only on(non-zero)/off(zero) is supported by
this parameter.
This patch adds the drivers/scsi/fcoe/fcoe.h file for
shared fcoe defines. Currently only the logging code
is there, but later it may be used for other common
code.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/fcoe.h | 31 ++++++++++++++++++++++++++++
drivers/scsi/fcoe/fcoe_sw.c | 16 ++++++++------
drivers/scsi/fcoe/libfcoe.c | 48 +++++++++++++++++++++----------------------
3 files changed, 63 insertions(+), 32 deletions(-)
create mode 100644 drivers/scsi/fcoe/fcoe.h
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
new file mode 100644
index 0000000..d15355f
--- /dev/null
+++ b/drivers/scsi/fcoe/fcoe.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright(c) 2009 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Maintained at www.Open-FCoE.org
+ */
+
+#ifndef _FCOE_H_
+#define _FCOE_H_
+
+extern unsigned int debug_logging;
+
+#define FCOE_DBG(fmt, args...) \
+do { \
+ if (unlikely(debug_logging)) \
+ printk(KERN_INFO "%s " fmt, __func__, ##args); \
+} while (0)
+
+#endif /* _FCOE_H_ */
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index cf83675..e861c36 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -38,6 +38,8 @@
#include <scsi/libfcoe.h>
#include <scsi/fc_transport_fcoe.h>
+#include "fcoe.h"
+
#define FCOE_SW_VERSION "0.1"
#define FCOE_SW_NAME "fcoesw"
#define FCOE_SW_VENDOR "Open-FCoE.org"
@@ -251,7 +253,7 @@ static int fcoe_sw_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
/* add the new host to the SCSI-ml */
rc = scsi_add_host(lp->host, dev);
if (rc) {
- FC_DBG("fcoe_sw_shost_config:error on scsi_add_host\n");
+ FCOE_DBG("fcoe_sw_shost_config:error on scsi_add_host\n");
return rc;
}
sprintf(fc_host_symbolic_name(lp->host), "%s v%s over %s",
@@ -381,7 +383,7 @@ static int fcoe_sw_create(struct net_device *netdev)
shost = fcoe_host_alloc(&fcoe_sw_shost_template,
sizeof(struct fcoe_softc));
if (!shost) {
- FC_DBG("Could not allocate host structure\n");
+ FCOE_DBG("Could not allocate host structure\n");
return -ENOMEM;
}
lp = shost_priv(shost);
@@ -390,35 +392,35 @@ static int fcoe_sw_create(struct net_device *netdev)
/* configure fc_lport, e.g., em */
rc = fcoe_sw_lport_config(lp);
if (rc) {
- FC_DBG("Could not configure lport\n");
+ FCOE_DBG("Could not configure lport\n");
goto out_host_put;
}
/* configure lport network properties */
rc = fcoe_sw_netdev_config(lp, netdev);
if (rc) {
- FC_DBG("Could not configure netdev for lport\n");
+ FCOE_DBG("Could not configure netdev for lport\n");
goto out_host_put;
}
/* configure lport scsi host properties */
rc = fcoe_sw_shost_config(lp, shost, &netdev->dev);
if (rc) {
- FC_DBG("Could not configure shost for lport\n");
+ FCOE_DBG("Could not configure shost for lport\n");
goto out_host_put;
}
/* lport exch manager allocation */
rc = fcoe_sw_em_config(lp);
if (rc) {
- FC_DBG("Could not configure em for lport\n");
+ FCOE_DBG("Could not configure em for lport\n");
goto out_host_put;
}
/* Initialize the library */
rc = fcoe_libfc_config(lp, &fcoe_sw_libfc_fcn_templ);
if (rc) {
- FC_DBG("Could not configure libfc for lport!\n");
+ FCOE_DBG("Could not configure libfc for lport!\n");
goto out_lp_destroy;
}
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 2960710..594295b 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -46,7 +46,7 @@
#include <scsi/libfcoe.h>
#include <scsi/fc_transport_fcoe.h>
-static int debug_fcoe;
+#include "fcoe.h"
#define FCOE_MAX_QUEUE_DEPTH 256
@@ -60,13 +60,16 @@ MODULE_AUTHOR("Open-FCoE.org");
MODULE_DESCRIPTION("FCoE");
MODULE_LICENSE("GPL");
+unsigned int debug_logging;
+module_param(debug_logging, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
+
/* fcoe host list */
LIST_HEAD(fcoe_hostlist);
DEFINE_RWLOCK(fcoe_hostlist_lock);
DEFINE_TIMER(fcoe_timer, NULL, 0, 0);
struct fcoe_percpu_s *fcoe_percpu[NR_CPUS];
-
/* Function Prototyes */
static int fcoe_check_wait_queue(struct fc_lport *);
static void fcoe_insert_wait_queue_head(struct fc_lport *, struct sk_buff *);
@@ -191,22 +194,19 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *dev,
fc = container_of(ptype, struct fcoe_softc, fcoe_packet_type);
lp = fc->lp;
if (unlikely(lp == NULL)) {
- FC_DBG("cannot find hba structure");
+ FCOE_DBG("cannot find hba structure");
goto err2;
}
- if (unlikely(debug_fcoe)) {
- FC_DBG("skb_info: len:%d data_len:%d head:%p data:%p tail:%p "
- "end:%p sum:%d dev:%s", skb->len, skb->data_len,
- skb->head, skb->data, skb_tail_pointer(skb),
- skb_end_pointer(skb), skb->csum,
- skb->dev ? skb->dev->name : "<NULL>");
-
- }
+ FCOE_DBG("skb_info: len:%d data_len:%d head:%p data:%p tail:%p "
+ "end:%p sum:%d dev:%s", skb->len, skb->data_len,
+ skb->head, skb->data, skb_tail_pointer(skb),
+ skb_end_pointer(skb), skb->csum,
+ skb->dev ? skb->dev->name : "<NULL>");
/* check for FCOE packet type */
if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) {
- FC_DBG("wrong FC type frame");
+ FCOE_DBG("wrong FC type frame");
goto err;
}
@@ -551,21 +551,19 @@ int fcoe_percpu_receive_thread(void *arg)
fr = fcoe_dev_from_skb(skb);
lp = fr->fr_dev;
if (unlikely(lp == NULL)) {
- FC_DBG("invalid HBA Structure");
+ FCOE_DBG("invalid HBA Structure");
kfree_skb(skb);
continue;
}
stats = lp->dev_stats[smp_processor_id()];
- if (unlikely(debug_fcoe)) {
- FC_DBG("skb_info: len:%d data_len:%d head:%p data:%p "
- "tail:%p end:%p sum:%d dev:%s",
- skb->len, skb->data_len,
- skb->head, skb->data, skb_tail_pointer(skb),
- skb_end_pointer(skb), skb->csum,
- skb->dev ? skb->dev->name : "<NULL>");
- }
+ FCOE_DBG("skb_info: len:%d data_len:%d head:%p data:%p "
+ "tail:%p end:%p sum:%d dev:%s",
+ skb->len, skb->data_len,
+ skb->head, skb->data, skb_tail_pointer(skb),
+ skb_end_pointer(skb), skb->csum,
+ skb->dev ? skb->dev->name : "<NULL>");
/*
* Save source MAC address before discarding header.
@@ -587,8 +585,8 @@ int fcoe_percpu_receive_thread(void *arg)
if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) {
if (stats) {
if (stats->ErrorFrames < 5)
- FC_DBG("unknown FCoE version %x",
- FC_FCOE_DECAPS_VER(hp));
+ FCOE_DBG("unknown FCoE version %x",
+ FC_FCOE_DECAPS_VER(hp));
stats->ErrorFrames++;
}
kfree_skb(skb);
@@ -639,7 +637,7 @@ int fcoe_percpu_receive_thread(void *arg)
if (fr_flags(fp) & FCPHF_CRC_UNCHECKED) {
if (le32_to_cpu(fr_crc(fp)) !=
~crc32(~0, skb->data, fr_len)) {
- if (debug_fcoe || stats->InvalidCRCCount < 5)
+ if (debug_logging || stats->InvalidCRCCount < 5)
printk(KERN_WARNING "fcoe: dropping "
"frame with CRC error\n");
stats->InvalidCRCCount++;
@@ -908,7 +906,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,
case NETDEV_REGISTER:
break;
default:
- FC_DBG("unknown event %ld call", event);
+ FCOE_DBG("unknown event %ld call", event);
}
if (lp->link_up != new_link_up) {
if (new_link_up)
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 08/17] fcoe: Logging review changes
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (6 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 07/17] fcoe: runtime debugging with debug_logging module parameter Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 09/17] libfc: runtime debugging with debug_logging module parameter Robert Love
` (9 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
I reviewed the current FCOE_DBG and printk statements. These are the corrections and changes that I came up with.
1) Don't need to put function names as prefixes to print statements, the macro will do that.
2) Transport related additions and removals are printk(KERN_INFO, any other transport prints are FCOE_DBG()
3) Miscellaneous cleanups
4) Added newlines to statements without them
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/fc_transport_fcoe.c | 83 +++++++++++++++------------------
drivers/scsi/fcoe/fcoe_sw.c | 7 +--
drivers/scsi/fcoe/libfcoe.c | 36 ++++++++------
3 files changed, 61 insertions(+), 65 deletions(-)
diff --git a/drivers/scsi/fcoe/fc_transport_fcoe.c b/drivers/scsi/fcoe/fc_transport_fcoe.c
index bf7fe6f..9fd4acc 100644
--- a/drivers/scsi/fcoe/fc_transport_fcoe.c
+++ b/drivers/scsi/fcoe/fc_transport_fcoe.c
@@ -21,6 +21,8 @@
#include <scsi/libfcoe.h>
#include <scsi/fc_transport_fcoe.h>
+#include "fcoe.h"
+
/* internal fcoe transport */
struct fcoe_transport_internal {
struct fcoe_transport *t;
@@ -96,9 +98,8 @@ static int fcoe_transport_device_add(struct fcoe_transport *t,
ti = fcoe_transport_device_lookup(t, netdev);
if (ti) {
- printk(KERN_DEBUG "fcoe_transport_device_add:"
- "device %s is already added to transport %s\n",
- netdev->name, t->name);
+ FCOE_DBG("Device %s is already added to transport %s\n",
+ netdev->name, t->name);
return -EEXIST;
}
/* allocate an internal struct to host the netdev and the list */
@@ -115,9 +116,8 @@ static int fcoe_transport_device_add(struct fcoe_transport *t,
list_add(&ti->list, &t->devlist);
mutex_unlock(&t->devlock);
- printk(KERN_DEBUG "fcoe_transport_device_add:"
- "device %s added to transport %s\n",
- netdev->name, t->name);
+ printk(KERN_INFO "fcoe: Device %s added to transport %s\n",
+ netdev->name, t->name);
return 0;
}
@@ -138,17 +138,15 @@ static int fcoe_transport_device_remove(struct fcoe_transport *t,
ti = fcoe_transport_device_lookup(t, netdev);
if (!ti) {
- printk(KERN_DEBUG "fcoe_transport_device_remove:"
- "device %s is not managed by transport %s\n",
- netdev->name, t->name);
+ FCOE_DBG("Device %s is not managed by transport %s\n",
+ netdev->name, t->name);
return -ENODEV;
}
mutex_lock(&t->devlock);
list_del(&ti->list);
mutex_unlock(&t->devlock);
- printk(KERN_DEBUG "fcoe_transport_device_remove:"
- "device %s removed from transport %s\n",
- netdev->name, t->name);
+ printk(KERN_INFO "fcoe: Device %s removed from transport %s\n",
+ netdev->name, t->name);
dev_put(ti->netdev);
kfree(ti);
return 0;
@@ -194,10 +192,9 @@ static bool fcoe_transport_match(struct fcoe_transport *t,
pci = fcoe_transport_pcidev(netdev);
if (pci) {
- printk(KERN_DEBUG "fcoe_transport_match:"
- "%s:%x:%x -- %s:%x:%x\n",
- t->name, t->vendor, t->device,
- netdev->name, pci->vendor, pci->device);
+ FCOE_DBG("%s:%x:%x -- %s:%x:%x\n",
+ t->name, t->vendor, t->device,
+ netdev->name, pci->vendor, pci->device);
/* if transport supports match */
if (t->match)
@@ -233,8 +230,9 @@ static struct fcoe_transport *fcoe_transport_lookup(
}
mutex_unlock(&fcoe_transports_lock);
- printk(KERN_DEBUG "fcoe_transport_lookup:"
- "use default transport for %s\n", netdev->name);
+ FCOE_DBG("Unable to lookup for transport for %s, "
+ "using the default software transport\n",
+ netdev->name);
return fcoe_transport_default();
}
@@ -262,7 +260,7 @@ int fcoe_transport_register(struct fcoe_transport *t)
mutex_init(&t->devlock);
INIT_LIST_HEAD(&t->devlist);
- printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name);
+ printk(KERN_INFO "fcoe: Transport %s has been registered\n", t->name);
return 0;
}
@@ -284,8 +282,8 @@ int fcoe_transport_unregister(struct fcoe_transport *t)
list_del(&t->list);
mutex_unlock(&fcoe_transports_lock);
fcoe_transport_device_remove_all(t);
- printk(KERN_DEBUG "fcoe_transport_unregister:%s\n",
- t->name);
+ printk(KERN_INFO "fcoe: Transport %s has been "
+ "unregistered\n", t->name);
return 0;
}
}
@@ -314,19 +312,20 @@ int fcoe_load_transport_driver(struct net_device *netdev)
struct device *dev = netdev->dev.parent;
if (fcoe_transport_lookup(netdev)) {
- /* load default transport */
- printk(KERN_DEBUG "fcoe: already loaded transport for %s\n",
- netdev->name);
+ FCOE_DBG("Transport for %s has already been registered\n",
+ netdev->name);
return -EEXIST;
}
pci = to_pci_dev(dev);
if (dev->bus != &pci_bus_type) {
- printk(KERN_DEBUG "fcoe: support noly PCI device\n");
+ printk(KERN_WARNING "fcoe: Support for only PCI devices, "
+ "but %s is not a PCI device\n", netdev->name);
return -ENODEV;
}
- printk(KERN_DEBUG "fcoe: loading driver fcoe-pci-0x%04x-0x%04x\n",
- pci->vendor, pci->device);
+
+ FCOE_DBG("Loading driver fcoe-pci-0x%04x-0x%04x\n",
+ pci->vendor, pci->device);
return request_module("fcoe-pci-0x%04x-0x%04x",
pci->vendor, pci->device);
@@ -350,24 +349,22 @@ int fcoe_transport_attach(struct net_device *netdev)
/* find the corresponding transport */
t = fcoe_transport_lookup(netdev);
if (!t) {
- printk(KERN_DEBUG "fcoe_transport_attach"
- ":no transport for %s:use %s\n",
- netdev->name, t->name);
+ FCOE_DBG("Found %s transport for %s\n",
+ t->name, netdev->name);
return -ENODEV;
}
/* add to the transport */
if (fcoe_transport_device_add(t, netdev)) {
- printk(KERN_DEBUG "fcoe_transport_attach"
- ":failed to add %s to tramsport %s\n",
- netdev->name, t->name);
+ FCOE_DBG("Failed to add %s to tramsport %s\n",
+ netdev->name, t->name);
return -EIO;
}
/* transport create function */
if (t->create)
t->create(netdev);
- printk(KERN_DEBUG "fcoe_transport_attach:transport %s for %s\n",
- t->name, netdev->name);
+ printk(KERN_INFO "fcoe: Added %s to transport %s\n",
+ netdev->name, t->name);
return 0;
}
EXPORT_SYMBOL_GPL(fcoe_transport_attach);
@@ -385,26 +382,22 @@ int fcoe_transport_release(struct net_device *netdev)
/* find the corresponding transport */
t = fcoe_transport_lookup(netdev);
if (!t) {
- printk(KERN_DEBUG "fcoe_transport_release:"
- "no transport for %s:use %s\n",
- netdev->name, t->name);
+ FCOE_DBG("Releasing %s from the default software transport\n",
+ netdev->name);
return -ENODEV;
}
/* remove the device from the transport */
if (fcoe_transport_device_remove(t, netdev)) {
- printk(KERN_DEBUG "fcoe_transport_release:"
- "failed to add %s to tramsport %s\n",
- netdev->name, t->name);
+ FCOE_DBG("Failed to remove %s from tramsport %s\n",
+ netdev->name, t->name);
return -EIO;
}
/* transport destroy function */
if (t->destroy)
t->destroy(netdev);
- printk(KERN_DEBUG "fcoe_transport_release:"
- "device %s dettached from transport %s\n",
- netdev->name, t->name);
-
+ printk(KERN_INFO "fcoe: Detached %s from transport %s\n",
+ t->name, netdev->name);
return 0;
}
EXPORT_SYMBOL_GPL(fcoe_transport_release);
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index e861c36..769e6a8 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -296,8 +296,7 @@ static int fcoe_sw_destroy(struct net_device *netdev)
BUG_ON(!netdev);
- printk(KERN_DEBUG "fcoe_sw_destroy:interface on %s\n",
- netdev->name);
+ FCOE_DBG("fcoe_sw_destroy:interface on %s\n", netdev->name);
lp = fcoe_hostlist_lookup(netdev);
if (!lp)
@@ -383,7 +382,7 @@ static int fcoe_sw_create(struct net_device *netdev)
shost = fcoe_host_alloc(&fcoe_sw_shost_template,
sizeof(struct fcoe_softc));
if (!shost) {
- FCOE_DBG("Could not allocate host structure\n");
+ printk(KERN_WARNING "Could not allocate host structure\n");
return -ENOMEM;
}
lp = shost_priv(shost);
@@ -474,7 +473,7 @@ int __init fcoe_sw_init(void)
scsi_transport_fcoe_sw =
fc_attach_transport(&fcoe_sw_transport_function);
if (!scsi_transport_fcoe_sw) {
- printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n");
+ FCOE_DBG("fcoe_sw_init:fc_attach_transport() failed\n");
return -ENODEV;
}
/* register sw transport */
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 594295b..9efe1bf 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -194,19 +194,19 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *dev,
fc = container_of(ptype, struct fcoe_softc, fcoe_packet_type);
lp = fc->lp;
if (unlikely(lp == NULL)) {
- FCOE_DBG("cannot find hba structure");
+ FCOE_DBG("cannot find hba structure\n");
goto err2;
}
FCOE_DBG("skb_info: len:%d data_len:%d head:%p data:%p tail:%p "
- "end:%p sum:%d dev:%s", skb->len, skb->data_len,
+ "end:%p sum:%d dev:%s\n", skb->len, skb->data_len,
skb->head, skb->data, skb_tail_pointer(skb),
skb_end_pointer(skb), skb->csum,
skb->dev ? skb->dev->name : "<NULL>");
/* check for FCOE packet type */
if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) {
- FCOE_DBG("wrong FC type frame");
+ FCOE_DBG("wrong FC type frame\n");
goto err;
}
@@ -551,7 +551,7 @@ int fcoe_percpu_receive_thread(void *arg)
fr = fcoe_dev_from_skb(skb);
lp = fr->fr_dev;
if (unlikely(lp == NULL)) {
- FCOE_DBG("invalid HBA Structure");
+ FCOE_DBG("invalid HBA Structure\n");
kfree_skb(skb);
continue;
}
@@ -559,7 +559,7 @@ int fcoe_percpu_receive_thread(void *arg)
stats = lp->dev_stats[smp_processor_id()];
FCOE_DBG("skb_info: len:%d data_len:%d head:%p data:%p "
- "tail:%p end:%p sum:%d dev:%s",
+ "tail:%p end:%p sum:%d dev:%s\n",
skb->len, skb->data_len,
skb->head, skb->data, skb_tail_pointer(skb),
skb_end_pointer(skb), skb->csum,
@@ -585,8 +585,12 @@ int fcoe_percpu_receive_thread(void *arg)
if (unlikely(FC_FCOE_DECAPS_VER(hp) != FC_FCOE_VER)) {
if (stats) {
if (stats->ErrorFrames < 5)
- FCOE_DBG("unknown FCoE version %x",
- FC_FCOE_DECAPS_VER(hp));
+ printk(KERN_WARNING "FCoE version "
+ "mismatch: The frame has "
+ "version %x, but the "
+ "initiator supports version "
+ "%x\n", FC_FCOE_DECAPS_VER(hp),
+ FC_FCOE_VER);
stats->ErrorFrames++;
}
kfree_skb(skb);
@@ -906,7 +910,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,
case NETDEV_REGISTER:
break;
default:
- FCOE_DBG("unknown event %ld call", event);
+ FCOE_DBG("Unknown event %ld from netdev netlink\n", event);
}
if (lp->link_up != new_link_up) {
if (new_link_up)
@@ -982,8 +986,8 @@ static int fcoe_ethdrv_get(const struct net_device *netdev)
owner = fcoe_netdev_to_module_owner(netdev);
if (owner) {
- printk(KERN_DEBUG "fcoe:hold driver module %s for %s\n",
- module_name(owner), netdev->name);
+ FCOE_DBG("fcoe:hold driver module %s for %s\n",
+ module_name(owner), netdev->name);
return try_module_get(owner);
}
return -ENODEV;
@@ -1002,8 +1006,8 @@ static int fcoe_ethdrv_put(const struct net_device *netdev)
owner = fcoe_netdev_to_module_owner(netdev);
if (owner) {
- printk(KERN_DEBUG "fcoe:release driver module %s for %s\n",
- module_name(owner), netdev->name);
+ FCOE_DBG("fcoe:release driver module %s for %s\n",
+ module_name(owner), netdev->name);
module_put(owner);
return 0;
}
@@ -1035,8 +1039,8 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
/* pass to transport */
rc = fcoe_transport_release(netdev);
if (rc) {
- printk(KERN_ERR "fcoe: fcoe_transport_release(%s) failed\n",
- netdev->name);
+ FCOE_DBG("fcoe: fcoe_transport_release(%s) failed\n",
+ netdev->name);
rc = -EIO;
goto out_putdev;
}
@@ -1075,8 +1079,8 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
/* pass to transport */
rc = fcoe_transport_attach(netdev);
if (rc) {
- printk(KERN_ERR "fcoe: fcoe_transport_attach(%s) failed\n",
- netdev->name);
+ FCOE_DBG("fcoe: fcoe_transport_attach(%s) failed\n",
+ netdev->name);
fcoe_ethdrv_put(netdev);
rc = -EIO;
goto out_putdev;
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 09/17] libfc: runtime debugging with debug_logging module parameter
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (7 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 08/17] fcoe: Logging review changes Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 10/17] libfc: Logging review changes Robert Love
` (8 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
This patch adds the /sys/module/libfc/parameters/debug_logging
file to sysfs as a module parameter. It accepts an integer
bitmask for logging. Currently it supports:
LSB x = lport debugging
x = disc debugging
x = rport debugging
x = fcp debugging
x = EM debugging
the other bits are not used at this time.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_disc.c | 15 +++------------
drivers/scsi/libfc/fc_exch.c | 11 -----------
drivers/scsi/libfc/fc_fcp.c | 10 +++-------
drivers/scsi/libfc/fc_lport.c | 8 --------
drivers/scsi/libfc/fc_rport.c | 8 --------
include/scsi/libfc.h | 37 +++++++++++++++++++++++++++++++++++++
6 files changed, 43 insertions(+), 46 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index cfbce89..05189f6 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -45,14 +45,6 @@
#define FC_DISC_DELAY 3
-static int fc_disc_debug;
-
-#define FC_DEBUG_DISC(fmt...) \
- do { \
- if (fc_disc_debug) \
- FC_DBG(fmt); \
- } while (0)
-
static void fc_disc_gpn_ft_req(struct fc_disc *);
static void fc_disc_gpn_ft_resp(struct fc_seq *, struct fc_frame *, void *);
static int fc_disc_new_target(struct fc_disc *, struct fc_rport *,
@@ -487,10 +479,9 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
{
struct fc_lport *lport = disc->lport;
unsigned long delay = 0;
- if (fc_disc_debug)
- FC_DBG("Error %ld, retries %d/%d\n",
- PTR_ERR(fp), disc->retry_count,
- FC_DISC_RETRY_LIMIT);
+ FC_DEBUG_DISC("Error %ld, retries %d/%d\n",
+ PTR_ERR(fp), disc->retry_count,
+ FC_DISC_RETRY_LIMIT);
if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) {
/*
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 8c40189..ce608d7 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -32,17 +32,6 @@
#include <scsi/libfc.h>
#include <scsi/fc_encode.h>
-/*
- * fc_exch_debug can be set in debugger or at compile time to get more logs.
- */
-static int fc_exch_debug;
-
-#define FC_DEBUG_EXCH(fmt...) \
- do { \
- if (fc_exch_debug) \
- FC_DBG(fmt); \
- } while (0)
-
static struct kmem_cache *fc_em_cachep; /* cache for exchanges */
/*
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index ecc7261..3f93930 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -43,13 +43,9 @@ MODULE_AUTHOR("Open-FCoE.org");
MODULE_DESCRIPTION("libfc");
MODULE_LICENSE("GPL");
-static int fc_fcp_debug;
-
-#define FC_DEBUG_FCP(fmt...) \
- do { \
- if (fc_fcp_debug) \
- FC_DBG(fmt); \
- } while (0)
+unsigned int debug_logging;
+module_param(debug_logging, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
static struct kmem_cache *scsi_pkt_cachep;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 7dd433c..f777723 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -101,14 +101,6 @@
#define DNS_DELAY 3 /* Discovery delay after RSCN (in seconds)*/
-static int fc_lport_debug;
-
-#define FC_DEBUG_LPORT(fmt...) \
- do { \
- if (fc_lport_debug) \
- FC_DBG(fmt); \
- } while (0)
-
static void fc_lport_error(struct fc_lport *, struct fc_frame *);
static void fc_lport_enter_reset(struct fc_lport *);
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 4f23a9b..05330c0 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -55,14 +55,6 @@
#include <scsi/libfc.h>
#include <scsi/fc_encode.h>
-static int fc_rport_debug;
-
-#define FC_DEBUG_RPORT(fmt...) \
- do { \
- if (fc_rport_debug) \
- FC_DBG(fmt); \
- } while (0)
-
struct workqueue_struct *rport_event_queue;
static void fc_rport_enter_plogi(struct fc_rport *);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 37df48e..01f68f6 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -45,6 +45,43 @@
#define FC_DBG(fmt, args...)
#endif
+#define FC_LPORT_LOGGING 0x01
+#define FC_DISC_LOGGING 0x02
+#define FC_RPORT_LOGGING 0x04
+#define FC_FCP_LOGGING 0x08
+#define FC_EXCH_LOGGING 0x10
+
+extern unsigned int debug_logging;
+
+#define FC_CHECK_LOGGING(LEVEL, CMD) \
+do { \
+ if (unlikely(debug_logging & LEVEL)) \
+ do { \
+ CMD; \
+ } while (0); \
+} while (0)
+
+#define FC_DEBUG_LPORT(fmt, args...) \
+ FC_CHECK_LOGGING(FC_LPORT_LOGGING, \
+ printk(KERN_INFO "%s " fmt, __func__, ##args);)
+
+#define FC_DEBUG_DISC(fmt, args...) \
+ FC_CHECK_LOGGING(FC_DISC_LOGGING, \
+ printk(KERN_INFO "%s " fmt, __func__, ##args);)
+
+#define FC_DEBUG_RPORT(fmt, args...) \
+ FC_CHECK_LOGGING(FC_RPORT_LOGGING, \
+ printk(KERN_INFO "%s " fmt, __func__, ##args);)
+
+#define FC_DEBUG_FCP(fmt, args...) \
+ FC_CHECK_LOGGING(FC_FCP_LOGGING, \
+ printk(KERN_INFO "%s " fmt, __func__, ##args);)
+
+#define FC_DEBUG_EXCH(fmt, args...) \
+ FC_CHECK_LOGGING(FC_EXCH_LOGGING, \
+ printk(KERN_INFO "%s " fmt, __func__, ##args);)
+
+
/*
* libfc error codes
*/
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 10/17] libfc: Logging review changes
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (8 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 09/17] libfc: runtime debugging with debug_logging module parameter Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 11/17] libfc: Cleanup libfc_function_template comments Robert Love
` (7 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
1) Rename FC_DEBUG_* to FC_*_DBG
- Most of our functions in libfc are named fc_<component>_<action>().
for example fc_rport_recv_plogi_resp(). Also converting DEBUG to
DBG saves a little bit of space on the line.
2) Convert all FC_DBG() calls to FC_*_DBG() calls
- There's no need for the FC_DBG macro with the new runtime tunable
debug macros.
3) Remove FC_DBG definition
4) Removed a "list_del" debug statement that wasn't useful
5) Converted one FC_*_DBG to a printk when we receive a FLOGI from port
with same WWPN as our lport.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/libfc/fc_disc.c | 82 +++++++++++------------
drivers/scsi/libfc/fc_exch.c | 41 ++++++-----
drivers/scsi/libfc/fc_fcp.c | 77 +++++++++++----------
drivers/scsi/libfc/fc_lport.c | 147 +++++++++++++++++++++--------------------
drivers/scsi/libfc/fc_rport.c | 112 ++++++++++++++++---------------
include/scsi/fc_encode.h | 2 -
include/scsi/libfc.h | 22 +-----
7 files changed, 236 insertions(+), 247 deletions(-)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 05189f6..f37ce94 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -125,8 +125,8 @@ static void fc_disc_rport_callback(struct fc_lport *lport,
struct fc_disc *disc = &lport->disc;
int found = 0;
- FC_DEBUG_DISC("Received a %d event for port (%6x)\n", event,
- rport->port_id);
+ FC_DISC_DBG("Received a %d event for port (%6x)\n", event,
+ rport->port_id);
if (event == RPORT_EV_CREATED) {
if (disc) {
@@ -138,8 +138,8 @@ static void fc_disc_rport_callback(struct fc_lport *lport,
}
if (!found)
- FC_DEBUG_DISC("The rport (%6x) is not maintained "
- "by the discovery layer\n", rport->port_id);
+ FC_DISC_DBG("The rport (%6x) is not maintained "
+ "by the discovery layer\n", rport->port_id);
}
/**
@@ -169,8 +169,8 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
lport = disc->lport;
- FC_DEBUG_DISC("Received an RSCN event on port (%6x)\n",
- fc_host_port_id(lport->host));
+ FC_DISC_DBG("Received an RSCN event on port (%6x)\n",
+ fc_host_port_id(lport->host));
/* make sure the frame contains an RSCN message */
rp = fc_frame_payload_get(fp, sizeof(*rp));
@@ -203,8 +203,8 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
*/
switch (fmt) {
case ELS_ADDR_FMT_PORT:
- FC_DEBUG_DISC("Port address format for port (%6x)\n",
- ntoh24(pp->rscn_fid));
+ FC_DISC_DBG("Port address format for port (%6x)\n",
+ ntoh24(pp->rscn_fid));
dp = kzalloc(sizeof(*dp), GFP_KERNEL);
if (!dp) {
redisc = 1;
@@ -221,19 +221,19 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
case ELS_ADDR_FMT_DOM:
case ELS_ADDR_FMT_FAB:
default:
- FC_DEBUG_DISC("Address format is (%d)\n", fmt);
+ FC_DISC_DBG("Address format is (%d)\n", fmt);
redisc = 1;
break;
}
}
lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
if (redisc) {
- FC_DEBUG_DISC("RSCN received: rediscovering\n");
+ FC_DISC_DBG("RSCN received: rediscovering\n");
fc_disc_restart(disc);
} else {
- FC_DEBUG_DISC("RSCN received: not rediscovering. "
- "redisc %d state %d in_prog %d\n",
- redisc, lport->state, disc->pending);
+ FC_DISC_DBG("RSCN received: not rediscovering. "
+ "redisc %d state %d in_prog %d\n",
+ redisc, lport->state, disc->pending);
list_for_each_entry_safe(dp, next, &disc_ports, peers) {
list_del(&dp->peers);
rport = lport->tt.rport_lookup(lport, dp->ids.port_id);
@@ -248,7 +248,7 @@ static void fc_disc_recv_rscn_req(struct fc_seq *sp, struct fc_frame *fp,
fc_frame_free(fp);
return;
reject:
- FC_DEBUG_DISC("Received a bad RSCN frame\n");
+ FC_DISC_DBG("Received a bad RSCN frame\n");
rjt_data.fp = NULL;
rjt_data.reason = ELS_RJT_LOGIC;
rjt_data.explan = ELS_EXPL_NONE;
@@ -280,7 +280,8 @@ static void fc_disc_recv_req(struct fc_seq *sp, struct fc_frame *fp,
mutex_unlock(&disc->disc_mutex);
break;
default:
- FC_DBG("Received an unsupported request. opcode (%x)\n", op);
+ FC_DISC_DBG("Received an unsupported request, "
+ "the opcode is (%x)\n", op);
break;
}
}
@@ -298,12 +299,11 @@ static void fc_disc_restart(struct fc_disc *disc)
struct fc_rport_libfc_priv *rdata, *next;
struct fc_lport *lport = disc->lport;
- FC_DEBUG_DISC("Restarting discovery for port (%6x)\n",
- fc_host_port_id(lport->host));
+ FC_DISC_DBG("Restarting discovery for port (%6x)\n",
+ fc_host_port_id(lport->host));
list_for_each_entry_safe(rdata, next, &disc->rports, peers) {
rport = PRIV_TO_RPORT(rdata);
- FC_DEBUG_DISC("list_del(%6x)\n", rport->port_id);
list_del(&rdata->peers);
lport->tt.rport_logoff(rport);
}
@@ -458,8 +458,8 @@ static void fc_disc_done(struct fc_disc *disc)
{
struct fc_lport *lport = disc->lport;
- FC_DEBUG_DISC("Discovery complete for port (%6x)\n",
- fc_host_port_id(lport->host));
+ FC_DISC_DBG("Discovery complete for port (%6x)\n",
+ fc_host_port_id(lport->host));
disc->disc_callback(lport, disc->event);
disc->event = DISC_EV_NONE;
@@ -479,9 +479,9 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
{
struct fc_lport *lport = disc->lport;
unsigned long delay = 0;
- FC_DEBUG_DISC("Error %ld, retries %d/%d\n",
- PTR_ERR(fp), disc->retry_count,
- FC_DISC_RETRY_LIMIT);
+ FC_DISC_DBG("Error %ld, retries %d/%d\n",
+ PTR_ERR(fp), disc->retry_count,
+ FC_DISC_RETRY_LIMIT);
if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) {
/*
@@ -615,9 +615,9 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
rdata->local_port = lport;
lport->tt.rport_login(rport);
} else
- FC_DBG("Failed to allocate memory for "
- "the newly discovered port (%6x)\n",
- dp.ids.port_id);
+ printk(KERN_WARNING "libfc: Failed to allocate "
+ "memory for the newly discovered port "
+ "(%6x)\n", dp.ids.port_id);
}
if (np->fp_flags & FC_NS_FID_LAST) {
@@ -637,9 +637,9 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
*/
if (error == 0 && len > 0 && len < sizeof(*np)) {
if (np != &disc->partial_buf) {
- FC_DEBUG_DISC("Partial buffer remains "
- "for discovery by (%6x)\n",
- fc_host_port_id(lport->host));
+ FC_DISC_DBG("Partial buffer remains "
+ "for discovery by (%6x)\n",
+ fc_host_port_id(lport->host));
memcpy(&disc->partial_buf, np, len);
}
disc->buf_len = (unsigned char) len;
@@ -683,8 +683,8 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
unsigned int len;
int error;
- FC_DEBUG_DISC("Received a GPN_FT response on port (%6x)\n",
- fc_host_port_id(disc->lport->host));
+ FC_DISC_DBG("Received a GPN_FT response on port (%6x)\n",
+ fc_host_port_id(disc->lport->host));
if (IS_ERR(fp)) {
fc_disc_error(disc, fp);
@@ -699,8 +699,8 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
disc->seq_count == 0) {
cp = fc_frame_payload_get(fp, sizeof(*cp));
if (!cp) {
- FC_DBG("GPN_FT response too short, len %d\n",
- fr_len(fp));
+ FC_DISC_DBG("GPN_FT response too short, len %d\n",
+ fr_len(fp));
} else if (ntohs(cp->ct_cmd) == FC_FS_ACC) {
/*
@@ -709,22 +709,22 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
buf = cp + 1;
len -= sizeof(*cp);
} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
- FC_DBG("GPN_FT rejected reason %x exp %x "
- "(check zoning)\n", cp->ct_reason,
- cp->ct_explan);
+ FC_DISC_DBG("GPN_FT rejected reason %x exp %x "
+ "(check zoning)\n", cp->ct_reason,
+ cp->ct_explan);
disc->event = DISC_EV_FAILED;
fc_disc_done(disc);
} else {
- FC_DBG("GPN_FT unexpected response code %x\n",
- ntohs(cp->ct_cmd));
+ FC_DISC_DBG("GPN_FT unexpected response code %x\n",
+ ntohs(cp->ct_cmd));
}
} else if (fr_sof(fp) == FC_SOF_N3 &&
seq_cnt == disc->seq_count) {
buf = fh + 1;
} else {
- FC_DBG("GPN_FT unexpected frame - out of sequence? "
- "seq_cnt %x expected %x sof %x eof %x\n",
- seq_cnt, disc->seq_count, fr_sof(fp), fr_eof(fp));
+ FC_DISC_DBG("GPN_FT unexpected frame - out of sequence? "
+ "seq_cnt %x expected %x sof %x eof %x\n",
+ seq_cnt, disc->seq_count, fr_sof(fp), fr_eof(fp));
}
if (buf) {
error = fc_disc_gpn_ft_parse(disc, buf, len);
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index ce608d7..b0d3ec7 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -322,8 +322,8 @@ static inline void fc_exch_timer_set_locked(struct fc_exch *ep,
if (ep->state & (FC_EX_RST_CLEANUP | FC_EX_DONE))
return;
- FC_DEBUG_EXCH("Exchange (%4x) timed out, notifying the upper layer\n",
- ep->xid);
+ FC_EXCH_DBG("Exchange (%4x) timed out, notifying the upper layer\n",
+ ep->xid);
if (schedule_delayed_work(&ep->timeout_work,
msecs_to_jiffies(timer_msec)))
fc_exch_hold(ep); /* hold for timer */
@@ -534,7 +534,7 @@ struct fc_exch *fc_exch_alloc(struct fc_exch_mgr *mp,
/* alloc a new xid */
xid = fc_em_alloc_xid(mp, fp);
if (!xid) {
- printk(KERN_ERR "fc_em_alloc_xid() failed\n");
+ printk(KERN_WARNING "libfc: Failed to allocate an exhange\n");
goto err;
}
}
@@ -822,8 +822,8 @@ static struct fc_seq *fc_seq_start_next_locked(struct fc_seq *sp)
struct fc_exch *ep = fc_seq_exch(sp);
sp = fc_seq_alloc(ep, ep->seq_id++);
- FC_DEBUG_EXCH("exch %4x f_ctl %6x seq %2x\n",
- ep->xid, ep->f_ctl, sp->id);
+ FC_EXCH_DBG("exch %4x f_ctl %6x seq %2x\n",
+ ep->xid, ep->f_ctl, sp->id);
return sp;
}
/*
@@ -903,7 +903,7 @@ void fc_seq_els_rsp_send(struct fc_seq *sp, enum fc_els_cmd els_cmd,
fc_exch_els_rec(sp, els_data->fp);
break;
default:
- FC_DBG("Invalid ELS CMD:%x\n", els_cmd);
+ FC_EXCH_DBG("Invalid ELS CMD:%x\n", els_cmd);
}
}
EXPORT_SYMBOL(fc_seq_els_rsp_send);
@@ -1136,7 +1136,7 @@ static void fc_exch_recv_req(struct fc_lport *lp, struct fc_exch_mgr *mp,
lp->tt.lport_recv(lp, sp, fp);
fc_exch_release(ep); /* release from lookup */
} else {
- FC_DEBUG_EXCH("exch/seq lookup failed: reject %x\n", reject);
+ FC_EXCH_DBG("exch/seq lookup failed: reject %x\n", reject);
fc_frame_free(fp);
}
}
@@ -1240,10 +1240,10 @@ static void fc_exch_recv_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
sp = fc_seq_lookup_orig(mp, fp); /* doesn't hold sequence */
if (!sp) {
atomic_inc(&mp->stats.xid_not_found);
- FC_DEBUG_EXCH("seq lookup failed\n");
+ FC_EXCH_DBG("seq lookup failed\n");
} else {
atomic_inc(&mp->stats.non_bls_resp);
- FC_DEBUG_EXCH("non-BLS response to sequence");
+ FC_EXCH_DBG("non-BLS response to sequence");
}
fc_frame_free(fp);
}
@@ -1264,8 +1264,8 @@ static void fc_exch_abts_resp(struct fc_exch *ep, struct fc_frame *fp)
int rc = 1, has_rec = 0;
fh = fc_frame_header_get(fp);
- FC_DEBUG_EXCH("exch: BLS rctl %x - %s\n",
- fh->fh_r_ctl, fc_exch_rctl_name(fh->fh_r_ctl));
+ FC_EXCH_DBG("exch: BLS rctl %x - %s\n", fh->fh_r_ctl,
+ fc_exch_rctl_name(fh->fh_r_ctl));
if (cancel_delayed_work_sync(&ep->timeout_work))
fc_exch_release(ep); /* release from pending timer hold */
@@ -1357,9 +1357,8 @@ static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp)
case FC_RCTL_ACK_0:
break;
default:
- FC_DEBUG_EXCH("BLS rctl %x - %s received",
- fh->fh_r_ctl,
- fc_exch_rctl_name(fh->fh_r_ctl));
+ FC_EXCH_DBG("BLS rctl %x - %s received", fh->fh_r_ctl,
+ fc_exch_rctl_name(fh->fh_r_ctl));
break;
}
fc_frame_free(fp);
@@ -1597,7 +1596,7 @@ static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg)
if (err == -FC_EX_CLOSED || err == -FC_EX_TIMEOUT)
goto cleanup;
- FC_DBG("Cannot process RRQ, because of frame error %d\n", err);
+ FC_EXCH_DBG("Cannot process RRQ, frame error %d\n", err);
return;
}
@@ -1606,12 +1605,12 @@ static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg)
switch (op) {
case ELS_LS_RJT:
- FC_DBG("LS_RJT for RRQ");
+ FC_EXCH_DBG("LS_RJT for RRQ");
/* fall through */
case ELS_LS_ACC:
goto cleanup;
default:
- FC_DBG("unexpected response op %x for RRQ", op);
+ FC_EXCH_DBG("unexpected response op %x for RRQ", op);
return;
}
@@ -1738,8 +1737,8 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp,
size_t len;
if (max_xid <= min_xid || min_xid == 0 || max_xid == FC_XID_UNKNOWN) {
- FC_DBG("Invalid min_xid 0x:%x and max_xid 0x:%x\n",
- min_xid, max_xid);
+ FC_EXCH_DBG("Invalid min_xid 0x:%x and max_xid 0x:%x\n",
+ min_xid, max_xid);
return NULL;
}
@@ -1874,7 +1873,7 @@ void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp,
/* lport lock ? */
if (!lp || !mp || (lp->state == LPORT_ST_NONE)) {
- FC_DBG("fc_lport or EM is not allocated and configured");
+ FC_EXCH_DBG("fc_lport or EM is not allocated and configured");
fc_frame_free(fp);
return;
}
@@ -1900,7 +1899,7 @@ void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp,
fc_exch_recv_req(lp, mp, fp);
break;
default:
- FC_DBG("dropping invalid frame (eof %x)", fr_eof(fp));
+ FC_EXCH_DBG("dropping invalid frame (eof %x)", fr_eof(fp));
fc_frame_free(fp);
break;
}
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 3f93930..0d75b23 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -293,8 +293,8 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) &&
fc_frame_crc_check(fp))
goto crc_err;
- FC_DEBUG_FCP("data received past end. len %zx offset %zx "
- "data_len %x\n", len, offset, fsp->data_len);
+ FC_FCP_DBG("data received past end. len %zx offset %zx "
+ "data_len %x\n", len, offset, fsp->data_len);
fc_fcp_retry_cmd(fsp);
return;
}
@@ -356,7 +356,7 @@ crc_err:
stats = lp->dev_stats[smp_processor_id()];
stats->ErrorFrames++;
if (stats->InvalidCRCCount++ < 5)
- FC_DBG("CRC error on data frame\n");
+ FC_FCP_DBG("CRC error on data frame\n");
/*
* Assume the frame is total garbage.
* We may have copied it over the good part
@@ -419,14 +419,14 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
WARN_ON(seq_blen <= 0);
if (unlikely(offset + seq_blen > fsp->data_len)) {
/* this should never happen */
- FC_DEBUG_FCP("xfer-ready past end. seq_blen %zx offset %zx\n",
- seq_blen, offset);
+ FC_FCP_DBG("xfer-ready past end. seq_blen %zx offset %zx\n",
+ seq_blen, offset);
fc_fcp_send_abort(fsp);
return 0;
} else if (offset != fsp->xfer_len) {
/* Out of Order Data Request - no problem, but unexpected. */
- FC_DEBUG_FCP("xfer-ready non-contiguous. "
- "seq_blen %zx offset %zx\n", seq_blen, offset);
+ FC_FCP_DBG("xfer-ready non-contiguous. "
+ "seq_blen %zx offset %zx\n", seq_blen, offset);
}
/*
@@ -705,7 +705,7 @@ static void fc_fcp_recv(struct fc_seq *seq, struct fc_frame *fp, void *arg)
fc_fcp_resp(fsp, fp);
} else {
- FC_DBG("unexpected frame. r_ctl %x\n", r_ctl);
+ FC_FCP_DBG("unexpected frame. r_ctl %x\n", r_ctl);
}
unlock:
fc_fcp_unlock_pkt(fsp);
@@ -811,17 +811,17 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
return;
}
fsp->status_code = FC_DATA_OVRRUN;
- FC_DBG("tgt %6x xfer len %zx greater than expected len %x. "
- "data len %x\n",
- fsp->rport->port_id,
- fsp->xfer_len, expected_len, fsp->data_len);
+ FC_FCP_DBG("tgt %6x xfer len %zx greater than expected, "
+ "len %x, data len %x\n",
+ fsp->rport->port_id,
+ fsp->xfer_len, expected_len, fsp->data_len);
}
fc_fcp_complete_locked(fsp);
return;
len_err:
- FC_DBG("short FCP response. flags 0x%x len %u respl %u snsl %u\n",
- flags, fr_len(fp), respl, snsl);
+ FC_FCP_DBG("short FCP response. flags 0x%x len %u respl %u snsl %u\n",
+ flags, fr_len(fp), respl, snsl);
err:
fsp->status_code = FC_ERROR;
fc_fcp_complete_locked(fsp);
@@ -1041,13 +1041,11 @@ static void fc_fcp_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
if (fc_fcp_lock_pkt(fsp))
return;
- switch (error) {
- case -FC_EX_CLOSED:
+ if (error == -FC_EX_CLOSED) {
fc_fcp_retry_cmd(fsp);
goto unlock;
- default:
- FC_DBG("unknown error %ld\n", PTR_ERR(fp));
}
+
/*
* clear abort pending, because the lower layer
* decided to force completion.
@@ -1079,10 +1077,10 @@ static int fc_fcp_pkt_abort(struct fc_lport *lp, struct fc_fcp_pkt *fsp)
fsp->wait_for_comp = 0;
if (!rc) {
- FC_DBG("target abort cmd failed\n");
+ FC_FCP_DBG("target abort cmd failed\n");
rc = FAILED;
} else if (fsp->state & FC_SRB_ABORTED) {
- FC_DBG("target abort cmd passed\n");
+ FC_FCP_DBG("target abort cmd passed\n");
rc = SUCCESS;
fc_fcp_complete_locked(fsp);
}
@@ -1147,7 +1145,7 @@ static int fc_lun_reset(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
spin_unlock_bh(&fsp->scsi_pkt_lock);
if (!rc) {
- FC_DBG("lun reset failed\n");
+ FC_FCP_DBG("lun reset failed\n");
return FAILED;
}
@@ -1155,7 +1153,7 @@ static int fc_lun_reset(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
if (fsp->cdb_status != FCP_TMF_CMPL)
return FAILED;
- FC_DBG("lun reset to lun %u completed\n", lun);
+ FC_FCP_DBG("lun reset to lun %u completed\n", lun);
fc_fcp_cleanup_each_cmd(lp, id, lun, FC_CMD_ABORTED);
return SUCCESS;
}
@@ -1322,13 +1320,13 @@ static void fc_fcp_rec_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg)
rjt = fc_frame_payload_get(fp, sizeof(*rjt));
switch (rjt->er_reason) {
default:
- FC_DEBUG_FCP("device %x unexpected REC reject "
- "reason %d expl %d\n",
- fsp->rport->port_id, rjt->er_reason,
- rjt->er_explan);
+ FC_FCP_DBG("device %x unexpected REC reject "
+ "reason %d expl %d\n",
+ fsp->rport->port_id, rjt->er_reason,
+ rjt->er_explan);
/* fall through */
case ELS_RJT_UNSUP:
- FC_DEBUG_FCP("device does not support REC\n");
+ FC_FCP_DBG("device does not support REC\n");
rp = fsp->rport->dd_data;
/*
* if we do not spport RECs or got some bogus
@@ -1448,8 +1446,8 @@ static void fc_fcp_rec_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
break;
default:
- FC_DBG("REC %p fid %x error unexpected error %d\n",
- fsp, fsp->rport->port_id, error);
+ FC_FCP_DBG("REC %p fid %x error unexpected error %d\n",
+ fsp, fsp->rport->port_id, error);
fsp->status_code = FC_CMD_PLOGO;
/* fall through */
@@ -1458,9 +1456,9 @@ static void fc_fcp_rec_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
* Assume REC or LS_ACC was lost.
* The exchange manager will have aborted REC, so retry.
*/
- FC_DBG("REC fid %x error error %d retry %d/%d\n",
- fsp->rport->port_id, error, fsp->recov_retry,
- FC_MAX_RECOV_RETRY);
+ FC_FCP_DBG("REC fid %x error error %d retry %d/%d\n",
+ fsp->rport->port_id, error, fsp->recov_retry,
+ FC_MAX_RECOV_RETRY);
if (fsp->recov_retry++ < FC_MAX_RECOV_RETRY)
fc_fcp_rec(fsp);
else
@@ -1943,7 +1941,7 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd)
fsp = fc_fcp_pkt_alloc(lp, GFP_NOIO);
if (fsp == NULL) {
- FC_DBG("could not allocate scsi_pkt\n");
+ printk(KERN_WARNING "libfc: could not allocate scsi_pkt\n");
sc_cmd->result = DID_NO_CONNECT << 16;
goto out;
}
@@ -1984,11 +1982,12 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
msleep(1000);
if (fc_fcp_lport_queue_ready(lp)) {
- shost_printk(KERN_INFO, shost, "Host reset succeeded.\n");
+ shost_printk(KERN_INFO, shost, "Host reset succeeded on port "
+ "(%6x)\n", fc_host_port_id(lp->host));
return SUCCESS;
} else {
- shost_printk(KERN_INFO, shost, "Host reset failed. "
- "lport not ready.\n");
+ shost_printk(KERN_INFO, shost, "Host reset failed, port (%6x) "
+ "is not ready.\n", fc_host_port_id(lp->host));
return FAILED;
}
}
@@ -2047,7 +2046,8 @@ void fc_fcp_destroy(struct fc_lport *lp)
struct fc_fcp_internal *si = fc_get_scsi_internal(lp);
if (!list_empty(&si->scsi_pkt_queue))
- printk(KERN_ERR "Leaked scsi packets.\n");
+ printk(KERN_ERR "libfc: Leaked SCSI packets when destroying "
+ "port (%6x)\n", fc_host_port_id(lp->host));
mempool_destroy(si->scsi_pkt_pool);
kfree(si);
@@ -2096,7 +2096,8 @@ static int __init libfc_init(void)
sizeof(struct fc_fcp_pkt),
0, SLAB_HWCACHE_ALIGN, NULL);
if (scsi_pkt_cachep == NULL) {
- FC_DBG("Unable to allocate SRB cache...module load failed!");
+ printk(KERN_ERR "libfc: Unable to allocate SRB cache, "
+ "module load failed!");
return -ENOMEM;
}
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index f777723..54ef40e 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -143,8 +143,8 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
struct fc_rport *rport,
enum fc_rport_event event)
{
- FC_DEBUG_LPORT("Received a %d event for port (%6x)\n", event,
- rport->port_id);
+ FC_LPORT_DBG("Received a %d event for port (%6x)\n", event,
+ rport->port_id);
switch (event) {
case RPORT_EV_CREATED:
@@ -154,19 +154,19 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
lport->dns_rp = rport;
fc_lport_enter_rpn_id(lport);
} else {
- FC_DEBUG_LPORT("Received an CREATED event on "
- "port (%6x) for the directory "
- "server, but the lport is not "
- "in the DNS state, it's in the "
- "%d state", rport->port_id,
- lport->state);
+ FC_LPORT_DBG("Received an CREATED event on "
+ "port (%6x) for the directory "
+ "server, but the lport is not "
+ "in the DNS state, it's in the "
+ "%d state", rport->port_id,
+ lport->state);
lport->tt.rport_logoff(rport);
}
mutex_unlock(&lport->lp_mutex);
} else
- FC_DEBUG_LPORT("Received an event for port (%6x) "
- "which is not the directory server\n",
- rport->port_id);
+ FC_LPORT_DBG("Received an event for port (%6x) "
+ "which is not the directory server\n",
+ rport->port_id);
break;
case RPORT_EV_LOGO:
case RPORT_EV_FAILED:
@@ -177,9 +177,9 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
mutex_unlock(&lport->lp_mutex);
} else
- FC_DEBUG_LPORT("Received an event for port (%6x) "
- "which is not the directory server\n",
- rport->port_id);
+ FC_LPORT_DBG("Received an event for port (%6x) "
+ "which is not the directory server\n",
+ rport->port_id);
break;
case RPORT_EV_NONE:
break;
@@ -354,8 +354,8 @@ static void fc_lport_add_fc4_type(struct fc_lport *lport, enum fc_fh_type type)
static void fc_lport_recv_rlir_req(struct fc_seq *sp, struct fc_frame *fp,
struct fc_lport *lport)
{
- FC_DEBUG_LPORT("Received RLIR request while in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received RLIR request while in state %s\n",
+ fc_lport_state(lport));
lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL);
fc_frame_free(fp);
@@ -380,8 +380,8 @@ static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
void *dp;
u32 f_ctl;
- FC_DEBUG_LPORT("Received RLIR request while in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received RLIR request while in state %s\n",
+ fc_lport_state(lport));
len = fr_len(in_fp) - sizeof(struct fc_frame_header);
pp = fc_frame_payload_get(in_fp, len);
@@ -428,8 +428,8 @@ static void fc_lport_recv_rnid_req(struct fc_seq *sp, struct fc_frame *in_fp,
size_t len;
u32 f_ctl;
- FC_DEBUG_LPORT("Received RNID request while in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received RNID request while in state %s\n",
+ fc_lport_state(lport));
req = fc_frame_payload_get(in_fp, sizeof(*req));
if (!req) {
@@ -489,8 +489,8 @@ static void fc_lport_recv_adisc_req(struct fc_seq *sp, struct fc_frame *in_fp,
size_t len;
u32 f_ctl;
- FC_DEBUG_LPORT("Received ADISC request while in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received ADISC request while in state %s\n",
+ fc_lport_state(lport));
req = fc_frame_payload_get(in_fp, sizeof(*req));
if (!req) {
@@ -565,8 +565,8 @@ EXPORT_SYMBOL(fc_fabric_login);
*/
void fc_linkup(struct fc_lport *lport)
{
- FC_DEBUG_LPORT("Link is up for port (%6x)\n",
- fc_host_port_id(lport->host));
+ printk(KERN_INFO "libfc: Link up on port (%6x)\n",
+ fc_host_port_id(lport->host));
mutex_lock(&lport->lp_mutex);
if (!lport->link_up) {
@@ -586,8 +586,8 @@ EXPORT_SYMBOL(fc_linkup);
void fc_linkdown(struct fc_lport *lport)
{
mutex_lock(&lport->lp_mutex);
- FC_DEBUG_LPORT("Link is down for port (%6x)\n",
- fc_host_port_id(lport->host));
+ printk(KERN_INFO "libfc: Link down on port (%6x)\n",
+ fc_host_port_id(lport->host));
if (lport->link_up) {
lport->link_up = 0;
@@ -683,12 +683,12 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event)
{
switch (event) {
case DISC_EV_SUCCESS:
- FC_DEBUG_LPORT("Got a SUCCESS event for port (%6x)\n",
- fc_host_port_id(lport->host));
+ FC_LPORT_DBG("Discovery succeeded for port (%6x)\n",
+ fc_host_port_id(lport->host));
break;
case DISC_EV_FAILED:
- FC_DEBUG_LPORT("Got a FAILED event for port (%6x)\n",
- fc_host_port_id(lport->host));
+ printk(KERN_ERR "libfc: Discovery failed for port (%6x)\n",
+ fc_host_port_id(lport->host));
mutex_lock(&lport->lp_mutex);
fc_lport_enter_reset(lport);
mutex_unlock(&lport->lp_mutex);
@@ -708,8 +708,8 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event)
*/
static void fc_lport_enter_ready(struct fc_lport *lport)
{
- FC_DEBUG_LPORT("Port (%6x) entered Ready from state %s\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered READY from state %s\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_READY);
@@ -744,8 +744,8 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
u32 local_fid;
u32 f_ctl;
- FC_DEBUG_LPORT("Received FLOGI request while in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received FLOGI request while in state %s\n",
+ fc_lport_state(lport));
fh = fc_frame_header_get(rx_fp);
remote_fid = ntoh24(fh->fh_s_id);
@@ -754,11 +754,11 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
goto out;
remote_wwpn = get_unaligned_be64(&flp->fl_wwpn);
if (remote_wwpn == lport->wwpn) {
- FC_DBG("FLOGI from port with same WWPN %llx "
- "possible configuration error\n", remote_wwpn);
+ printk(KERN_WARNING "libfc: Received FLOGI from port "
+ "with same WWPN %llx\n", remote_wwpn);
goto out;
}
- FC_DBG("FLOGI from port WWPN %llx\n", remote_wwpn);
+ FC_LPORT_DBG("FLOGI from port WWPN %llx\n", remote_wwpn);
/*
* XXX what is the right thing to do for FIDs?
@@ -890,7 +890,7 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp,
}
}
} else {
- FC_DBG("dropping invalid frame (eof %x)\n", fr_eof(fp));
+ FC_LPORT_DBG("dropping invalid frame (eof %x)\n", fr_eof(fp));
fc_frame_free(fp);
}
mutex_unlock(&lport->lp_mutex);
@@ -927,8 +927,8 @@ EXPORT_SYMBOL(fc_lport_reset);
*/
static void fc_lport_enter_reset(struct fc_lport *lport)
{
- FC_DEBUG_LPORT("Port (%6x) entered RESET state from %s state\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered RESET state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_RESET);
cancel_delayed_work_sync(&lport->retry_work);
@@ -963,9 +963,9 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp)
{
unsigned long delay = 0;
- FC_DEBUG_LPORT("Error %ld in state %s, retries %d\n",
- PTR_ERR(fp), fc_lport_state(lport),
- lport->retry_count);
+ FC_LPORT_DBG("Error %ld in state %s, retries %d\n",
+ PTR_ERR(fp), fc_lport_state(lport),
+ lport->retry_count);
if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) {
/*
@@ -1021,7 +1021,7 @@ static void fc_lport_rft_id_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&lport->lp_mutex);
- FC_DEBUG_LPORT("Received a RFT_ID response\n");
+ FC_LPORT_DBG("Received a RFT_ID response\n");
if (IS_ERR(fp)) {
fc_lport_error(lport, fp);
@@ -1029,8 +1029,8 @@ static void fc_lport_rft_id_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (lport->state != LPORT_ST_RFT_ID) {
- FC_DBG("Received a RFT_ID response, but in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received a RFT_ID response, but in state %s\n",
+ fc_lport_state(lport));
goto out;
}
@@ -1073,7 +1073,7 @@ static void fc_lport_rpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&lport->lp_mutex);
- FC_DEBUG_LPORT("Received a RPN_ID response\n");
+ FC_LPORT_DBG("Received a RPN_ID response\n");
if (IS_ERR(fp)) {
fc_lport_error(lport, fp);
@@ -1081,8 +1081,8 @@ static void fc_lport_rpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (lport->state != LPORT_ST_RPN_ID) {
- FC_DBG("Received a RPN_ID response, but in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received a RPN_ID response, but in state %s\n",
+ fc_lport_state(lport));
goto out;
}
@@ -1123,7 +1123,7 @@ static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&lport->lp_mutex);
- FC_DEBUG_LPORT("Received a SCR response\n");
+ FC_LPORT_DBG("Received a SCR response\n");
if (IS_ERR(fp)) {
fc_lport_error(lport, fp);
@@ -1131,8 +1131,8 @@ static void fc_lport_scr_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (lport->state != LPORT_ST_SCR) {
- FC_DBG("Received a SCR response, but in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received a SCR response, but in state %s\n",
+ fc_lport_state(lport));
goto out;
}
@@ -1159,8 +1159,8 @@ static void fc_lport_enter_scr(struct fc_lport *lport)
{
struct fc_frame *fp;
- FC_DEBUG_LPORT("Port (%6x) entered SCR state from %s state\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered SCR state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_SCR);
@@ -1188,8 +1188,8 @@ static void fc_lport_enter_rft_id(struct fc_lport *lport)
struct fc_ns_fts *lps;
int i;
- FC_DEBUG_LPORT("Port (%6x) entered RFT_ID state from %s state\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered RFT_ID state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_RFT_ID);
@@ -1228,8 +1228,8 @@ static void fc_lport_enter_rpn_id(struct fc_lport *lport)
{
struct fc_frame *fp;
- FC_DEBUG_LPORT("Port (%6x) entered RPN_ID state from %s state\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered RPN_ID state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_RPN_ID);
@@ -1269,8 +1269,8 @@ static void fc_lport_enter_dns(struct fc_lport *lport)
dp.ids.roles = FC_RPORT_ROLE_UNKNOWN;
dp.lp = lport;
- FC_DEBUG_LPORT("Port (%6x) entered DNS state from %s state\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered DNS state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_DNS);
@@ -1349,7 +1349,7 @@ static void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&lport->lp_mutex);
- FC_DEBUG_LPORT("Received a LOGO response\n");
+ FC_LPORT_DBG("Received a LOGO response\n");
if (IS_ERR(fp)) {
fc_lport_error(lport, fp);
@@ -1357,8 +1357,8 @@ static void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (lport->state != LPORT_ST_LOGO) {
- FC_DBG("Received a LOGO response, but in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received a LOGO response, but in state %s\n",
+ fc_lport_state(lport));
goto out;
}
@@ -1386,8 +1386,8 @@ static void fc_lport_enter_logo(struct fc_lport *lport)
struct fc_frame *fp;
struct fc_els_logo *logo;
- FC_DEBUG_LPORT("Port (%6x) entered LOGO state from %s state\n",
- fc_host_port_id(lport->host), fc_lport_state(lport));
+ FC_LPORT_DBG("Port (%6x) entered LOGO state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_LOGO);
@@ -1433,7 +1433,7 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&lport->lp_mutex);
- FC_DEBUG_LPORT("Received a FLOGI response\n");
+ FC_LPORT_DBG("Received a FLOGI response\n");
if (IS_ERR(fp)) {
fc_lport_error(lport, fp);
@@ -1441,8 +1441,8 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (lport->state != LPORT_ST_FLOGI) {
- FC_DBG("Received a FLOGI response, but in state %s\n",
- fc_lport_state(lport));
+ FC_LPORT_DBG("Received a FLOGI response, but in state %s\n",
+ fc_lport_state(lport));
goto out;
}
@@ -1450,7 +1450,8 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
did = ntoh24(fh->fh_d_id);
if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) {
- FC_DEBUG_LPORT("Assigned fid %x\n", did);
+ printk(KERN_INFO "libfc: Assigned FID (%6x) in FLOGI response\n",
+ did);
fc_host_port_id(lport->host) = did;
flp = fc_frame_payload_get(fp, sizeof(*flp));
@@ -1469,7 +1470,8 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
if (e_d_tov > lport->e_d_tov)
lport->e_d_tov = e_d_tov;
lport->r_a_tov = 2 * e_d_tov;
- FC_DBG("Point-to-Point mode\n");
+ printk(KERN_INFO "libfc: Port (%6x) entered "
+ "point to point mode\n", did);
fc_lport_ptp_setup(lport, ntoh24(fh->fh_s_id),
get_unaligned_be64(
&flp->fl_wwpn),
@@ -1492,7 +1494,7 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
}
}
} else {
- FC_DBG("bad FLOGI response\n");
+ FC_LPORT_DBG("bad FLOGI response\n");
}
out:
@@ -1512,7 +1514,8 @@ void fc_lport_enter_flogi(struct fc_lport *lport)
{
struct fc_frame *fp;
- FC_DEBUG_LPORT("Processing FLOGI state\n");
+ FC_LPORT_DBG("Port (%6x) entered FLOGI state from %s state\n",
+ fc_host_port_id(lport->host), fc_lport_state(lport));
fc_lport_state_enter(lport, LPORT_ST_FLOGI);
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 05330c0..d4f6e01 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -89,7 +89,7 @@ static const char *fc_rport_state_names[] = {
static void fc_rport_rogue_destroy(struct device *dev)
{
struct fc_rport *rport = dev_to_rport(dev);
- FC_DEBUG_RPORT("Destroying rogue rport (%6x)\n", rport->port_id);
+ FC_RPORT_DBG("Destroying rogue rport (%6x)\n", rport->port_id);
kfree(rport);
}
@@ -255,8 +255,8 @@ static void fc_rport_work(struct work_struct *work)
fc_rport_state_enter(new_rport, RPORT_ST_READY);
} else {
- FC_DBG("Failed to create the rport for port "
- "(%6x).\n", ids.port_id);
+ printk(KERN_WARNING "libfc: Failed to allocate "
+ " memory for rport (%6x)\n", ids.port_id);
event = RPORT_EV_FAILED;
}
put_device(&rport->dev);
@@ -297,7 +297,7 @@ int fc_rport_login(struct fc_rport *rport)
mutex_lock(&rdata->rp_mutex);
- FC_DEBUG_RPORT("Login to port (%6x)\n", rport->port_id);
+ FC_LPORT_DBG("Login to port (%6x)\n", rport->port_id);
fc_rport_enter_plogi(rport);
@@ -320,7 +320,7 @@ int fc_rport_logoff(struct fc_rport *rport)
mutex_lock(&rdata->rp_mutex);
- FC_DEBUG_RPORT("Remove port (%6x)\n", rport->port_id);
+ FC_LPORT_DBG("Remove port (%6x)\n", rport->port_id);
fc_rport_enter_logo(rport);
@@ -357,7 +357,7 @@ static void fc_rport_enter_ready(struct fc_rport *rport)
fc_rport_state_enter(rport, RPORT_ST_READY);
- FC_DEBUG_RPORT("Port (%6x) is Ready\n", rport->port_id);
+ FC_LPORT_DBG("Port (%6x) is Ready\n", rport->port_id);
rdata->event = RPORT_EV_CREATED;
queue_work(rport_event_queue, &rdata->event_work);
@@ -414,8 +414,8 @@ static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp)
{
struct fc_rport_libfc_priv *rdata = rport->dd_data;
- FC_DEBUG_RPORT("Error %ld in state %s, retries %d\n",
- PTR_ERR(fp), fc_rport_state(rport), rdata->retries);
+ FC_LPORT_DBG("Error %ld in state %s, retries %d\n",
+ PTR_ERR(fp), fc_rport_state(rport), rdata->retries);
switch (rdata->rp_state) {
case RPORT_ST_PLOGI:
@@ -456,8 +456,8 @@ static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp)
return fc_rport_error(rport, fp);
if (rdata->retries < rdata->local_port->max_retry_count) {
- FC_DEBUG_RPORT("Error %ld in state %s, retrying\n",
- PTR_ERR(fp), fc_rport_state(rport));
+ FC_LPORT_DBG("Error %ld in state %s, retrying\n",
+ PTR_ERR(fp), fc_rport_state(rport));
rdata->retries++;
/* no additional delay on exchange timeouts */
if (PTR_ERR(fp) == -FC_EX_TIMEOUT)
@@ -494,8 +494,8 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&rdata->rp_mutex);
- FC_DEBUG_RPORT("Received a PLOGI response from port (%6x)\n",
- rport->port_id);
+ FC_LPORT_DBG("Received a PLOGI response from port (%6x)\n",
+ rport->port_id);
if (IS_ERR(fp)) {
fc_rport_error_retry(rport, fp);
@@ -503,8 +503,8 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (rdata->rp_state != RPORT_ST_PLOGI) {
- FC_DBG("Received a PLOGI response, but in state %s\n",
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received a PLOGI response, but in state %s\n",
+ fc_rport_state(rport));
goto out;
}
@@ -558,8 +558,8 @@ static void fc_rport_enter_plogi(struct fc_rport *rport)
struct fc_lport *lport = rdata->local_port;
struct fc_frame *fp;
- FC_DEBUG_RPORT("Port (%6x) entered PLOGI state from %s state\n",
- rport->port_id, fc_rport_state(rport));
+ FC_LPORT_DBG("Port (%6x) entered PLOGI state from %s state\n",
+ rport->port_id, fc_rport_state(rport));
fc_rport_state_enter(rport, RPORT_ST_PLOGI);
@@ -603,8 +603,8 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&rdata->rp_mutex);
- FC_DEBUG_RPORT("Received a PRLI response from port (%6x)\n",
- rport->port_id);
+ FC_LPORT_DBG("Received a PRLI response from port (%6x)\n",
+ rport->port_id);
if (IS_ERR(fp)) {
fc_rport_error_retry(rport, fp);
@@ -612,8 +612,8 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (rdata->rp_state != RPORT_ST_PRLI) {
- FC_DBG("Received a PRLI response, but in state %s\n",
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received a PRLI response, but in state %s\n",
+ fc_rport_state(rport));
goto out;
}
@@ -636,7 +636,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
fc_rport_enter_rtv(rport);
} else {
- FC_DBG("Bad ELS response\n");
+ FC_LPORT_DBG("Bad ELS response for PRLI command\n");
rdata->event = RPORT_EV_FAILED;
queue_work(rport_event_queue, &rdata->event_work);
}
@@ -667,7 +667,7 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&rdata->rp_mutex);
- FC_DEBUG_RPORT("Received a LOGO response from port (%6x)\n",
+ FC_LPORT_DBG("Received a LOGO response from port (%6x)\n",
rport->port_id);
if (IS_ERR(fp)) {
@@ -676,8 +676,8 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (rdata->rp_state != RPORT_ST_LOGO) {
- FC_DEBUG_RPORT("Received a LOGO response, but in state %s\n",
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received a LOGO response, but in state %s\n",
+ fc_rport_state(rport));
goto out;
}
@@ -685,7 +685,7 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
if (op == ELS_LS_ACC) {
fc_rport_enter_rtv(rport);
} else {
- FC_DBG("Bad ELS response\n");
+ FC_LPORT_DBG("Bad ELS response for LOGO command\n");
rdata->event = RPORT_EV_LOGO;
queue_work(rport_event_queue, &rdata->event_work);
}
@@ -714,8 +714,8 @@ static void fc_rport_enter_prli(struct fc_rport *rport)
} *pp;
struct fc_frame *fp;
- FC_DEBUG_RPORT("Port (%6x) entered PRLI state from %s state\n",
- rport->port_id, fc_rport_state(rport));
+ FC_LPORT_DBG("Port (%6x) entered PRLI state from %s state\n",
+ rport->port_id, fc_rport_state(rport));
fc_rport_state_enter(rport, RPORT_ST_PRLI);
@@ -753,8 +753,8 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_lock(&rdata->rp_mutex);
- FC_DEBUG_RPORT("Received a RTV response from port (%6x)\n",
- rport->port_id);
+ FC_LPORT_DBG("Received a RTV response from port (%6x)\n",
+ rport->port_id);
if (IS_ERR(fp)) {
fc_rport_error(rport, fp);
@@ -762,8 +762,8 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp,
}
if (rdata->rp_state != RPORT_ST_RTV) {
- FC_DBG("Received a RTV response, but in state %s\n",
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received a RTV response, but in state %s\n",
+ fc_rport_state(rport));
goto out;
}
@@ -811,8 +811,8 @@ static void fc_rport_enter_rtv(struct fc_rport *rport)
struct fc_rport_libfc_priv *rdata = rport->dd_data;
struct fc_lport *lport = rdata->local_port;
- FC_DEBUG_RPORT("Port (%6x) entered RTV state from %s state\n",
- rport->port_id, fc_rport_state(rport));
+ FC_LPORT_DBG("Port (%6x) entered RTV state from %s state\n",
+ rport->port_id, fc_rport_state(rport));
fc_rport_state_enter(rport, RPORT_ST_RTV);
@@ -842,8 +842,8 @@ static void fc_rport_enter_logo(struct fc_rport *rport)
struct fc_lport *lport = rdata->local_port;
struct fc_frame *fp;
- FC_DEBUG_RPORT("Port (%6x) entered LOGO state from %s state\n",
- rport->port_id, fc_rport_state(rport));
+ FC_LPORT_DBG("Port (%6x) entered LOGO state from %s state\n",
+ rport->port_id, fc_rport_state(rport));
fc_rport_state_enter(rport, RPORT_ST_LOGO);
@@ -950,14 +950,14 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
fh = fc_frame_header_get(fp);
- FC_DEBUG_RPORT("Received PLOGI request from port (%6x) "
- "while in state %s\n", ntoh24(fh->fh_s_id),
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received PLOGI request from port (%6x) "
+ "while in state %s\n", ntoh24(fh->fh_s_id),
+ fc_rport_state(rport));
sid = ntoh24(fh->fh_s_id);
pl = fc_frame_payload_get(fp, sizeof(*pl));
if (!pl) {
- FC_DBG("incoming PLOGI from %x too short\n", sid);
+ FC_LPORT_DBG("Incoming PLOGI from (%6x) too short\n", sid);
WARN_ON(1);
/* XXX TBD: send reject? */
fc_frame_free(fp);
@@ -979,26 +979,26 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
*/
switch (rdata->rp_state) {
case RPORT_ST_INIT:
- FC_DEBUG_RPORT("incoming PLOGI from %6x wwpn %llx state INIT "
- "- reject\n", sid, wwpn);
+ FC_LPORT_DBG("incoming PLOGI from %6x wwpn %llx state INIT "
+ "- reject\n", sid, wwpn);
reject = ELS_RJT_UNSUP;
break;
case RPORT_ST_PLOGI:
- FC_DEBUG_RPORT("incoming PLOGI from %x in PLOGI state %d\n",
- sid, rdata->rp_state);
+ FC_LPORT_DBG("incoming PLOGI from %x in PLOGI state %d\n",
+ sid, rdata->rp_state);
if (wwpn < lport->wwpn)
reject = ELS_RJT_INPROG;
break;
case RPORT_ST_PRLI:
case RPORT_ST_READY:
- FC_DEBUG_RPORT("incoming PLOGI from %x in logged-in state %d "
- "- ignored for now\n", sid, rdata->rp_state);
+ FC_LPORT_DBG("incoming PLOGI from %x in logged-in state %d "
+ "- ignored for now\n", sid, rdata->rp_state);
/* XXX TBD - should reset */
break;
case RPORT_ST_NONE:
default:
- FC_DEBUG_RPORT("incoming PLOGI from %x in unexpected "
- "state %d\n", sid, rdata->rp_state);
+ FC_LPORT_DBG("incoming PLOGI from %x in unexpected "
+ "state %d\n", sid, rdata->rp_state);
break;
}
@@ -1080,9 +1080,9 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport,
fh = fc_frame_header_get(rx_fp);
- FC_DEBUG_RPORT("Received PRLI request from port (%6x) "
- "while in state %s\n", ntoh24(fh->fh_s_id),
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received PRLI request from port (%6x) "
+ "while in state %s\n", ntoh24(fh->fh_s_id),
+ fc_rport_state(rport));
switch (rdata->rp_state) {
case RPORT_ST_PRLI:
@@ -1215,9 +1215,9 @@ static void fc_rport_recv_prlo_req(struct fc_rport *rport, struct fc_seq *sp,
fh = fc_frame_header_get(fp);
- FC_DEBUG_RPORT("Received PRLO request from port (%6x) "
- "while in state %s\n", ntoh24(fh->fh_s_id),
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received PRLO request from port (%6x) "
+ "while in state %s\n", ntoh24(fh->fh_s_id),
+ fc_rport_state(rport));
rjt_data.fp = NULL;
rjt_data.reason = ELS_RJT_UNAB;
@@ -1244,9 +1244,9 @@ static void fc_rport_recv_logo_req(struct fc_rport *rport, struct fc_seq *sp,
fh = fc_frame_header_get(fp);
- FC_DEBUG_RPORT("Received LOGO request from port (%6x) "
- "while in state %s\n", ntoh24(fh->fh_s_id),
- fc_rport_state(rport));
+ FC_LPORT_DBG("Received LOGO request from port (%6x) "
+ "while in state %s\n", ntoh24(fh->fh_s_id),
+ fc_rport_state(rport));
rdata->event = RPORT_EV_LOGO;
queue_work(rport_event_queue, &rdata->event_work);
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index 6300f55..a0ff61c 100644
--- a/include/scsi/fc_encode.h
+++ b/include/scsi/fc_encode.h
@@ -107,7 +107,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
break;
default:
- FC_DBG("Invalid op code %x \n", op);
return -EINVAL;
}
*r_ctl = FC_RCTL_DD_UNSOL_CTL;
@@ -298,7 +297,6 @@ static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport,
break;
default:
- FC_DBG("Invalid op code %x \n", op);
return -EINVAL;
}
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 01f68f6..a774e78 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -33,18 +33,6 @@
#include <scsi/fc_frame.h>
-#define LIBFC_DEBUG
-
-#ifdef LIBFC_DEBUG
-/* Log messages */
-#define FC_DBG(fmt, args...) \
- do { \
- printk(KERN_INFO "%s " fmt, __func__, ##args); \
- } while (0)
-#else
-#define FC_DBG(fmt, args...)
-#endif
-
#define FC_LPORT_LOGGING 0x01
#define FC_DISC_LOGGING 0x02
#define FC_RPORT_LOGGING 0x04
@@ -61,23 +49,23 @@ do { \
} while (0); \
} while (0)
-#define FC_DEBUG_LPORT(fmt, args...) \
+#define FC_LPORT_DBG(fmt, args...) \
FC_CHECK_LOGGING(FC_LPORT_LOGGING, \
printk(KERN_INFO "%s " fmt, __func__, ##args);)
-#define FC_DEBUG_DISC(fmt, args...) \
+#define FC_DISC_DBG(fmt, args...) \
FC_CHECK_LOGGING(FC_DISC_LOGGING, \
printk(KERN_INFO "%s " fmt, __func__, ##args);)
-#define FC_DEBUG_RPORT(fmt, args...) \
+#define FC_RPORT_DBG(fmt, args...) \
FC_CHECK_LOGGING(FC_RPORT_LOGGING, \
printk(KERN_INFO "%s " fmt, __func__, ##args);)
-#define FC_DEBUG_FCP(fmt, args...) \
+#define FC_FCP_DBG(fmt, args...) \
FC_CHECK_LOGGING(FC_FCP_LOGGING, \
printk(KERN_INFO "%s " fmt, __func__, ##args);)
-#define FC_DEBUG_EXCH(fmt, args...) \
+#define FC_EXCH_DBG(fmt, args...) \
FC_CHECK_LOGGING(FC_EXCH_LOGGING, \
printk(KERN_INFO "%s " fmt, __func__, ##args);)
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 11/17] libfc: Cleanup libfc_function_template comments
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (9 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 10/17] libfc: Logging review changes Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 12/17] libfc, fcoe: Fix kerneldoc comments Robert Love
` (6 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
Made the comments more like the comments for struct scsi_host_template.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
include/scsi/libfc.h | 107 +++++++++++++++++++++++++++++++-------------------
1 files changed, 66 insertions(+), 41 deletions(-)
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index a774e78..30056cd 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -361,31 +361,17 @@ struct fc_exch {
struct libfc_function_template {
- /**
- * Mandatory Fields
- *
- * These handlers must be implemented by the LLD.
- */
-
/*
* Interface to send a FC frame
- */
- int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
-
- /**
- * Optional Fields
*
- * The LLD may choose to implement any of the following handlers.
- * If LLD doesn't specify hander and leaves its pointer NULL then
- * the default libfc function will be used for that handler.
- */
-
- /**
- * ELS/CT interfaces
+ * STATUS: REQUIRED
*/
+ int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
/*
- * elsct_send - sends ELS/CT frame
+ * Interface to send ELS/CT frames
+ *
+ * STATUS: OPTIONAL
*/
struct fc_seq *(*elsct_send)(struct fc_lport *lport,
struct fc_rport *rport,
@@ -395,9 +381,6 @@ struct libfc_function_template {
struct fc_frame *fp,
void *arg),
void *arg, u32 timer_msec);
- /**
- * Exhance Manager interfaces
- */
/*
* Send the FC frame payload using a new exchange and sequence.
@@ -429,6 +412,8 @@ struct libfc_function_template {
* timer_msec argument is specified. The timer is canceled when
* it fires or when the exchange is done. The exchange timeout handler
* is registered by EM layer.
+ *
+ * STATUS: OPTIONAL
*/
struct fc_seq *(*exch_seq_send)(struct fc_lport *lp,
struct fc_frame *fp,
@@ -440,14 +425,18 @@ struct libfc_function_template {
void *arg, unsigned int timer_msec);
/*
- * send a frame using existing sequence and exchange.
+ * Send a frame using an existing sequence and exchange.
+ *
+ * STATUS: OPTIONAL
*/
int (*seq_send)(struct fc_lport *lp, struct fc_seq *sp,
struct fc_frame *fp);
/*
- * Send ELS response using mainly infomation
- * in exchange and sequence in EM layer.
+ * Send an ELS response using infomation from a previous
+ * exchange and sequence.
+ *
+ * STATUS: OPTIONAL
*/
void (*seq_els_rsp_send)(struct fc_seq *sp, enum fc_els_cmd els_cmd,
struct fc_seq_els_data *els_data);
@@ -459,6 +448,8 @@ struct libfc_function_template {
* A timer_msec can be specified for abort timeout, if non-zero
* timer_msec value is specified then exchange resp handler
* will be called with timeout error if no response to abort.
+ *
+ * STATUS: OPTIONAL
*/
int (*seq_exch_abort)(const struct fc_seq *req_sp,
unsigned int timer_msec);
@@ -466,6 +457,8 @@ struct libfc_function_template {
/*
* Indicate that an exchange/sequence tuple is complete and the memory
* allocated for the related objects may be freed.
+ *
+ * STATUS: OPTIONAL
*/
void (*exch_done)(struct fc_seq *sp);
@@ -473,6 +466,8 @@ struct libfc_function_template {
* Assigns a EM and a free XID for an new exchange and then
* allocates a new exchange and sequence pair.
* The fp can be used to determine free XID.
+ *
+ * STATUS: OPTIONAL
*/
struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp);
@@ -480,12 +475,16 @@ struct libfc_function_template {
* Release previously assigned XID by exch_get API.
* The LLD may implement this if XID is assigned by LLD
* in exch_get().
+ *
+ * STATUS: OPTIONAL
*/
void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp,
u16 ex_id);
/*
* Start a new sequence on the same exchange/sequence tuple.
+ *
+ * STATUS: OPTIONAL
*/
struct fc_seq *(*seq_start_next)(struct fc_seq *sp);
@@ -493,26 +492,33 @@ struct libfc_function_template {
* Reset an exchange manager, completing all sequences and exchanges.
* If s_id is non-zero, reset only exchanges originating from that FID.
* If d_id is non-zero, reset only exchanges sending to that FID.
+ *
+ * STATUS: OPTIONAL
*/
void (*exch_mgr_reset)(struct fc_lport *,
u32 s_id, u32 d_id);
- void (*rport_flush_queue)(void);
- /**
- * Local Port interfaces
+ /*
+ * Flush the rport work queue. Generally used before shutdown.
+ *
+ * STATUS: OPTIONAL
*/
+ void (*rport_flush_queue)(void);
/*
- * Receive a frame to a local port.
+ * Receive a frame for a local port.
+ *
+ * STATUS: OPTIONAL
*/
void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp,
struct fc_frame *fp);
- int (*lport_reset)(struct fc_lport *);
-
- /**
- * Remote Port interfaces
+ /*
+ * Reset the local port.
+ *
+ * STATUS: OPTIONAL
*/
+ int (*lport_reset)(struct fc_lport *);
/*
* Create a remote port
@@ -527,26 +533,33 @@ struct libfc_function_template {
* - PLOGI
* - PRLI
* - RTV
+ *
+ * STATUS: OPTIONAL
*/
int (*rport_login)(struct fc_rport *rport);
/*
* Logoff, and remove the rport from the transport if
* it had been added. This will send a LOGO to the target.
+ *
+ * STATUS: OPTIONAL
*/
int (*rport_logoff)(struct fc_rport *rport);
/*
* Recieve a request from a remote port.
+ *
+ * STATUS: OPTIONAL
*/
void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
struct fc_rport *);
- struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
-
- /**
- * FCP interfaces
+ /*
+ * lookup an rport by it's port ID.
+ *
+ * STATUS: OPTIONAL
*/
+ struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
/*
* Send a fcp cmd from fsp pkt.
@@ -554,30 +567,38 @@ struct libfc_function_template {
*
* The resp handler is called when FCP_RSP received.
*
+ * STATUS: OPTIONAL
*/
int (*fcp_cmd_send)(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
void (*resp)(struct fc_seq *, struct fc_frame *fp,
void *arg));
/*
- * Used at least durring linkdown and reset
+ * Cleanup the FCP layer, used durring link down and reset
+ *
+ * STATUS: OPTIONAL
*/
void (*fcp_cleanup)(struct fc_lport *lp);
/*
* Abort all I/O on a local port
+ *
+ * STATUS: OPTIONAL
*/
void (*fcp_abort_io)(struct fc_lport *lp);
- /**
- * Discovery interfaces
+ /*
+ * Receive a request for the discovery layer.
+ *
+ * STATUS: OPTIONAL
*/
-
void (*disc_recv_req)(struct fc_seq *,
struct fc_frame *, struct fc_lport *);
/*
* Start discovery for a local port.
+ *
+ * STATUS: OPTIONAL
*/
void (*disc_start)(void (*disc_callback)(struct fc_lport *,
enum fc_disc_event),
@@ -586,6 +607,8 @@ struct libfc_function_template {
/*
* Stop discovery for a given lport. This will remove
* all discovered rports
+ *
+ * STATUS: OPTIONAL
*/
void (*disc_stop) (struct fc_lport *);
@@ -593,6 +616,8 @@ struct libfc_function_template {
* Stop discovery for a given lport. This will block
* until all discovered rports are deleted from the
* FC transport class
+ *
+ * STATUS: OPTIONAL
*/
void (*disc_stop_final) (struct fc_lport *);
};
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 12/17] libfc, fcoe: Fix kerneldoc comments
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (10 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 11/17] libfc: Cleanup libfc_function_template comments Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:56 ` [PATCH 13/17] libfc, fcoe: Cleanup function formatting and minor typos Robert Love
` (5 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
1) Added '()' for function names in kerneldoc comments
2) Changed comment bookends from '**/' to '*/'. The comment on the the mailing list
was that '**/' "is consistently unconventional. Not wrong, just odd." The
Documentation/kernel-doc-nano-HOWTO.txt states that kerneldoc comment blocks
should end with '**/' but most (if not all) instance I found under drivers/scsi/
were only using the '*/' so I converted to that style.
3) Removed incorrect linebreaks in kerneldoc comments where found
4) Removed a few unnecessary blank comment lines in kerneldoc comment blocks
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/fc_transport_fcoe.c | 77 ++++++++--------
drivers/scsi/fcoe/fcoe_sw.c | 42 ++++-----
drivers/scsi/fcoe/libfcoe.c | 162 +++++++++++++++++----------------
drivers/scsi/libfc/fc_disc.c | 45 +++++----
drivers/scsi/libfc/fc_fcp.c | 46 +++++----
drivers/scsi/libfc/fc_lport.c | 77 ++++++++--------
drivers/scsi/libfc/fc_rport.c | 46 +++++----
include/scsi/libfc.h | 14 +--
8 files changed, 252 insertions(+), 257 deletions(-)
diff --git a/drivers/scsi/fcoe/fc_transport_fcoe.c b/drivers/scsi/fcoe/fc_transport_fcoe.c
index 9fd4acc..f48c0b0 100644
--- a/drivers/scsi/fcoe/fc_transport_fcoe.c
+++ b/drivers/scsi/fcoe/fc_transport_fcoe.c
@@ -35,19 +35,19 @@ static LIST_HEAD(fcoe_transports);
static DEFINE_MUTEX(fcoe_transports_lock);
/**
- * fcoe_transport_default - returns ptr to the default transport fcoe_sw
- **/
+ * fcoe_transport_default() - Returns ptr to the default transport fcoe_sw
+ */
struct fcoe_transport *fcoe_transport_default(void)
{
return &fcoe_sw_transport;
}
/**
- * fcoe_transport_to_pcidev - get the pci dev from a netdev
+ * fcoe_transport_to_pcidev() - get the pci dev from a netdev
* @netdev: the netdev that pci dev will be retrived from
*
* Returns: NULL or the corrsponding pci_dev
- **/
+ */
struct pci_dev *fcoe_transport_pcidev(const struct net_device *netdev)
{
if (!netdev->dev.parent)
@@ -56,16 +56,14 @@ struct pci_dev *fcoe_transport_pcidev(const struct net_device *netdev)
}
/**
- * fcoe_transport_device_lookup - find out netdev is managed by the
- * transport
- * assign a transport to a device
+ * fcoe_transport_device_lookup() - Lookup a transport
* @netdev: the netdev the transport to be attached to
*
* This will look for existing offload driver, if not found, it falls back to
* the default sw hba (fcoe_sw) as its fcoe transport.
*
* Returns: 0 for success
- **/
+ */
static struct fcoe_transport_internal *fcoe_transport_device_lookup(
struct fcoe_transport *t, struct net_device *netdev)
{
@@ -83,14 +81,14 @@ static struct fcoe_transport_internal *fcoe_transport_device_lookup(
return NULL;
}
/**
- * fcoe_transport_device_add - assign a transport to a device
+ * fcoe_transport_device_add() - Assign a transport to a device
* @netdev: the netdev the transport to be attached to
*
* This will look for existing offload driver, if not found, it falls back to
* the default sw hba (fcoe_sw) as its fcoe transport.
*
* Returns: 0 for success
- **/
+ */
static int fcoe_transport_device_add(struct fcoe_transport *t,
struct net_device *netdev)
{
@@ -123,14 +121,14 @@ static int fcoe_transport_device_add(struct fcoe_transport *t,
}
/**
- * fcoe_transport_device_remove - remove a device from its transport
+ * fcoe_transport_device_remove() - Remove a device from its transport
* @netdev: the netdev the transport to be attached to
*
- * this removes the device from the transport so the given transport will
+ * This removes the device from the transport so the given transport will
* not manage this device any more
*
* Returns: 0 for success
- **/
+ */
static int fcoe_transport_device_remove(struct fcoe_transport *t,
struct net_device *netdev)
{
@@ -153,13 +151,13 @@ static int fcoe_transport_device_remove(struct fcoe_transport *t,
}
/**
- * fcoe_transport_device_remove_all - remove all from transport devlist
+ * fcoe_transport_device_remove_all() - Remove all from transport devlist
*
- * this removes the device from the transport so the given transport will
+ * This removes the device from the transport so the given transport will
* not manage this device any more
*
* Returns: 0 for success
- **/
+ */
static void fcoe_transport_device_remove_all(struct fcoe_transport *t)
{
struct fcoe_transport_internal *ti, *tmp;
@@ -173,16 +171,16 @@ static void fcoe_transport_device_remove_all(struct fcoe_transport *t)
}
/**
- * fcoe_transport_match - use the bus device match function to match the hw
- * @t: the fcoe transport
- * @netdev:
+ * fcoe_transport_match() - Use the bus device match function to match the hw
+ * @t: The fcoe transport to check
+ * @netdev: The netdev to match against
*
- * This function is used to check if the givne transport wants to manage the
+ * This function is used to check if the given transport wants to manage the
* input netdev. if the transports implements the match function, it will be
* called, o.w. we just compare the pci vendor and device id.
*
* Returns: true for match up
- **/
+ */
static bool fcoe_transport_match(struct fcoe_transport *t,
struct net_device *netdev)
{
@@ -207,15 +205,15 @@ static bool fcoe_transport_match(struct fcoe_transport *t,
}
/**
- * fcoe_transport_lookup - check if the transport is already registered
+ * fcoe_transport_lookup() - Check if the transport is already registered
* @t: the transport to be looked up
*
* This compares the parent device (pci) vendor and device id
*
* Returns: NULL if not found
*
- * TODO - return default sw transport if no other transport is found
- **/
+ * TODO: return default sw transport if no other transport is found
+ */
static struct fcoe_transport *fcoe_transport_lookup(
struct net_device *netdev)
{
@@ -237,11 +235,11 @@ static struct fcoe_transport *fcoe_transport_lookup(
}
/**
- * fcoe_transport_register - adds a fcoe transport to the fcoe transports list
+ * fcoe_transport_register() - Adds a fcoe transport to the fcoe transports list
* @t: ptr to the fcoe transport to be added
*
* Returns: 0 for success
- **/
+ */
int fcoe_transport_register(struct fcoe_transport *t)
{
struct fcoe_transport *tt;
@@ -267,11 +265,11 @@ int fcoe_transport_register(struct fcoe_transport *t)
EXPORT_SYMBOL_GPL(fcoe_transport_register);
/**
- * fcoe_transport_unregister - remove the tranport fro the fcoe transports list
+ * fcoe_transport_unregister() - Remove the tranport fro the fcoe transports list
* @t: ptr to the fcoe transport to be removed
*
* Returns: 0 for success
- **/
+ */
int fcoe_transport_unregister(struct fcoe_transport *t)
{
struct fcoe_transport *tt, *tmp;
@@ -292,8 +290,8 @@ int fcoe_transport_unregister(struct fcoe_transport *t)
}
EXPORT_SYMBOL_GPL(fcoe_transport_unregister);
-/*
- * fcoe_load_transport_driver - load an offload driver by alias name
+/**
+ * fcoe_load_transport_driver() - Load an offload driver by alias name
* @netdev: the target net device
*
* Requests for an offload driver module as the fcoe transport, if fails, it
@@ -305,7 +303,7 @@ EXPORT_SYMBOL_GPL(fcoe_transport_unregister);
* 3. pure hw fcoe hba may not have netdev
*
* Returns: 0 for success
- **/
+ */
int fcoe_load_transport_driver(struct net_device *netdev)
{
struct pci_dev *pci;
@@ -334,14 +332,14 @@ int fcoe_load_transport_driver(struct net_device *netdev)
EXPORT_SYMBOL_GPL(fcoe_load_transport_driver);
/**
- * fcoe_transport_attach - load transport to fcoe
+ * fcoe_transport_attach() - Load transport to fcoe
* @netdev: the netdev the transport to be attached to
*
* This will look for existing offload driver, if not found, it falls back to
* the default sw hba (fcoe_sw) as its fcoe transport.
*
* Returns: 0 for success
- **/
+ */
int fcoe_transport_attach(struct net_device *netdev)
{
struct fcoe_transport *t;
@@ -370,11 +368,11 @@ int fcoe_transport_attach(struct net_device *netdev)
EXPORT_SYMBOL_GPL(fcoe_transport_attach);
/**
- * fcoe_transport_release - unload transport from fcoe
+ * fcoe_transport_release() - Unload transport from fcoe
* @netdev: the net device on which fcoe is to be released
*
* Returns: 0 for success
- **/
+ */
int fcoe_transport_release(struct net_device *netdev)
{
struct fcoe_transport *t;
@@ -403,12 +401,12 @@ int fcoe_transport_release(struct net_device *netdev)
EXPORT_SYMBOL_GPL(fcoe_transport_release);
/**
- * fcoe_transport_init - initializes fcoe transport layer
+ * fcoe_transport_init() - Initializes fcoe transport layer
*
* This prepares for the fcoe transport layer
*
* Returns: none
- **/
+ */
int __init fcoe_transport_init(void)
{
INIT_LIST_HEAD(&fcoe_transports);
@@ -417,12 +415,13 @@ int __init fcoe_transport_init(void)
}
/**
- * fcoe_transport_exit - cleans up the fcoe transport layer
+ * fcoe_transport_exit() - Cleans up the fcoe transport layer
+ *
* This cleans up the fcoe transport layer. removing any transport on the list,
* note that the transport destroy func is not called here.
*
* Returns: none
- **/
+ */
int __exit fcoe_transport_exit(void)
{
struct fcoe_transport *t, *tmp;
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index 769e6a8..b5b2abf 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -106,13 +106,12 @@ static struct scsi_host_template fcoe_sw_shost_template = {
.max_sectors = 0xffff,
};
-/*
- * fcoe_sw_lport_config - sets up the fc_lport
+/**
+ * fcoe_sw_lport_config() - sets up the fc_lport
* @lp: ptr to the fc_lport
* @shost: ptr to the parent scsi host
*
* Returns: 0 for success
- *
*/
static int fcoe_sw_lport_config(struct fc_lport *lp)
{
@@ -139,16 +138,14 @@ static int fcoe_sw_lport_config(struct fc_lport *lp)
return 0;
}
-/*
- * fcoe_sw_netdev_config - sets up fcoe_softc for lport and network
- * related properties
+/**
+ * fcoe_sw_netdev_config() - Set up netdev for SW FCoE
* @lp : ptr to the fc_lport
* @netdev : ptr to the associated netdevice struct
*
* Must be called after fcoe_sw_lport_config() as it will use lport mutex
*
* Returns : 0 for success
- *
*/
static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
{
@@ -226,16 +223,15 @@ static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
return 0;
}
-/*
- * fcoe_sw_shost_config - sets up fc_lport->host
+/**
+ * fcoe_sw_shost_config() - Sets up fc_lport->host
* @lp : ptr to the fc_lport
* @shost : ptr to the associated scsi host
* @dev : device associated to scsi host
*
- * Must be called after fcoe_sw_lport_config) and fcoe_sw_netdev_config()
+ * Must be called after fcoe_sw_lport_config() and fcoe_sw_netdev_config()
*
* Returns : 0 for success
- *
*/
static int fcoe_sw_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
struct device *dev)
@@ -263,8 +259,8 @@ static int fcoe_sw_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
return 0;
}
-/*
- * fcoe_sw_em_config - allocates em for this lport
+/**
+ * fcoe_sw_em_config() - allocates em for this lport
* @lp: the port that em is to allocated for
*
* Returns : 0 on success
@@ -281,8 +277,8 @@ static inline int fcoe_sw_em_config(struct fc_lport *lp)
return 0;
}
-/*
- * fcoe_sw_destroy - FCoE software HBA tear-down function
+/**
+ * fcoe_sw_destroy() - FCoE software HBA tear-down function
* @netdev: ptr to the associated net_device
*
* Returns: 0 if link is OK for use by FCoE.
@@ -354,8 +350,8 @@ static struct libfc_function_template fcoe_sw_libfc_fcn_templ = {
.frame_send = fcoe_xmit,
};
-/*
- * fcoe_sw_create - this function creates the fcoe interface
+/**
+ * fcoe_sw_create() - this function creates the fcoe interface
* @netdev: pointer the associated netdevice
*
* Creates fc_lport struct and scsi_host for lport, configures lport
@@ -441,8 +437,8 @@ out_host_put:
return rc;
}
-/*
- * fcoe_sw_match - the fcoe sw transport match function
+/**
+ * fcoe_sw_match() - The FCoE SW transport match function
*
* Returns : false always
*/
@@ -462,8 +458,8 @@ struct fcoe_transport fcoe_sw_transport = {
.device = 0xffff,
};
-/*
- * fcoe_sw_init - registers fcoe_sw_transport
+/**
+ * fcoe_sw_init() - Registers fcoe_sw_transport
*
* Returns : 0 on success
*/
@@ -481,8 +477,8 @@ int __init fcoe_sw_init(void)
return 0;
}
-/*
- * fcoe_sw_exit - unregisters fcoe_sw_transport
+/**
+ * fcoe_sw_exit() - Unregisters fcoe_sw_transport
*
* Returns : 0 on success
*/
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 9efe1bf..60677a8 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -94,13 +94,13 @@ static struct notifier_block fcoe_cpu_notifier = {
};
/**
- * fcoe_create_percpu_data - creates the associated cpu data
+ * fcoe_create_percpu_data() - creates the associated cpu data
* @cpu: index for the cpu where fcoe cpu data will be created
*
* create percpu stats block, from cpu add notifier
*
* Returns: none
- **/
+ */
static void fcoe_create_percpu_data(int cpu)
{
struct fc_lport *lp;
@@ -118,13 +118,13 @@ static void fcoe_create_percpu_data(int cpu)
}
/**
- * fcoe_destroy_percpu_data - destroys the associated cpu data
+ * fcoe_destroy_percpu_data() - destroys the associated cpu data
* @cpu: index for the cpu where fcoe cpu data will destroyed
*
* destroy percpu stats block called by cpu add/remove notifier
*
* Retuns: none
- **/
+ */
static void fcoe_destroy_percpu_data(int cpu)
{
struct fc_lport *lp;
@@ -140,7 +140,7 @@ static void fcoe_destroy_percpu_data(int cpu)
}
/**
- * fcoe_cpu_callback - fcoe cpu hotplug event callback
+ * fcoe_cpu_callback() - fcoe cpu hotplug event callback
* @nfb: callback data block
* @action: event triggering the callback
* @hcpu: index for the cpu of this event
@@ -148,7 +148,7 @@ static void fcoe_destroy_percpu_data(int cpu)
* this creates or destroys per cpu data for fcoe
*
* Returns NOTIFY_OK always.
- **/
+ */
static int fcoe_cpu_callback(struct notifier_block *nfb, unsigned long action,
void *hcpu)
{
@@ -169,7 +169,7 @@ static int fcoe_cpu_callback(struct notifier_block *nfb, unsigned long action,
#endif /* CONFIG_HOTPLUG_CPU */
/**
- * fcoe_rcv - this is the fcoe receive function called by NET_RX_SOFTIRQ
+ * fcoe_rcv() - this is the fcoe receive function called by NET_RX_SOFTIRQ
* @skb: the receive skb
* @dev: associated net device
* @ptype: context
@@ -178,7 +178,7 @@ static int fcoe_cpu_callback(struct notifier_block *nfb, unsigned long action,
* this function will receive the packet and build fc frame and pass it up
*
* Returns: 0 for success
- **/
+ */
int fcoe_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype, struct net_device *olddev)
{
@@ -265,11 +265,11 @@ err2:
EXPORT_SYMBOL_GPL(fcoe_rcv);
/**
- * fcoe_start_io - pass to netdev to start xmit for fcoe
+ * fcoe_start_io() - pass to netdev to start xmit for fcoe
* @skb: the skb to be xmitted
*
* Returns: 0 for success
- **/
+ */
static inline int fcoe_start_io(struct sk_buff *skb)
{
int rc;
@@ -283,12 +283,12 @@ static inline int fcoe_start_io(struct sk_buff *skb)
}
/**
- * fcoe_get_paged_crc_eof - in case we need alloc a page for crc_eof
+ * fcoe_get_paged_crc_eof() - in case we need alloc a page for crc_eof
* @skb: the skb to be xmitted
* @tlen: total len
*
* Returns: 0 for success
- **/
+ */
static int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen)
{
struct fcoe_percpu_s *fps;
@@ -326,13 +326,12 @@ static int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen)
}
/**
- * fcoe_fc_crc - calculates FC CRC in this fcoe skb
+ * fcoe_fc_crc() - calculates FC CRC in this fcoe skb
* @fp: the fc_frame containg data to be checksummed
*
* This uses crc32() to calculate the crc for fc frame
* Return : 32 bit crc
- *
- **/
+ */
u32 fcoe_fc_crc(struct fc_frame *fp)
{
struct sk_buff *skb = fp_skb(fp);
@@ -363,13 +362,12 @@ u32 fcoe_fc_crc(struct fc_frame *fp)
EXPORT_SYMBOL_GPL(fcoe_fc_crc);
/**
- * fcoe_xmit - FCoE frame transmit function
+ * fcoe_xmit() - FCoE frame transmit function
* @lp: the associated local port
* @fp: the fc_frame to be transmitted
*
* Return : 0 for success
- *
- **/
+ */
int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
{
int wlen, rc = 0;
@@ -511,12 +509,11 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
}
EXPORT_SYMBOL_GPL(fcoe_xmit);
-/*
- * fcoe_percpu_receive_thread - recv thread per cpu
+/**
+ * fcoe_percpu_receive_thread() - recv thread per cpu
* @arg: ptr to the fcoe per cpu struct
*
* Return: 0 for success
- *
*/
int fcoe_percpu_receive_thread(void *arg)
{
@@ -660,7 +657,7 @@ int fcoe_percpu_receive_thread(void *arg)
}
/**
- * fcoe_recv_flogi - flogi receive function
+ * fcoe_recv_flogi() - flogi receive function
* @fc: associated fcoe_softc
* @fp: the recieved frame
* @sa: the source address of this flogi
@@ -669,7 +666,7 @@ int fcoe_percpu_receive_thread(void *arg)
* mac address for the initiator, eitehr OUI based or GW based.
*
* Returns: none
- **/
+ */
static void fcoe_recv_flogi(struct fcoe_softc *fc, struct fc_frame *fp, u8 *sa)
{
struct fc_frame_header *fh;
@@ -717,7 +714,7 @@ static void fcoe_recv_flogi(struct fcoe_softc *fc, struct fc_frame *fp, u8 *sa)
}
/**
- * fcoe_watchdog - fcoe timer callback
+ * fcoe_watchdog() - fcoe timer callback
* @vp:
*
* This checks the pending queue length for fcoe and set lport qfull
@@ -725,7 +722,7 @@ static void fcoe_recv_flogi(struct fcoe_softc *fc, struct fc_frame *fp, u8 *sa)
* fcoe_hostlist.
*
* Returns: 0 for success
- **/
+ */
void fcoe_watchdog(ulong vp)
{
struct fc_lport *lp;
@@ -752,7 +749,7 @@ void fcoe_watchdog(ulong vp)
/**
- * fcoe_check_wait_queue - put the skb into fcoe pending xmit queue
+ * fcoe_check_wait_queue() - put the skb into fcoe pending xmit queue
* @lp: the fc_port for this skb
* @skb: the associated skb to be xmitted
*
@@ -766,7 +763,7 @@ void fcoe_watchdog(ulong vp)
* by the next skb transmit.
*
* Returns: 0 for success
- **/
+ */
static int fcoe_check_wait_queue(struct fc_lport *lp)
{
int rc;
@@ -799,12 +796,12 @@ static int fcoe_check_wait_queue(struct fc_lport *lp)
}
/**
- * fcoe_insert_wait_queue_head - puts skb to fcoe pending queue head
+ * fcoe_insert_wait_queue_head() - puts skb to fcoe pending queue head
* @lp: the fc_port for this skb
* @skb: the associated skb to be xmitted
*
* Returns: none
- **/
+ */
static void fcoe_insert_wait_queue_head(struct fc_lport *lp,
struct sk_buff *skb)
{
@@ -817,12 +814,12 @@ static void fcoe_insert_wait_queue_head(struct fc_lport *lp,
}
/**
- * fcoe_insert_wait_queue - put the skb into fcoe pending queue tail
+ * fcoe_insert_wait_queue() - put the skb into fcoe pending queue tail
* @lp: the fc_port for this skb
* @skb: the associated skb to be xmitted
*
* Returns: none
- **/
+ */
static void fcoe_insert_wait_queue(struct fc_lport *lp,
struct sk_buff *skb)
{
@@ -835,10 +832,9 @@ static void fcoe_insert_wait_queue(struct fc_lport *lp,
}
/**
- * fcoe_dev_setup - setup link change notification interface
- *
- **/
-static void fcoe_dev_setup(void)
+ * fcoe_dev_setup() - setup link change notification interface
+ */
+static void fcoe_dev_setup()
{
/*
* here setup a interface specific wd time to
@@ -848,15 +844,15 @@ static void fcoe_dev_setup(void)
}
/**
- * fcoe_dev_setup - cleanup link change notification interface
- **/
+ * fcoe_dev_setup() - cleanup link change notification interface
+ */
static void fcoe_dev_cleanup(void)
{
unregister_netdevice_notifier(&fcoe_notifier);
}
/**
- * fcoe_device_notification - netdev event notification callback
+ * fcoe_device_notification() - netdev event notification callback
* @notifier: context of the notification
* @event: type of event
* @ptr: fixed array for output parsed ifname
@@ -864,7 +860,7 @@ static void fcoe_dev_cleanup(void)
* This function is called by the ethernet driver in case of link change event
*
* Returns: 0 for success
- **/
+ */
static int fcoe_device_notification(struct notifier_block *notifier,
ulong event, void *ptr)
{
@@ -928,12 +924,12 @@ out:
}
/**
- * fcoe_if_to_netdev - parse a name buffer to get netdev
+ * fcoe_if_to_netdev() - parse a name buffer to get netdev
* @ifname: fixed array for output parsed ifname
* @buffer: incoming buffer to be copied
*
* Returns: NULL or ptr to netdeive
- **/
+ */
static struct net_device *fcoe_if_to_netdev(const char *buffer)
{
char *cp;
@@ -950,11 +946,11 @@ static struct net_device *fcoe_if_to_netdev(const char *buffer)
}
/**
- * fcoe_netdev_to_module_owner - finds out the nic drive moddule of the netdev
+ * fcoe_netdev_to_module_owner() - finds out the nic drive moddule of the netdev
* @netdev: the target netdev
*
* Returns: ptr to the struct module, NULL for failure
- **/
+ */
static struct module *fcoe_netdev_to_module_owner(
const struct net_device *netdev)
{
@@ -974,12 +970,14 @@ static struct module *fcoe_netdev_to_module_owner(
}
/**
- * fcoe_ethdrv_get - holds the nic driver module by try_module_get() for
- * the corresponding netdev.
+ * fcoe_ethdrv_get() - Hold the Ethernet driver
* @netdev: the target netdev
*
+ * Holds the Ethernet driver module by try_module_get() for
+ * the corresponding netdev.
+ *
* Returns: 0 for succsss
- **/
+ */
static int fcoe_ethdrv_get(const struct net_device *netdev)
{
struct module *owner;
@@ -994,12 +992,14 @@ static int fcoe_ethdrv_get(const struct net_device *netdev)
}
/**
- * fcoe_ethdrv_get - releases the nic driver module by module_put for
- * the corresponding netdev.
+ * fcoe_ethdrv_put() - Release the Ethernet driver
* @netdev: the target netdev
*
+ * Releases the Ethernet driver module by module_put for
+ * the corresponding netdev.
+ *
* Returns: 0 for succsss
- **/
+ */
static int fcoe_ethdrv_put(const struct net_device *netdev)
{
struct module *owner;
@@ -1015,12 +1015,12 @@ static int fcoe_ethdrv_put(const struct net_device *netdev)
}
/**
- * fcoe_destroy- handles the destroy from sysfs
+ * fcoe_destroy() - handles the destroy from sysfs
* @buffer: expcted to be a eth if name
* @kp: associated kernel param
*
* Returns: 0 for success
- **/
+ */
static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
{
int rc;
@@ -1053,12 +1053,12 @@ out_nodev:
}
/**
- * fcoe_create - handles the create call from sysfs
+ * fcoe_create() - Handles the create call from sysfs
* @buffer: expcted to be a eth if name
* @kp: associated kernel param
*
* Returns: 0 for success
- **/
+ */
static int fcoe_create(const char *buffer, struct kernel_param *kp)
{
int rc;
@@ -1099,8 +1099,8 @@ module_param_call(destroy, fcoe_destroy, NULL, NULL, S_IWUSR);
__MODULE_PARM_TYPE(destroy, "string");
MODULE_PARM_DESC(destroy, "Destroy fcoe port");
-/*
- * fcoe_link_ok - check if link is ok for the fc_lport
+/**
+ * fcoe_link_ok() - Check if link is ok for the fc_lport
* @lp: ptr to the fc_lport
*
* Any permanently-disqualifying conditions have been previously checked.
@@ -1144,9 +1144,8 @@ int fcoe_link_ok(struct fc_lport *lp)
}
EXPORT_SYMBOL_GPL(fcoe_link_ok);
-/*
- * fcoe_percpu_clean - frees skb of the corresponding lport from the per
- * cpu queue.
+/**
+ * fcoe_percpu_clean() - Clear the pending skbs for an lport
* @lp: the fc_lport
*/
void fcoe_percpu_clean(struct fc_lport *lp)
@@ -1180,11 +1179,11 @@ void fcoe_percpu_clean(struct fc_lport *lp)
EXPORT_SYMBOL_GPL(fcoe_percpu_clean);
/**
- * fcoe_clean_pending_queue - dequeue skb and free it
+ * fcoe_clean_pending_queue() - Dequeue a skb and free it
* @lp: the corresponding fc_lport
*
* Returns: none
- **/
+ */
void fcoe_clean_pending_queue(struct fc_lport *lp)
{
struct fcoe_softc *fc = lport_priv(lp);
@@ -1201,12 +1200,12 @@ void fcoe_clean_pending_queue(struct fc_lport *lp)
EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue);
/**
- * libfc_host_alloc - allocate a Scsi_Host with room for the fc_lport
+ * libfc_host_alloc() - Allocate a Scsi_Host with room for the fc_lport
* @sht: ptr to the scsi host templ
* @priv_size: size of private data after fc_lport
*
* Returns: ptr to Scsi_Host
- * TODO - to libfc?
+ * TODO: to libfc?
*/
static inline struct Scsi_Host *libfc_host_alloc(
struct scsi_host_template *sht, int priv_size)
@@ -1215,7 +1214,7 @@ static inline struct Scsi_Host *libfc_host_alloc(
}
/**
- * fcoe_host_alloc - allocate a Scsi_Host with room for the fcoe_softc
+ * fcoe_host_alloc() - Allocate a Scsi_Host with room for the fcoe_softc
* @sht: ptr to the scsi host templ
* @priv_size: size of private data after fc_lport
*
@@ -1227,8 +1226,8 @@ struct Scsi_Host *fcoe_host_alloc(struct scsi_host_template *sht, int priv_size)
}
EXPORT_SYMBOL_GPL(fcoe_host_alloc);
-/*
- * fcoe_reset - resets the fcoe
+/**
+ * fcoe_reset() - Resets the fcoe
* @shost: shost the reset is from
*
* Returns: always 0
@@ -1241,8 +1240,8 @@ int fcoe_reset(struct Scsi_Host *shost)
}
EXPORT_SYMBOL_GPL(fcoe_reset);
-/*
- * fcoe_wwn_from_mac - converts 48-bit IEEE MAC address to 64-bit FC WWN.
+/**
+ * fcoe_wwn_from_mac() - Converts 48-bit IEEE MAC address to 64-bit FC WWN.
* @mac: mac address
* @scheme: check port
* @port: port indicator for converting
@@ -1281,8 +1280,9 @@ u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN],
return wwn;
}
EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac);
-/*
- * fcoe_hostlist_lookup_softc - find the corresponding lport by a given device
+
+/**
+ * fcoe_hostlist_lookup_softc() - find the corresponding lport by a given device
* @device: this is currently ptr to net_device
*
* Returns: NULL or the located fcoe_softc
@@ -1303,8 +1303,8 @@ static struct fcoe_softc *fcoe_hostlist_lookup_softc(
return NULL;
}
-/*
- * fcoe_hostlist_lookup - find the corresponding lport by netdev
+/**
+ * fcoe_hostlist_lookup() - Find the corresponding lport by netdev
* @netdev: ptr to net_device
*
* Returns: 0 for success
@@ -1319,8 +1319,8 @@ struct fc_lport *fcoe_hostlist_lookup(const struct net_device *netdev)
}
EXPORT_SYMBOL_GPL(fcoe_hostlist_lookup);
-/*
- * fcoe_hostlist_add - add a lport to lports list
+/**
+ * fcoe_hostlist_add() - Add a lport to lports list
* @lp: ptr to the fc_lport to badded
*
* Returns: 0 for success
@@ -1340,8 +1340,8 @@ int fcoe_hostlist_add(const struct fc_lport *lp)
}
EXPORT_SYMBOL_GPL(fcoe_hostlist_add);
-/*
- * fcoe_hostlist_remove - remove a lport from lports list
+/**
+ * fcoe_hostlist_remove() - remove a lport from lports list
* @lp: ptr to the fc_lport to badded
*
* Returns: 0 for success
@@ -1361,12 +1361,12 @@ int fcoe_hostlist_remove(const struct fc_lport *lp)
EXPORT_SYMBOL_GPL(fcoe_hostlist_remove);
/**
- * fcoe_libfc_config - sets up libfc related properties for lport
+ * fcoe_libfc_config() - sets up libfc related properties for lport
* @lp: ptr to the fc_lport
* @tt: libfc function template
*
* Returns : 0 for success
- **/
+ */
int fcoe_libfc_config(struct fc_lport *lp, struct libfc_function_template *tt)
{
/* Set the function pointers set by the LLDD */
@@ -1384,14 +1384,14 @@ int fcoe_libfc_config(struct fc_lport *lp, struct libfc_function_template *tt)
EXPORT_SYMBOL_GPL(fcoe_libfc_config);
/**
- * fcoe_init - fcoe module loading initialization
+ * fcoe_init() - fcoe module loading initialization
*
* Initialization routine
* 1. Will create fc transport software structure
* 2. initialize the link list of port information structure
*
* Returns 0 on success, negative on failure
- **/
+ */
static int __init fcoe_init(void)
{
int cpu;
@@ -1454,10 +1454,10 @@ static int __init fcoe_init(void)
module_init(fcoe_init);
/**
- * fcoe_exit - fcoe module unloading cleanup
+ * fcoe_exit() - fcoe module unloading cleanup
*
* Returns 0 on success, negative on failure
- **/
+ */
static void __exit fcoe_exit(void)
{
u32 idx;
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index f37ce94..dcf9301 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -56,7 +56,7 @@ static void fc_disc_single(struct fc_disc *, struct fc_disc_port *);
static void fc_disc_restart(struct fc_disc *);
/**
- * fc_disc_lookup_rport - lookup a remote port by port_id
+ * fc_disc_lookup_rport() - lookup a remote port by port_id
* @lport: Fibre Channel host port instance
* @port_id: remote port port_id to match
*/
@@ -84,7 +84,7 @@ struct fc_rport *fc_disc_lookup_rport(const struct fc_lport *lport,
}
/**
- * fc_disc_stop_rports - delete all the remote ports associated with the lport
+ * fc_disc_stop_rports() - delete all the remote ports associated with the lport
* @disc: The discovery job to stop rports on
*
* Locking Note: This function expects that the lport mutex is locked before
@@ -109,7 +109,7 @@ void fc_disc_stop_rports(struct fc_disc *disc)
}
/**
- * fc_disc_rport_callback - Event handler for rport events
+ * fc_disc_rport_callback() - Event handler for rport events
* @lport: The lport which is receiving the event
* @rport: The rport which the event has occured on
* @event: The event that occured
@@ -143,7 +143,7 @@ static void fc_disc_rport_callback(struct fc_lport *lport,
}
/**
- * fc_disc_recv_rscn_req - Handle Registered State Change Notification (RSCN)
+ * fc_disc_recv_rscn_req() - Handle Registered State Change Notification (RSCN)
* @sp: Current sequence of the RSCN exchange
* @fp: RSCN Frame
* @lport: Fibre Channel host port instance
@@ -257,7 +257,7 @@ reject:
}
/**
- * fc_disc_recv_req - Handle incoming requests
+ * fc_disc_recv_req() - Handle incoming requests
* @sp: Current sequence of the request exchange
* @fp: The frame
* @lport: The FC local port
@@ -287,7 +287,7 @@ static void fc_disc_recv_req(struct fc_seq *sp, struct fc_frame *fp,
}
/**
- * fc_disc_restart - Restart discovery
+ * fc_disc_restart() - Restart discovery
* @lport: FC discovery context
*
* Locking Note: This function expects that the disc mutex
@@ -314,7 +314,7 @@ static void fc_disc_restart(struct fc_disc *disc)
}
/**
- * fc_disc_start - Fibre Channel Target discovery
+ * fc_disc_start() - Fibre Channel Target discovery
* @lport: FC local port
*
* Returns non-zero if discovery cannot be started.
@@ -375,7 +375,7 @@ static struct fc_rport_operations fc_disc_rport_ops = {
};
/**
- * fc_disc_new_target - Handle new target found by discovery
+ * fc_disc_new_target() - Handle new target found by discovery
* @lport: FC local port
* @rport: The previous FC remote port (NULL if new remote port)
* @ids: Identifiers for the new FC remote port
@@ -438,7 +438,7 @@ static int fc_disc_new_target(struct fc_disc *disc,
}
/**
- * fc_disc_del_target - Delete a target
+ * fc_disc_del_target() - Delete a target
* @disc: FC discovery context
* @rport: The remote port to be removed
*/
@@ -451,7 +451,7 @@ static void fc_disc_del_target(struct fc_disc *disc, struct fc_rport *rport)
}
/**
- * fc_disc_done - Discovery has been completed
+ * fc_disc_done() - Discovery has been completed
* @disc: FC discovery context
*/
static void fc_disc_done(struct fc_disc *disc)
@@ -471,7 +471,7 @@ static void fc_disc_done(struct fc_disc *disc)
}
/**
- * fc_disc_error - Handle error on dNS request
+ * fc_disc_error() - Handle error on dNS request
* @disc: FC discovery context
* @fp: The frame pointer
*/
@@ -510,7 +510,7 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
}
/**
- * fc_disc_gpn_ft_req - Send Get Port Names by FC-4 type (GPN_FT) request
+ * fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request
* @lport: FC discovery context
*
* Locking Note: This function expects that the disc_mutex is locked
@@ -544,7 +544,7 @@ err:
}
/**
- * fc_disc_gpn_ft_parse - Parse the list of IDs and names resulting from a request
+ * fc_disc_gpn_ft_parse() - Parse the list of IDs and names resulting from a request
* @lport: Fibre Channel host port instance
* @buf: GPN_FT response buffer
* @len: size of response buffer
@@ -649,7 +649,10 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
return error;
}
-/*
+/**
+ * fc_disc_timeout() - Retry handler for the disc component
+ * @work: Structure holding disc obj that needs retry discovery
+ *
* Handle retry of memory allocation for remote ports.
*/
static void fc_disc_timeout(struct work_struct *work)
@@ -664,7 +667,7 @@ static void fc_disc_timeout(struct work_struct *work)
}
/**
- * fc_disc_gpn_ft_resp - Handle a response frame from Get Port Names (GPN_FT)
+ * fc_disc_gpn_ft_resp() - Handle a response frame from Get Port Names (GPN_FT)
* @sp: Current sequence of GPN_FT exchange
* @fp: response frame
* @lp_arg: Fibre Channel host port instance
@@ -703,9 +706,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
fr_len(fp));
} else if (ntohs(cp->ct_cmd) == FC_FS_ACC) {
- /*
- * Accepted. Parse response.
- */
+ /* Accepted, parse the response. */
buf = cp + 1;
len -= sizeof(*cp);
} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
@@ -737,7 +738,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
}
/**
- * fc_disc_single - Discover the directory information for a single target
+ * fc_disc_single() - Discover the directory information for a single target
* @lport: FC local port
* @dp: The port to rediscover
*
@@ -773,7 +774,7 @@ out:
}
/**
- * fc_disc_stop - Stop discovery for a given lport
+ * fc_disc_stop() - Stop discovery for a given lport
* @lport: The lport that discovery should stop for
*/
void fc_disc_stop(struct fc_lport *lport)
@@ -787,7 +788,7 @@ void fc_disc_stop(struct fc_lport *lport)
}
/**
- * fc_disc_stop_final - Stop discovery for a given lport
+ * fc_disc_stop_final() - Stop discovery for a given lport
* @lport: The lport that discovery should stop for
*
* This function will block until discovery has been
@@ -800,7 +801,7 @@ void fc_disc_stop_final(struct fc_lport *lport)
}
/**
- * fc_disc_init - Initialize the discovery block
+ * fc_disc_init() - Initialize the discovery block
* @lport: FC local port
*/
int fc_disc_init(struct fc_lport *lport)
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 0d75b23..22e29d1 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -157,7 +157,7 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lp, gfp_t gfp)
}
/**
- * fc_fcp_pkt_release - release hold on scsi_pkt packet
+ * fc_fcp_pkt_release() - release hold on scsi_pkt packet
* @fsp: fcp packet struct
*
* This is used by upper layer scsi driver.
@@ -179,8 +179,7 @@ static void fc_fcp_pkt_hold(struct fc_fcp_pkt *fsp)
}
/**
- * fc_fcp_pkt_destory - release hold on scsi_pkt packet
- *
+ * fc_fcp_pkt_destory() - release hold on scsi_pkt packet
* @seq: exchange sequence
* @fsp: fcp packet struct
*
@@ -195,7 +194,7 @@ static void fc_fcp_pkt_destroy(struct fc_seq *seq, void *fsp)
}
/**
- * fc_fcp_lock_pkt - lock a packet and get a ref to it.
+ * fc_fcp_lock_pkt() - lock a packet and get a ref to it.
* @fsp: fcp packet
*
* We should only return error if we return a command to scsi-ml before
@@ -287,9 +286,7 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
buf = fc_frame_payload_get(fp, 0);
if (offset + len > fsp->data_len) {
- /*
- * this should never happen
- */
+ /* this should never happen */
if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) &&
fc_frame_crc_check(fp))
goto crc_err;
@@ -383,8 +380,8 @@ crc_err:
fc_fcp_complete_locked(fsp);
}
-/*
- * fc_fcp_send_data - Send SCSI data to target.
+/**
+ * fc_fcp_send_data() - Send SCSI data to target.
* @fsp: ptr to fc_fcp_pkt
* @sp: ptr to this sequence
* @offset: starting offset for this data request
@@ -606,8 +603,8 @@ static void fc_fcp_abts_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
}
}
-/*
- * fc_fcp_reduce_can_queue - drop can_queue
+/**
+ * fc_fcp_reduce_can_queue() - drop can_queue
* @lp: lport to drop queueing for
*
* If we are getting memory allocation failures, then we may
@@ -638,9 +635,11 @@ done:
spin_unlock_irqrestore(lp->host->host_lock, flags);
}
-/*
- * exch mgr calls this routine to process scsi
- * exchanges.
+/**
+ * fc_fcp_recv() - Reveive FCP frames
+ * @seq: The sequence the frame is on
+ * @fp: The FC frame
+ * @arg: The related FCP packet
*
* Return : None
* Context : called from Soft IRQ context
@@ -828,7 +827,7 @@ err:
}
/**
- * fc_fcp_complete_locked - complete processing of a fcp packet
+ * fc_fcp_complete_locked() - complete processing of a fcp packet
* @fsp: fcp packet
*
* This function may sleep if a timer is pending. The packet lock must be
@@ -896,7 +895,7 @@ static void fc_fcp_cleanup_cmd(struct fc_fcp_pkt *fsp, int error)
}
/**
- * fc_fcp_cleanup_each_cmd - run fn on each active command
+ * fc_fcp_cleanup_each_cmd() - Cleanup active commads
* @lp: logical port
* @id: target id
* @lun: lun
@@ -948,7 +947,7 @@ static void fc_fcp_abort_io(struct fc_lport *lp)
}
/**
- * fc_fcp_pkt_send - send a fcp packet to the lower level.
+ * fc_fcp_pkt_send() - send a fcp packet to the lower level.
* @lp: fc lport
* @fsp: fc packet.
*
@@ -1721,7 +1720,7 @@ out:
EXPORT_SYMBOL(fc_queuecommand);
/**
- * fc_io_compl - Handle responses for completed commands
+ * fc_io_compl() - Handle responses for completed commands
* @fsp: scsi packet
*
* Translates a error to a Linux SCSI error.
@@ -1851,7 +1850,7 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
}
/**
- * fc_fcp_complete - complete processing of a fcp packet
+ * fc_fcp_complete() - complete processing of a fcp packet
* @fsp: fcp packet
*
* This function may sleep if a fsp timer is pending.
@@ -1868,9 +1867,10 @@ void fc_fcp_complete(struct fc_fcp_pkt *fsp)
EXPORT_SYMBOL(fc_fcp_complete);
/**
- * fc_eh_abort - Abort a command...from scsi host template
+ * fc_eh_abort() - Abort a command
* @sc_cmd: scsi command to abort
*
+ * From scsi host template.
* send ABTS to the target device and wait for the response
* sc_cmd is the pointer to the command to be aborted.
*/
@@ -1914,7 +1914,7 @@ release_pkt:
EXPORT_SYMBOL(fc_eh_abort);
/**
- * fc_eh_device_reset: Reset a single LUN
+ * fc_eh_device_reset() Reset a single LUN
* @sc_cmd: scsi command
*
* Set from scsi host template to send tm cmd to the target and wait for the
@@ -1967,7 +1967,7 @@ out:
EXPORT_SYMBOL(fc_eh_device_reset);
/**
- * fc_eh_host_reset - The reset function will reset the ports on the host.
+ * fc_eh_host_reset() - The reset function will reset the ports on the host.
* @sc_cmd: scsi command
*/
int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
@@ -1994,7 +1994,7 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
EXPORT_SYMBOL(fc_eh_host_reset);
/**
- * fc_slave_alloc - configure queue depth
+ * fc_slave_alloc() - configure queue depth
* @sdev: scsi device
*
* Configures queue depth based on host's cmd_per_len. If not set
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 54ef40e..fb581a6 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -131,7 +131,7 @@ static int fc_frame_drop(struct fc_lport *lport, struct fc_frame *fp)
}
/**
- * fc_lport_rport_callback - Event handler for rport events
+ * fc_lport_rport_callback() - Event handler for rport events
* @lport: The lport which is receiving the event
* @rport: The rport which the event has occured on
* @event: The event that occured
@@ -187,7 +187,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
}
/**
- * fc_lport_state - Return a string which represents the lport's state
+ * fc_lport_state() - Return a string which represents the lport's state
* @lport: The lport whose state is to converted to a string
*/
static const char *fc_lport_state(struct fc_lport *lport)
@@ -201,7 +201,7 @@ static const char *fc_lport_state(struct fc_lport *lport)
}
/**
- * fc_lport_ptp_setup - Create an rport for point-to-point mode
+ * fc_lport_ptp_setup() - Create an rport for point-to-point mode
* @lport: The lport to attach the ptp rport to
* @fid: The FID of the ptp rport
* @remote_wwpn: The WWPN of the ptp rport
@@ -343,7 +343,7 @@ static void fc_lport_add_fc4_type(struct fc_lport *lport, enum fc_fh_type type)
}
/**
- * fc_lport_recv_rlir_req - Handle received Registered Link Incident Report.
+ * fc_lport_recv_rlir_req() - Handle received Registered Link Incident Report.
* @lport: Fibre Channel local port recieving the RLIR
* @sp: current sequence in the RLIR exchange
* @fp: RLIR request frame
@@ -362,7 +362,7 @@ static void fc_lport_recv_rlir_req(struct fc_seq *sp, struct fc_frame *fp,
}
/**
- * fc_lport_recv_echo_req - Handle received ECHO request
+ * fc_lport_recv_echo_req() - Handle received ECHO request
* @lport: Fibre Channel local port recieving the ECHO
* @sp: current sequence in the ECHO exchange
* @fp: ECHO request frame
@@ -404,7 +404,7 @@ static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
}
/**
- * fc_lport_recv_echo_req - Handle received Request Node ID data request
+ * fc_lport_recv_echo_req() - Handle received Request Node ID data request
* @lport: Fibre Channel local port recieving the RNID
* @sp: current sequence in the RNID exchange
* @fp: RNID request frame
@@ -471,7 +471,7 @@ static void fc_lport_recv_rnid_req(struct fc_seq *sp, struct fc_frame *in_fp,
}
/**
- * fc_lport_recv_adisc_req - Handle received Address Discovery Request
+ * fc_lport_recv_adisc_req() - Handle received Address Discovery Request
* @lport: Fibre Channel local port recieving the ADISC
* @sp: current sequence in the ADISC exchange
* @fp: ADISC request frame
@@ -521,7 +521,7 @@ static void fc_lport_recv_adisc_req(struct fc_seq *sp, struct fc_frame *in_fp,
}
/**
- * fc_lport_recv_logo_req - Handle received fabric LOGO request
+ * fc_lport_recv_logo_req() - Handle received fabric LOGO request
* @lport: Fibre Channel local port recieving the LOGO
* @sp: current sequence in the LOGO exchange
* @fp: LOGO request frame
@@ -538,7 +538,7 @@ static void fc_lport_recv_logo_req(struct fc_seq *sp, struct fc_frame *fp,
}
/**
- * fc_fabric_login - Start the lport state machine
+ * fc_fabric_login() - Start the lport state machine
* @lport: The lport that should log into the fabric
*
* Locking Note: This function should not be called
@@ -560,7 +560,7 @@ int fc_fabric_login(struct fc_lport *lport)
EXPORT_SYMBOL(fc_fabric_login);
/**
- * fc_linkup - Handler for transport linkup events
+ * fc_linkup() - Handler for transport linkup events
* @lport: The lport whose link is up
*/
void fc_linkup(struct fc_lport *lport)
@@ -580,7 +580,7 @@ void fc_linkup(struct fc_lport *lport)
EXPORT_SYMBOL(fc_linkup);
/**
- * fc_linkdown - Handler for transport linkdown events
+ * fc_linkdown() - Handler for transport linkdown events
* @lport: The lport whose link is down
*/
void fc_linkdown(struct fc_lport *lport)
@@ -599,12 +599,12 @@ void fc_linkdown(struct fc_lport *lport)
EXPORT_SYMBOL(fc_linkdown);
/**
- * fc_fabric_logoff - Logout of the fabric
+ * fc_fabric_logoff() - Logout of the fabric
* @lport: fc_lport pointer to logoff the fabric
*
* Return value:
* 0 for success, -1 for failure
- **/
+ */
int fc_fabric_logoff(struct fc_lport *lport)
{
lport->tt.disc_stop_final(lport);
@@ -617,7 +617,7 @@ int fc_fabric_logoff(struct fc_lport *lport)
EXPORT_SYMBOL(fc_fabric_logoff);
/**
- * fc_lport_destroy - unregister a fc_lport
+ * fc_lport_destroy() - unregister a fc_lport
* @lport: fc_lport pointer to unregister
*
* Return value:
@@ -627,7 +627,7 @@ EXPORT_SYMBOL(fc_fabric_logoff);
* clean-up all the allocated memory
* and free up other system resources.
*
- **/
+ */
int fc_lport_destroy(struct fc_lport *lport)
{
lport->tt.frame_send = fc_frame_drop;
@@ -638,15 +638,14 @@ int fc_lport_destroy(struct fc_lport *lport)
EXPORT_SYMBOL(fc_lport_destroy);
/**
- * fc_set_mfs - sets up the mfs for the corresponding fc_lport
+ * fc_set_mfs() - sets up the mfs for the corresponding fc_lport
* @lport: fc_lport pointer to unregister
* @mfs: the new mfs for fc_lport
*
* Set mfs for the given fc_lport to the new mfs.
*
* Return: 0 for success
- *
- **/
+ */
int fc_set_mfs(struct fc_lport *lport, u32 mfs)
{
unsigned int old_mfs;
@@ -675,7 +674,7 @@ int fc_set_mfs(struct fc_lport *lport, u32 mfs)
EXPORT_SYMBOL(fc_set_mfs);
/**
- * fc_lport_disc_callback - Callback for discovery events
+ * fc_lport_disc_callback() - Callback for discovery events
* @lport: FC local port
* @event: The discovery event
*/
@@ -700,7 +699,7 @@ void fc_lport_disc_callback(struct fc_lport *lport, enum fc_disc_event event)
}
/**
- * fc_rport_enter_ready - Enter the ready state and start discovery
+ * fc_rport_enter_ready() - Enter the ready state and start discovery
* @lport: Fibre Channel local port that is ready
*
* Locking Note: The lport lock is expected to be held before calling
@@ -717,7 +716,7 @@ static void fc_lport_enter_ready(struct fc_lport *lport)
}
/**
- * fc_lport_recv_flogi_req - Receive a FLOGI request
+ * fc_lport_recv_flogi_req() - Receive a FLOGI request
* @sp_in: The sequence the FLOGI is on
* @rx_fp: The frame the FLOGI is in
* @lport: The lport that recieved the request
@@ -807,7 +806,7 @@ out:
}
/**
- * fc_lport_recv_req - The generic lport request handler
+ * fc_lport_recv_req() - The generic lport request handler
* @lport: The lport that received the request
* @sp: The sequence the request is on
* @fp: The frame the request is in
@@ -903,7 +902,7 @@ static void fc_lport_recv_req(struct fc_lport *lport, struct fc_seq *sp,
}
/**
- * fc_lport_reset - Reset an lport
+ * fc_lport_reset() - Reset an lport
* @lport: The lport which should be reset
*
* Locking Note: This functions should not be called with the
@@ -919,7 +918,7 @@ int fc_lport_reset(struct fc_lport *lport)
EXPORT_SYMBOL(fc_lport_reset);
/**
- * fc_rport_enter_reset - Reset the local port
+ * fc_rport_enter_reset() - Reset the local port
* @lport: Fibre Channel local port to be reset
*
* Locking Note: The lport lock is expected to be held before calling
@@ -952,7 +951,7 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
}
/**
- * fc_lport_error - Handler for any errors
+ * fc_lport_error() - Handler for any errors
* @lport: The fc_lport object
* @fp: The frame pointer
*
@@ -999,8 +998,8 @@ static void fc_lport_error(struct fc_lport *lport, struct fc_frame *fp)
}
/**
- * fc_lport_rft_id_resp - Handle response to Register Fibre
- * Channel Types by ID (RPN_ID) request
+ * fc_lport_rft_id_resp() - Handle response to Register Fibre
+ * Channel Types by ID (RPN_ID) request
* @sp: current sequence in RPN_ID exchange
* @fp: response frame
* @lp_arg: Fibre Channel host port instance
@@ -1051,8 +1050,8 @@ err:
}
/**
- * fc_lport_rpn_id_resp - Handle response to Register Port
- * Name by ID (RPN_ID) request
+ * fc_lport_rpn_id_resp() - Handle response to Register Port
+ * Name by ID (RPN_ID) request
* @sp: current sequence in RPN_ID exchange
* @fp: response frame
* @lp_arg: Fibre Channel host port instance
@@ -1103,7 +1102,7 @@ err:
}
/**
- * fc_lport_scr_resp - Handle response to State Change Register (SCR) request
+ * fc_lport_scr_resp() - Handle response to State Change Register (SCR) request
* @sp: current sequence in SCR exchange
* @fp: response frame
* @lp_arg: Fibre Channel lport port instance that sent the registration request
@@ -1149,7 +1148,7 @@ err:
}
/**
- * fc_lport_enter_scr - Send a State Change Register (SCR) request
+ * fc_lport_enter_scr() - Send a State Change Register (SCR) request
* @lport: Fibre Channel local port to register for state changes
*
* Locking Note: The lport lock is expected to be held before calling
@@ -1176,7 +1175,7 @@ static void fc_lport_enter_scr(struct fc_lport *lport)
}
/**
- * fc_lport_enter_rft_id - Register FC4-types with the name server
+ * fc_lport_enter_rft_id() - Register FC4-types with the name server
* @lport: Fibre Channel local port to register
*
* Locking Note: The lport lock is expected to be held before calling
@@ -1218,7 +1217,7 @@ static void fc_lport_enter_rft_id(struct fc_lport *lport)
}
/**
- * fc_rport_enter_rft_id - Register port name with the name server
+ * fc_rport_enter_rft_id() - Register port name with the name server
* @lport: Fibre Channel local port to register
*
* Locking Note: The lport lock is expected to be held before calling
@@ -1251,7 +1250,7 @@ static struct fc_rport_operations fc_lport_rport_ops = {
};
/**
- * fc_rport_enter_dns - Create a rport to the name server
+ * fc_rport_enter_dns() - Create a rport to the name server
* @lport: Fibre Channel local port requesting a rport for the name server
*
* Locking Note: The lport lock is expected to be held before calling
@@ -1288,7 +1287,7 @@ err:
}
/**
- * fc_lport_timeout - Handler for the retry_work timer.
+ * fc_lport_timeout() - Handler for the retry_work timer.
* @work: The work struct of the fc_lport
*/
static void fc_lport_timeout(struct work_struct *work)
@@ -1329,7 +1328,7 @@ static void fc_lport_timeout(struct work_struct *work)
}
/**
- * fc_lport_logo_resp - Handle response to LOGO request
+ * fc_lport_logo_resp() - Handle response to LOGO request
* @sp: current sequence in LOGO exchange
* @fp: response frame
* @lp_arg: Fibre Channel lport port instance that sent the LOGO request
@@ -1375,7 +1374,7 @@ err:
}
/**
- * fc_rport_enter_logo - Logout of the fabric
+ * fc_rport_enter_logo() - Logout of the fabric
* @lport: Fibre Channel local port to be logged out
*
* Locking Note: The lport lock is expected to be held before calling
@@ -1407,7 +1406,7 @@ static void fc_lport_enter_logo(struct fc_lport *lport)
}
/**
- * fc_lport_flogi_resp - Handle response to FLOGI request
+ * fc_lport_flogi_resp() - Handle response to FLOGI request
* @sp: current sequence in FLOGI exchange
* @fp: response frame
* @lp_arg: Fibre Channel lport port instance that sent the FLOGI request
@@ -1504,7 +1503,7 @@ err:
}
/**
- * fc_rport_enter_flogi - Send a FLOGI request to the fabric manager
+ * fc_rport_enter_flogi() - Send a FLOGI request to the fabric manager
* @lport: Fibre Channel local port to be logged in to the fabric
*
* Locking Note: The lport lock is expected to be held before calling
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index d4f6e01..b008f49 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -138,7 +138,7 @@ struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *dp)
}
/**
- * fc_rport_state - return a string for the state the rport is in
+ * fc_rport_state() - return a string for the state the rport is in
* @rport: The rport whose state we want to get a string for
*/
static const char *fc_rport_state(struct fc_rport *rport)
@@ -153,7 +153,7 @@ static const char *fc_rport_state(struct fc_rport *rport)
}
/**
- * fc_set_rport_loss_tmo - Set the remote port loss timeout in seconds.
+ * fc_set_rport_loss_tmo() - Set the remote port loss timeout in seconds.
* @rport: Pointer to Fibre Channel remote port structure
* @timeout: timeout in seconds
*/
@@ -167,7 +167,7 @@ void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
EXPORT_SYMBOL(fc_set_rport_loss_tmo);
/**
- * fc_plogi_get_maxframe - Get max payload from the common service parameters
+ * fc_plogi_get_maxframe() - Get max payload from the common service parameters
* @flp: FLOGI payload structure
* @maxval: upper limit, may be less than what is in the service parameters
*/
@@ -190,7 +190,7 @@ fc_plogi_get_maxframe(struct fc_els_flogi *flp, unsigned int maxval)
}
/**
- * fc_rport_state_enter - Change the rport's state
+ * fc_rport_state_enter() - Change the rport's state
* @rport: The rport whose state should change
* @new: The new state of the rport
*
@@ -284,7 +284,7 @@ static void fc_rport_work(struct work_struct *work)
}
/**
- * fc_rport_login - Start the remote port login state machine
+ * fc_rport_login() - Start the remote port login state machine
* @rport: Fibre Channel remote port
*
* Locking Note: Called without the rport lock held. This
@@ -307,7 +307,7 @@ int fc_rport_login(struct fc_rport *rport)
}
/**
- * fc_rport_logoff - Logoff and remove an rport
+ * fc_rport_logoff() - Logoff and remove an rport
* @rport: Fibre Channel remote port to be removed
*
* Locking Note: Called without the rport lock held. This
@@ -345,7 +345,7 @@ int fc_rport_logoff(struct fc_rport *rport)
}
/**
- * fc_rport_enter_ready - The rport is ready
+ * fc_rport_enter_ready() - The rport is ready
* @rport: Fibre Channel remote port that is ready
*
* Locking Note: The rport lock is expected to be held before calling
@@ -364,7 +364,7 @@ static void fc_rport_enter_ready(struct fc_rport *rport)
}
/**
- * fc_rport_timeout - Handler for the retry_work timer.
+ * fc_rport_timeout() - Handler for the retry_work timer.
* @work: The work struct of the fc_rport_libfc_priv
*
* Locking Note: Called without the rport lock held. This
@@ -403,7 +403,7 @@ static void fc_rport_timeout(struct work_struct *work)
}
/**
- * fc_rport_error - Error handler, called once retries have been exhausted
+ * fc_rport_error() - Error handler, called once retries have been exhausted
* @rport: The fc_rport object
* @fp: The frame pointer
*
@@ -436,7 +436,7 @@ static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp)
}
/**
- * fc_rport_error_retry - Error handler when retries are desired
+ * fc_rport_error_retry() - Error handler when retries are desired
* @rport: The fc_rport object
* @fp: The frame pointer
*
@@ -471,7 +471,7 @@ static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp)
}
/**
- * fc_rport_plogi_recv_resp - Handle incoming ELS PLOGI response
+ * fc_rport_plogi_recv_resp() - Handle incoming ELS PLOGI response
* @sp: current sequence in the PLOGI exchange
* @fp: response frame
* @rp_arg: Fibre Channel remote port
@@ -546,7 +546,7 @@ err:
}
/**
- * fc_rport_enter_plogi - Send Port Login (PLOGI) request to peer
+ * fc_rport_enter_plogi() - Send Port Login (PLOGI) request to peer
* @rport: Fibre Channel remote port to send PLOGI to
*
* Locking Note: The rport lock is expected to be held before calling
@@ -579,7 +579,7 @@ static void fc_rport_enter_plogi(struct fc_rport *rport)
}
/**
- * fc_rport_prli_resp - Process Login (PRLI) response handler
+ * fc_rport_prli_resp() - Process Login (PRLI) response handler
* @sp: current sequence in the PRLI exchange
* @fp: response frame
* @rp_arg: Fibre Channel remote port
@@ -649,7 +649,7 @@ err:
}
/**
- * fc_rport_logo_resp - Logout (LOGO) response handler
+ * fc_rport_logo_resp() - Logout (LOGO) response handler
* @sp: current sequence in the LOGO exchange
* @fp: response frame
* @rp_arg: Fibre Channel remote port
@@ -698,7 +698,7 @@ err:
}
/**
- * fc_rport_enter_prli - Send Process Login (PRLI) request to peer
+ * fc_rport_enter_prli() - Send Process Login (PRLI) request to peer
* @rport: Fibre Channel remote port to send PRLI to
*
* Locking Note: The rport lock is expected to be held before calling
@@ -733,7 +733,7 @@ static void fc_rport_enter_prli(struct fc_rport *rport)
}
/**
- * fc_rport_els_rtv_resp - Request Timeout Value response handler
+ * fc_rport_els_rtv_resp() - Request Timeout Value response handler
* @sp: current sequence in the RTV exchange
* @fp: response frame
* @rp_arg: Fibre Channel remote port
@@ -799,7 +799,7 @@ err:
}
/**
- * fc_rport_enter_rtv - Send Request Timeout Value (RTV) request to peer
+ * fc_rport_enter_rtv() - Send Request Timeout Value (RTV) request to peer
* @rport: Fibre Channel remote port to send RTV to
*
* Locking Note: The rport lock is expected to be held before calling
@@ -830,7 +830,7 @@ static void fc_rport_enter_rtv(struct fc_rport *rport)
}
/**
- * fc_rport_enter_logo - Send Logout (LOGO) request to peer
+ * fc_rport_enter_logo() - Send Logout (LOGO) request to peer
* @rport: Fibre Channel remote port to send LOGO to
*
* Locking Note: The rport lock is expected to be held before calling
@@ -862,7 +862,7 @@ static void fc_rport_enter_logo(struct fc_rport *rport)
/**
- * fc_rport_recv_req - Receive a request from a rport
+ * fc_rport_recv_req() - Receive a request from a rport
* @sp: current sequence in the PLOGI exchange
* @fp: response frame
* @rp_arg: Fibre Channel remote port
@@ -923,7 +923,7 @@ void fc_rport_recv_req(struct fc_seq *sp, struct fc_frame *fp,
}
/**
- * fc_rport_recv_plogi_req - Handle incoming Port Login (PLOGI) request
+ * fc_rport_recv_plogi_req() - Handle incoming Port Login (PLOGI) request
* @rport: Fibre Channel remote port that initiated PLOGI
* @sp: current sequence in the PLOGI exchange
* @fp: PLOGI request frame
@@ -1045,7 +1045,7 @@ static void fc_rport_recv_plogi_req(struct fc_rport *rport,
}
/**
- * fc_rport_recv_prli_req - Handle incoming Process Login (PRLI) request
+ * fc_rport_recv_prli_req() - Handle incoming Process Login (PRLI) request
* @rport: Fibre Channel remote port that initiated PRLI
* @sp: current sequence in the PRLI exchange
* @fp: PRLI request frame
@@ -1196,7 +1196,7 @@ static void fc_rport_recv_prli_req(struct fc_rport *rport,
}
/**
- * fc_rport_recv_prlo_req - Handle incoming Process Logout (PRLO) request
+ * fc_rport_recv_prlo_req() - Handle incoming Process Logout (PRLO) request
* @rport: Fibre Channel remote port that initiated PRLO
* @sp: current sequence in the PRLO exchange
* @fp: PRLO request frame
@@ -1227,7 +1227,7 @@ static void fc_rport_recv_prlo_req(struct fc_rport *rport, struct fc_seq *sp,
}
/**
- * fc_rport_recv_logo_req - Handle incoming Logout (LOGO) request
+ * fc_rport_recv_logo_req() - Handle incoming Logout (LOGO) request
* @rport: Fibre Channel remote port that initiated LOGO
* @sp: current sequence in the LOGO exchange
* @fp: LOGO request frame
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 30056cd..7df48de 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -690,7 +690,7 @@ struct fc_lport {
struct delayed_work disc_work;
};
-/**
+/*
* FC_LPORT HELPER FUNCTIONS
*****************************/
static inline void *lport_priv(const struct fc_lport *lp)
@@ -722,7 +722,7 @@ static inline void fc_lport_state_enter(struct fc_lport *lp,
}
-/**
+/*
* LOCAL PORT LAYER
*****************************/
int fc_lport_init(struct fc_lport *lp);
@@ -772,19 +772,19 @@ int fc_lport_reset(struct fc_lport *);
int fc_set_mfs(struct fc_lport *lp, u32 mfs);
-/**
+/*
* REMOTE PORT LAYER
*****************************/
int fc_rport_init(struct fc_lport *lp);
void fc_rport_terminate_io(struct fc_rport *rp);
-/**
+/*
* DISCOVERY LAYER
*****************************/
int fc_disc_init(struct fc_lport *lp);
-/**
+/*
* SCSI LAYER
*****************************/
/*
@@ -845,7 +845,7 @@ int fc_change_queue_type(struct scsi_device *sdev, int tag_type);
*/
void fc_fcp_destroy(struct fc_lport *);
-/**
+/*
* ELS/CT interface
*****************************/
/*
@@ -854,7 +854,7 @@ void fc_fcp_destroy(struct fc_lport *);
int fc_elsct_init(struct fc_lport *lp);
-/**
+/*
* EXCHANGE MANAGER LAYER
*****************************/
/*
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 13/17] libfc, fcoe: Cleanup function formatting and minor typos
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (11 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 12/17] libfc, fcoe: Fix kerneldoc comments Robert Love
@ 2009-02-06 18:56 ` Robert Love
2009-02-06 18:57 ` [PATCH 14/17] libfc, fcoe: Remove unnecessary cast by removing inline wrapper Robert Love
` (4 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:56 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
1) There were a few functions with a strange layout, i.e. all
arguments on the second line, when not necessary.
Where ever possible I moved the return value to the same line
as the function name. However, when the line was too long
to have a single argument on the same line I moved the
return value to above line. For example:
<short return> <function name>(<arg 1>, <arg2>)
and
<very long return value>
<function name>(<arg1>,
<arg2>)
2) Removed one extra whitespace line
3) Fixed two typos
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/fc_transport_fcoe.c | 11 ++++++-----
drivers/scsi/fcoe/libfcoe.c | 15 +++++++--------
drivers/scsi/libfc/fc_exch.c | 10 +++++-----
drivers/scsi/libfc/fc_rport.c | 4 ++--
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/fcoe/fc_transport_fcoe.c b/drivers/scsi/fcoe/fc_transport_fcoe.c
index f48c0b0..c9f75b4 100644
--- a/drivers/scsi/fcoe/fc_transport_fcoe.c
+++ b/drivers/scsi/fcoe/fc_transport_fcoe.c
@@ -64,8 +64,9 @@ struct pci_dev *fcoe_transport_pcidev(const struct net_device *netdev)
*
* Returns: 0 for success
*/
-static struct fcoe_transport_internal *fcoe_transport_device_lookup(
- struct fcoe_transport *t, struct net_device *netdev)
+static struct fcoe_transport_internal *
+fcoe_transport_device_lookup(struct fcoe_transport *t,
+ struct net_device *netdev)
{
struct fcoe_transport_internal *ti;
@@ -182,7 +183,7 @@ static void fcoe_transport_device_remove_all(struct fcoe_transport *t)
* Returns: true for match up
*/
static bool fcoe_transport_match(struct fcoe_transport *t,
- struct net_device *netdev)
+ struct net_device *netdev)
{
/* match transport by vendor and device id */
struct pci_dev *pci;
@@ -214,8 +215,8 @@ static bool fcoe_transport_match(struct fcoe_transport *t,
*
* TODO: return default sw transport if no other transport is found
*/
-static struct fcoe_transport *fcoe_transport_lookup(
- struct net_device *netdev)
+static struct fcoe_transport *
+fcoe_transport_lookup(struct net_device *netdev)
{
struct fcoe_transport *t;
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 60677a8..e76e4f6 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -951,8 +951,8 @@ static struct net_device *fcoe_if_to_netdev(const char *buffer)
*
* Returns: ptr to the struct module, NULL for failure
*/
-static struct module *fcoe_netdev_to_module_owner(
- const struct net_device *netdev)
+static struct module *
+fcoe_netdev_to_module_owner(const struct net_device *netdev)
{
struct device *dev;
@@ -1207,8 +1207,8 @@ EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue);
* Returns: ptr to Scsi_Host
* TODO: to libfc?
*/
-static inline struct Scsi_Host *libfc_host_alloc(
- struct scsi_host_template *sht, int priv_size)
+static inline struct Scsi_Host *
+libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
{
return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size);
}
@@ -1287,8 +1287,8 @@ EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac);
*
* Returns: NULL or the located fcoe_softc
*/
-static struct fcoe_softc *fcoe_hostlist_lookup_softc(
- const struct net_device *dev)
+static struct fcoe_softc *
+fcoe_hostlist_lookup_softc(const struct net_device *dev)
{
struct fcoe_softc *fc;
@@ -1428,7 +1428,6 @@ static int __init fcoe_init(void)
} else {
fcoe_percpu[cpu] = NULL;
kfree(p);
-
}
}
}
@@ -1478,7 +1477,7 @@ static void __exit fcoe_exit(void)
*/
del_timer_sync(&fcoe_timer);
- /* releases the assocaited fcoe transport for each lport */
+ /* releases the associated fcoe transport for each lport */
list_for_each_entry_safe(fc, tmp, &fcoe_hostlist, list)
fcoe_transport_release(fc->real_dev);
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index b0d3ec7..4026959 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -664,8 +664,8 @@ static struct fc_exch *fc_exch_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
* If fc_pf_rjt_reason is FC_RJT_NONE then this function will have a hold
* on the ep that should be released by the caller.
*/
-static enum fc_pf_rjt_reason
-fc_seq_lookup_recip(struct fc_exch_mgr *mp, struct fc_frame *fp)
+static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_exch_mgr *mp,
+ struct fc_frame *fp)
{
struct fc_frame_header *fh = fc_frame_header_get(fp);
struct fc_exch *ep = NULL;
@@ -983,9 +983,9 @@ static void fc_seq_send_ack(struct fc_seq *sp, const struct fc_frame *rx_fp)
* Send BLS Reject.
* This is for rejecting BA_ABTS only.
*/
-static void
-fc_exch_send_ba_rjt(struct fc_frame *rx_fp, enum fc_ba_rjt_reason reason,
- enum fc_ba_rjt_explan explan)
+static void fc_exch_send_ba_rjt(struct fc_frame *rx_fp,
+ enum fc_ba_rjt_reason reason,
+ enum fc_ba_rjt_explan explan)
{
struct fc_frame *fp;
struct fc_frame_header *rx_fh;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index b008f49..a6d3406 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -171,8 +171,8 @@ EXPORT_SYMBOL(fc_set_rport_loss_tmo);
* @flp: FLOGI payload structure
* @maxval: upper limit, may be less than what is in the service parameters
*/
-static unsigned int
-fc_plogi_get_maxframe(struct fc_els_flogi *flp, unsigned int maxval)
+static unsigned int fc_plogi_get_maxframe(struct fc_els_flogi *flp,
+ unsigned int maxval)
{
unsigned int mfs;
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 14/17] libfc, fcoe: Remove unnecessary cast by removing inline wrapper
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (12 preceding siblings ...)
2009-02-06 18:56 ` [PATCH 13/17] libfc, fcoe: Cleanup function formatting and minor typos Robert Love
@ 2009-02-06 18:57 ` Robert Love
2009-02-06 18:57 ` [PATCH 15/17] fcoe: Use setup_timer() and mod_timer() Robert Love
` (3 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:57 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
Comment from "Andrew Morton <akpm@linux-foundation.org>"
> +{
> + return (struct fcoe_softc *)lport_priv(lp);
unneeded/undesirable cast of void*. There are probably zillions of
instances of this - there always are.
This whole inline function was unnecessary. The FCoE layer knows
that it's data structure is stored in the lport private data, it
can just access it from lport_priv().
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/fcoe_sw.c | 2 +-
drivers/scsi/fcoe/libfcoe.c | 12 ++++++------
include/scsi/libfcoe.h | 8 +-------
3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index b5b2abf..91bae90 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -298,7 +298,7 @@ static int fcoe_sw_destroy(struct net_device *netdev)
if (!lp)
return -ENODEV;
- fc = fcoe_softc(lp);
+ fc = lport_priv(lp);
/* Logout of the fabric */
fc_fabric_logoff(lp);
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index e76e4f6..5dae859 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -387,7 +387,7 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
WARN_ON((fr_len(fp) % sizeof(u32)) != 0);
- fc = fcoe_softc(lp);
+ fc = lport_priv(lp);
/*
* if it is a flogi then we need to learn gw-addr
* and my own fcid
@@ -770,7 +770,7 @@ static int fcoe_check_wait_queue(struct fc_lport *lp)
struct sk_buff *skb;
struct fcoe_softc *fc;
- fc = fcoe_softc(lp);
+ fc = lport_priv(lp);
spin_lock_bh(&fc->fcoe_pending_queue.lock);
/*
@@ -807,7 +807,7 @@ static void fcoe_insert_wait_queue_head(struct fc_lport *lp,
{
struct fcoe_softc *fc;
- fc = fcoe_softc(lp);
+ fc = lport_priv(lp);
spin_lock_bh(&fc->fcoe_pending_queue.lock);
__skb_queue_head(&fc->fcoe_pending_queue, skb);
spin_unlock_bh(&fc->fcoe_pending_queue.lock);
@@ -825,7 +825,7 @@ static void fcoe_insert_wait_queue(struct fc_lport *lp,
{
struct fcoe_softc *fc;
- fc = fcoe_softc(lp);
+ fc = lport_priv(lp);
spin_lock_bh(&fc->fcoe_pending_queue.lock);
__skb_queue_tail(&fc->fcoe_pending_queue, skb);
spin_unlock_bh(&fc->fcoe_pending_queue.lock);
@@ -1115,7 +1115,7 @@ MODULE_PARM_DESC(destroy, "Destroy fcoe port");
*/
int fcoe_link_ok(struct fc_lport *lp)
{
- struct fcoe_softc *fc = fcoe_softc(lp);
+ struct fcoe_softc *fc = lport_priv(lp);
struct net_device *dev = fc->real_dev;
struct ethtool_cmd ecmd = { ETHTOOL_GSET };
int rc = 0;
@@ -1331,7 +1331,7 @@ int fcoe_hostlist_add(const struct fc_lport *lp)
fc = fcoe_hostlist_lookup_softc(fcoe_netdev(lp));
if (!fc) {
- fc = fcoe_softc(lp);
+ fc = lport_priv(lp);
write_lock_bh(&fcoe_hostlist_lock);
list_add_tail(&fc->list, &fcoe_hostlist);
write_unlock_bh(&fcoe_hostlist_lock);
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 89fdbb9..f43d383 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -58,16 +58,10 @@ struct fcoe_softc {
u8 address_mode;
};
-static inline struct fcoe_softc *fcoe_softc(
- const struct fc_lport *lp)
-{
- return (struct fcoe_softc *)lport_priv(lp);
-}
-
static inline struct net_device *fcoe_netdev(
const struct fc_lport *lp)
{
- return fcoe_softc(lp)->real_dev;
+ return ((struct fcoe_softc *)lport_priv(lp))->real_dev;
}
static inline struct fcoe_hdr *skb_fcoe_header(const struct sk_buff *skb)
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 15/17] fcoe: Use setup_timer() and mod_timer()
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (13 preceding siblings ...)
2009-02-06 18:57 ` [PATCH 14/17] libfc, fcoe: Remove unnecessary cast by removing inline wrapper Robert Love
@ 2009-02-06 18:57 ` Robert Love
2009-02-06 18:57 ` [PATCH 16/17] fcoe: Correct fcoe_transports initialization vs. registration Robert Love
` (2 subsequent siblings)
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:57 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
Use helper functions for watchdog timer setup.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/libfcoe.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 5dae859..3072428 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -1437,11 +1437,9 @@ static int __init fcoe_init(void)
*/
fcoe_dev_setup();
- init_timer(&fcoe_timer);
- fcoe_timer.data = 0;
- fcoe_timer.function = fcoe_watchdog;
- fcoe_timer.expires = (jiffies + (10 * HZ));
- add_timer(&fcoe_timer);
+ setup_timer(&fcoe_timer, fcoe_watchdog, 0);
+
+ mod_timer(&fcoe_timer, jiffies + (10 * HZ));
/* initiatlize the fcoe transport */
fcoe_transport_init();
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 16/17] fcoe: Correct fcoe_transports initialization vs. registration
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (14 preceding siblings ...)
2009-02-06 18:57 ` [PATCH 15/17] fcoe: Use setup_timer() and mod_timer() Robert Love
@ 2009-02-06 18:57 ` Robert Love
2009-02-06 18:57 ` [PATCH 17/17] [SCSI] fcoe: fix kfree(skb) Robert Love
2009-02-26 2:49 ` [PATCH 00/17] Open-FCoE Updates Mike Christie
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:57 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Robert Love
The registration function shouldn't initialize the mutex or
list head. The fcoe SW transport should initialize itself
before registering.
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/fc_transport_fcoe.c | 3 ---
drivers/scsi/fcoe/fcoe_sw.c | 5 +++++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/fcoe/fc_transport_fcoe.c b/drivers/scsi/fcoe/fc_transport_fcoe.c
index c9f75b4..058baea 100644
--- a/drivers/scsi/fcoe/fc_transport_fcoe.c
+++ b/drivers/scsi/fcoe/fc_transport_fcoe.c
@@ -256,9 +256,6 @@ int fcoe_transport_register(struct fcoe_transport *t)
list_add_tail(&t->list, &fcoe_transports);
mutex_unlock(&fcoe_transports_lock);
- mutex_init(&t->devlock);
- INIT_LIST_HEAD(&t->devlist);
-
printk(KERN_INFO "fcoe: Transport %s has been registered\n", t->name);
return 0;
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index 91bae90..b41462c 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -468,10 +468,15 @@ int __init fcoe_sw_init(void)
/* attach to scsi transport */
scsi_transport_fcoe_sw =
fc_attach_transport(&fcoe_sw_transport_function);
+
if (!scsi_transport_fcoe_sw) {
FCOE_DBG("fcoe_sw_init:fc_attach_transport() failed\n");
return -ENODEV;
}
+
+ mutex_init(&fcoe_sw_transport.devlock);
+ INIT_LIST_HEAD(&fcoe_sw_transport.devlist);
+
/* register sw transport */
fcoe_transport_register(&fcoe_sw_transport);
return 0;
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 17/17] [SCSI] fcoe: fix kfree(skb)
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (15 preceding siblings ...)
2009-02-06 18:57 ` [PATCH 16/17] fcoe: Correct fcoe_transports initialization vs. registration Robert Love
@ 2009-02-06 18:57 ` Robert Love
2009-02-26 2:49 ` [PATCH 00/17] Open-FCoE Updates Mike Christie
17 siblings, 0 replies; 23+ messages in thread
From: Robert Love @ 2009-02-06 18:57 UTC (permalink / raw)
To: james.bottomley, linux-scsi; +Cc: Roel Kluin, Robert Love
From: Roel Kluin <roel.kluin@gmail.com>
Use kfree_skb instead of kfree for struct sk_buff pointers.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
drivers/scsi/fcoe/libfcoe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 3072428..6237ac2 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -437,7 +437,7 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
if (skb_is_nonlinear(skb)) {
skb_frag_t *frag;
if (fcoe_get_paged_crc_eof(skb, tlen)) {
- kfree(skb);
+ kfree_skb(skb);
return -ENOMEM;
}
frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1];
^ permalink raw reply related [flat|nested] 23+ messages in thread* Re: [PATCH 00/17] Open-FCoE Updates
2009-02-06 18:55 [PATCH 00/17] Open-FCoE Updates Robert Love
` (16 preceding siblings ...)
2009-02-06 18:57 ` [PATCH 17/17] [SCSI] fcoe: fix kfree(skb) Robert Love
@ 2009-02-26 2:49 ` Mike Christie
2009-02-26 18:29 ` Robert Love
17 siblings, 1 reply; 23+ messages in thread
From: Mike Christie @ 2009-02-26 2:49 UTC (permalink / raw)
To: Robert Love; +Cc: james.bottomley, linux-scsi
Robert Love wrote:
> The following series implements bug fixes, adds a module param for runtime debug logging and cleans up some coding style issues. The top patch is a patch that was posted to linux-scsi on 01/04, but doesn't seem to have made it in yet.
>
> This patch set is based on Linus' tree + the Open-FCoE patches submitted to linux-scsi on 01/21.
>
Were these patches and that other patchset for 2.6.29-rc? This one had
some non bug fixes. I was not sure if you can do that in a rc. I was not
sure if because it is a new driver you get a exception since there can
be no regressions.
The first bunch of patches from 1/21 look ok.
The patches below looked ok too. I was not sure about the underrun
handling in this one though:
> Vasu Dev (1):
> libfc: fixed a read IO data integrity issue when a IO data frame lost
>
I always mess underrun handling up.
Other patches looked ok.
Reviewed-by: Mike Christie <micaelc@cs.wisc.edu>
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH 00/17] Open-FCoE Updates
2009-02-26 2:49 ` [PATCH 00/17] Open-FCoE Updates Mike Christie
@ 2009-02-26 18:29 ` Robert Love
2009-02-26 19:05 ` James Bottomley
0 siblings, 1 reply; 23+ messages in thread
From: Robert Love @ 2009-02-26 18:29 UTC (permalink / raw)
To: Mike Christie
Cc: james.bottomley@hansenpartnership.com, linux-scsi@vger.kernel.org
On Wed, 2009-02-25 at 18:49 -0800, Mike Christie wrote:
> Robert Love wrote:
> > The following series implements bug fixes, adds a module param for runtime debug logging and cleans up some coding style issues. The top patch is a patch that was posted to linux-scsi on 01/04, but doesn't seem to have made it in yet.
> >
> > This patch set is based on Linus' tree + the Open-FCoE patches submitted to linux-scsi on 01/21.
> >
>
> Were these patches and that other patchset for 2.6.29-rc? This one had
> some non bug fixes. I was not sure if you can do that in a rc. I was not
> sure if because it is a new driver you get a exception since there can
> be no regressions.
>
They were intended for the RC phase, should I have been more explicit?
I'm not sure what the policy is exactly, I've heard that the RC phase is
only for regressions, but I'm not sure how that applies to new drivers.
We have nothing to regress from and I'd prefer getting these fixes in so
that FCoE in 2.6.29 is as stable as can be.
I agree that the logging stuff is a feature and not a fix, so it should
not go in the RC. Also, there is one locking fix that introduced a
defect that is later fixed in another patch. I'll re-do the patch set-
pull out the locking changes, and merge the two locking patches. Can
these fixes still make 2.6.29?
I have a handful of fixes that I was going to send out on Friday, but
I'll include them in the series as the last few patches. I'll call them
out in the cover mail too.
> The first bunch of patches from 1/21 look ok.
>
> The patches below looked ok too. I was not sure about the underrun
> handling in this one though:
>
> > Vasu Dev (1):
> > libfc: fixed a read IO data integrity issue when a IO data frame lost
> >
>
> I always mess underrun handling up.
>
> Other patches looked ok.
>
> Reviewed-by: Mike Christie <micaelc@cs.wisc.edu>
Thanks for the review.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 00/17] Open-FCoE Updates
2009-02-26 18:29 ` Robert Love
@ 2009-02-26 19:05 ` James Bottomley
2009-02-26 19:54 ` Love, Robert W
2009-03-02 22:24 ` Love, Robert W
0 siblings, 2 replies; 23+ messages in thread
From: James Bottomley @ 2009-02-26 19:05 UTC (permalink / raw)
To: Robert Love; +Cc: Mike Christie, linux-scsi@vger.kernel.org
On Thu, 2009-02-26 at 10:29 -0800, Robert Love wrote:
> On Wed, 2009-02-25 at 18:49 -0800, Mike Christie wrote:
> > Robert Love wrote:
> > > The following series implements bug fixes, adds a module param for runtime debug logging and cleans up some coding style issues. The top patch is a patch that was posted to linux-scsi on 01/04, but doesn't seem to have made it in yet.
> > >
> > > This patch set is based on Linus' tree + the Open-FCoE patches submitted to linux-scsi on 01/21.
> > >
> >
> > Were these patches and that other patchset for 2.6.29-rc? This one had
> > some non bug fixes. I was not sure if you can do that in a rc. I was not
> > sure if because it is a new driver you get a exception since there can
> > be no regressions.
> >
> They were intended for the RC phase, should I have been more explicit?
> I'm not sure what the policy is exactly, I've heard that the RC phase is
> only for regressions, but I'm not sure how that applies to new drivers.
> We have nothing to regress from and I'd prefer getting these fixes in so
> that FCoE in 2.6.29 is as stable as can be.
OK, so how it works is firstly you have to tell me it's for rc fixes ...
I can sometimes get this from the subject (if it contains words like bug
fix). Secondly, I need enhancements and fixes separated so they can be
separately applied to the different trees (if you have an entanglement,
I can rebase the misc tree to pick up the needed rc-fixes dependencies).
So if you separate the patches (or just tell me what's a bug fix ... and
they apply individually) I can put them in the rc-fixes tree.
James
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH 00/17] Open-FCoE Updates
2009-02-26 19:05 ` James Bottomley
@ 2009-02-26 19:54 ` Love, Robert W
2009-03-02 22:24 ` Love, Robert W
1 sibling, 0 replies; 23+ messages in thread
From: Love, Robert W @ 2009-02-26 19:54 UTC (permalink / raw)
To: James Bottomley; +Cc: Mike Christie, linux-scsi@vger.kernel.org
James Bottomley wrote:
> On Thu, 2009-02-26 at 10:29 -0800, Robert Love wrote:
>> On Wed, 2009-02-25 at 18:49 -0800, Mike Christie wrote:
>>> Robert Love wrote:
>>>> The following series implements bug fixes, adds a module param for
>>>> runtime debug logging and cleans up some coding style issues. The
>>>> top patch is a patch that was posted to linux-scsi on 01/04, but
>>>> doesn't seem to have made it in yet.
>>>>
>>>> This patch set is based on Linus' tree + the Open-FCoE patches
>>>> submitted to linux-scsi on 01/21.
>>>>
>>>
>>> Were these patches and that other patchset for 2.6.29-rc? This one
>>> had some non bug fixes. I was not sure if you can do that in a rc.
>>> I was not sure if because it is a new driver you get a exception
>>> since there can be no regressions.
>>>
>> They were intended for the RC phase, should I have been more
>> explicit? I'm not sure what the policy is exactly, I've heard that
>> the RC phase is only for regressions, but I'm not sure how that
>> applies to new drivers. We have nothing to regress from and I'd
>> prefer getting these fixes in so that FCoE in 2.6.29 is as stable as
>> can be.
>
> OK, so how it works is firstly you have to tell me it's for rc fixes
> ... I can sometimes get this from the subject (if it contains words
> like bug fix). Secondly, I need enhancements and fixes separated so
> they can be separately applied to the different trees (if you have an
> entanglement, I can rebase the misc tree to pick up the needed
> rc-fixes dependencies).
>
> So if you separate the patches (or just tell me what's a bug fix ...
> and they apply individually) I can put them in the rc-fixes tree.
>
Thanks for the clarification. I'll resend a clearly labeled patchset
of fixes. I'll also post the dynamic debug logging improvements I did
separately, labeled as a feature.
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: [PATCH 00/17] Open-FCoE Updates
2009-02-26 19:05 ` James Bottomley
2009-02-26 19:54 ` Love, Robert W
@ 2009-03-02 22:24 ` Love, Robert W
1 sibling, 0 replies; 23+ messages in thread
From: Love, Robert W @ 2009-03-02 22:24 UTC (permalink / raw)
To: James Bottomley; +Cc: Mike Christie, linux-scsi@vger.kernel.org
James Bottomley wrote:
> On Thu, 2009-02-26 at 10:29 -0800, Robert Love wrote:
>> On Wed, 2009-02-25 at 18:49 -0800, Mike Christie wrote:
>>> Robert Love wrote:
>>>> The following series implements bug fixes, adds a module param for
>>>> runtime debug logging and cleans up some coding style issues. The
>>>> top patch is a patch that was posted to linux-scsi on 01/04, but
>>>> doesn't seem to have made it in yet.
>>>>
>>>> This patch set is based on Linus' tree + the Open-FCoE patches
>>>> submitted to linux-scsi on 01/21.
>>>>
>>>
>>> Were these patches and that other patchset for 2.6.29-rc? This one
>>> had some non bug fixes. I was not sure if you can do that in a rc.
>>> I was not sure if because it is a new driver you get a exception
>>> since there can be no regressions.
>>>
>> They were intended for the RC phase, should I have been more
>> explicit? I'm not sure what the policy is exactly, I've heard that
>> the RC phase is only for regressions, but I'm not sure how that
>> applies to new drivers. We have nothing to regress from and I'd
>> prefer getting these fixes in so that FCoE in 2.6.29 is as stable as
>> can be.
>
> OK, so how it works is firstly you have to tell me it's for rc fixes
> ... I can sometimes get this from the subject (if it contains words
> like bug fix). Secondly, I need enhancements and fixes separated so
> they can be separately applied to the different trees (if you have an
> entanglement, I can rebase the misc tree to pick up the needed
> rc-fixes dependencies).
>
> So if you separate the patches (or just tell me what's a bug fix ...
> and they apply individually) I can put them in the rc-fixes tree.
>
Thanks for the clarification. Will the fixes I resent on Friday make
it into 2.6.29?
^ permalink raw reply [flat|nested] 23+ messages in thread