]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix SQ offset in QPs with small RQ
authorTariq Toukan <tariqt@mellanox.com>
Mon, 3 Sep 2018 15:06:24 +0000 (18:06 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Sep 2018 19:17:33 +0000 (12:17 -0700)
commitd23db0833357e88457d53574987a9b3d935f5f95
tree47f3bb3050bd9f0e80850236e54b6994709aa226
parentdbc89130d3ffbe12633bd7163601d6071f88680e
net/mlx5: Fix SQ offset in QPs with small RQ

Correct the formula for calculating the RQ page remainder,
which should be in byte granularity.  The result will be
non-zero only for RQs smaller than PAGE_SIZE, as an RQ size
is a power of 2.

Divide this by the SQ stride (MLX5_SEND_WQE_BB) to get the
SQ offset in strides granularity.

Fixes: 4d8df7ccad94 ("net/mlx5: Fix QP fragmented buffer allocation")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/wq.c