#include <linux/etherdevice.h>
#include <linux/iopoll.h>
#include <net/rtnetlink.h>
#include "hclgevf_cmd.h"
#include "hclgevf_main.h"
#include "hclgevf_regs.h"
#include "hclge_mbx.h"
#include "hnae3.h"
#include "hclgevf_devlink.h"
#include "hclge_comm_rss.h"
#include "hclgevf_trace.h"
#define HCLGEVF_NAME …
#define HCLGEVF_RESET_MAX_FAIL_CNT …
static int hclgevf_reset_hdev(struct hclgevf_dev *hdev);
static void hclgevf_task_schedule(struct hclgevf_dev *hdev,
unsigned long delay);
static struct hnae3_ae_algo ae_algovf;
static struct workqueue_struct *hclgevf_wq;
static const struct pci_device_id ae_algovf_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, ae_algovf_pci_tbl);
int hclgevf_cmd_send(struct hclgevf_hw *hw, struct hclge_desc *desc, int num)
{ … }
static void hclgevf_trace_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc,
int num, bool is_special)
{ … }
static void hclgevf_trace_cmd_get(struct hclge_comm_hw *hw, struct hclge_desc *desc,
int num, bool is_special)
{ … }
static const struct hclge_comm_cmq_ops hclgevf_cmq_ops = …;
void hclgevf_arq_init(struct hclgevf_dev *hdev)
{ … }
struct hclgevf_dev *hclgevf_ae_get_hdev(struct hnae3_handle *handle)
{ … }
static void hclgevf_update_stats(struct hnae3_handle *handle)
{ … }
static int hclgevf_get_sset_count(struct hnae3_handle *handle, int strset)
{ … }
static void hclgevf_get_strings(struct hnae3_handle *handle, u32 strset,
u8 *data)
{ … }
static void hclgevf_get_stats(struct hnae3_handle *handle, u64 *data)
{ … }
static void hclgevf_build_send_msg(struct hclge_vf_to_pf_msg *msg, u8 code,
u8 subcode)
{ … }
static int hclgevf_get_basic_info(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_get_port_base_vlan_filter_state(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_get_queue_info(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_get_queue_depth(struct hclgevf_dev *hdev)
{ … }
static u16 hclgevf_get_qid_global(struct hnae3_handle *handle, u16 queue_id)
{ … }
static int hclgevf_get_pf_media_type(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_alloc_tqps(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_knic_setup(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_request_link_info(struct hclgevf_dev *hdev)
{ … }
void hclgevf_update_link_status(struct hclgevf_dev *hdev, int link_state)
{ … }
static void hclgevf_update_link_mode(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_set_handle_info(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_free_vector(struct hclgevf_dev *hdev, int vector_id)
{ … }
static int hclgevf_get_vector(struct hnae3_handle *handle, u16 vector_num,
struct hnae3_vector_info *vector_info)
{ … }
static int hclgevf_get_vector_index(struct hclgevf_dev *hdev, int vector)
{ … }
static int hclgevf_get_rss_hash_key(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_get_rss(struct hnae3_handle *handle, u32 *indir, u8 *key,
u8 *hfunc)
{ … }
static int hclgevf_set_rss(struct hnae3_handle *handle, const u32 *indir,
const u8 *key, const u8 hfunc)
{ … }
static int hclgevf_set_rss_tuple(struct hnae3_handle *handle,
struct ethtool_rxnfc *nfc)
{ … }
static int hclgevf_get_rss_tuple(struct hnae3_handle *handle,
struct ethtool_rxnfc *nfc)
{ … }
static int hclgevf_get_tc_size(struct hnae3_handle *handle)
{ … }
static int hclgevf_bind_ring_to_vector(struct hnae3_handle *handle, bool en,
int vector_id,
struct hnae3_ring_chain_node *ring_chain)
{ … }
static int hclgevf_map_ring_to_vector(struct hnae3_handle *handle, int vector,
struct hnae3_ring_chain_node *ring_chain)
{ … }
static int hclgevf_unmap_ring_from_vector(
struct hnae3_handle *handle,
int vector,
struct hnae3_ring_chain_node *ring_chain)
{ … }
static int hclgevf_put_vector(struct hnae3_handle *handle, int vector)
{ … }
static int hclgevf_cmd_set_promisc_mode(struct hclgevf_dev *hdev,
bool en_uc_pmc, bool en_mc_pmc,
bool en_bc_pmc)
{ … }
static int hclgevf_set_promisc_mode(struct hnae3_handle *handle, bool en_uc_pmc,
bool en_mc_pmc)
{ … }
static void hclgevf_request_update_promisc_mode(struct hnae3_handle *handle)
{ … }
static void hclgevf_sync_promisc_mode(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_tqp_enable_cmd_send(struct hclgevf_dev *hdev, u16 tqp_id,
u16 stream_id, bool enable)
{ … }
static int hclgevf_tqp_enable(struct hnae3_handle *handle, bool enable)
{ … }
static int hclgevf_get_host_mac_addr(struct hclgevf_dev *hdev, u8 *p)
{ … }
static void hclgevf_get_mac_addr(struct hnae3_handle *handle, u8 *p)
{ … }
static int hclgevf_set_mac_addr(struct hnae3_handle *handle, const void *p,
bool is_first)
{ … }
static struct hclgevf_mac_addr_node *
hclgevf_find_mac_node(struct list_head *list, const u8 *mac_addr)
{ … }
static void hclgevf_update_mac_node(struct hclgevf_mac_addr_node *mac_node,
enum HCLGEVF_MAC_NODE_STATE state)
{ … }
static int hclgevf_update_mac_list(struct hnae3_handle *handle,
enum HCLGEVF_MAC_NODE_STATE state,
enum HCLGEVF_MAC_ADDR_TYPE mac_type,
const unsigned char *addr)
{ … }
static int hclgevf_add_uc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
static int hclgevf_rm_uc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
static int hclgevf_add_mc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
static int hclgevf_rm_mc_addr(struct hnae3_handle *handle,
const unsigned char *addr)
{ … }
static int hclgevf_add_del_mac_addr(struct hclgevf_dev *hdev,
struct hclgevf_mac_addr_node *mac_node,
enum HCLGEVF_MAC_ADDR_TYPE mac_type)
{ … }
static void hclgevf_config_mac_list(struct hclgevf_dev *hdev,
struct list_head *list,
enum HCLGEVF_MAC_ADDR_TYPE mac_type)
{ … }
static void hclgevf_sync_from_add_list(struct list_head *add_list,
struct list_head *mac_list)
{ … }
static void hclgevf_sync_from_del_list(struct list_head *del_list,
struct list_head *mac_list)
{ … }
static void hclgevf_clear_list(struct list_head *list)
{ … }
static void hclgevf_sync_mac_list(struct hclgevf_dev *hdev,
enum HCLGEVF_MAC_ADDR_TYPE mac_type)
{ … }
static void hclgevf_sync_mac_table(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_uninit_mac_list(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_enable_vlan_filter(struct hnae3_handle *handle, bool enable)
{ … }
static int hclgevf_set_vlan_filter(struct hnae3_handle *handle,
__be16 proto, u16 vlan_id,
bool is_kill)
{ … }
static void hclgevf_sync_vlan_filter(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable)
{ … }
static int hclgevf_reset_tqp(struct hnae3_handle *handle)
{ … }
static int hclgevf_set_mtu(struct hnae3_handle *handle, int new_mtu)
{ … }
static int hclgevf_notify_client(struct hclgevf_dev *hdev,
enum hnae3_reset_notify_type type)
{ … }
static int hclgevf_notify_roce_client(struct hclgevf_dev *hdev,
enum hnae3_reset_notify_type type)
{ … }
static void hclgevf_set_reset_pending(struct hclgevf_dev *hdev,
enum hnae3_reset_type reset_type)
{ … }
static int hclgevf_reset_wait(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_reset_handshake(struct hclgevf_dev *hdev, bool enable)
{ … }
static int hclgevf_reset_stack(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_reset_prepare_wait(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_dump_rst_info(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_reset_err_handle(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_reset_prepare(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_reset_rebuild(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_reset(struct hclgevf_dev *hdev)
{ … }
static enum hnae3_reset_type hclgevf_get_reset_level(unsigned long *addr)
{ … }
static void hclgevf_reset_event(struct pci_dev *pdev,
struct hnae3_handle *handle)
{ … }
static void hclgevf_set_def_reset_request(struct hnae3_ae_dev *ae_dev,
enum hnae3_reset_type rst_type)
{ … }
static void hclgevf_enable_vector(struct hclgevf_misc_vector *vector, bool en)
{ … }
static void hclgevf_reset_prepare_general(struct hnae3_ae_dev *ae_dev,
enum hnae3_reset_type rst_type)
{ … }
static void hclgevf_reset_done(struct hnae3_ae_dev *ae_dev)
{ … }
static u32 hclgevf_get_fw_version(struct hnae3_handle *handle)
{ … }
static void hclgevf_get_misc_vector(struct hclgevf_dev *hdev)
{ … }
void hclgevf_reset_task_schedule(struct hclgevf_dev *hdev)
{ … }
void hclgevf_mbx_task_schedule(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_task_schedule(struct hclgevf_dev *hdev,
unsigned long delay)
{ … }
static void hclgevf_reset_service_task(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_mailbox_service_task(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_keep_alive(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_service_task(struct work_struct *work)
{ … }
static void hclgevf_clear_event_cause(struct hclgevf_dev *hdev, u32 regclr)
{ … }
static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev,
u32 *clearval)
{ … }
static void hclgevf_reset_timer(struct timer_list *t)
{ … }
static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data)
{ … }
static int hclgevf_configure(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_alloc_hdev(struct hnae3_ae_dev *ae_dev)
{ … }
static int hclgevf_init_roce_base_info(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_config_gro(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_init_vlan_config(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_flush_link_update(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_set_timer_task(struct hnae3_handle *handle, bool enable)
{ … }
static int hclgevf_ae_start(struct hnae3_handle *handle)
{ … }
static void hclgevf_ae_stop(struct hnae3_handle *handle)
{ … }
static int hclgevf_set_alive(struct hnae3_handle *handle, bool alive)
{ … }
static int hclgevf_client_start(struct hnae3_handle *handle)
{ … }
static void hclgevf_client_stop(struct hnae3_handle *handle)
{ … }
static void hclgevf_state_init(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_state_uninit(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_init_msi(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_uninit_msi(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_misc_irq_init(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_misc_irq_uninit(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_info_show(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_init_nic_client_instance(struct hnae3_ae_dev *ae_dev,
struct hnae3_client *client)
{ … }
static int hclgevf_init_roce_client_instance(struct hnae3_ae_dev *ae_dev,
struct hnae3_client *client)
{ … }
static int hclgevf_init_client_instance(struct hnae3_client *client,
struct hnae3_ae_dev *ae_dev)
{ … }
static void hclgevf_uninit_client_instance(struct hnae3_client *client,
struct hnae3_ae_dev *ae_dev)
{ … }
static int hclgevf_dev_mem_map(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_pci_init(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_pci_uninit(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_query_vf_resource(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_set_default_dev_specs(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_parse_dev_specs(struct hclgevf_dev *hdev,
struct hclge_desc *desc)
{ … }
static void hclgevf_check_dev_specs(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_query_dev_specs(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_pci_reset(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_clear_vport_list(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_init_rxd_adv_layout(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_uninit_rxd_adv_layout(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_reset_hdev(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_uninit_hdev(struct hclgevf_dev *hdev)
{ … }
static int hclgevf_init_ae_dev(struct hnae3_ae_dev *ae_dev)
{ … }
static void hclgevf_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
{ … }
static u32 hclgevf_get_max_channels(struct hclgevf_dev *hdev)
{ … }
static void hclgevf_get_channels(struct hnae3_handle *handle,
struct ethtool_channels *ch)
{ … }
static void hclgevf_get_tqps_and_rss_info(struct hnae3_handle *handle,
u16 *alloc_tqps, u16 *max_rss_size)
{ … }
static void hclgevf_update_rss_size(struct hnae3_handle *handle,
u32 new_tqps_num)
{ … }
static int hclgevf_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
bool rxfh_configured)
{ … }
static int hclgevf_get_status(struct hnae3_handle *handle)
{ … }
static void hclgevf_get_ksettings_an_result(struct hnae3_handle *handle,
u8 *auto_neg, u32 *speed,
u8 *duplex, u32 *lane_num)
{ … }
void hclgevf_update_speed_duplex(struct hclgevf_dev *hdev, u32 speed,
u8 duplex)
{ … }
static int hclgevf_gro_en(struct hnae3_handle *handle, bool enable)
{ … }
static void hclgevf_get_media_type(struct hnae3_handle *handle, u8 *media_type,
u8 *module_type)
{ … }
static bool hclgevf_get_hw_reset_stat(struct hnae3_handle *handle)
{ … }
static bool hclgevf_get_cmdq_stat(struct hnae3_handle *handle)
{ … }
static bool hclgevf_ae_dev_resetting(struct hnae3_handle *handle)
{ … }
static unsigned long hclgevf_ae_dev_reset_cnt(struct hnae3_handle *handle)
{ … }
static void hclgevf_get_link_mode(struct hnae3_handle *handle,
unsigned long *supported,
unsigned long *advertising)
{ … }
void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state,
struct hclge_mbx_port_base_vlan *port_base_vlan)
{ … }
static const struct hnae3_ae_ops hclgevf_ops = …;
static struct hnae3_ae_algo ae_algovf = …;
static int __init hclgevf_init(void)
{ … }
static void __exit hclgevf_exit(void)
{ … }
module_init(…) …;
module_exit(hclgevf_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);