[Open-FCoE] [PATCH V2 06/13] fcoe: move offload exchange manager pointer from fcoe_port to fcoe_interface

Joe Eykholt jeykholt at cisco.com
Thu Jul 9 18:38:31 UTC 2009


Chris Leech wrote:
> 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 at intel.com>
> ---
> 
>  drivers/scsi/fcoe/fcoe.c |   14 ++++++--------
>  drivers/scsi/fcoe/fcoe.h |    2 +-
>  2 files changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
> index e898c5d..400c147 100644
> --- a/drivers/scsi/fcoe/fcoe.c
> +++ b/drivers/scsi/fcoe/fcoe.c
> @@ -441,7 +441,6 @@ bool fcoe_oem_match(struct fc_frame *fp)
>  static inline int fcoe_em_config(struct fc_lport *lp)
>  {
>  	struct fcoe_port *port = lport_priv(lp);
> -	struct fcoe_port *oldport = NULL;
>  	struct fcoe_interface *fcoe = port->fcoe;
>  	struct fcoe_interface *oldfcoe = NULL;
>  	u16 min_xid = FCOE_MIN_XID;
> @@ -462,24 +461,23 @@ static inline int fcoe_em_config(struct fc_lport *lp)
>  	 */
>  	list_for_each_entry(oldfcoe, &fcoe_hostlist, list) {
>  		if (oldfcoe->phys_dev == fcoe->phys_dev) {
> -			oldport = oldfcoe->priv;
> -			port->oem = oldport->oem;
> +			fcoe->oem = oldfcoe->oem;
>  			break;
>  		}
>  	}
>  
> -	if (port->oem) {
> -		if (!fc_exch_mgr_add(lp, port->oem, fcoe_oem_match)) {
> +	if (fcoe->oem) {
> +		if (!fc_exch_mgr_add(lp, fcoe->oem, fcoe_oem_match)) {
>  			printk(KERN_ERR "fcoe_em_config: failed to add "
>  			       "offload em:%p on interface:%s\n",
> -			       port->oem, fcoe->real_dev->name);
> +			       fcoe->oem, fcoe->real_dev->name);
>  			return -ENOMEM;
>  		}
>  	} 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_oem_match);
> -		if (!port->oem) {
> +		if (!fcoe->oem) {
>  			printk(KERN_ERR "fcoe_em_config: failed to allocate "
>  			       "em for offload exches on interface:%s\n",
>  			       fcoe->real_dev->name);
> diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
> index d351b04..4f41aad 100644
> --- a/drivers/scsi/fcoe/fcoe.h
> +++ b/drivers/scsi/fcoe/fcoe.h
> @@ -87,6 +87,7 @@ struct fcoe_interface {
>  	struct packet_type  fcoe_packet_type;
>  	struct packet_type  fip_packet_type;
>  	struct fcoe_ctlr ctlr;
> +	struct fc_exch_mgr *oem;		/* offload exchange manger */

Let's delete or fix the misspelled comment.

>  };
>  
>  /*
> @@ -95,7 +96,6 @@ struct fcoe_interface {
>   */
>  struct fcoe_port {
>  	struct fcoe_interface *fcoe;
> -	struct fc_exch_mgr *oem;		/* offload exchange manger */
>  	struct sk_buff_head fcoe_pending_queue;
>  	u8	fcoe_pending_queue_active;
>  	struct timer_list timer;		/* queue timer */
> 
> _______________________________________________
> devel mailing list
> devel at open-fcoe.org
> http://www.open-fcoe.org/mailman/listinfo/devel




More information about the devel mailing list