]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix context memory allocation.
authorMichael Chan <michael.chan@broadcom.com>
Sat, 12 Jan 2019 05:13:05 +0000 (00:13 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Jan 2019 18:51:39 +0000 (10:51 -0800)
commite3b85fdeb6a930f35ee44866f82efd8f2c4e44b1
tree7a58838481cb7dcd3981da30097deaddb1b7bdd1
parentef8733384598514824692db7c0b1d77ae1713d56
bnxt_en: Fix context memory allocation.

When allocating memory pages for context memory, if the last page table
should be fully populated, the current code will set nr_pages to 0 when
calling bnxt_alloc_ctx_mem_blk().  This will cause the last page table
to be completely blank and causing some RDMA failures.

Fix it by setting the last page table's nr_pages to the remainder only
if it is non-zero.

Fixes: 46294549b081 ("bnxt_en: Add Level 2 context memory paging support.")
Reported-by: Eric Davis <eric.davis@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c