sf.h (1733B)
1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2/* Copyright (c) 2020 Mellanox Technologies Ltd */ 3 4#ifndef __MLX5_SF_H__ 5#define __MLX5_SF_H__ 6 7#include <linux/mlx5/driver.h> 8#include "lib/sf.h" 9 10#ifdef CONFIG_MLX5_SF_MANAGER 11 12int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev); 13void mlx5_sf_hw_table_cleanup(struct mlx5_core_dev *dev); 14 15int mlx5_sf_hw_table_create(struct mlx5_core_dev *dev); 16void mlx5_sf_hw_table_destroy(struct mlx5_core_dev *dev); 17 18int mlx5_sf_table_init(struct mlx5_core_dev *dev); 19void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev); 20 21int mlx5_devlink_sf_port_new(struct devlink *devlink, 22 const struct devlink_port_new_attrs *add_attr, 23 struct netlink_ext_ack *extack, 24 unsigned int *new_port_index); 25int mlx5_devlink_sf_port_del(struct devlink *devlink, unsigned int port_index, 26 struct netlink_ext_ack *extack); 27int mlx5_devlink_sf_port_fn_state_get(struct devlink_port *dl_port, 28 enum devlink_port_fn_state *state, 29 enum devlink_port_fn_opstate *opstate, 30 struct netlink_ext_ack *extack); 31int mlx5_devlink_sf_port_fn_state_set(struct devlink_port *dl_port, 32 enum devlink_port_fn_state state, 33 struct netlink_ext_ack *extack); 34#else 35 36static inline int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev) 37{ 38 return 0; 39} 40 41static inline void mlx5_sf_hw_table_cleanup(struct mlx5_core_dev *dev) 42{ 43} 44 45static inline int mlx5_sf_hw_table_create(struct mlx5_core_dev *dev) 46{ 47 return 0; 48} 49 50static inline void mlx5_sf_hw_table_destroy(struct mlx5_core_dev *dev) 51{ 52} 53 54static inline int mlx5_sf_table_init(struct mlx5_core_dev *dev) 55{ 56 return 0; 57} 58 59static inline void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev) 60{ 61} 62 63#endif 64 65#endif