aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Leech <christopher.leech@intel.com>2009-08-25 16:59:51 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 13:07:33 -0400
commit991cbb6082db3025bd82908eb9ee2d2920be2114 (patch)
tree74f2a5f22c0a9bb20b5430e7019d24723988b4ff /drivers
parent3fe9a0badae7fa2eb35eff4f07e851fbd25e3d4f (diff)
[SCSI] fcoe: move offload exchange manager pointer from fcoe_port to fcoe_interface
The offload EM pointer is only used when setting up a new libfc instance, but as it's designed to be shared among NPIV VN_Ports it should be tracked in fcoe_interface. With the host-list changed to track fcoe_interfaces as well, this is needed before we can remove the priv pointer from that structure (which is only there to help in the transition, and stops making sense once NPIV is enabled). Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/fcoe/fcoe.c14
-rw-r--r--drivers/scsi/fcoe/fcoe.h2
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 01519c722edf..bb59a7a04f23 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -438,7 +438,6 @@ bool fcoe_oem_match(struct fc_frame *fp)
438static inline int fcoe_em_config(struct fc_lport *lp) 438static inline int fcoe_em_config(struct fc_lport *lp)
439{ 439{
440 struct fcoe_port *port = lport_priv(lp); 440 struct fcoe_port *port = lport_priv(lp);
441 struct fcoe_port *oldport = NULL;
442 struct fcoe_interface *fcoe = port->fcoe; 441 struct fcoe_interface *fcoe = port->fcoe;
443 struct fcoe_interface *oldfcoe = NULL; 442 struct fcoe_interface *oldfcoe = NULL;
444 struct net_device *old_real_dev, *cur_real_dev; 443 struct net_device *old_real_dev, *cur_real_dev;
@@ -464,30 +463,29 @@ static inline int fcoe_em_config(struct fc_lport *lp)
464 cur_real_dev = fcoe->netdev; 463 cur_real_dev = fcoe->netdev;
465 464
466 list_for_each_entry(oldfcoe, &fcoe_hostlist, list) { 465 list_for_each_entry(oldfcoe, &fcoe_hostlist, list) {
467 oldport = oldfcoe->priv;
468 if (oldfcoe->netdev->priv_flags & IFF_802_1Q_VLAN) 466 if (oldfcoe->netdev->priv_flags & IFF_802_1Q_VLAN)
469 old_real_dev = vlan_dev_real_dev(oldfcoe->netdev); 467 old_real_dev = vlan_dev_real_dev(oldfcoe->netdev);
470 else 468 else
471 old_real_dev = oldfcoe->netdev; 469 old_real_dev = oldfcoe->netdev;
472 470
473 if (cur_real_dev == old_real_dev) { 471 if (cur_real_dev == old_real_dev) {
474 port->oem = oldport->oem; 472 fcoe->oem = oldfcoe->oem;
475 break; 473 break;
476 } 474 }
477 } 475 }
478 476
479 if (port->oem) { 477 if (fcoe->oem) {
480 if (!fc_exch_mgr_add(lp, port->oem, fcoe_oem_match)) { 478 if (!fc_exch_mgr_add(lp, fcoe->oem, fcoe_oem_match)) {
481 printk(KERN_ERR "fcoe_em_config: failed to add " 479 printk(KERN_ERR "fcoe_em_config: failed to add "
482 "offload em:%p on interface:%s\n", 480 "offload em:%p on interface:%s\n",
483 port->oem, fcoe->netdev->name); 481 fcoe->oem, fcoe->netdev->name);
484 return -ENOMEM; 482 return -ENOMEM;
485 } 483 }
486 } else { 484 } else {
487 port->oem = fc_exch_mgr_alloc(lp, FC_CLASS_3, 485 fcoe->oem = fc_exch_mgr_alloc(lp, FC_CLASS_3,
488 FCOE_MIN_XID, lp->lro_xid, 486 FCOE_MIN_XID, lp->lro_xid,
489 fcoe_oem_match); 487 fcoe_oem_match);
490 if (!port->oem) { 488 if (!fcoe->oem) {
491 printk(KERN_ERR "fcoe_em_config: failed to allocate " 489 printk(KERN_ERR "fcoe_em_config: failed to allocate "
492 "em for offload exches on interface:%s\n", 490 "em for offload exches on interface:%s\n",
493 fcoe->netdev->name); 491 fcoe->netdev->name);
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
index 5b190b5fea3f..26e859574604 100644
--- a/drivers/scsi/fcoe/fcoe.h
+++ b/drivers/scsi/fcoe/fcoe.h
@@ -86,6 +86,7 @@ struct fcoe_interface {
86 struct packet_type fcoe_packet_type; 86 struct packet_type fcoe_packet_type;
87 struct packet_type fip_packet_type; 87 struct packet_type fip_packet_type;
88 struct fcoe_ctlr ctlr; 88 struct fcoe_ctlr ctlr;
89 struct fc_exch_mgr *oem; /* offload exchange manager */
89}; 90};
90 91
91/* 92/*
@@ -94,7 +95,6 @@ struct fcoe_interface {
94 */ 95 */
95struct fcoe_port { 96struct fcoe_port {
96 struct fcoe_interface *fcoe; 97 struct fcoe_interface *fcoe;
97 struct fc_exch_mgr *oem; /* offload exchange manger */
98 struct sk_buff_head fcoe_pending_queue; 98 struct sk_buff_head fcoe_pending_queue;
99 u8 fcoe_pending_queue_active; 99 u8 fcoe_pending_queue_active;
100 struct timer_list timer; /* queue timer */ 100 struct timer_list timer; /* queue timer */