/* Names used in this framework: * ae handle (handle): * a set of queues provided by AE * ring buffer queue (rbq): * the channel between upper layer and the AE, can do tx and rx * ring: * a tx or rx channel within a rbq * ring description (desc): * an element in the ring with packet information * buffer: * a memory region referred by desc with the full packet payload * * "num" means a static number set as a parameter, "count" mean a dynamic * number set while running * "cb" means control block
*/
struct hnae3_queue { void __iomem *io_base; void __iomem *mem_base; struct hnae3_ae_algo *ae_algo; struct hnae3_handle *handle; int tqp_index; /* index in a handle */
u32 buf_size; /* size for hnae_desc->addr, preset by AE */
u16 tx_desc_num; /* total number of tx desc */
u16 rx_desc_num; /* total number of rx desc */
};
/* mac media type */ enum hnae3_media_type {
HNAE3_MEDIA_TYPE_UNKNOWN,
HNAE3_MEDIA_TYPE_FIBER,
HNAE3_MEDIA_TYPE_COPPER,
HNAE3_MEDIA_TYPE_BACKPLANE,
HNAE3_MEDIA_TYPE_NONE,
};
/* must be consistent with definition in firmware */ enum hnae3_module_type {
HNAE3_MODULE_TYPE_UNKNOWN = 0x00,
HNAE3_MODULE_TYPE_FIBRE_LR = 0x01,
HNAE3_MODULE_TYPE_FIBRE_SR = 0x02,
HNAE3_MODULE_TYPE_AOC = 0x03,
HNAE3_MODULE_TYPE_CR = 0x04,
HNAE3_MODULE_TYPE_KR = 0x05,
HNAE3_MODULE_TYPE_TP = 0x06,
};
/* device specification info from firmware */ struct hnae3_dev_specs {
u32 mac_entry_num; /* number of mac-vlan table entry */
u32 mng_entry_num; /* number of manager table entry */
u32 max_tm_rate;
u16 rss_ind_tbl_size;
u16 rss_key_size;
u16 int_ql_max; /* max value of interrupt coalesce based on INT_QL */
u16 max_int_gl; /* max value of interrupt coalesce based on INT_GL */
u8 max_non_tso_bd_num; /* max BD number of one non-TSO packet */
u16 max_frm_size;
u16 max_qset_num;
u16 umv_size;
u16 mc_mac_size;
u32 mac_stats_num;
u8 tnl_num;
u8 hilink_version;
};
/* This struct defines the operation on the handle. * * init_ae_dev(): (mandatory) * Get PF configure from pci_dev and initialize PF hardware * uninit_ae_dev() * Disable PF device and release PF resource * register_client * Register client to ae_dev * unregister_client() * Unregister client from ae_dev * start() * Enable the hardware * stop() * Disable the hardware * start_client() * Inform the hclge that client has been started * stop_client() * Inform the hclge that client has been stopped * get_status() * Get the carrier state of the back channel of the handle, 1 for ok, 0 for * non-ok * get_ksettings_an_result() * Get negotiation status,speed and duplex * get_media_type() * Get media type of MAC * check_port_speed() * Check target speed whether is supported * adjust_link() * Adjust link status * set_loopback() * Set loopback * set_promisc_mode * Set promisc mode * request_update_promisc_mode * request to hclge(vf) to update promisc mode * set_mtu() * set mtu * get_pauseparam() * get tx and rx of pause frame use * set_pauseparam() * set tx and rx of pause frame use * set_autoneg() * set auto autonegotiation of pause frame use * get_autoneg() * get auto autonegotiation of pause frame use * restart_autoneg() * restart autonegotiation * halt_autoneg() * halt/resume autonegotiation when autonegotiation on * get_coalesce_usecs() * get usecs to delay a TX interrupt after a packet is sent * get_rx_max_coalesced_frames() * get Maximum number of packets to be sent before a TX interrupt. * set_coalesce_usecs() * set usecs to delay a TX interrupt after a packet is sent * set_coalesce_frames() * set Maximum number of packets to be sent before a TX interrupt. * get_mac_addr() * get mac address * set_mac_addr() * set mac address * add_uc_addr * Add unicast addr to mac table * rm_uc_addr * Remove unicast addr from mac table * set_mc_addr() * Set multicast address * add_mc_addr * Add multicast address to mac table * rm_mc_addr * Remove multicast address from mac table * update_stats() * Update Old network device statistics * get_mac_stats() * get mac pause statistics including tx_cnt and rx_cnt * get_ethtool_stats() * Get ethtool network device statistics * get_strings() * Get a set of strings that describe the requested objects * get_sset_count() * Get number of strings that @get_strings will write * update_led_status() * Update the led status * set_led_id() * Set led id * get_regs() * Get regs dump * get_regs_len() * Get the len of the regs dump * get_rss_key_size() * Get rss key size * get_rss() * Get rss table * set_rss() * Set rss table * get_tc_size() * Get tc size of handle * get_vector() * Get vector number and vector information * put_vector() * Put the vector in hdev * map_ring_to_vector() * Map rings to vector * unmap_ring_from_vector() * Unmap rings from vector * reset_queue() * Reset queue * get_fw_version() * Get firmware version * get_mdix_mode() * Get media typr of phy * enable_vlan_filter() * Enable vlan filter * set_vlan_filter() * Set vlan filter config of Ports * set_vf_vlan_filter() * Set vlan filter config of vf * enable_hw_strip_rxvtag() * Enable/disable hardware strip vlan tag of packets received * set_gro_en * Enable/disable HW GRO * add_arfs_entry * Check the 5-tuples of flow, and create flow director rule * get_vf_config * Get the VF configuration setting by the host * set_vf_link_state * Set VF link status * set_vf_spoofchk * Enable/disable spoof check for specified vf * set_vf_trust * Enable/disable trust for specified vf, if the vf being trusted, then * it can enable promisc mode * set_vf_rate * Set the max tx rate of specified vf. * set_vf_mac * Configure the default MAC for specified VF * get_module_eeprom * Get the optical module eeprom info. * add_cls_flower * Add clsflower rule * del_cls_flower * Delete clsflower rule * cls_flower_active * Check if any cls flower rule exist * set_tx_hwts_info * Save information for 1588 tx packet * get_rx_hwts * Get 1588 rx hwstamp * get_ts_info * Get phc info * clean_vf_config * Clean residual vf info after disable sriov * get_wol * Get wake on lan info * set_wol * Config wake on lan * dbg_get_read_func * Return the read func for debugfs seq file
*/ struct hnae3_ae_ops { int (*init_ae_dev)(struct hnae3_ae_dev *ae_dev); void (*uninit_ae_dev)(struct hnae3_ae_dev *ae_dev); void (*reset_prepare)(struct hnae3_ae_dev *ae_dev, enum hnae3_reset_type rst_type); void (*reset_done)(struct hnae3_ae_dev *ae_dev); int (*init_client_instance)(struct hnae3_client *client, struct hnae3_ae_dev *ae_dev); void (*uninit_client_instance)(struct hnae3_client *client, struct hnae3_ae_dev *ae_dev); int (*start)(struct hnae3_handle *handle); void (*stop)(struct hnae3_handle *handle); int (*client_start)(struct hnae3_handle *handle); void (*client_stop)(struct hnae3_handle *handle); int (*get_status)(struct hnae3_handle *handle); void (*get_ksettings_an_result)(struct hnae3_handle *handle,
u8 *auto_neg, u32 *speed, u8 *duplex,
u32 *lane_num);
int (*cfg_mac_speed_dup_h)(struct hnae3_handle *handle, int speed,
u8 duplex, u8 lane_num);
int (*set_autoneg)(struct hnae3_handle *handle, bool enable); int (*get_autoneg)(struct hnae3_handle *handle); int (*restart_autoneg)(struct hnae3_handle *handle); int (*halt_autoneg)(struct hnae3_handle *handle, bool halt);
int (*get_vector)(struct hnae3_handle *handle, u16 vector_num, struct hnae3_vector_info *vector_info); int (*put_vector)(struct hnae3_handle *handle, int vector_num); int (*map_ring_to_vector)(struct hnae3_handle *handle, int vector_num, struct hnae3_ring_chain_node *vr_chain); int (*unmap_ring_from_vector)(struct hnae3_handle *handle, int vector_num, struct hnae3_ring_chain_node *vr_chain);
u16 num_tqps; /* total number of TQPs in this handle */ struct hnae3_queue **tqp; /* array base of all TQPs in this instance */ conststruct hnae3_dcb_ops *dcb_ops;
u16 int_rl_setting; void __iomem *io_base;
};
struct hnae3_roce_private_info { struct net_device *netdev; void __iomem *roce_io_base; void __iomem *roce_mem_base; int base_vector; int num_vectors;
/* The below attributes defined for RoCE client, hnae3 gives * initial values to them, and RoCE client can modify and use * them.
*/ unsignedlong reset_state; unsignedlong instance_state; unsignedlong state;
};
struct hnae3_handle { struct hnae3_client *client; struct pci_dev *pdev; void *priv; struct hnae3_ae_algo *ae_algo; /* the class who provides this handle */
u64 flags; /* Indicate the capabilities for this handle */
union { struct net_device *netdev; /* first member */ struct hnae3_knic_private_info kinfo; struct hnae3_roce_private_info rinfo;
};
nodemask_t numa_node_mask; /* for multi-chip support */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.