diff options
author | Vasu Dev <vasu.dev@intel.com> | 2009-07-29 20:05:00 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-08-22 18:52:07 -0400 |
commit | 96316099ac3cb259eac2d6891f3c75b38b29d26e (patch) | |
tree | f4ec7001462bd00340de19b3045063872652c5a6 /drivers/scsi/fcoe/fcoe.c | |
parent | 201e5795b7b9582accb6d83316e30f24d7d40fd3 (diff) |
[SCSI] fcoe, libfc: adds exchange manager(EM) anchor list per lport and related APIs
Adds EM list using a anchor struct fc_exch_mgr_anchor, anchor is used
to allow same EM instance sharing across more than one lport on a eth
device, this implementation is per discussed design posted at
http://www.open-fcoe.org/pipermail/devel/2009-June/002566.html.
The shared EM is required for multiple lports on eth device when
using multiple VLANs or NPIV.
Adds fc_exch_mgr_add API to add a EM to the lport and fc_exch_mgr_del
API to delete previously added EM.
Also adds function fc_exch_mgr_destroy() to destroy allocated EM.
The kref is added to the EM to keep track of EM usage count, the EM is
destroyed when no longer in use upon kref reaching to zero.
The caller can specify match function to fc_exch_mgr_add, this
will be used in determining exchange allocation from its EM or not.
Moved calling of fcoe_em_config below fcoe_libfc_config calling,
so that list head lp->ema_list is initialized before configuring
EM.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 14a4017a1535..719a99d4a438 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -603,18 +603,18 @@ static int fcoe_if_create(struct net_device *netdev) | |||
603 | goto out_netdev_cleanup; | 603 | goto out_netdev_cleanup; |
604 | } | 604 | } |
605 | 605 | ||
606 | /* lport exch manager allocation */ | 606 | /* Initialize the library */ |
607 | rc = fcoe_em_config(lp); | 607 | rc = fcoe_libfc_config(lp, &fcoe_libfc_fcn_templ); |
608 | if (rc) { | 608 | if (rc) { |
609 | FCOE_NETDEV_DBG(netdev, "Could not configure the EM for the " | 609 | FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the " |
610 | "interface\n"); | 610 | "interface\n"); |
611 | goto out_netdev_cleanup; | 611 | goto out_lp_destroy; |
612 | } | 612 | } |
613 | 613 | ||
614 | /* Initialize the library */ | 614 | /* lport exch manager allocation */ |
615 | rc = fcoe_libfc_config(lp, &fcoe_libfc_fcn_templ); | 615 | rc = fcoe_em_config(lp); |
616 | if (rc) { | 616 | if (rc) { |
617 | FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the " | 617 | FCOE_NETDEV_DBG(netdev, "Could not configure the EM for the " |
618 | "interface\n"); | 618 | "interface\n"); |
619 | goto out_lp_destroy; | 619 | goto out_lp_destroy; |
620 | } | 620 | } |