]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix QP fragmented buffer allocation
authorTariq Toukan <tariqt@mellanox.com>
Sun, 8 Jul 2018 09:14:59 +0000 (12:14 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 19 Jul 2018 01:16:58 +0000 (18:16 -0700)
commit441f46f08e9c42a386dd5d600a131d3ed7e84042
tree45a88454360fce7a902b9e9e53ea638ab233ef09
parent2109f118cc1d73b3a9a64932a8d407739cd2b092
net/mlx5: Fix QP fragmented buffer allocation

Fix bad alignment of SQ buffer in fragmented QP allocation.
It should start directly after RQ buffer ends.

Take special care of the end case where the RQ buffer does not occupy
a whole page. RQ size is a power of two, so would be the case only for
small RQ sizes (RQ size < PAGE_SIZE).

Fix wrong assignments for sqb->size (mistakenly assigned RQ size),
and for npages value of RQ and SQ.

Fixes: e78b285cd520 ("net/mlx5: Use order-0 allocations for all WQ types")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/alloc.c
drivers/net/ethernet/mellanox/mlx5/core/wq.c
include/linux/mlx5/driver.h