diff options
author | Rana Shahout <ranas@mellanox.com> | 2015-05-28 15:28:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-30 21:23:59 -0400 |
commit | 90b3e38d048f09b22fb50bcd460cea65fd00b2d7 (patch) | |
tree | 66b2f0aadc31cfb8d333a9fc5b7e0a194f6f2fb9 | |
parent | 4c916a798058c1acf5a980438416020932c24aca (diff) |
net/mlx5_core: Modify CQ moderation parameters
Introduce mlx5_core_modify_cq_moderation() to be used by the netdev, to
set hardware coalescing.
Signed-off-by: Rana Shahout <ranas@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/cq.c | 18 | ||||
-rw-r--r-- | include/linux/mlx5/cq.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c index eb0cf81f5f45..04ab7e445eae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c | |||
@@ -219,6 +219,24 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | |||
219 | } | 219 | } |
220 | EXPORT_SYMBOL(mlx5_core_modify_cq); | 220 | EXPORT_SYMBOL(mlx5_core_modify_cq); |
221 | 221 | ||
222 | int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, | ||
223 | struct mlx5_core_cq *cq, | ||
224 | u16 cq_period, | ||
225 | u16 cq_max_count) | ||
226 | { | ||
227 | struct mlx5_modify_cq_mbox_in in; | ||
228 | |||
229 | memset(&in, 0, sizeof(in)); | ||
230 | |||
231 | in.cqn = cpu_to_be32(cq->cqn); | ||
232 | in.ctx.cq_period = cpu_to_be16(cq_period); | ||
233 | in.ctx.cq_max_count = cpu_to_be16(cq_max_count); | ||
234 | in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | | ||
235 | MLX5_CQ_MODIFY_COUNT); | ||
236 | |||
237 | return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); | ||
238 | } | ||
239 | |||
222 | int mlx5_init_cq_table(struct mlx5_core_dev *dev) | 240 | int mlx5_init_cq_table(struct mlx5_core_dev *dev) |
223 | { | 241 | { |
224 | struct mlx5_cq_table *table = &dev->priv.cq_table; | 242 | struct mlx5_cq_table *table = &dev->priv.cq_table; |
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h index 2695ced222df..abc4767695e4 100644 --- a/include/linux/mlx5/cq.h +++ b/include/linux/mlx5/cq.h | |||
@@ -169,6 +169,9 @@ int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | |||
169 | struct mlx5_query_cq_mbox_out *out); | 169 | struct mlx5_query_cq_mbox_out *out); |
170 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, | 170 | int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, |
171 | struct mlx5_modify_cq_mbox_in *in, int in_sz); | 171 | struct mlx5_modify_cq_mbox_in *in, int in_sz); |
172 | int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, | ||
173 | struct mlx5_core_cq *cq, u16 cq_period, | ||
174 | u16 cq_max_count); | ||
172 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | 175 | int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); |
173 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); | 176 | void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); |
174 | 177 | ||