On Wed, Dec 09, 2015 at 09:38:21AM +0000, Liran Liss wrote: > > 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. > You are pushing abstraction into provider code instead of handling it in a > generic way.
No, I am defining an API that *make sense* and doesn't leak useless details. Of course that doesn't force code duplication or anyhting like that, just implement it smartly. I think mlx made a big mistake returning network_type instead of gid index, and I don't want to see that error enshrined in our API. > The Verbs are a low-level API, that should report exactly what was > received from the wire. In the RoCEv2 case, it should be the GID/IP > addresses and the protocol type. The addressing information is not > intended to be used directly by applications; it is the raw bits > that were accepted from the wire. Low level details isn't what any in kernel consumer needs. Everything in kernel needs the gid index to determine the namespace, routing and other details. It is not optional. A common API is thus needed to do this conversion. API-wise, once you get the gid index then it is trivial to make easy extractors for everything else. ie for example: rdma_get_ud_src_sockaddr(gid_index,&addr,wc,grh) rdma_get_ud_dst_sockaddr(gid_index,&addr,wc,grh) > ib_init_ah_from_wc() and friends is exactly the place that you want > to create an address handle based on completion and packet fields. CMA needs exactly the same logic as well, the fact it doesn't have it is a bug in this series. 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