summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/wq.c
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2018-08-21 16:04:41 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2018-09-05 17:08:33 -0700
commit8d71e818506718e8d7032ce824b5c74a17d4f7a5 (patch)
tree1c20f622f9f26092a94a121d782b38f68ca4302f /drivers/net/ethernet/mellanox/mlx5/core/wq.c
parent5df816e7f43f1297c40021ef17ec6e722b45c82f (diff)
downloadlinux-8d71e818506718e8d7032ce824b5c74a17d4f7a5.tar.bz2
net/mlx5: Use u16 for Work Queue buffer fragment size
Minimal stride size is 16. Hence, the number of strides in a fragment (of PAGE_SIZE) is <= PAGE_SIZE / 16 <= 4K. u16 is sufficient to represent this. Fixes: 388ca8be0037 ("IB/mlx5: Implement fragmented completion queue (CQ)") Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/wq.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/wq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/wq.c b/drivers/net/ethernet/mellanox/mlx5/core/wq.c
index c8c315eb5128..d838af9539b1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/wq.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/wq.c
@@ -39,9 +39,9 @@ u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq)
return (u32)wq->fbc.sz_m1 + 1;
}
-u32 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq)
+u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq)
{
- return (u32)wq->fbc.frag_sz_m1 + 1;
+ return wq->fbc.frag_sz_m1 + 1;
}
u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq)