[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>
This commit is contained in:
Chris Leech 2009-08-25 13:59:51 -07:00 committed by James Bottomley
parent 3fe9a0bada
commit 991cbb6082
2 changed files with 7 additions and 9 deletions

View File

@ -438,7 +438,6 @@ bool fcoe_oem_match(struct fc_frame *fp)
static inline int fcoe_em_config(struct fc_lport *lp) static inline int fcoe_em_config(struct fc_lport *lp)
{ {
struct fcoe_port *port = lport_priv(lp); struct fcoe_port *port = lport_priv(lp);
struct fcoe_port *oldport = NULL;
struct fcoe_interface *fcoe = port->fcoe; struct fcoe_interface *fcoe = port->fcoe;
struct fcoe_interface *oldfcoe = NULL; struct fcoe_interface *oldfcoe = NULL;
struct net_device *old_real_dev, *cur_real_dev; struct net_device *old_real_dev, *cur_real_dev;
@ -464,30 +463,29 @@ static inline int fcoe_em_config(struct fc_lport *lp)
cur_real_dev = fcoe->netdev; cur_real_dev = fcoe->netdev;
list_for_each_entry(oldfcoe, &fcoe_hostlist, list) { list_for_each_entry(oldfcoe, &fcoe_hostlist, list) {
oldport = oldfcoe->priv;
if (oldfcoe->netdev->priv_flags & IFF_802_1Q_VLAN) if (oldfcoe->netdev->priv_flags & IFF_802_1Q_VLAN)
old_real_dev = vlan_dev_real_dev(oldfcoe->netdev); old_real_dev = vlan_dev_real_dev(oldfcoe->netdev);
else else
old_real_dev = oldfcoe->netdev; old_real_dev = oldfcoe->netdev;
if (cur_real_dev == old_real_dev) { if (cur_real_dev == old_real_dev) {
port->oem = oldport->oem; fcoe->oem = oldfcoe->oem;
break; break;
} }
} }
if (port->oem) { if (fcoe->oem) {
if (!fc_exch_mgr_add(lp, port->oem, fcoe_oem_match)) { if (!fc_exch_mgr_add(lp, fcoe->oem, fcoe_oem_match)) {
printk(KERN_ERR "fcoe_em_config: failed to add " printk(KERN_ERR "fcoe_em_config: failed to add "
"offload em:%p on interface:%s\n", "offload em:%p on interface:%s\n",
port->oem, fcoe->netdev->name); fcoe->oem, fcoe->netdev->name);
return -ENOMEM; return -ENOMEM;
} }
} else { } else {
port->oem = fc_exch_mgr_alloc(lp, FC_CLASS_3, fcoe->oem = fc_exch_mgr_alloc(lp, FC_CLASS_3,
FCOE_MIN_XID, lp->lro_xid, FCOE_MIN_XID, lp->lro_xid,
fcoe_oem_match); fcoe_oem_match);
if (!port->oem) { if (!fcoe->oem) {
printk(KERN_ERR "fcoe_em_config: failed to allocate " printk(KERN_ERR "fcoe_em_config: failed to allocate "
"em for offload exches on interface:%s\n", "em for offload exches on interface:%s\n",
fcoe->netdev->name); fcoe->netdev->name);

View File

@ -86,6 +86,7 @@ struct fcoe_interface {
struct packet_type fcoe_packet_type; struct packet_type fcoe_packet_type;
struct packet_type fip_packet_type; struct packet_type fip_packet_type;
struct fcoe_ctlr ctlr; struct fcoe_ctlr ctlr;
struct fc_exch_mgr *oem; /* offload exchange manager */
}; };
/* /*
@ -94,7 +95,6 @@ struct fcoe_interface {
*/ */
struct fcoe_port { struct fcoe_port {
struct fcoe_interface *fcoe; struct fcoe_interface *fcoe;
struct fc_exch_mgr *oem; /* offload exchange manger */
struct sk_buff_head fcoe_pending_queue; struct sk_buff_head fcoe_pending_queue;
u8 fcoe_pending_queue_active; u8 fcoe_pending_queue_active;
struct timer_list timer; /* queue timer */ struct timer_list timer; /* queue timer */