On Wed, Nov 15, 2017 at 5:39 PM, Jason Gunthorpe <jgg@xxxxxxxx> wrote: > On Wed, Nov 15, 2017 at 09:01:07AM +0200, Erez Shitrit wrote: >> >> if (!IS_ERR_OR_NULL(ah)) { >> >> + /* check there is no mismatch from the request */ >> >> + if (memcmp(pathrec->dgid.raw, path->pathrec.dgid.raw, >> >> + sizeof(union ib_gid))) { >> >> + pr_warn("%s got PathRec for gid %pI6 while asked for %pI6\n", >> >> + dev->name, pathrec->dgid.raw, path->pathrec.dgid.raw); >> >> + /* overwrite the response from the sm before copy to the db */ >> >> + memcpy(pathrec->dgid.raw, path->pathrec.dgid.raw, >> >> + sizeof(union ib_gid)); >> > >> > This doesn't seem like it should be a warning, and replacing the >> > good DGID from the SA with local garbage seems really wrong. >> >> IPoIB is L2 driver and should act as a pipe and cannot add its opinion >> about what is a good or a garbage GID. > > Which is why ipoib should not override the result from the SA. It override only the DGID in the record, and that for IPoIB uses only, not the ah which is the important. otherwise if the host will re-ask again for that DGID it will not be found in IPoIB database, and new record will be created and so on till the end of all the device memory. > > It needs to work in a way where it looks up a DGID from the LLADDR and > gets back a wire GRH and LRH which come from SA. For that there is the ah object, this object is used as it came from the SA. > >> If the host is asking for specific mac address, IPoIB should return >> the response for the original request/mac and should not decide what >> is good for the host. > > No, it is up to the SA to return the GRH to put in the packets, it > should never be changed in any way by a ULP. The change is only for the ULP, the user/host has no idea of that, and it gets the same ah that came from the SA. > > 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