On Tue, Apr 13, 2021 at 11:36:05AM -0700, Manjunath Patil wrote: > Currently ipoib connected mode queries the device[HCA] to get pkey table > entry during connection formation. This will increase the time taken to > form the connection, especially when limited pkeys are in use. This > gets worse when multiple connection attempts are done in parallel. > > Since ipoib interfaces are locked to a single pkey, use the pkey index > that was determined at link up time instead of searching anything. > > This improved the latency from 500ms to 1ms on an internal setup. > > Suggested-by: Jason Gunthorpe <jgg@xxxxxxxxxx> > Signed-off-by: Manjunath Patil <manjunath.b.patil@xxxxxxxxxx> > --- > v2: v1 used the cached version[ib_find_cached_pkey()] to get the pkey table > entry. Following the Jason's comments for v1, I switched to pkey index that was > determined at link up time in v2. Can you confirm that the pkey index does get updated if the SM changes the pkey table? (and if so how is the locking done for reading the pkey_index?) That is about the only reason to have had a dedicated query here Jason