public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
To: Steven Rostedt <rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	pv-drivers-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org
Subject: Re: [Pv-drivers] [PATCH rdma-core] vmw_pvrdma: Explicitly check for IP_BASED_GIDS port flag
Date: Thu, 31 Aug 2017 10:42:14 -0700	[thread overview]
Message-ID: <bdd5a150-ebae-ad43-fa02-7d85ddaf651b@vmware.com> (raw)
In-Reply-To: <20170831100438.4e90516f-pVyPKaU+gKZOHLTnHDQRgA@public.gmane.org>

On Thu, Aug 31, 2017 at 10:06:02AM -0400, Steven Rostedt wrote:
> On Wed, 30 Aug 2017 16:34:01 -0700
> Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> wrote:
> 
> 
> >  struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
> > @@ -218,15 +222,17 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
> >  				   attr->grh.flow_label;
> >  	memcpy(av->dgid, attr->grh.dgid.raw, 16);
> >  
> > -	if (ibv_resolve_eth_l2_from_gid(pd->context, attr,
> > -					av->dmac, &vlan_id)) {
> > -		free(ah);
> > -		return NULL;
> > +	if (port_attr.port_cap_flags & IBV_PORT_IP_BASED_GIDS) {
> > +		if (!ibv_resolve_eth_l2_from_gid(pd->context, attr,
> > +						 av->dmac, &vlan_id))
> > +			return &ah->ibv_ah;
> >  	} else {
> > -		set_mac_from_gid(&attr->grh.dgid, av->dmac);
> > +		if (!set_mac_from_gid(&attr->grh.dgid, av->dmac))
> 
> Could this have been simplified to:
> 
> 	} else if (!set_mac_from_gid(...)) {
> 
> > +		return &ah->ibv_ah;

Thanks, Steve. We can probably look at doing that in a future cleanup
patch.
--
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

      parent reply	other threads:[~2017-08-31 17:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 23:34 [PATCH rdma-core] vmw_pvrdma: Explicitly check for IP_BASED_GIDS port flag Adit Ranadive
     [not found] ` <1504136041-3070-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2017-08-31  9:06   ` Leon Romanovsky
2017-08-31 14:06   ` [Pv-drivers] " Steven Rostedt
     [not found]     ` <20170831100438.4e90516f-pVyPKaU+gKZOHLTnHDQRgA@public.gmane.org>
2017-08-31 17:42       ` Adit Ranadive [this message]

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=bdd5a150-ebae-ad43-fa02-7d85ddaf651b@vmware.com \
    --to=aditr-pghwnbhtmq7qt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pv-drivers-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org \
    --cc=rostedt-nx8X9YLhiw1AfugRpC6u6w@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