> 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. > returning gid_index is wrong because it forces CQ pollers to be aware of the entire table. Like I already mentioned, the GID table is a HW resource that can be divided and handed to multiple VMs,
>> 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 -- 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