On Thu, Dec 03, 2015 at 03:47:12PM +0200, Matan Barak wrote: > From: Somnath Kotur <somnath.ko...@avagotech.com> > > Providers should tell IB core the wc's network type. > This is used in order to search for the proper GID in the > GID table. When using HCAs that can't provide this info, > IB core tries to deep examine the packet and extract > the GID type by itself.
Eh? A wc has a sgid_index, and in this brave new world a gid has the network type. Why do we need to specify it again? > memset(ah_attr, 0, sizeof *ah_attr); > if (rdma_cap_eth_ah(device, port_num)) { > + if (wc->wc_flags & IB_WC_WITH_NETWORK_HDR_TYPE) > + net_type = wc->network_hdr_type; > + else > + net_type = ib_get_net_type_by_grh(device, port_num, > grh); > + gid_type = ib_network_to_gid_type(net_type); Like here for instance. ... and I keep saying this is all wrong, once you get into IP land this entire process needs a route/neighbour lookup. > - ret = rdma_addr_find_dmac_by_grh(&grh->dgid, &grh->sgid, > + ret = rdma_addr_find_dmac_by_grh(&dgid, &sgid, > ah_attr->dmac, > wc->wc_flags & > IB_WC_WITH_VLAN ? > NULL : &vlan_id, ie no to this. > + if (sgid_attr.gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP) > + /* TODO: get the hoplimit from the inet/inet6 > + * device > + */ And no again, please fix this and all other missing route lookups before sending another version. > + struct { > + /* The IB spec states that if it's IPv4, the header roceev2 spec, surely Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html