diff options
author | Raed Salem <raeds@mellanox.com> | 2018-05-31 09:43:30 -0400 |
---|---|---|
committer | Leon Romanovsky <leonro@mellanox.com> | 2018-06-02 00:33:53 -0400 |
commit | 5f9bf63ae80c4d0e5e986b6c1280bf8174978545 (patch) | |
tree | 173d27ec399828f6ba3e12b9c7f2efccf42b3f05 | |
parent | 930821e39d0a5f91ed58fea1692afe04f0fe0e1f (diff) |
net/mlx5: Export flow counter related API
Exports counters API to be used in both IB and EN.
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Raed Salem <raeds@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c | 3 | ||||
-rw-r--r-- | include/linux/mlx5/fs.h | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h index 276b13d7ea43..4157dd76165e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | |||
@@ -233,8 +233,6 @@ void mlx5_fc_queue_stats_work(struct mlx5_core_dev *dev, | |||
233 | unsigned long delay); | 233 | unsigned long delay); |
234 | void mlx5_fc_update_sampling_interval(struct mlx5_core_dev *dev, | 234 | void mlx5_fc_update_sampling_interval(struct mlx5_core_dev *dev, |
235 | unsigned long interval); | 235 | unsigned long interval); |
236 | int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, | ||
237 | u64 *packets, u64 *bytes); | ||
238 | 236 | ||
239 | int mlx5_init_fs(struct mlx5_core_dev *dev); | 237 | int mlx5_init_fs(struct mlx5_core_dev *dev); |
240 | void mlx5_cleanup_fs(struct mlx5_core_dev *dev); | 238 | void mlx5_cleanup_fs(struct mlx5_core_dev *dev); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c index f5cb3fa5d8cf..58af6be13dfa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c | |||
@@ -243,6 +243,7 @@ err_out: | |||
243 | 243 | ||
244 | return ERR_PTR(err); | 244 | return ERR_PTR(err); |
245 | } | 245 | } |
246 | EXPORT_SYMBOL(mlx5_fc_create); | ||
246 | 247 | ||
247 | void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter) | 248 | void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter) |
248 | { | 249 | { |
@@ -260,6 +261,7 @@ void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter) | |||
260 | mlx5_cmd_fc_free(dev, counter->id); | 261 | mlx5_cmd_fc_free(dev, counter->id); |
261 | kfree(counter); | 262 | kfree(counter); |
262 | } | 263 | } |
264 | EXPORT_SYMBOL(mlx5_fc_destroy); | ||
263 | 265 | ||
264 | int mlx5_init_fc_stats(struct mlx5_core_dev *dev) | 266 | int mlx5_init_fc_stats(struct mlx5_core_dev *dev) |
265 | { | 267 | { |
@@ -317,6 +319,7 @@ int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, | |||
317 | { | 319 | { |
318 | return mlx5_cmd_fc_query(dev, counter->id, packets, bytes); | 320 | return mlx5_cmd_fc_query(dev, counter->id, packets, bytes); |
319 | } | 321 | } |
322 | EXPORT_SYMBOL(mlx5_fc_query); | ||
320 | 323 | ||
321 | void mlx5_fc_query_cached(struct mlx5_fc *counter, | 324 | void mlx5_fc_query_cached(struct mlx5_fc *counter, |
322 | u64 *bytes, u64 *packets, u64 *lastuse) | 325 | u64 *bytes, u64 *packets, u64 *lastuse) |
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h index 9f4d32e41c06..3b4c3298061c 100644 --- a/include/linux/mlx5/fs.h +++ b/include/linux/mlx5/fs.h | |||
@@ -186,6 +186,9 @@ struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging); | |||
186 | void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter); | 186 | void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter); |
187 | void mlx5_fc_query_cached(struct mlx5_fc *counter, | 187 | void mlx5_fc_query_cached(struct mlx5_fc *counter, |
188 | u64 *bytes, u64 *packets, u64 *lastuse); | 188 | u64 *bytes, u64 *packets, u64 *lastuse); |
189 | int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, | ||
190 | u64 *packets, u64 *bytes); | ||
191 | |||
189 | int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); | 192 | int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); |
190 | int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); | 193 | int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); |
191 | 194 | ||