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)
commit255efcaeb623dd9777523b98d29aa5a0792d9245
tree12d00ce0aa21fe81312b519d1b965a5946d41437
parent5f5e4eb4fb2d6c09db18dc431a0c4a3b11ff5bae
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