From: Raed Salem Date: Thu, 31 May 2018 13:43:30 +0000 (+0300) Subject: net/mlx5: Export flow counter related API X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5f9bf63ae80c4d0e5e986b6c1280bf8174978545;p=openwrt%2Fstaging%2Fblogic.git net/mlx5: Export flow counter related API Exports counters API to be used in both IB and EN. Reviewed-by: Yishai Hadas Signed-off-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- 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, unsigned long delay); void mlx5_fc_update_sampling_interval(struct mlx5_core_dev *dev, unsigned long interval); -int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, - u64 *packets, u64 *bytes); int mlx5_init_fs(struct mlx5_core_dev *dev); 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: return ERR_PTR(err); } +EXPORT_SYMBOL(mlx5_fc_create); void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter) { @@ -260,6 +261,7 @@ void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter) mlx5_cmd_fc_free(dev, counter->id); kfree(counter); } +EXPORT_SYMBOL(mlx5_fc_destroy); int mlx5_init_fc_stats(struct mlx5_core_dev *dev) { @@ -317,6 +319,7 @@ int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, { return mlx5_cmd_fc_query(dev, counter->id, packets, bytes); } +EXPORT_SYMBOL(mlx5_fc_query); void mlx5_fc_query_cached(struct mlx5_fc *counter, 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); void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter); void mlx5_fc_query_cached(struct mlx5_fc *counter, u64 *bytes, u64 *packets, u64 *lastuse); +int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter, + u64 *packets, u64 *bytes); + int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn); int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);