Re: [Pv-drivers] [PATCH rdma-core] vmw_pvrdma: Explicitly check for IP_BASED_GIDS port flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 30 Aug 2017 16:34:01 -0700
Adit Ranadive <aditr@xxxxxxxxxx> 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;

>  	}

-- Steve

>  
> -	return &ah->ibv_ah;
> +	free(ah);
> +	return NULL;
>  }
>  
>  int pvrdma_destroy_ah(struct ibv_ah *ah)

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux