public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org
Subject: [PATCH] fcoe: prep work to completely remove fc_transport_fcoe code
Date: Fri, 27 Mar 2009 09:03:29 -0700	[thread overview]
Message-ID: <20090327160328.18274.31785.stgit@fritz> (raw)
In-Reply-To: <20090317184151.22987.73806.stgit@fritz>

From: Vasu Dev <vasu.dev@intel.com>

The fcoe transport code was added for generic FCoE transport
infrastructure to allow additional offload related module loading
on demand, this is not required anymore after recently added
different offload approach by having offload related func ops
in netdev.

This patch removes fcoe transport related code use, calls functions
directly between existing libfcoe.c and fcoe_sw.c for now, for
example fcoe_sw_destroy and fcoe_sw_create calling.

The fcoe_sw.c and libfcoe.c code will be further consolidated in
later patches and then also the default fcoe sw transport code
file fcoe_sw.c will be completely removed.

The fcoe transport code files are completely removed in next
patch to keep this patch simple for reviewing.

--

This patch is an update to a previous patch. This update
resolves a build error as well as fixes a defect related to
not calling fc_release_transport().

The following updates to the other patches in the series
are just adjustments to the changes this update introduces.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---

 drivers/scsi/fcoe/Makefile  |    3 +--
 drivers/scsi/fcoe/fcoe_sw.c |   37 ++++---------------------------------
 drivers/scsi/fcoe/libfcoe.c |   25 ++++++-------------------
 include/scsi/libfcoe.h      |    2 ++
 4 files changed, 13 insertions(+), 54 deletions(-)

diff --git a/drivers/scsi/fcoe/Makefile b/drivers/scsi/fcoe/Makefile
index b78da06..e950adf 100644
--- a/drivers/scsi/fcoe/Makefile
+++ b/drivers/scsi/fcoe/Makefile
@@ -4,5 +4,4 @@ obj-$(CONFIG_FCOE) += fcoe.o
 
 fcoe-y := \
 	libfcoe.o \
-	fcoe_sw.o \
-	fc_transport_fcoe.o
+	fcoe_sw.o
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index a675390..f060220 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -36,7 +36,6 @@
 
 #include <scsi/libfc.h>
 #include <scsi/libfcoe.h>
-#include <scsi/fc_transport_fcoe.h>
 
 #define FCOE_SW_VERSION	"0.1"
 #define	FCOE_SW_NAME	"fcoesw"
@@ -302,7 +301,7 @@ static inline int fcoe_sw_em_config(struct fc_lport *lp)
  *
  * Returns: 0 if link is OK for use by FCoE.
  */
-static int fcoe_sw_destroy(struct net_device *netdev)
+int fcoe_sw_destroy(struct net_device *netdev)
 {
 	struct fc_lport *lp = NULL;
 	struct fcoe_softc *fc;
@@ -415,7 +414,7 @@ static struct libfc_function_template fcoe_sw_libfc_fcn_templ = {
  *
  * Returns : 0 on success
  */
-static int fcoe_sw_create(struct net_device *netdev)
+int fcoe_sw_create(struct net_device *netdev)
 {
 	int rc;
 	struct fc_lport *lp = NULL;
@@ -494,28 +493,7 @@ out_host_put:
 }
 
 /**
- * fcoe_sw_match() - The FCoE SW transport match function
- *
- * Returns : false always
- */
-static bool fcoe_sw_match(struct net_device *netdev)
-{
-	/* FIXME - for sw transport, always return false */
-	return false;
-}
-
-/* the sw hba fcoe transport */
-struct fcoe_transport fcoe_sw_transport = {
-	.name = "fcoesw",
-	.create = fcoe_sw_create,
-	.destroy = fcoe_sw_destroy,
-	.match = fcoe_sw_match,
-	.vendor = 0x0,
-	.device = 0xffff,
-};
-
-/**
- * fcoe_sw_init() - Registers fcoe_sw_transport
+ * fcoe_sw_init() - attach to scsi transport
  *
  * Returns : 0 on success
  */
@@ -530,23 +508,16 @@ int __init fcoe_sw_init(void)
 		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;
 }
 
 /**
- * fcoe_sw_exit() - Unregisters fcoe_sw_transport
+ * fcoe_sw_exit() - detach from scsi transport
  *
  * Returns : 0 on success
  */
 int __exit fcoe_sw_exit(void)
 {
-	/* dettach the transport */
 	fc_release_transport(scsi_transport_fcoe_sw);
-	fcoe_transport_unregister(&fcoe_sw_transport);
 	return 0;
 }
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 951d244..334db95 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -44,7 +44,6 @@
 #include <scsi/libfc.h>
 #include <scsi/fc_frame.h>
 #include <scsi/libfcoe.h>
-#include <scsi/fc_transport_fcoe.h>
 
 static int debug_fcoe;
 
@@ -1081,10 +1080,9 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
 		rc = -ENODEV;
 		goto out_putdev;
 	}
-	/* pass to transport */
-	rc = fcoe_transport_release(netdev);
+	rc = fcoe_sw_destroy(netdev);
 	if (rc) {
-		printk(KERN_ERR "fcoe: fcoe_transport_release(%s) failed\n",
+		printk(KERN_ERR "fcoe: fcoe_sw_destroy(%s) failed\n",
 		       netdev->name);
 		rc = -EIO;
 		goto out_putdev;
@@ -1121,10 +1119,9 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
 	}
 	fcoe_ethdrv_get(netdev);
 
-	/* pass to transport */
-	rc = fcoe_transport_attach(netdev);
+	rc = fcoe_sw_create(netdev);
 	if (rc) {
-		printk(KERN_ERR "fcoe: fcoe_transport_attach(%s) failed\n",
+		printk(KERN_ERR "fcoe: fcoe_sw_create(%s) failed\n",
 		       netdev->name);
 		fcoe_ethdrv_put(netdev);
 		rc = -EIO;
@@ -1429,10 +1426,6 @@ EXPORT_SYMBOL_GPL(fcoe_libfc_config);
 /**
  * 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)
@@ -1464,9 +1457,6 @@ static int __init fcoe_init(void)
 
 	mod_timer(&fcoe_timer, jiffies + (10 * HZ));
 
-	/* initiatlize the fcoe transport */
-	fcoe_transport_init();
-
 	fcoe_sw_init();
 
 	return 0;
@@ -1495,9 +1485,9 @@ static void __exit fcoe_exit(void)
 	/* Stop the timer */
 	del_timer_sync(&fcoe_timer);
 
-	/* releases the associated fcoe transport for each lport */
+	/* releases the associated fcoe hosts */
 	list_for_each_entry_safe(fc, tmp, &fcoe_hostlist, list)
-		fcoe_transport_release(fc->real_dev);
+		fcoe_sw_destroy(fc->real_dev);
 
 	unregister_hotcpu_notifier(&fcoe_cpu_notifier);
 
@@ -1507,8 +1497,5 @@ static void __exit fcoe_exit(void)
 
 	/* remove sw trasnport */
 	fcoe_sw_exit();
-
-	/* detach the transport */
-	fcoe_transport_exit();
 }
 module_exit(fcoe_exit);
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 1ad4f93..dc64405 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -149,4 +149,6 @@ int fcoe_libfc_config(struct fc_lport *, struct libfc_function_template *);
 /* fcoe sw hba */
 int __init fcoe_sw_init(void);
 int __exit fcoe_sw_exit(void);
+int fcoe_sw_create(struct net_device *);
+int fcoe_sw_destroy(struct net_device *);
 #endif /* _LIBFCOE_H */


  parent reply	other threads:[~2009-03-27 16:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 18:41 [PATCH 00/14] Open-FCoE fixes and features for 2.6.30 merge window Robert Love
2009-03-17 18:41 ` [PATCH 01/14] fcoe: Initialize all possilbe skb_queue(s) when module is loaded Robert Love
2009-03-17 18:41 ` [PATCH 02/14] fcoe: Use percpu kernel funcs for struct fcoe_percpu_s Robert Love
2009-03-17 18:41 ` [PATCH 03/14] fcoe: Use per-CPU kernel function for dev_stats instead of an array Robert Love
2009-03-31 22:51   ` [PATCH 3/14 v2] " Robert Love
2009-03-17 18:41 ` [PATCH 04/14] fcoe: create/destroy fcoe Rx threads on CPU hotplug events Robert Love
2009-03-23  0:59   ` James Bottomley
2009-03-23 19:42     ` Robert Love
2009-03-24  3:50       ` James Bottomley
2009-03-17 18:41 ` [PATCH 05/14] fcoe: prep work to completely remove fc_transport_fcoe code Robert Love
2009-03-24 23:19   ` [PATCH] " Robert Love
2009-03-26  3:03     ` [PATCH] PM port setting and attached SATA port selector in discover Andy Yan
2009-03-27 16:52       ` James Bottomley
2009-03-27 16:03   ` Robert Love [this message]
2009-03-27 16:12     ` [PATCH] fcoe: prep work to completely remove fc_transport_fcoe code Love, Robert W
2009-03-17 18:41 ` [PATCH 06/14] fcoe: removes fc_transport_fcoe.[ch] code files Robert Love
2009-03-24 23:24   ` [PATCH] " Robert Love
2009-03-27 16:05   ` Robert Love
2009-03-17 18:42 ` [PATCH 07/14] fcoe: removes default sw transport code file fcoe_sw.c Robert Love
2009-03-24 23:27   ` [PATCH] " Robert Love
2009-03-27 16:06   ` Robert Love
2009-03-17 18:42 ` [PATCH 08/14] fcoe: renames libfcoe.c to fcoe.c as the only fcoe module file Robert Love
2009-03-24 23:27   ` [PATCH] " Robert Love
2009-03-27 16:07   ` Robert Love
2009-03-17 18:42 ` [PATCH 09/14] fcoe, libfc, scsi: adds libfcoe module Robert Love
2009-03-17 18:42 ` [PATCH 10/14] fcoe: moves common FCoE library API functions to " Robert Love
2009-03-17 18:42 ` [PATCH 11/14] fcoe: cleans up libfcoe.h and adds fcoe.h for fcoe module Robert Love
2009-03-17 18:42 ` [PATCH 12/14] fcoe, libfc: fix double fcoe_softc memory alloc Robert Love
2009-03-17 18:42 ` [PATCH 13/14] fcoe: Add a header file defining the FIP protocol for FCoE Robert Love
2009-03-17 18:42 ` [PATCH 14/14] fcoe, libfcoe: Add support for FIP. FCoE discovery and keep-alive Robert Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090327160328.18274.31785.stgit@fritz \
    --to=robert.w.love@intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox