public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
To: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: "Hefty,
	Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	RDMA list <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCHv10 02/12] ib_core: IBoE CMA device binding
Date: Thu, 26 Aug 2010 23:14:26 -0700	[thread overview]
Message-ID: <adavd6w37lp.fsf@cisco.com> (raw)
In-Reply-To: <20100827054256.GA9755@mtldesk30> (Eli Cohen's message of "Fri, 27 Aug 2010 08:42:56 +0300")

 > 	if (dev_addr->dev_type != ARPHRD_INFINIBAND) {
 > 		iboe_addr_get_sgid(dev_addr, &gid);
 > 		list_for_each_entry(cma_dev, &dev_list, list) {
 > 			ret = ib_find_cached_gid(cma_dev->device, &gid,
 > 						 &id_priv->id.port_num, NULL);
 > 			if (!ret)
 > 				goto out;
 > 		}
 > 	}
 > 
 > 	memcpy(&gid, dev_addr->src_dev_addr +
 > 	       rdma_addr_gid_offset(dev_addr), sizeof gid);
 > 	list_for_each_entry(cma_dev, &dev_list, list) {
 > 		ret = ib_find_cached_gid(cma_dev->device, &gid,
 > 					 &id_priv->id.port_num, NULL);
 > 		if (!ret)
 > 			break;
 > 	}
 > 
 > out:

This duplication of the code in the loop ends up looking pretty bad, and
indeed the change to the function doesn't make much sense to me:

 > @@ -330,15 +348,29 @@ static int cma_acquire_dev(struct rdma_id_private *id_priv)
 >  	union ib_gid gid;
 >  	int ret = -ENODEV;
 >  
 > -	rdma_addr_get_sgid(dev_addr, &gid);
 > +	if (dev_addr->dev_type != ARPHRD_INFINIBAND) {
 > +		iboe_addr_get_sgid(dev_addr, &gid);
 > +		list_for_each_entry(cma_dev, &dev_list, list) {
 > +			ret = ib_find_cached_gid(cma_dev->device, &gid,
 > +						 &id_priv->id.port_num, NULL);
 > +			if (!ret)
 > +				goto out;
 > +		}
 > +	}
 > +
 > +	memcpy(&gid, dev_addr->src_dev_addr +
 > +	       rdma_addr_gid_offset(dev_addr), sizeof gid);

I thought the whole point of this change:

 >  static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid)
 >  {
 > -	memcpy(gid, dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid);
 > +	if (dev_addr->transport == RDMA_TRANSPORT_IB &&
 > +	    dev_addr->dev_type != ARPHRD_INFINIBAND)
 > +		iboe_addr_get_sgid(dev_addr, gid);
 > +	else
 > +		memcpy(gid, dev_addr->src_dev_addr +
 > +		       rdma_addr_gid_offset(dev_addr), sizeof *gid);
 >  }

is that rdma_addr_get_sgid() now calls iboe_addr_get_sgid for IBoE
devices, and does the original thing in the other case.  So I don't see
why any change to cma_acquire_dev() is needed at all?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-08-27  6:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26 14:17 [PATCHv10 02/12] ib_core: IBoE CMA device binding Eli Cohen
2010-08-26 20:11 ` Hefty, Sean
     [not found]   ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25AB26491D-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-08-27  5:42     ` Eli Cohen
2010-08-27  6:14       ` Roland Dreier [this message]
     [not found]         ` <adavd6w37lp.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-08-29 14:39           ` Eli Cohen
2010-09-01 20:05             ` Hefty, Sean
2010-09-02 17:46             ` Roland Dreier
     [not found]               ` <adaeidcnin1.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-09-02 19:27                 ` Eli Cohen
2010-09-02 20:10                   ` Roland Dreier
     [not found]                     ` <aday6bjnbyu.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-09-07 15:18                       ` Eli Cohen
2010-09-02 20:30                   ` Hefty, Sean
     [not found]                     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25AB44BA6F-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-09-02 21:57                       ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adavd6w37lp.fsf@cisco.com \
    --to=rdreier-fyb4gu1cfyuavxtiumwx3w@public.gmane.org \
    --cc=eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox