On Tue, Dec 08, 2015 at 09:23:18AM +0200, Moni Shoua wrote: > >> Now, when same gid value can be present in multiple entries you need > >> an extra parameter to get distinguish between them - that would be > >> the netwrok_type > > > > Eh? You are only worried about duplicates between rocev1 mode which > > uses the GUID and v2 mode which uses the host's IP address? > > > > What about duplicates entirely within v2 mode where vlan and macvlan > > can create duplicate host IP addresses. > In that case these entries will be distinguished byt its eth devices > (eth device is part of the gid attributes structure) Eh? I think you've missed the point, there is no net device when looking at a wc. Look, here is a concrete direction: Replace all the crap in ib_init_ah_from_wc/get_sgid_index_from_eth/rdma_addr_find_dmac_by_grh with a straightforward rdma_dgid_index_from_wc( const struct ib_qp *qp, const struct ib_wc *wc, const struct ib_grh *grh, u16 *gid_index) Sort of function that reads the GRH and wc and returns the unambiguous gid index that was used to receive that packet on the UD QP. The gid cache is not allowed to create an ambiguity the driver cannot resolve. That said, I wouldn't object to vendor-specific bits in the wc. Ie if mlx hardware needs a network_type bit to implement rdma_find_dgid_index_from_wc, then fine - define a vendor specific place to put it. In this case rdma_find_dgid_index_from_wc would be a driver call back, which is fine, and what Caitlin was talking about. But, it is not part of our verbs API, and I'd *strongly* encourage other vendors and future hardware to simply return the gid index that the hardware matched instead of requiring the software to try and guess after the fact. This is the same issue/argument we went around and around on the lladdr ipoib details when working on the namespace patches, about how important it is to resolve the namespace from the hardware headers. Of course once we have the gid index we now have the net device and other information needed to make namespaces work. .. and this is part of what I mean what I said the interface from the gid cache code is not a sane API and needs to be changed. 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