]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/efa: Use kvzalloc instead of kzalloc with fallback
authorGal Pressman <galpress@amazon.com>
Tue, 28 May 2019 12:46:14 +0000 (15:46 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 29 May 2019 16:14:14 +0000 (13:14 -0300)
commit2dca12473f46e47b4aa329f49804837656065a73
tree12d00ce0aa21fe81312b519d1b965a5946d41437
parent39e0f94103b0259ea8c1a9588cc26989cbbe9dcb
RDMA/efa: Use kvzalloc instead of kzalloc with fallback

Use kvzalloc which attempts to allocate a physically continuous buffer and
fallbacks to virtually continuous on failure instead of open coding it in
the driver.

The is_vmalloc_addr function is used to determine whether the buffer is
physically continuous or not (which determines direct vs indirect MR
registration mode).

Suggested-by: Jason Gunthorpe <jgg@ziepe.ca>
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/efa/efa_verbs.c