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)
commitd7037ad73daa9598b8caa7d5fdf41e8ceee6ef73
tree45a88454360fce7a902b9e9e53ea638ab233ef09
parent8c49f54a3f48ddb516e7e12e5c065317c06a58fa
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: 3a2f70331226 ("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