public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fcoe patch for scsi-post-merge.git (2.6.33)
@ 2009-11-20 23:22 Robert Love
  2009-11-20 23:22 ` [PATCH] fcoe: Use LLD's WWPN and WWNN for lport if LLD supports ndo_fcoe_get_wwn Robert Love
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Love @ 2009-11-20 23:22 UTC (permalink / raw)
  To: James.Bottomley, linux-scsi

The following series adds fcoe stack support for a new netdev API that allows an Ethernet
driver to specify a WWNN and WWPN for its FCoE connection.

This patch depends on the netdev_ops.ndo_fcoe_get_wwn() API, which is currently in
net-next-2.6.git. To apply this patch net-next-2.6.git should be merged into scsi-misc.git
(after the 9 previously submitted fcoe patches on 11/20/09 are committed to scsi-misc.git).

---

Yi Zou (1):
      fcoe: Use LLD's WWPN and WWNN for lport if LLD supports ndo_fcoe_get_wwn


 drivers/scsi/fcoe/fcoe.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

-- 
//Rob

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] fcoe: Use LLD's WWPN and WWNN for lport if LLD supports ndo_fcoe_get_wwn
  2009-11-20 23:22 [PATCH] fcoe patch for scsi-post-merge.git (2.6.33) Robert Love
@ 2009-11-20 23:22 ` Robert Love
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Love @ 2009-11-20 23:22 UTC (permalink / raw)
  To: James.Bottomley, linux-scsi; +Cc: Yi Zou, Robert Love

From: Yi Zou <yi.zou@intel.com>

If the LLD wants its own WWNN/WWPN to be used, it should implement the
netdev_ops.ndo_fcoe_get_wwn(). If that is the case, we query the LLD and use
the queried WWNN/WWPN from the LLD.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---

 drivers/scsi/fcoe/fcoe.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index a30ffaa..9b6aebb 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -545,6 +545,23 @@ static void fcoe_queue_timer(ulong lport)
 }
 
 /**
+ * fcoe_get_wwn() - Get the world wide name from LLD if it supports it
+ * @netdev: the associated net device
+ * @wwn: the output WWN
+ * @type: the type of WWN (WWPN or WWNN)
+ *
+ * Returns: 0 for success
+ */
+static int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type)
+{
+	const struct net_device_ops *ops = netdev->netdev_ops;
+
+	if (ops->ndo_fcoe_get_wwn)
+		return ops->ndo_fcoe_get_wwn(netdev, wwn, type);
+	return -EINVAL;
+}
+
+/**
  * fcoe_netdev_config() - Set up net devive for SW FCoE
  * @lport:  The local port that is associated with the net device
  * @netdev: The associated net device
@@ -611,9 +628,13 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev)
 		 */
 		if (netdev->priv_flags & IFF_802_1Q_VLAN)
 			vid = vlan_dev_vlan_id(netdev);
-		wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0);
+
+		if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN))
+			wwnn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 1, 0);
 		fc_set_wwnn(lport, wwnn);
-		wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr, 2, vid);
+		if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN))
+			wwpn = fcoe_wwn_from_mac(fcoe->ctlr.ctl_src_addr,
+						 2, vid);
 		fc_set_wwpn(lport, wwpn);
 	}
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-20 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 23:22 [PATCH] fcoe patch for scsi-post-merge.git (2.6.33) Robert Love
2009-11-20 23:22 ` [PATCH] fcoe: Use LLD's WWPN and WWNN for lport if LLD supports ndo_fcoe_get_wwn Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox