Skip to contentSkip to conversation

Open-FCoE Updates

PATCH In review Robert Love 3 participants 23 messages Feb 6, 2009 – Mar 2, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Open-FCoE Updates

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.

---

Robert Love (14):
fcoe: Correct fcoe_transports initialization vs. registration
fcoe: Use setup_timer() and mod_timer()
libfc, fcoe: Remove unnecessary cast by removing inline wrapper libfc, fcoe: Cleanup function formatting and minor typos libfc, fcoe: Fix kerneldoc comments
libfc: Cleanup libfc_function_template comments
libfc: Logging review changes
libfc: runtime debugging with debug_logging module parameter
fcoe: Logging review changes
fcoe: runtime debugging with debug_logging module parameter
libfc: check for err when recv and state is incorrect
libfc: rename rp to rdata in fc_disc_new_target()
libfc: correct RPORT_TO_PRIV usage
libfc: Don't violate transport template for rogue port creation

Roel Kluin (1):
[SCSI] fcoe: fix kfree(skb)

Steve Ma (1):
fcoe: exch mgr is freed while lport still retrying sequences

Vasu Dev (1):
libfc: fixed a read IO data integrity issue when a IO data frame lost

 drivers/scsi/fcoe/fc_transport_fcoe.c |  174 ++++++++++-----------
 drivers/scsi/fcoe/fcoe.h              |   31 ++++
 drivers/scsi/fcoe/fcoe_sw.c           |   70 ++++----
 drivers/scsi/fcoe/libfcoe.c           |  267 ++++++++++++++++----------------
 drivers/scsi/libfc/fc_disc.c          |  154 +++++++++---------
 drivers/scsi/libfc/fc_exch.c          |   62 +++----
 drivers/scsi/libfc/fc_fcp.c           |  139 ++++++++---------
 drivers/scsi/libfc/fc_lport.c         |  278 ++++++++++++++++-----------------
 drivers/scsi/libfc/fc_rport.c         |  197 +++++++++++------------
 include/scsi/fc_encode.h              |    2 
 include/scsi/libfc.h                  |  167 +++++++++++++-------
 include/scsi/libfcoe.h                |    8 -
 12 files changed, 793 insertions(+), 756 deletions(-)
 create mode 100644 drivers/scsi/fcoe/fcoe.h
Signature · 1 line
//Rob
#1 lore raw

PATCH 1/17 libfc: fixed a read IO data integrity issue when a IO data frame lost

From: Vasu Dev <[email protected]>

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.

---

 drivers/scsi/libfc/fc_fcp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/libfc/fc_fcp.c +3 -3
index f440aac..ecc7261 100644
@@ -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
#2 lore raw

PATCH 2/17 fcoe: exch mgr is freed while lport still retrying sequences

In reply to Robert Love

From: Steve Ma <[email protected]>

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.

---

 drivers/scsi/libfc/fc_lport.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/libfc/fc_lport.c +2 -0
index a6ab692..a60b919 100644
@@ -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);
#3 lore raw

PATCH 3/17 libfc: Don't violate transport template for rogue port creation

In reply to Robert Love

---

 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(-)
drivers/scsi/libfc/fc_disc.c +3 -3
index dd1564c..15e3f84 100644
@@ -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;
drivers/scsi/libfc/fc_lport.c +2 -2
index a60b919..60ac36f 100644
@@ -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;
 
drivers/scsi/libfc/fc_rport.c +3 -0
index 600a8ff..81b3ca1 100644
@@ -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;
 
include/scsi/libfc.h +5 -0
index b9e6c1c..37df48e 100644
@@ -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.
#4 lore raw

PATCH 4/17 libfc: correct RPORT_TO_PRIV usage

In reply to 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.

---

 drivers/scsi/libfc/fc_disc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/libfc/fc_disc.c +2 -2
index 15e3f84..9f4e408 100644
@@ -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);
 }
#5 lore raw

PATCH 5/17 libfc: rename rp to rdata in fc_disc_new_target()

In reply to Robert Love

Just rename the variable as per our naming convention.

---

 drivers/scsi/libfc/fc_disc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/libfc/fc_disc.c +4 -4
index 9f4e408..cfbce89 100644
@@ -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);
 		}
 	}
#6 lore raw

PATCH 6/17 libfc: check for err when recv and state is incorrect

In reply to 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.

---

 drivers/scsi/libfc/fc_lport.c |   50 +++++++++++++++++++++--------------------
 drivers/scsi/libfc/fc_rport.c |   30 ++++++++++++-------------
 2 files changed, 40 insertions(+), 40 deletions(-)
drivers/scsi/libfc/fc_lport.c +25 -25
index 60ac36f..7dd433c 100644
@@ -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) {
drivers/scsi/libfc/fc_rport.c +15 -15
index 81b3ca1..4f23a9b 100644
@@ -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;
#7 lore raw

PATCH 7/17 fcoe: runtime debugging with debug_logging module parameter

In reply to 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.

---

 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
drivers/scsi/fcoe/fcoe.h new file +31 -0
new file mode 100644
index 0000000..d15355f
@@ -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_ */
drivers/scsi/fcoe/fcoe_sw.c +9 -7
index cf83675..e861c36 100644
@@ -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;
 	}
 
drivers/scsi/fcoe/libfcoe.c +23 -25

108 lines not on this page · raw message

#8 lore raw

PATCH 8/17 fcoe: Logging review changes

In reply to 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

---

 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(-)
drivers/scsi/fcoe/fc_transport_fcoe.c +38 -45
index bf7fe6f..9fd4acc 100644
@@ -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);
drivers/scsi/fcoe/fcoe_sw.c +3 -4
index e861c36..769e6a8 100644
@@ -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 */
drivers/scsi/fcoe/libfcoe.c +20 -16
index 594295b..9efe1bf 100644
@@ -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;
#9 lore raw

PATCH 9/17 libfc: runtime debugging with debug_logging module parameter

In reply to 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.

---

 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(-)
drivers/scsi/libfc/fc_disc.c +3 -12
index cfbce89..05189f6 100644
@@ -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) {
 		/*
drivers/scsi/libfc/fc_exch.c +0 -11
index 8c40189..ce608d7 100644
@@ -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 */
 
 /*
drivers/scsi/libfc/fc_fcp.c +3 -7
index ecc7261..3f93930 100644
@@ -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;
 
drivers/scsi/libfc/fc_lport.c +0 -8
index 7dd433c..f777723 100644
@@ -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 *);
drivers/scsi/libfc/fc_rport.c +0 -8
index 4f23a9b..05330c0 100644
@@ -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 *);
include/scsi/libfc.h +37 -0
index 37df48e..01f68f6 100644
@@ -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
  */
#10 lore raw

PATCH 10/17 libfc: Logging review changes

In reply to 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.

---

 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(-)
drivers/scsi/libfc/fc_disc.c +41 -41
index 05189f6..f37ce94 100644
@@ -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);
drivers/scsi/libfc/fc_exch.c +20 -21

125 lines not on this page · raw message

drivers/scsi/libfc/fc_fcp.c +39 -38

191 lines not on this page · raw message

drivers/scsi/libfc/fc_lport.c +75 -72

365 lines not on this page · raw message

drivers/scsi/libfc/fc_rport.c +56 -56

284 lines not on this page · raw message

include/scsi/fc_encode.h +0 -2
index 6300f55..a0ff61c 100644
@@ -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;
 	}
 
include/scsi/libfc.h +5 -17
index 01f68f6..a774e78 100644
@@ -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);)
 
#11 lore raw

PATCH 11/17 libfc: Cleanup libfc_function_template comments

In reply to Robert Love

Made the comments more like the comments for struct scsi_host_template.

---

 include/scsi/libfc.h |  107 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 66 insertions(+), 41 deletions(-)
include/scsi/libfc.h +66 -41
index a774e78..30056cd 100644
@@ -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 *);
 };
#12 lore raw

PATCH 12/17 libfc, fcoe: Fix kerneldoc comments

In reply to 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

---

 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(-)
drivers/scsi/fcoe/fc_transport_fcoe.c +38 -39
index 9fd4acc..f48c0b0 100644
@@ -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;
drivers/scsi/fcoe/fcoe_sw.c +19 -23

112 lines not on this page · raw message

drivers/scsi/fcoe/libfcoe.c +81 -81

496 lines not on this page · raw message

drivers/scsi/libfc/fc_disc.c +23 -22

165 lines not on this page · raw message

drivers/scsi/libfc/fc_fcp.c +23 -23

144 lines not on this page · raw message

drivers/scsi/libfc/fc_lport.c +38 -39

291 lines not on this page · raw message

drivers/scsi/libfc/fc_rport.c +23 -23

184 lines not on this page · raw message

include/scsi/libfc.h +7 -7
index 30056cd..7df48de 100644
@@ -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
  *****************************/
 /*
#13 lore raw

PATCH 13/17 libfc, fcoe: Cleanup function formatting and minor typos

In reply to 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

---

 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(-)
drivers/scsi/fcoe/fc_transport_fcoe.c +6 -5
index f48c0b0..c9f75b4 100644
@@ -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;
 
drivers/scsi/fcoe/libfcoe.c +7 -8
index 60677a8..e76e4f6 100644
@@ -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);
 
drivers/scsi/libfc/fc_exch.c +5 -5
index b0d3ec7..4026959 100644
@@ -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;
drivers/scsi/libfc/fc_rport.c +2 -2
index b008f49..a6d3406 100644
@@ -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;
 
#14 lore raw

PATCH 14/17 libfc, fcoe: Remove unnecessary cast by removing inline wrapper

In reply to Robert Love

Comment from "Andrew Morton <[email protected]>"

Review

Quoted 2 lines
(quoted diff) +2 -0
+{
+     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().

---

 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(-)
drivers/scsi/fcoe/fcoe_sw.c +1 -1
index b5b2abf..91bae90 100644
@@ -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);
drivers/scsi/fcoe/libfcoe.c +6 -6
index e76e4f6..5dae859 100644
@@ -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);
include/scsi/libfcoe.h +1 -7
index 89fdbb9..f43d383 100644
@@ -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)
#15 lore raw

PATCH 15/17 fcoe: Use setup_timer() and mod_timer()

In reply to Robert Love

Use helper functions for watchdog timer setup.

---

 drivers/scsi/fcoe/libfcoe.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/scsi/fcoe/libfcoe.c +3 -5
index 5dae859..3072428 100644
@@ -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();
#16 lore raw

PATCH 16/17 fcoe: Correct fcoe_transports initialization vs. registration

In reply to Robert Love

The registration function shouldn't initialize the mutex or list head. The fcoe SW transport should initialize itself before registering.

---

 drivers/scsi/fcoe/fc_transport_fcoe.c |    3 ---
 drivers/scsi/fcoe/fcoe_sw.c           |    5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/scsi/fcoe/fc_transport_fcoe.c +0 -3
index c9f75b4..058baea 100644
@@ -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;
drivers/scsi/fcoe/fcoe_sw.c +5 -0
index 91bae90..b41462c 100644
@@ -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;
#17 lore raw

PATCH 17/17 fcoe: fix kfree(skb)

In reply to Robert Love

From: Roel Kluin <[email protected]>

Use kfree_skb instead of kfree for struct sk_buff pointers.

---

 drivers/scsi/fcoe/libfcoe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/fcoe/libfcoe.c +1 -1
index 3072428..6237ac2 100644
@@ -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];
Reviewed-by on the v1 series
#18 lore raw
In reply to Robert Love
Quoted 4 lines · Robert Love

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:

Quoted 3 lines

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.

#19 lore raw
Quoted 11 lines · Mike Christie
Quoted 4 lines · Robert Love

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.

Quoted 9 lines

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:

Quoted 3 lines

Vasu Dev (1):
libfc: fixed a read IO data integrity issue when a IO data frame lost

Quoted 5 lines

I always mess underrun handling up.

Other patches looked ok.

Thanks for the review.

maintainer
#20 lore raw
Quoted 12 lines · Robert Love
Quoted 11 lines · Mike Christie
Quoted 4 lines · Robert Love

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.

Quoted 5 lines

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

#21 lore raw
Quoted 31 lines · James Bottomley
Quoted 16 lines · Robert Love
Quoted 6 lines · Mike Christie
Quoted 5 lines · Robert Love

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.

Quoted 9 lines
Quoted 3 lines

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.

Quoted 6 lines

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).

Quoted 3 lines

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.

#22 lore raw
In reply to James Bottomley
Quoted 31 lines · James Bottomley
Quoted 16 lines · Robert Love
Quoted 6 lines · Mike Christie
Quoted 5 lines · Robert Love

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.

Quoted 9 lines
Quoted 3 lines

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.

Quoted 6 lines

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).

Quoted 3 lines

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?