Mellanox / nv_peer_memory

292 stars 60 forks source link

nv_peer_mem: Fix SGls #75

Open yishaih opened 3 years ago

yishaih commented 3 years ago

Fix SGls to hold the correct data in both the first and the last entries.

drossetti commented 3 years ago

you are also changing nv_mem_get_page_size(), which is beyond the description of this patch. but you are just adjusting the alignment for only the first and last entry of the sg_table. I'm struggling to find the connection between the two. Are they related ? It's weird probably because nv_mem_get_page_size() does not have a meaning for sg_table, where each entry has its own size.

jgunthorpe commented 3 years ago

get_page_size() was a hack that over-rides the automatic page size detection, and for old kernels it makes certain requirements on the construction of the sgl that are incompatible with this. New kernels ignore the result of get_page_size() and use the automatic page size detection from the SGL. Returning a 4k PAGE_SIZE and a properly formed SGL is compatible both ways.

ferasd commented 3 years ago

For now, this change will not be merged as it fixes functionality but introduces a performance degradation It will be on hold until changing the kernel part to override this degradation