diff options
author | Tariq Toukan <tariqt@mellanox.com> | 2018-08-21 09:04:41 -0400 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-09-05 20:08:33 -0400 |
commit | 8d71e818506718e8d7032ce824b5c74a17d4f7a5 (patch) | |
tree | 1c20f622f9f26092a94a121d782b38f68ca4302f | |
parent | 5df816e7f43f1297c40021ef17ec6e722b45c82f (diff) |
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>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/wq.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/wq.h | 2 | ||||
-rw-r--r-- | include/linux/mlx5/driver.h | 2 |
3 files changed, 4 insertions, 4 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) | |||
39 | return (u32)wq->fbc.sz_m1 + 1; | 39 | return (u32)wq->fbc.sz_m1 + 1; |
40 | } | 40 | } |
41 | 41 | ||
42 | u32 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq) | 42 | u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq) |
43 | { | 43 | { |
44 | return (u32)wq->fbc.frag_sz_m1 + 1; | 44 | return wq->fbc.frag_sz_m1 + 1; |
45 | } | 45 | } |
46 | 46 | ||
47 | u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq) | 47 | u32 mlx5_cqwq_get_size(struct mlx5_cqwq *wq) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/wq.h b/drivers/net/ethernet/mellanox/mlx5/core/wq.h index 2bd4c3184eba..3a1a170bb2d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/wq.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/wq.h | |||
@@ -80,7 +80,7 @@ int mlx5_wq_cyc_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param, | |||
80 | void *wqc, struct mlx5_wq_cyc *wq, | 80 | void *wqc, struct mlx5_wq_cyc *wq, |
81 | struct mlx5_wq_ctrl *wq_ctrl); | 81 | struct mlx5_wq_ctrl *wq_ctrl); |
82 | u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq); | 82 | u32 mlx5_wq_cyc_get_size(struct mlx5_wq_cyc *wq); |
83 | u32 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq); | 83 | u16 mlx5_wq_cyc_get_frag_size(struct mlx5_wq_cyc *wq); |
84 | 84 | ||
85 | int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param, | 85 | int mlx5_wq_qp_create(struct mlx5_core_dev *mdev, struct mlx5_wq_param *param, |
86 | void *qpc, struct mlx5_wq_qp *wq, | 86 | void *qpc, struct mlx5_wq_qp *wq, |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index aa65f58c6610..3a1258fd8ac3 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
@@ -362,7 +362,7 @@ struct mlx5_frag_buf { | |||
362 | struct mlx5_frag_buf_ctrl { | 362 | struct mlx5_frag_buf_ctrl { |
363 | struct mlx5_frag_buf frag_buf; | 363 | struct mlx5_frag_buf frag_buf; |
364 | u32 sz_m1; | 364 | u32 sz_m1; |
365 | u32 frag_sz_m1; | 365 | u16 frag_sz_m1; |
366 | u32 strides_offset; | 366 | u32 strides_offset; |
367 | u8 log_sz; | 367 | u8 log_sz; |
368 | u8 log_stride; | 368 | u8 log_stride; |