Re: [rdma-next, 02/31] IB/{core/cm}: Fix dmac query for IPv6 link local destination

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

 



On Tue, Nov 14, 2017 at 02:51:49PM +0200, Leon Romanovsky wrote:

> +static int ib_resolve_unicast_gid_dmac(struct ib_device *device,
> +				       struct rdma_ah_attr *ah_attr)
> +{
> +	struct ib_gid_attr sgid_attr;
> +	struct ib_global_route *grh;
> +	int hop_limit = 0xff;
> +	union ib_gid sgid;
> +	int ret;
> +
> +	grh = rdma_ah_retrieve_grh(ah_attr);
> +
> +	ret = ib_query_gid(device,
> +			   rdma_ah_get_port_num(ah_attr),
> +			   grh->sgid_index,
> +			   &sgid, &sgid_attr);

[..]

> +		ret = get_sgid_index_from_eth(device, port_num,
> +					      vlan_id, &dgid,
> +					      gid_type, &gid_index);
>  		if (ret)
>  			return ret;
> +		flow_class = be32_to_cpu(grh->version_tclass_flow);
> +		rdma_ah_set_grh(ah_attr, &sgid,
> +				flow_class & 0xFFFFF,
> +				(u8)gid_index, hoplimit,
> +				(flow_class >> 20) & 0xFF);
> +		return ib_resolve_unicast_gid_dmac(device, ah_attr);

This patch looks like a major improvement, so I am going to take it.

However, I dislike this flow here, calling get_sgid_index_from_eth to
get an index then converting the index to a ib_gid_attr via
ib_query_gid is silly.

We should have support APIs that go directly from the WC & GRH to a
gid_attr without the racy inbetween step of gid_index.

Can you send a followup to fix it?

Jason
--
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