net/mlx5: cleanup header file

The cleanup refers to header file mlx5.h.
1. Remove unused prototypes.
2. Move prototypes under their correct title.
3. Change functions to static and remove their prototye from the header
file.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
This commit is contained in:
Ophir Munk 2020-07-19 10:18:14 +00:00 committed by Ferruh Yigit
parent 98c4b12afa
commit ef9ee13f6e
2 changed files with 59 additions and 62 deletions

View File

@ -972,6 +972,57 @@ mlx5_is_removed(struct rte_eth_dev *dev)
return 0;
}
/**
* Analyze gathered port parameters via sysfs to recognize master
* and representor devices for E-Switch configuration.
*
* @param[in] device_dir
* flag of presence of "device" directory under port device key.
* @param[inout] switch_info
* Port information, including port name as a number and port name
* type if recognized
*
* @return
* master and representor flags are set in switch_info according to
* recognized parameters (if any).
*/
static void
mlx5_sysfs_check_switch_info(bool device_dir,
struct mlx5_switch_info *switch_info)
{
switch (switch_info->name_type) {
case MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN:
/*
* Name is not recognized, assume the master,
* check the device directory presence.
*/
switch_info->master = device_dir;
break;
case MLX5_PHYS_PORT_NAME_TYPE_NOTSET:
/*
* Name is not set, this assumes the legacy naming
* schema for master, just check if there is
* a device directory.
*/
switch_info->master = device_dir;
break;
case MLX5_PHYS_PORT_NAME_TYPE_UPLINK:
/* New uplink naming schema recognized. */
switch_info->master = 1;
break;
case MLX5_PHYS_PORT_NAME_TYPE_LEGACY:
/* Legacy representors naming schema. */
switch_info->representor = !device_dir;
break;
case MLX5_PHYS_PORT_NAME_TYPE_PFHPF:
/* Fallthrough */
case MLX5_PHYS_PORT_NAME_TYPE_PFVF:
/* New representors naming schema. */
switch_info->representor = 1;
break;
}
}
/**
* Get switch information associated with network interface.
*
@ -1050,57 +1101,6 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
return 0;
}
/**
* Analyze gathered port parameters via sysfs to recognize master
* and representor devices for E-Switch configuration.
*
* @param[in] device_dir
* flag of presence of "device" directory under port device key.
* @param[inout] switch_info
* Port information, including port name as a number and port name
* type if recognized
*
* @return
* master and representor flags are set in switch_info according to
* recognized parameters (if any).
*/
void
mlx5_sysfs_check_switch_info(bool device_dir,
struct mlx5_switch_info *switch_info)
{
switch (switch_info->name_type) {
case MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN:
/*
* Name is not recognized, assume the master,
* check the device directory presence.
*/
switch_info->master = device_dir;
break;
case MLX5_PHYS_PORT_NAME_TYPE_NOTSET:
/*
* Name is not set, this assumes the legacy naming
* schema for master, just check if there is
* a device directory.
*/
switch_info->master = device_dir;
break;
case MLX5_PHYS_PORT_NAME_TYPE_UPLINK:
/* New uplink naming schema recognized. */
switch_info->master = 1;
break;
case MLX5_PHYS_PORT_NAME_TYPE_LEGACY:
/* Legacy representors naming schema. */
switch_info->representor = !device_dir;
break;
case MLX5_PHYS_PORT_NAME_TYPE_PFHPF:
/* Fallthrough */
case MLX5_PHYS_PORT_NAME_TYPE_PFVF:
/* New representors naming schema. */
switch_info->representor = 1;
break;
}
}
/**
* DPDK callback to retrieve plug-in module EEPROM information (type and size).
*

View File

@ -815,6 +815,10 @@ const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev);
int mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu);
int mlx5_hairpin_cap_get(struct rte_eth_dev *dev,
struct rte_eth_hairpin_cap *cap);
eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev);
struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid);
struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev);
int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev);
/* mlx5_ethdev_os.c */
@ -825,27 +829,17 @@ int mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *mtu);
int mlx5_set_mtu(struct rte_eth_dev *dev, uint16_t mtu);
int mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock);
int mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete);
int mlx5_force_link_status_change(struct rte_eth_dev *dev, int status);
int mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev,
struct rte_eth_fc_conf *fc_conf);
int mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev,
struct rte_eth_fc_conf *fc_conf);
void mlx5_dev_link_status_handler(void *arg);
void mlx5_dev_interrupt_handler(void *arg);
void mlx5_dev_interrupt_handler_devx(void *arg);
void mlx5_dev_interrupt_handler_uninstall(struct rte_eth_dev *dev);
void mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev);
int mlx5_set_link_down(struct rte_eth_dev *dev);
int mlx5_set_link_up(struct rte_eth_dev *dev);
int mlx5_is_removed(struct rte_eth_dev *dev);
eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev);
eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev);
struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid);
struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev);
int mlx5_sysfs_switch_info(unsigned int ifindex,
struct mlx5_switch_info *info);
void mlx5_sysfs_check_switch_info(bool device_dir,
struct mlx5_switch_info *switch_info);
void mlx5_translate_port_name(const char *port_name_in,
struct mlx5_switch_info *port_info_out);
void mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,
@ -854,7 +848,6 @@ int mlx5_get_module_info(struct rte_eth_dev *dev,
struct rte_eth_dev_module_info *modinfo);
int mlx5_get_module_eeprom(struct rte_eth_dev *dev,
struct rte_dev_eeprom_info *info);
int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev);
int mlx5_os_read_dev_stat(struct mlx5_priv *priv,
const char *ctr_name, uint64_t *stat);
int mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats);
@ -1045,4 +1038,8 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev,
unsigned int n, unsigned int n_used);
void mlx5_txpp_interrupt_handler(void *cb_arg);
/* mlx5_rxtx.c */
eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev);
#endif /* RTE_PMD_MLX5_H_ */