#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/if_vlan.h>
#include <linux/crash_dump.h>
#include <net/ipv6.h>
#include <net/rtnetlink.h>
#include "hclge_cmd.h"
#include "hclge_dcb.h"
#include "hclge_main.h"
#include "hclge_mbx.h"
#include "hclge_mdio.h"
#include "hclge_regs.h"
#include "hclge_tm.h"
#include "hclge_err.h"
#include "hnae3.h"
#include "hclge_devlink.h"
#include "hclge_comm_cmd.h"
#include "hclge_trace.h"
#define HCLGE_NAME …
#define HCLGE_BUF_SIZE_UNIT …
#define HCLGE_BUF_MUL_BY …
#define HCLGE_BUF_DIV_BY …
#define NEED_RESERVE_TC_NUM …
#define BUF_MAX_PERCENT …
#define BUF_RESERVE_PERCENT …
#define HCLGE_RESET_MAX_FAIL_CNT …
#define HCLGE_RESET_SYNC_TIME …
#define HCLGE_PF_RESET_SYNC_TIME …
#define HCLGE_PF_RESET_SYNC_CNT …
#define HCLGE_LINK_STATUS_MS …
static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mps);
static int hclge_init_vlan_config(struct hclge_dev *hdev);
static void hclge_sync_vlan_filter(struct hclge_dev *hdev);
static int hclge_reset_ae_dev(struct hnae3_ae_dev *ae_dev);
static bool hclge_get_hw_reset_stat(struct hnae3_handle *handle);
static void hclge_rfs_filter_expire(struct hclge_dev *hdev);
static int hclge_clear_arfs_rules(struct hclge_dev *hdev);
static enum hnae3_reset_type hclge_get_reset_level(struct hnae3_ae_dev *ae_dev,
unsigned long *addr);
static int hclge_set_default_loopback(struct hclge_dev *hdev);
static void hclge_sync_mac_table(struct hclge_dev *hdev);
static void hclge_restore_hw_table(struct hclge_dev *hdev);
static void hclge_sync_promisc_mode(struct hclge_dev *hdev);
static void hclge_sync_fd_table(struct hclge_dev *hdev);
static void hclge_update_fec_stats(struct hclge_dev *hdev);
static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret,
int wait_cnt);
static int hclge_update_port_info(struct hclge_dev *hdev);
static struct hnae3_ae_algo ae_algo;
static struct workqueue_struct *hclge_wq;
static const struct pci_device_id ae_algo_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, ae_algo_pci_tbl);
static const char hns3_nic_test_strs[][ETH_GSTRING_LEN] = …;
static const struct hclge_comm_stats_str g_mac_stats_string[] = …;
static const struct hclge_mac_mgr_tbl_entry_cmd hclge_mgr_table[] = …;
static const struct key_info meta_data_key_info[] = …;
static const struct key_info tuple_key_info[] = …;
int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
{ … }
static void hclge_trace_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc,
int num, bool is_special)
{ … }
static void hclge_trace_cmd_get(struct hclge_comm_hw *hw, struct hclge_desc *desc,
int num, bool is_special)
{ … }
static const struct hclge_comm_cmq_ops hclge_cmq_ops = …;
static int hclge_mac_update_stats_defective(struct hclge_dev *hdev)
{ … }
static int hclge_mac_update_stats_complete(struct hclge_dev *hdev)
{ … }
static int hclge_mac_query_reg_num(struct hclge_dev *hdev, u32 *reg_num)
{ … }
int hclge_mac_update_stats(struct hclge_dev *hdev)
{ … }
static int hclge_comm_get_count(struct hclge_dev *hdev,
const struct hclge_comm_stats_str strs[],
u32 size)
{ … }
static u64 *hclge_comm_get_stats(struct hclge_dev *hdev,
const struct hclge_comm_stats_str strs[],
int size, u64 *data)
{ … }
static u8 *hclge_comm_get_strings(struct hclge_dev *hdev, u32 stringset,
const struct hclge_comm_stats_str strs[],
int size, u8 *data)
{ … }
static void hclge_update_stats_for_all(struct hclge_dev *hdev)
{ … }
static void hclge_update_stats(struct hnae3_handle *handle)
{ … }
static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset)
{ … }
static void hclge_get_strings(struct hnae3_handle *handle, u32 stringset,
u8 *data)
{ … }
static void hclge_get_stats(struct hnae3_handle *handle, u64 *data)
{ … }
static void hclge_get_mac_stat(struct hnae3_handle *handle,
struct hns3_mac_stats *mac_stats)
{ … }
static int hclge_parse_func_status(struct hclge_dev *hdev,
struct hclge_func_status_cmd *status)
{ … }
static int hclge_query_function_status(struct hclge_dev *hdev)
{ … }
static int hclge_query_pf_resource(struct hclge_dev *hdev)
{ … }
static int hclge_parse_speed(u8 speed_cmd, u32 *speed)
{ … }
static const struct hclge_speed_bit_map speed_bit_map[] = …;
static int hclge_get_speed_bit(u32 speed, u32 *speed_bit)
{ … }
static int hclge_check_port_speed(struct hnae3_handle *handle, u32 speed)
{ … }
static void hclge_update_fec_support(struct hclge_mac *mac)
{ … }
static const struct hclge_link_mode_bmap hclge_sr_link_mode_bmap[] = …;
static const struct hclge_link_mode_bmap hclge_lr_link_mode_bmap[] = …;
static const struct hclge_link_mode_bmap hclge_cr_link_mode_bmap[] = …;
static const struct hclge_link_mode_bmap hclge_kr_link_mode_bmap[] = …;
static void hclge_convert_setting_sr(u16 speed_ability,
unsigned long *link_mode)
{ … }
static void hclge_convert_setting_lr(u16 speed_ability,
unsigned long *link_mode)
{ … }
static void hclge_convert_setting_cr(u16 speed_ability,
unsigned long *link_mode)
{ … }
static void hclge_convert_setting_kr(u16 speed_ability,
unsigned long *link_mode)
{ … }
static void hclge_convert_setting_fec(struct hclge_mac *mac)
{ … }
static void hclge_parse_fiber_link_mode(struct hclge_dev *hdev,
u16 speed_ability)
{ … }
static void hclge_parse_backplane_link_mode(struct hclge_dev *hdev,
u16 speed_ability)
{ … }
static void hclge_parse_copper_link_mode(struct hclge_dev *hdev,
u16 speed_ability)
{ … }
static void hclge_parse_link_mode(struct hclge_dev *hdev, u16 speed_ability)
{ … }
static u32 hclge_get_max_speed(u16 speed_ability)
{ … }
static void hclge_parse_cfg(struct hclge_cfg *cfg, struct hclge_desc *desc)
{ … }
static int hclge_get_cfg(struct hclge_dev *hdev, struct hclge_cfg *hcfg)
{ … }
static void hclge_set_default_dev_specs(struct hclge_dev *hdev)
{ … }
static void hclge_parse_dev_specs(struct hclge_dev *hdev,
struct hclge_desc *desc)
{ … }
static void hclge_check_dev_specs(struct hclge_dev *hdev)
{ … }
static int hclge_query_mac_stats_num(struct hclge_dev *hdev)
{ … }
static int hclge_query_dev_specs(struct hclge_dev *hdev)
{ … }
static int hclge_get_cap(struct hclge_dev *hdev)
{ … }
static void hclge_init_kdump_kernel_config(struct hclge_dev *hdev)
{ … }
static void hclge_init_tc_config(struct hclge_dev *hdev)
{ … }
static int hclge_configure(struct hclge_dev *hdev)
{ … }
static int hclge_config_tso(struct hclge_dev *hdev, u16 tso_mss_min,
u16 tso_mss_max)
{ … }
static int hclge_config_gro(struct hclge_dev *hdev)
{ … }
static int hclge_alloc_tqps(struct hclge_dev *hdev)
{ … }
static int hclge_map_tqps_to_func(struct hclge_dev *hdev, u16 func_id,
u16 tqp_pid, u16 tqp_vid, bool is_pf)
{ … }
static int hclge_assign_tqp(struct hclge_vport *vport, u16 num_tqps)
{ … }
static int hclge_knic_setup(struct hclge_vport *vport, u16 num_tqps,
u16 num_tx_desc, u16 num_rx_desc)
{ … }
static int hclge_map_tqp_to_vport(struct hclge_dev *hdev,
struct hclge_vport *vport)
{ … }
static int hclge_map_tqp(struct hclge_dev *hdev)
{ … }
static int hclge_vport_setup(struct hclge_vport *vport, u16 num_tqps)
{ … }
static int hclge_alloc_vport(struct hclge_dev *hdev)
{ … }
static int hclge_cmd_alloc_tx_buff(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_tx_buffer_alloc(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static u32 hclge_get_tc_num(struct hclge_dev *hdev)
{ … }
static int hclge_get_pfc_priv_num(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_get_no_pfc_priv_num(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static u32 hclge_get_rx_priv_buff_alloced(struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static u32 hclge_get_tx_buff_alloced(struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static bool hclge_is_rx_buf_ok(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc,
u32 rx_all)
{ … }
static int hclge_tx_buffer_calc(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static bool hclge_rx_buf_calc_all(struct hclge_dev *hdev, bool max,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static bool hclge_drop_nopfc_buf_till_fit(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static bool hclge_drop_pfc_buf_till_fit(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_only_alloc_priv_buff(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_rx_buffer_calc(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_rx_priv_buf_alloc(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_rx_priv_wl_config(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_common_thrd_config(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
static int hclge_common_wl_config(struct hclge_dev *hdev,
struct hclge_pkt_buf_alloc *buf_alloc)
{ … }
int hclge_buffer_alloc(struct hclge_dev *hdev)
{ … }
static int hclge_init_roce_base_info(struct hclge_vport *vport)
{ … }
static int hclge_init_msi(struct hclge_dev *hdev)
{ … }
static u8 hclge_check_speed_dup(u8 duplex, int speed)
{ … }
static struct hclge_mac_speed_map hclge_mac_speed_map_to_fw[] = …;
static int hclge_convert_to_fw_speed(u32 speed_drv, u32 *speed_fw)
{ … }
static int hclge_cfg_mac_speed_dup_hw(struct hclge_dev *hdev, int speed,
u8 duplex, u8 lane_num)
{ … }
int hclge_cfg_mac_speed_dup(struct hclge_dev *hdev, int speed, u8 duplex, u8 lane_num)
{ … }
static int hclge_cfg_mac_speed_dup_h(struct hnae3_handle *handle, int speed,
u8 duplex, u8 lane_num)
{ … }
static int hclge_set_autoneg_en(struct hclge_dev *hdev, bool enable)
{ … }
static int hclge_set_autoneg(struct hnae3_handle *handle, bool enable)
{ … }
static int hclge_get_autoneg(struct hnae3_handle *handle)
{ … }
static int hclge_restart_autoneg(struct hnae3_handle *handle)
{ … }
static int hclge_halt_autoneg(struct hnae3_handle *handle, bool halt)
{ … }
static void hclge_parse_fec_stats_lanes(struct hclge_dev *hdev,
struct hclge_desc *desc, u32 desc_len)
{ … }
static void hclge_parse_fec_stats(struct hclge_dev *hdev,
struct hclge_desc *desc, u32 desc_len)
{ … }
static int hclge_update_fec_stats_hw(struct hclge_dev *hdev)
{ … }
static void hclge_update_fec_stats(struct hclge_dev *hdev)
{ … }
static void hclge_get_fec_stats_total(struct hclge_dev *hdev,
struct ethtool_fec_stats *fec_stats)
{ … }
static void hclge_get_fec_stats_lanes(struct hclge_dev *hdev,
struct ethtool_fec_stats *fec_stats)
{ … }
static void hclge_comm_get_fec_stats(struct hclge_dev *hdev,
struct ethtool_fec_stats *fec_stats)
{ … }
static void hclge_get_fec_stats(struct hnae3_handle *handle,
struct ethtool_fec_stats *fec_stats)
{ … }
static int hclge_set_fec_hw(struct hclge_dev *hdev, u32 fec_mode)
{ … }
static int hclge_set_fec(struct hnae3_handle *handle, u32 fec_mode)
{ … }
static void hclge_get_fec(struct hnae3_handle *handle, u8 *fec_ability,
u8 *fec_mode)
{ … }
static int hclge_mac_init(struct hclge_dev *hdev)
{ … }
static void hclge_mbx_task_schedule(struct hclge_dev *hdev)
{ … }
static void hclge_reset_task_schedule(struct hclge_dev *hdev)
{ … }
static void hclge_errhand_task_schedule(struct hclge_dev *hdev)
{ … }
void hclge_task_schedule(struct hclge_dev *hdev, unsigned long delay_time)
{ … }
static int hclge_get_mac_link_status(struct hclge_dev *hdev, int *link_status)
{ … }
static int hclge_get_mac_phy_link(struct hclge_dev *hdev, int *link_status)
{ … }
static void hclge_push_link_status(struct hclge_dev *hdev)
{ … }
static void hclge_update_link_status(struct hclge_dev *hdev)
{ … }
static void hclge_update_speed_advertising(struct hclge_mac *mac)
{ … }
static void hclge_update_fec_advertising(struct hclge_mac *mac)
{ … }
static void hclge_update_pause_advertising(struct hclge_dev *hdev)
{ … }
static void hclge_update_advertising(struct hclge_dev *hdev)
{ … }
static void hclge_update_port_capability(struct hclge_dev *hdev,
struct hclge_mac *mac)
{ … }
static int hclge_get_sfp_speed(struct hclge_dev *hdev, u32 *speed)
{ … }
static int hclge_get_sfp_info(struct hclge_dev *hdev, struct hclge_mac *mac)
{ … }
static int hclge_get_phy_link_ksettings(struct hnae3_handle *handle,
struct ethtool_link_ksettings *cmd)
{ … }
static int
hclge_set_phy_link_ksettings(struct hnae3_handle *handle,
const struct ethtool_link_ksettings *cmd)
{ … }
static int hclge_update_tp_port_info(struct hclge_dev *hdev)
{ … }
static int hclge_tp_port_init(struct hclge_dev *hdev)
{ … }
static int hclge_update_port_info(struct hclge_dev *hdev)
{ … }
static int hclge_get_status(struct hnae3_handle *handle)
{ … }
struct hclge_vport *hclge_get_vf_vport(struct hclge_dev *hdev, int vf)
{ … }
static int hclge_get_vf_config(struct hnae3_handle *handle, int vf,
struct ifla_vf_info *ivf)
{ … }
static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf,
int link_state)
{ … }
static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
{ … }
static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type,
u32 regclr)
{ … }
static void hclge_clear_all_event_cause(struct hclge_dev *hdev)
{ … }
static void hclge_enable_vector(struct hclge_misc_vector *vector, bool enable)
{ … }
static irqreturn_t hclge_misc_irq_handle(int irq, void *data)
{ … }
static void hclge_free_vector(struct hclge_dev *hdev, int vector_id)
{ … }
static void hclge_get_misc_vector(struct hclge_dev *hdev)
{ … }
static int hclge_misc_irq_init(struct hclge_dev *hdev)
{ … }
static void hclge_misc_irq_uninit(struct hclge_dev *hdev)
{ … }
int hclge_notify_client(struct hclge_dev *hdev,
enum hnae3_reset_notify_type type)
{ … }
static int hclge_notify_roce_client(struct hclge_dev *hdev,
enum hnae3_reset_notify_type type)
{ … }
static int hclge_reset_wait(struct hclge_dev *hdev)
{ … }
static int hclge_set_vf_rst(struct hclge_dev *hdev, int func_id, bool reset)
{ … }
static int hclge_set_all_vf_rst(struct hclge_dev *hdev, bool reset)
{ … }
static void hclge_mailbox_service_task(struct hclge_dev *hdev)
{ … }
static void hclge_func_reset_sync_vf(struct hclge_dev *hdev)
{ … }
void hclge_report_hw_error(struct hclge_dev *hdev,
enum hnae3_hw_error_type type)
{ … }
static void hclge_handle_imp_error(struct hclge_dev *hdev)
{ … }
int hclge_func_reset_cmd(struct hclge_dev *hdev, int func_id)
{ … }
static void hclge_do_reset(struct hclge_dev *hdev)
{ … }
static enum hnae3_reset_type hclge_get_reset_level(struct hnae3_ae_dev *ae_dev,
unsigned long *addr)
{ … }
static void hclge_clear_reset_cause(struct hclge_dev *hdev)
{ … }
static void hclge_reset_handshake(struct hclge_dev *hdev, bool enable)
{ … }
static int hclge_func_reset_notify_vf(struct hclge_dev *hdev)
{ … }
static int hclge_reset_prepare_wait(struct hclge_dev *hdev)
{ … }
static void hclge_show_rst_info(struct hclge_dev *hdev)
{ … }
static bool hclge_reset_err_handle(struct hclge_dev *hdev)
{ … }
static void hclge_update_reset_level(struct hclge_dev *hdev)
{ … }
static int hclge_set_rst_done(struct hclge_dev *hdev)
{ … }
static int hclge_reset_prepare_up(struct hclge_dev *hdev)
{ … }
static int hclge_reset_stack(struct hclge_dev *hdev)
{ … }
static int hclge_reset_prepare(struct hclge_dev *hdev)
{ … }
static int hclge_reset_rebuild(struct hclge_dev *hdev)
{ … }
static void hclge_reset(struct hclge_dev *hdev)
{ … }
static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
{ … }
static void hclge_set_def_reset_request(struct hnae3_ae_dev *ae_dev,
enum hnae3_reset_type rst_type)
{ … }
static void hclge_reset_timer(struct timer_list *t)
{ … }
static void hclge_reset_subtask(struct hclge_dev *hdev)
{ … }
static void hclge_handle_err_reset_request(struct hclge_dev *hdev)
{ … }
static void hclge_handle_err_recovery(struct hclge_dev *hdev)
{ … }
static void hclge_misc_err_recovery(struct hclge_dev *hdev)
{ … }
static void hclge_errhand_service_task(struct hclge_dev *hdev)
{ … }
static void hclge_reset_service_task(struct hclge_dev *hdev)
{ … }
static void hclge_update_vport_alive(struct hclge_dev *hdev)
{ … }
static void hclge_periodic_service_task(struct hclge_dev *hdev)
{ … }
static void hclge_ptp_service_task(struct hclge_dev *hdev)
{ … }
static void hclge_service_task(struct work_struct *work)
{ … }
struct hclge_vport *hclge_get_vport(struct hnae3_handle *handle)
{ … }
static void hclge_get_vector_info(struct hclge_dev *hdev, u16 idx,
struct hnae3_vector_info *vector_info)
{ … }
static int hclge_get_vector(struct hnae3_handle *handle, u16 vector_num,
struct hnae3_vector_info *vector_info)
{ … }
static int hclge_get_vector_index(struct hclge_dev *hdev, int vector)
{ … }
static int hclge_put_vector(struct hnae3_handle *handle, int vector)
{ … }
static int hclge_get_rss(struct hnae3_handle *handle, u32 *indir,
u8 *key, u8 *hfunc)
{ … }
static int hclge_set_rss(struct hnae3_handle *handle, const u32 *indir,
const u8 *key, const u8 hfunc)
{ … }
static int hclge_set_rss_tuple(struct hnae3_handle *handle,
struct ethtool_rxnfc *nfc)
{ … }
static int hclge_get_rss_tuple(struct hnae3_handle *handle,
struct ethtool_rxnfc *nfc)
{ … }
static int hclge_get_tc_size(struct hnae3_handle *handle)
{ … }
static int hclge_init_rss_tc_mode(struct hclge_dev *hdev)
{ … }
int hclge_rss_init_hw(struct hclge_dev *hdev)
{ … }
int hclge_bind_ring_with_vector(struct hclge_vport *vport,
int vector_id, bool en,
struct hnae3_ring_chain_node *ring_chain)
{ … }
static int hclge_map_ring_to_vector(struct hnae3_handle *handle, int vector,
struct hnae3_ring_chain_node *ring_chain)
{ … }
static int hclge_unmap_ring_frm_vector(struct hnae3_handle *handle, int vector,
struct hnae3_ring_chain_node *ring_chain)
{ … }
static int hclge_cmd_set_promisc_mode(struct hclge_dev *hdev, u8 vf_id,
bool en_uc, bool en_mc, bool en_bc)
{ … }
int hclge_set_vport_promisc_mode(struct hclge_vport *vport, bool en_uc_pmc,
bool en_mc_pmc, bool en_bc_pmc)
{ … }
static int hclge_set_promisc_mode(struct hnae3_handle *handle, bool en_uc_pmc,
bool en_mc_pmc)
{ … }
static void hclge_request_update_promisc_mode(struct hnae3_handle *handle)
{ … }
static void hclge_sync_fd_state(struct hclge_dev *hdev)
{ … }
static void hclge_fd_inc_rule_cnt(struct hclge_dev *hdev, u16 location)
{ … }
static void hclge_fd_dec_rule_cnt(struct hclge_dev *hdev, u16 location)
{ … }
static void hclge_fd_free_node(struct hclge_dev *hdev,
struct hclge_fd_rule *rule)
{ … }
static void hclge_update_fd_rule_node(struct hclge_dev *hdev,
struct hclge_fd_rule *old_rule,
struct hclge_fd_rule *new_rule,
enum HCLGE_FD_NODE_STATE state)
{ … }
static struct hclge_fd_rule *hclge_find_fd_rule(struct hlist_head *hlist,
u16 location,
struct hclge_fd_rule **parent)
{ … }
static void hclge_fd_insert_rule_node(struct hlist_head *hlist,
struct hclge_fd_rule *rule,
struct hclge_fd_rule *parent)
{ … }
static int hclge_fd_set_user_def_cmd(struct hclge_dev *hdev,
struct hclge_fd_user_def_cfg *cfg)
{ … }
static void hclge_sync_fd_user_def_cfg(struct hclge_dev *hdev, bool locked)
{ … }
static int hclge_fd_check_user_def_refcnt(struct hclge_dev *hdev,
struct hclge_fd_rule *rule)
{ … }
static void hclge_fd_inc_user_def_refcnt(struct hclge_dev *hdev,
struct hclge_fd_rule *rule)
{ … }
static void hclge_fd_dec_user_def_refcnt(struct hclge_dev *hdev,
struct hclge_fd_rule *rule)
{ … }
static void hclge_update_fd_list(struct hclge_dev *hdev,
enum HCLGE_FD_NODE_STATE state, u16 location,
struct hclge_fd_rule *new_rule)
{ … }
static int hclge_get_fd_mode(struct hclge_dev *hdev, u8 *fd_mode)
{ … }
static int hclge_get_fd_allocation(struct hclge_dev *hdev,
u32 *stage1_entry_num,
u32 *stage2_entry_num,
u16 *stage1_counter_num,
u16 *stage2_counter_num)
{ … }
static int hclge_set_fd_key_config(struct hclge_dev *hdev,
enum HCLGE_FD_STAGE stage_num)
{ … }
static void hclge_fd_disable_user_def(struct hclge_dev *hdev)
{ … }
static int hclge_init_fd_config(struct hclge_dev *hdev)
{ … }
static int hclge_fd_tcam_config(struct hclge_dev *hdev, u8 stage, bool sel_x,
int loc, u8 *key, bool is_add)
{ … }
static int hclge_fd_ad_config(struct hclge_dev *hdev, u8 stage, int loc,
struct hclge_fd_ad_data *action)
{ … }
static bool hclge_fd_convert_tuple(u32 tuple_bit, u8 *key_x, u8 *key_y,
struct hclge_fd_rule *rule)
{ … }
static u32 hclge_get_port_number(enum HLCGE_PORT_TYPE port_type, u8 pf_id,
u8 vf_id, u8 network_port_id)
{ … }
static void hclge_fd_convert_meta_data(struct hclge_fd_key_cfg *key_cfg,
__le32 *key_x, __le32 *key_y,
struct hclge_fd_rule *rule)
{ … }
static int hclge_config_key(struct hclge_dev *hdev, u8 stage,
struct hclge_fd_rule *rule)
{ … }
static int hclge_config_action(struct hclge_dev *hdev, u8 stage,
struct hclge_fd_rule *rule)
{ … }
static int hclge_fd_check_tcpip4_tuple(struct ethtool_tcpip4_spec *spec,
u32 *unused_tuple)
{ … }
static int hclge_fd_check_ip4_tuple(struct ethtool_usrip4_spec *spec,
u32 *unused_tuple)
{ … }
static int hclge_fd_check_tcpip6_tuple(struct ethtool_tcpip6_spec *spec,
u32 *unused_tuple)
{ … }
static int hclge_fd_check_ip6_tuple(struct ethtool_usrip6_spec *spec,
u32 *unused_tuple)
{ … }
static int hclge_fd_check_ether_tuple(struct ethhdr *spec, u32 *unused_tuple)
{ … }
static int hclge_fd_check_ext_tuple(struct hclge_dev *hdev,
struct ethtool_rx_flow_spec *fs,
u32 *unused_tuple)
{ … }
static int hclge_fd_get_user_def_layer(u32 flow_type, u32 *unused_tuple,
struct hclge_fd_user_def_info *info)
{ … }
static bool hclge_fd_is_user_def_all_masked(struct ethtool_rx_flow_spec *fs)
{ … }
static int hclge_fd_parse_user_def_field(struct hclge_dev *hdev,
struct ethtool_rx_flow_spec *fs,
u32 *unused_tuple,
struct hclge_fd_user_def_info *info)
{ … }
static int hclge_fd_check_spec(struct hclge_dev *hdev,
struct ethtool_rx_flow_spec *fs,
u32 *unused_tuple,
struct hclge_fd_user_def_info *info)
{ … }
static void hclge_fd_get_tcpip4_tuple(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule, u8 ip_proto)
{ … }
static void hclge_fd_get_ip4_tuple(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule)
{ … }
static void hclge_fd_get_tcpip6_tuple(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule, u8 ip_proto)
{ … }
static void hclge_fd_get_ip6_tuple(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule)
{ … }
static void hclge_fd_get_ether_tuple(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule)
{ … }
static void hclge_fd_get_user_def_tuple(struct hclge_fd_user_def_info *info,
struct hclge_fd_rule *rule)
{ … }
static int hclge_fd_get_tuple(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule,
struct hclge_fd_user_def_info *info)
{ … }
static int hclge_fd_config_rule(struct hclge_dev *hdev,
struct hclge_fd_rule *rule)
{ … }
static int hclge_add_fd_entry_common(struct hclge_dev *hdev,
struct hclge_fd_rule *rule)
{ … }
static bool hclge_is_cls_flower_active(struct hnae3_handle *handle)
{ … }
static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
u16 *vport_id, u8 *action, u16 *queue_id)
{ … }
static int hclge_add_fd_entry(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd)
{ … }
static int hclge_del_fd_entry(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd)
{ … }
static void hclge_clear_fd_rules_in_list(struct hclge_dev *hdev,
bool clear_list)
{ … }
static void hclge_del_all_fd_entries(struct hclge_dev *hdev)
{ … }
static int hclge_restore_fd_entries(struct hnae3_handle *handle)
{ … }
static int hclge_get_fd_rule_cnt(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd)
{ … }
static void hclge_fd_get_tcpip4_info(struct hclge_fd_rule *rule,
struct ethtool_tcpip4_spec *spec,
struct ethtool_tcpip4_spec *spec_mask)
{ … }
static void hclge_fd_get_ip4_info(struct hclge_fd_rule *rule,
struct ethtool_usrip4_spec *spec,
struct ethtool_usrip4_spec *spec_mask)
{ … }
static void hclge_fd_get_tcpip6_info(struct hclge_fd_rule *rule,
struct ethtool_tcpip6_spec *spec,
struct ethtool_tcpip6_spec *spec_mask)
{ … }
static void hclge_fd_get_ip6_info(struct hclge_fd_rule *rule,
struct ethtool_usrip6_spec *spec,
struct ethtool_usrip6_spec *spec_mask)
{ … }
static void hclge_fd_get_ether_info(struct hclge_fd_rule *rule,
struct ethhdr *spec,
struct ethhdr *spec_mask)
{ … }
static void hclge_fd_get_user_def_info(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule)
{ … }
static void hclge_fd_get_ext_info(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule)
{ … }
static struct hclge_fd_rule *hclge_get_fd_rule(struct hclge_dev *hdev,
u16 location)
{ … }
static void hclge_fd_get_ring_cookie(struct ethtool_rx_flow_spec *fs,
struct hclge_fd_rule *rule)
{ … }
static int hclge_get_fd_rule_info(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd)
{ … }
static int hclge_get_all_rules(struct hnae3_handle *handle,
struct ethtool_rxnfc *cmd, u32 *rule_locs)
{ … }
static void hclge_fd_get_flow_tuples(const struct flow_keys *fkeys,
struct hclge_fd_rule_tuples *tuples)
{ … }
static struct hclge_fd_rule *
hclge_fd_search_flow_keys(struct hclge_dev *hdev,
const struct hclge_fd_rule_tuples *tuples)
{ … }
static void hclge_fd_build_arfs_rule(const struct hclge_fd_rule_tuples *tuples,
struct hclge_fd_rule *rule)
{ … }
static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id,
u16 flow_id, struct flow_keys *fkeys)
{ … }
static void hclge_rfs_filter_expire(struct hclge_dev *hdev)
{ … }
static int hclge_clear_arfs_rules(struct hclge_dev *hdev)
{ … }
static void hclge_get_cls_key_basic(const struct flow_rule *flow,
struct hclge_fd_rule *rule)
{ … }
static void hclge_get_cls_key_mac(const struct flow_rule *flow,
struct hclge_fd_rule *rule)
{ … }
static void hclge_get_cls_key_vlan(const struct flow_rule *flow,
struct hclge_fd_rule *rule)
{ … }
static int hclge_get_cls_key_ip(const struct flow_rule *flow,
struct hclge_fd_rule *rule,
struct netlink_ext_ack *extack)
{ … }
static void hclge_get_cls_key_port(const struct flow_rule *flow,
struct hclge_fd_rule *rule)
{ … }
static int hclge_parse_cls_flower(struct hclge_dev *hdev,
struct flow_cls_offload *cls_flower,
struct hclge_fd_rule *rule)
{ … }
static int hclge_check_cls_flower(struct hclge_dev *hdev,
struct flow_cls_offload *cls_flower, int tc)
{ … }
static int hclge_add_cls_flower(struct hnae3_handle *handle,
struct flow_cls_offload *cls_flower,
int tc)
{ … }
static struct hclge_fd_rule *hclge_find_cls_flower(struct hclge_dev *hdev,
unsigned long cookie)
{ … }
static int hclge_del_cls_flower(struct hnae3_handle *handle,
struct flow_cls_offload *cls_flower)
{ … }
static void hclge_sync_fd_list(struct hclge_dev *hdev, struct hlist_head *hlist)
{ … }
static void hclge_sync_fd_table(struct hclge_dev *hdev)
{ … }
static bool hclge_get_hw_reset_stat(struct hnae3_handle *handle)
{ … }
static bool hclge_get_cmdq_stat(struct hnae3_handle *handle)
{ … }
static bool hclge_ae_dev_resetting(struct hnae3_handle *handle)
{ … }
static unsigned long hclge_ae_dev_reset_cnt(struct hnae3_handle *handle)
{ … }
static void hclge_enable_fd(struct hnae3_handle *handle, bool enable)
{ … }
static void hclge_cfg_mac_mode(struct hclge_dev *hdev, bool enable)
{ … }
static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid,
u8 switch_param, u8 param_mask)
{ … }
static void hclge_phy_link_status_wait(struct hclge_dev *hdev,
int link_ret)
{ … }
static int hclge_mac_link_status_wait(struct hclge_dev *hdev, int link_ret,
int wait_cnt)
{ … }
static int hclge_mac_phy_link_status_wait(struct hclge_dev *hdev, bool en,
bool is_phy)
{ … }
static int hclge_set_app_loopback(struct hclge_dev *hdev, bool en)
{ … }
static int hclge_cfg_common_loopback_cmd_send(struct hclge_dev *hdev, bool en,
enum hnae3_loop loop_mode)
{ … }
static int hclge_cfg_common_loopback_wait(struct hclge_dev *hdev)
{ … }
static int hclge_cfg_common_loopback(struct hclge_dev *hdev, bool en,
enum hnae3_loop loop_mode)
{ … }
static int hclge_set_common_loopback(struct hclge_dev *hdev, bool en,
enum hnae3_loop loop_mode)
{ … }
static int hclge_enable_phy_loopback(struct hclge_dev *hdev,
struct phy_device *phydev)
{ … }
static int hclge_disable_phy_loopback(struct hclge_dev *hdev,
struct phy_device *phydev)
{ … }
static int hclge_set_phy_loopback(struct hclge_dev *hdev, bool en)
{ … }
static int hclge_tqp_enable_cmd_send(struct hclge_dev *hdev, u16 tqp_id,
u16 stream_id, bool enable)
{ … }
static int hclge_tqp_enable(struct hnae3_handle *handle, bool enable)
{ … }
static int hclge_set_loopback(struct hnae3_handle *handle,
enum hnae3_loop loop_mode, bool en)
{ … }
static int hclge_set_default_loopback(struct hclge_dev *hdev)
{ … }
static void hclge_flush_link_update(struct hclge_dev *hdev)
{ … }
static void hclge_set_timer_task(struct hnae3_handle *handle, bool enable)
{ … }
static int hclge_ae_start(struct hnae3_handle *handle)
{ … }
static void hclge_ae_stop(struct hnae3_handle *handle)
{ … }
int hclge_vport_start(struct hclge_vport *vport)
{ … }
void hclge_vport_stop(struct hclge_vport *vport)
{ … }
static int hclge_client_start(struct hnae3_handle *handle)
{ … }
static void hclge_client_stop(struct hnae3_handle *handle)
{ … }
static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport,
u16 cmdq_resp, u8 resp_code,
enum hclge_mac_vlan_tbl_opcode op)
{ … }
static int hclge_update_desc_vfid(struct hclge_desc *desc, int vfid, bool clr)
{ … }
static bool hclge_is_all_function_id_zero(struct hclge_desc *desc)
{ … }
static void hclge_prepare_mac_addr(struct hclge_mac_vlan_tbl_entry_cmd *new_req,
const u8 *addr, bool is_mc)
{ … }
static int hclge_remove_mac_vlan_tbl(struct hclge_vport *vport,
struct hclge_mac_vlan_tbl_entry_cmd *req)
{ … }
static int hclge_lookup_mac_vlan_tbl(struct hclge_vport *vport,
struct hclge_mac_vlan_tbl_entry_cmd *req,
struct hclge_desc *desc,
bool is_mc)
{ … }
static int hclge_add_mac_vlan_tbl(struct hclge_vport *vport,
struct hclge_mac_vlan_tbl_entry_cmd *req,
struct hclge_desc *mc_desc)
{ … }
static int hclge_set_umv_space(struct hclge_dev *hdev, u16 space_size,
u16 *allocated_size)
{ … }
static int hclge_init_umv_space(struct hclge_dev *hdev)
{ … }
static void hclge_reset_umv_space(struct hclge_dev *hdev)
{ … }
static bool hclge_is_umv_space_full(struct hclge_vport *vport, bool need_lock)
{ … }
static void hclge_update_umv_space(struct hclge_vport *vport, bool is_free)
{ … }
static struct hclge_mac_node *hclge_find_mac_node(struct list_head *list,
const u8 *mac_addr)
{ … }
static void hclge_update_mac_node(struct hclge_mac_node *mac_node,
enum HCLGE_MAC_NODE_STATE state)
{ … }
int hclge_update_mac_list(struct hclge_vport *vport,
enum HCLGE_MAC_NODE_STATE state,
enum HCLGE_MAC_ADDR_TYPE mac_type,
const unsigned char *addr)
{ … }
static int hclge_add_uc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
int hclge_add_uc_addr_common(struct hclge_vport *vport,
const unsigned char *addr)
{ … }
static int hclge_rm_uc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
int hclge_rm_uc_addr_common(struct hclge_vport *vport,
const unsigned char *addr)
{ … }
static int hclge_add_mc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
int hclge_add_mc_addr_common(struct hclge_vport *vport,
const unsigned char *addr)
{ … }
static int hclge_rm_mc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
int hclge_rm_mc_addr_common(struct hclge_vport *vport,
const unsigned char *addr)
{ … }
static void hclge_sync_vport_mac_list(struct hclge_vport *vport,
struct list_head *list,
enum HCLGE_MAC_ADDR_TYPE mac_type)
{ … }
static void hclge_unsync_vport_mac_list(struct hclge_vport *vport,
struct list_head *list,
enum HCLGE_MAC_ADDR_TYPE mac_type)
{ … }
static bool hclge_sync_from_add_list(struct list_head *add_list,
struct list_head *mac_list)
{ … }
static void hclge_sync_from_del_list(struct list_head *del_list,
struct list_head *mac_list)
{ … }
static void hclge_update_overflow_flags(struct hclge_vport *vport,
enum HCLGE_MAC_ADDR_TYPE mac_type,
bool is_all_added)
{ … }
static void hclge_sync_vport_mac_table(struct hclge_vport *vport,
enum HCLGE_MAC_ADDR_TYPE mac_type)
{ … }
static bool hclge_need_sync_mac_table(struct hclge_vport *vport)
{ … }
static void hclge_sync_mac_table(struct hclge_dev *hdev)
{ … }
static void hclge_build_del_list(struct list_head *list,
bool is_del_list,
struct list_head *tmp_del_list)
{ … }
static void hclge_unsync_del_list(struct hclge_vport *vport,
int (*unsync)(struct hclge_vport *vport,
const unsigned char *addr),
bool is_del_list,
struct list_head *tmp_del_list)
{ … }
void hclge_rm_vport_all_mac_table(struct hclge_vport *vport, bool is_del_list,
enum HCLGE_MAC_ADDR_TYPE mac_type)
{ … }
static void hclge_uninit_vport_mac_list(struct hclge_vport *vport,
enum HCLGE_MAC_ADDR_TYPE mac_type)
{ … }
static void hclge_uninit_mac_table(struct hclge_dev *hdev)
{ … }
static int hclge_get_mac_ethertype_cmd_status(struct hclge_dev *hdev,
u16 cmdq_resp, u8 resp_code)
{ … }
static int hclge_set_vf_mac(struct hnae3_handle *handle, int vf,
u8 *mac_addr)
{ … }
static int hclge_add_mgr_tbl(struct hclge_dev *hdev,
const struct hclge_mac_mgr_tbl_entry_cmd *req)
{ … }
static int init_mgr_tbl(struct hclge_dev *hdev)
{ … }
static void hclge_get_mac_addr(struct hnae3_handle *handle, u8 *p)
{ … }
int hclge_update_mac_node_for_dev_addr(struct hclge_vport *vport,
const u8 *old_addr, const u8 *new_addr)
{ … }
static int hclge_set_mac_addr(struct hnae3_handle *handle, const void *p,
bool is_first)
{ … }
static int hclge_mii_ioctl(struct hclge_dev *hdev, struct ifreq *ifr, int cmd)
{ … }
static int hclge_do_ioctl(struct hnae3_handle *handle, struct ifreq *ifr,
int cmd)
{ … }
static int hclge_set_port_vlan_filter_bypass(struct hclge_dev *hdev, u8 vf_id,
bool bypass_en)
{ … }
static int hclge_set_vlan_filter_ctrl(struct hclge_dev *hdev, u8 vlan_type,
u8 fe_type, bool filter_en, u8 vf_id)
{ … }
static int hclge_set_vport_vlan_filter(struct hclge_vport *vport, bool enable)
{ … }
static bool hclge_need_enable_vport_vlan_filter(struct hclge_vport *vport)
{ … }
int hclge_enable_vport_vlan_filter(struct hclge_vport *vport, bool request_en)
{ … }
static int hclge_enable_vlan_filter(struct hnae3_handle *handle, bool enable)
{ … }
static int hclge_set_vf_vlan_filter_cmd(struct hclge_dev *hdev, u16 vfid,
bool is_kill, u16 vlan,
struct hclge_desc *desc)
{ … }
static int hclge_check_vf_vlan_cmd_status(struct hclge_dev *hdev, u16 vfid,
bool is_kill, struct hclge_desc *desc)
{ … }
static int hclge_set_vf_vlan_common(struct hclge_dev *hdev, u16 vfid,
bool is_kill, u16 vlan)
{ … }
static int hclge_set_port_vlan_filter(struct hclge_dev *hdev, __be16 proto,
u16 vlan_id, bool is_kill)
{ … }
static bool hclge_need_update_port_vlan(struct hclge_dev *hdev, u16 vport_id,
u16 vlan_id, bool is_kill)
{ … }
static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto,
u16 vport_id, u16 vlan_id,
bool is_kill)
{ … }
static int hclge_set_vlan_tx_offload_cfg(struct hclge_vport *vport)
{ … }
static int hclge_set_vlan_rx_offload_cfg(struct hclge_vport *vport)
{ … }
static int hclge_vlan_offload_cfg(struct hclge_vport *vport,
u16 port_base_vlan_state,
u16 vlan_tag, u8 qos)
{ … }
static int hclge_set_vlan_protocol_type(struct hclge_dev *hdev)
{ … }
static int hclge_init_vlan_filter(struct hclge_dev *hdev)
{ … }
static int hclge_init_vlan_type(struct hclge_dev *hdev)
{ … }
static int hclge_init_vport_vlan_offload(struct hclge_dev *hdev)
{ … }
static int hclge_init_vlan_config(struct hclge_dev *hdev)
{ … }
static void hclge_add_vport_vlan_table(struct hclge_vport *vport, u16 vlan_id,
bool writen_to_tbl)
{ … }
static int hclge_add_vport_all_vlan_table(struct hclge_vport *vport)
{ … }
static void hclge_rm_vport_vlan_table(struct hclge_vport *vport, u16 vlan_id,
bool is_write_tbl)
{ … }
void hclge_rm_vport_all_vlan_table(struct hclge_vport *vport, bool is_del_list)
{ … }
void hclge_uninit_vport_vlan_table(struct hclge_dev *hdev)
{ … }
void hclge_restore_vport_port_base_vlan_config(struct hclge_dev *hdev)
{ … }
void hclge_restore_vport_vlan_table(struct hclge_vport *vport)
{ … }
static void hclge_mac_node_convert_for_reset(struct list_head *list)
{ … }
void hclge_restore_mac_table_common(struct hclge_vport *vport)
{ … }
static void hclge_restore_hw_table(struct hclge_dev *hdev)
{ … }
int hclge_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable)
{ … }
static void hclge_set_vport_vlan_fltr_change(struct hclge_vport *vport)
{ … }
static int hclge_update_vlan_filter_entries(struct hclge_vport *vport,
u16 port_base_vlan_state,
struct hclge_vlan_info *new_info,
struct hclge_vlan_info *old_info)
{ … }
static bool hclge_need_update_vlan_filter(const struct hclge_vlan_info *new_cfg,
const struct hclge_vlan_info *old_cfg)
{ … }
static int hclge_modify_port_base_vlan_tag(struct hclge_vport *vport,
struct hclge_vlan_info *new_info,
struct hclge_vlan_info *old_info)
{ … }
int hclge_update_port_base_vlan_cfg(struct hclge_vport *vport, u16 state,
struct hclge_vlan_info *vlan_info)
{ … }
static u16 hclge_get_port_base_vlan_state(struct hclge_vport *vport,
enum hnae3_port_base_vlan_state state,
u16 vlan, u8 qos)
{ … }
static int hclge_set_vf_vlan_filter(struct hnae3_handle *handle, int vfid,
u16 vlan, u8 qos, __be16 proto)
{ … }
static void hclge_clear_vf_vlan(struct hclge_dev *hdev)
{ … }
int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto,
u16 vlan_id, bool is_kill)
{ … }
static void hclge_sync_vlan_fltr_state(struct hclge_dev *hdev)
{ … }
static void hclge_sync_vlan_filter(struct hclge_dev *hdev)
{ … }
static int hclge_set_mac_mtu(struct hclge_dev *hdev, int new_mps)
{ … }
static int hclge_set_mtu(struct hnae3_handle *handle, int new_mtu)
{ … }
int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
{ … }
static int hclge_reset_tqp_cmd_send(struct hclge_dev *hdev, u16 queue_id,
bool enable)
{ … }
static int hclge_get_reset_status(struct hclge_dev *hdev, u16 queue_id,
u8 *reset_status)
{ … }
u16 hclge_covert_handle_qid_global(struct hnae3_handle *handle, u16 queue_id)
{ … }
static int hclge_reset_tqp_cmd(struct hnae3_handle *handle)
{ … }
static int hclge_reset_rcb(struct hnae3_handle *handle)
{ … }
int hclge_reset_tqp(struct hnae3_handle *handle)
{ … }
static u32 hclge_get_fw_version(struct hnae3_handle *handle)
{ … }
int hclge_query_scc_version(struct hclge_dev *hdev, u32 *scc_version)
{ … }
static void hclge_set_flowctrl_adv(struct hclge_dev *hdev, u32 rx_en, u32 tx_en)
{ … }
static int hclge_cfg_pauseparam(struct hclge_dev *hdev, u32 rx_en, u32 tx_en)
{ … }
int hclge_cfg_flowctrl(struct hclge_dev *hdev)
{ … }
static void hclge_get_pauseparam(struct hnae3_handle *handle, u32 *auto_neg,
u32 *rx_en, u32 *tx_en)
{ … }
static void hclge_record_user_pauseparam(struct hclge_dev *hdev,
u32 rx_en, u32 tx_en)
{ … }
static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg,
u32 rx_en, u32 tx_en)
{ … }
static void hclge_get_ksettings_an_result(struct hnae3_handle *handle,
u8 *auto_neg, u32 *speed, u8 *duplex, u32 *lane_num)
{ … }
static void hclge_get_media_type(struct hnae3_handle *handle, u8 *media_type,
u8 *module_type)
{ … }
static void hclge_get_mdix_mode(struct hnae3_handle *handle,
u8 *tp_mdix_ctrl, u8 *tp_mdix)
{ … }
static void hclge_info_show(struct hclge_dev *hdev)
{ … }
static int hclge_init_nic_client_instance(struct hnae3_ae_dev *ae_dev,
struct hclge_vport *vport)
{ … }
static int hclge_init_roce_client_instance(struct hnae3_ae_dev *ae_dev,
struct hclge_vport *vport)
{ … }
static int hclge_init_client_instance(struct hnae3_client *client,
struct hnae3_ae_dev *ae_dev)
{ … }
static bool hclge_uninit_need_wait(struct hclge_dev *hdev)
{ … }
static void hclge_uninit_client_instance(struct hnae3_client *client,
struct hnae3_ae_dev *ae_dev)
{ … }
static int hclge_dev_mem_map(struct hclge_dev *hdev)
{ … }
static int hclge_pci_init(struct hclge_dev *hdev)
{ … }
static void hclge_pci_uninit(struct hclge_dev *hdev)
{ … }
static void hclge_state_init(struct hclge_dev *hdev)
{ … }
static void hclge_state_uninit(struct hclge_dev *hdev)
{ … }
static void hclge_reset_prepare_general(struct hnae3_ae_dev *ae_dev,
enum hnae3_reset_type rst_type)
{ … }
static void hclge_reset_done(struct hnae3_ae_dev *ae_dev)
{ … }
static void hclge_clear_resetting_state(struct hclge_dev *hdev)
{ … }
static int hclge_clear_hw_resource(struct hclge_dev *hdev)
{ … }
static void hclge_init_rxd_adv_layout(struct hclge_dev *hdev)
{ … }
static void hclge_uninit_rxd_adv_layout(struct hclge_dev *hdev)
{ … }
static struct hclge_wol_info *hclge_get_wol_info(struct hnae3_handle *handle)
{ … }
static int hclge_get_wol_supported_mode(struct hclge_dev *hdev,
u32 *wol_supported)
{ … }
static int hclge_set_wol_cfg(struct hclge_dev *hdev,
struct hclge_wol_info *wol_info)
{ … }
static int hclge_update_wol(struct hclge_dev *hdev)
{ … }
static int hclge_init_wol(struct hclge_dev *hdev)
{ … }
static void hclge_get_wol(struct hnae3_handle *handle,
struct ethtool_wolinfo *wol)
{ … }
static int hclge_set_wol(struct hnae3_handle *handle,
struct ethtool_wolinfo *wol)
{ … }
static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
{ … }
static void hclge_stats_clear(struct hclge_dev *hdev)
{ … }
static int hclge_set_mac_spoofchk(struct hclge_dev *hdev, int vf, bool enable)
{ … }
static int hclge_set_vlan_spoofchk(struct hclge_dev *hdev, int vf, bool enable)
{ … }
static int hclge_set_vf_spoofchk_hw(struct hclge_dev *hdev, int vf, bool enable)
{ … }
static int hclge_set_vf_spoofchk(struct hnae3_handle *handle, int vf,
bool enable)
{ … }
static int hclge_reset_vport_spoofchk(struct hclge_dev *hdev)
{ … }
static int hclge_set_vf_trust(struct hnae3_handle *handle, int vf, bool enable)
{ … }
static void hclge_reset_vf_rate(struct hclge_dev *hdev)
{ … }
static int hclge_vf_rate_param_check(struct hclge_dev *hdev,
int min_tx_rate, int max_tx_rate)
{ … }
static int hclge_set_vf_rate(struct hnae3_handle *handle, int vf,
int min_tx_rate, int max_tx_rate, bool force)
{ … }
static int hclge_resume_vf_rate(struct hclge_dev *hdev)
{ … }
static void hclge_reset_vport_state(struct hclge_dev *hdev)
{ … }
static int hclge_reset_ae_dev(struct hnae3_ae_dev *ae_dev)
{ … }
static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
{ … }
static u32 hclge_get_max_channels(struct hnae3_handle *handle)
{ … }
static void hclge_get_channels(struct hnae3_handle *handle,
struct ethtool_channels *ch)
{ … }
static void hclge_get_tqps_and_rss_info(struct hnae3_handle *handle,
u16 *alloc_tqps, u16 *max_rss_size)
{ … }
static int hclge_set_rss_tc_mode_cfg(struct hnae3_handle *handle)
{ … }
static int hclge_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
bool rxfh_configured)
{ … }
static int hclge_set_led_status(struct hclge_dev *hdev, u8 locate_led_status)
{ … }
enum hclge_led_status { … };
static int hclge_set_led_id(struct hnae3_handle *handle,
enum ethtool_phys_id_state status)
{ … }
static void hclge_get_link_mode(struct hnae3_handle *handle,
unsigned long *supported,
unsigned long *advertising)
{ … }
static int hclge_gro_en(struct hnae3_handle *handle, bool enable)
{ … }
static int hclge_sync_vport_promisc_mode(struct hclge_vport *vport)
{ … }
static void hclge_sync_promisc_mode(struct hclge_dev *hdev)
{ … }
static bool hclge_module_existed(struct hclge_dev *hdev)
{ … }
static u16 hclge_get_sfp_eeprom_info(struct hclge_dev *hdev, u32 offset,
u32 len, u8 *data)
{ … }
static int hclge_get_module_eeprom(struct hnae3_handle *handle, u32 offset,
u32 len, u8 *data)
{ … }
static int hclge_get_link_diagnosis_info(struct hnae3_handle *handle,
u32 *status_code)
{ … }
static void hclge_clear_vport_vf_info(struct hclge_vport *vport, int vfid)
{ … }
static void hclge_clean_vport_config(struct hnae3_ae_dev *ae_dev, int num_vfs)
{ … }
static int hclge_get_dscp_prio(struct hnae3_handle *h, u8 dscp, u8 *tc_mode,
u8 *priority)
{ … }
static const struct hnae3_ae_ops hclge_ops = …;
static struct hnae3_ae_algo ae_algo = …;
static int __init hclge_init(void)
{ … }
static void __exit hclge_exit(void)
{ … }
module_init(…) …;
module_exit(hclge_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);