Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /* Copyright (c) 2020 Mellanox Technologies Ltd */
0003 
0004 #ifndef __MLX5_SF_H__
0005 #define __MLX5_SF_H__
0006 
0007 #include <linux/mlx5/driver.h>
0008 #include "lib/sf.h"
0009 
0010 #ifdef CONFIG_MLX5_SF_MANAGER
0011 
0012 int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev);
0013 void mlx5_sf_hw_table_cleanup(struct mlx5_core_dev *dev);
0014 
0015 int mlx5_sf_hw_table_create(struct mlx5_core_dev *dev);
0016 void mlx5_sf_hw_table_destroy(struct mlx5_core_dev *dev);
0017 
0018 int mlx5_sf_table_init(struct mlx5_core_dev *dev);
0019 void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev);
0020 
0021 int mlx5_devlink_sf_port_new(struct devlink *devlink,
0022                  const struct devlink_port_new_attrs *add_attr,
0023                  struct netlink_ext_ack *extack,
0024                  unsigned int *new_port_index);
0025 int mlx5_devlink_sf_port_del(struct devlink *devlink, unsigned int port_index,
0026                  struct netlink_ext_ack *extack);
0027 int mlx5_devlink_sf_port_fn_state_get(struct devlink_port *dl_port,
0028                       enum devlink_port_fn_state *state,
0029                       enum devlink_port_fn_opstate *opstate,
0030                       struct netlink_ext_ack *extack);
0031 int mlx5_devlink_sf_port_fn_state_set(struct devlink_port *dl_port,
0032                       enum devlink_port_fn_state state,
0033                       struct netlink_ext_ack *extack);
0034 #else
0035 
0036 static inline int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev)
0037 {
0038     return 0;
0039 }
0040 
0041 static inline void mlx5_sf_hw_table_cleanup(struct mlx5_core_dev *dev)
0042 {
0043 }
0044 
0045 static inline int mlx5_sf_hw_table_create(struct mlx5_core_dev *dev)
0046 {
0047     return 0;
0048 }
0049 
0050 static inline void mlx5_sf_hw_table_destroy(struct mlx5_core_dev *dev)
0051 {
0052 }
0053 
0054 static inline int mlx5_sf_table_init(struct mlx5_core_dev *dev)
0055 {
0056     return 0;
0057 }
0058 
0059 static inline void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev)
0060 {
0061 }
0062 
0063 #endif
0064 
0065 #endif