5 #ifndef _RTE_ETHDEV_CORE_H_
6 #define _RTE_ETHDEV_CORE_H_
20 struct rte_eth_dev_callback;
22 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
31 typedef int (*eth_dev_configure_t)(
struct rte_eth_dev *dev);
34 typedef int (*eth_dev_start_t)(
struct rte_eth_dev *dev);
37 typedef void (*eth_dev_stop_t)(
struct rte_eth_dev *dev);
40 typedef int (*eth_dev_set_link_up_t)(
struct rte_eth_dev *dev);
43 typedef int (*eth_dev_set_link_down_t)(
struct rte_eth_dev *dev);
46 typedef void (*eth_dev_close_t)(
struct rte_eth_dev *dev);
49 typedef int (*eth_dev_reset_t)(
struct rte_eth_dev *dev);
78 typedef int (*eth_promiscuous_enable_t)(
struct rte_eth_dev *dev);
103 typedef int (*eth_promiscuous_disable_t)(
struct rte_eth_dev *dev);
128 typedef int (*eth_allmulticast_enable_t)(
struct rte_eth_dev *dev);
153 typedef int (*eth_allmulticast_disable_t)(
struct rte_eth_dev *dev);
155 typedef int (*eth_link_update_t)(
struct rte_eth_dev *dev,
156 int wait_to_complete);
159 typedef int (*eth_stats_get_t)(
struct rte_eth_dev *dev,
182 typedef int (*eth_stats_reset_t)(
struct rte_eth_dev *dev);
184 typedef int (*eth_xstats_get_t)(
struct rte_eth_dev *dev,
188 typedef int (*eth_xstats_get_by_id_t)(
struct rte_eth_dev *dev,
213 typedef int (*eth_xstats_reset_t)(
struct rte_eth_dev *dev);
215 typedef int (*eth_xstats_get_names_t)(
struct rte_eth_dev *dev,
219 typedef int (*eth_xstats_get_names_by_id_t)(
struct rte_eth_dev *dev,
224 typedef int (*eth_queue_stats_mapping_set_t)(
struct rte_eth_dev *dev,
230 typedef int (*eth_dev_infos_get_t)(
struct rte_eth_dev *dev,
234 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(
struct rte_eth_dev *dev);
249 typedef int (*eth_dev_ptypes_set_t)(
struct rte_eth_dev *dev,
250 uint32_t ptype_mask);
252 typedef int (*eth_queue_start_t)(
struct rte_eth_dev *dev,
256 typedef int (*eth_queue_stop_t)(
struct rte_eth_dev *dev,
260 typedef int (*eth_rx_queue_setup_t)(
struct rte_eth_dev *dev,
261 uint16_t rx_queue_id,
263 unsigned int socket_id,
268 typedef int (*eth_tx_queue_setup_t)(
struct rte_eth_dev *dev,
269 uint16_t tx_queue_id,
271 unsigned int socket_id,
275 typedef int (*eth_rx_enable_intr_t)(
struct rte_eth_dev *dev,
276 uint16_t rx_queue_id);
279 typedef int (*eth_rx_disable_intr_t)(
struct rte_eth_dev *dev,
280 uint16_t rx_queue_id);
283 typedef void (*eth_queue_release_t)(
void *queue);
286 typedef uint32_t (*eth_rx_queue_count_t)(
struct rte_eth_dev *dev,
287 uint16_t rx_queue_id);
290 typedef int (*eth_rx_descriptor_done_t)(
void *rxq, uint16_t offset);
293 typedef int (*eth_rx_descriptor_status_t)(
void *rxq, uint16_t offset);
296 typedef int (*eth_tx_descriptor_status_t)(
void *txq, uint16_t offset);
299 typedef int (*eth_fw_version_get_t)(
struct rte_eth_dev *dev,
300 char *fw_version,
size_t fw_size);
303 typedef int (*eth_tx_done_cleanup_t)(
void *txq, uint32_t free_cnt);
306 typedef void (*eth_rxq_info_get_t)(
struct rte_eth_dev *dev,
309 typedef void (*eth_txq_info_get_t)(
struct rte_eth_dev *dev,
312 typedef int (*eth_burst_mode_get_t)(
struct rte_eth_dev *dev,
315 typedef int (*mtu_set_t)(
struct rte_eth_dev *dev, uint16_t mtu);
318 typedef int (*vlan_filter_set_t)(
struct rte_eth_dev *dev,
323 typedef int (*vlan_tpid_set_t)(
struct rte_eth_dev *dev,
327 typedef int (*vlan_offload_set_t)(
struct rte_eth_dev *dev,
int mask);
330 typedef int (*vlan_pvid_set_t)(
struct rte_eth_dev *dev,
335 typedef void (*vlan_strip_queue_set_t)(
struct rte_eth_dev *dev,
336 uint16_t rx_queue_id,
340 typedef uint16_t (*eth_rx_burst_t)(
void *rxq,
345 typedef uint16_t (*eth_tx_burst_t)(
void *
txq,
350 typedef uint16_t (*eth_tx_prep_t)(
void *
txq,
355 typedef int (*flow_ctrl_get_t)(
struct rte_eth_dev *dev,
359 typedef int (*flow_ctrl_set_t)(
struct rte_eth_dev *dev,
363 typedef int (*priority_flow_ctrl_set_t)(
struct rte_eth_dev *dev,
367 typedef int (*reta_update_t)(
struct rte_eth_dev *dev,
372 typedef int (*reta_query_t)(
struct rte_eth_dev *dev,
377 typedef int (*rss_hash_update_t)(
struct rte_eth_dev *dev,
381 typedef int (*rss_hash_conf_get_t)(
struct rte_eth_dev *dev,
385 typedef int (*eth_dev_led_on_t)(
struct rte_eth_dev *dev);
388 typedef int (*eth_dev_led_off_t)(
struct rte_eth_dev *dev);
391 typedef void (*eth_mac_addr_remove_t)(
struct rte_eth_dev *dev, uint32_t index);
394 typedef int (*eth_mac_addr_add_t)(
struct rte_eth_dev *dev,
400 typedef int (*eth_mac_addr_set_t)(
struct rte_eth_dev *dev,
404 typedef int (*eth_uc_hash_table_set_t)(
struct rte_eth_dev *dev,
409 typedef int (*eth_uc_all_hash_table_set_t)(
struct rte_eth_dev *dev,
413 typedef int (*eth_set_queue_rate_limit_t)(
struct rte_eth_dev *dev,
418 typedef int (*eth_mirror_rule_set_t)(
struct rte_eth_dev *dev,
424 typedef int (*eth_mirror_rule_reset_t)(
struct rte_eth_dev *dev,
428 typedef int (*eth_udp_tunnel_port_add_t)(
struct rte_eth_dev *dev,
432 typedef int (*eth_udp_tunnel_port_del_t)(
struct rte_eth_dev *dev,
436 typedef int (*eth_set_mc_addr_list_t)(
struct rte_eth_dev *dev,
438 uint32_t nb_mc_addr);
441 typedef int (*eth_timesync_enable_t)(
struct rte_eth_dev *dev);
444 typedef int (*eth_timesync_disable_t)(
struct rte_eth_dev *dev);
447 typedef int (*eth_timesync_read_rx_timestamp_t)(
struct rte_eth_dev *dev,
448 struct timespec *timestamp,
452 typedef int (*eth_timesync_read_tx_timestamp_t)(
struct rte_eth_dev *dev,
453 struct timespec *timestamp);
456 typedef int (*eth_timesync_adjust_time)(
struct rte_eth_dev *dev, int64_t);
459 typedef int (*eth_timesync_read_time)(
struct rte_eth_dev *dev,
460 struct timespec *timestamp);
463 typedef int (*eth_timesync_write_time)(
struct rte_eth_dev *dev,
464 const struct timespec *timestamp);
467 typedef int (*eth_read_clock)(
struct rte_eth_dev *dev,
468 uint64_t *timestamp);
471 typedef int (*eth_get_reg_t)(
struct rte_eth_dev *dev,
472 struct rte_dev_reg_info *info);
475 typedef int (*eth_get_eeprom_length_t)(
struct rte_eth_dev *dev);
478 typedef int (*eth_get_eeprom_t)(
struct rte_eth_dev *dev,
479 struct rte_dev_eeprom_info *info);
482 typedef int (*eth_set_eeprom_t)(
struct rte_eth_dev *dev,
483 struct rte_dev_eeprom_info *info);
486 typedef int (*eth_get_module_info_t)(
struct rte_eth_dev *dev,
490 typedef int (*eth_get_module_eeprom_t)(
struct rte_eth_dev *dev,
491 struct rte_dev_eeprom_info *info);
494 typedef int (*eth_l2_tunnel_eth_type_conf_t)
498 typedef int (*eth_l2_tunnel_offload_set_t)
499 (
struct rte_eth_dev *dev,
506 typedef int (*eth_filter_ctrl_t)(
struct rte_eth_dev *dev,
512 typedef int (*eth_tm_ops_get_t)(
struct rte_eth_dev *dev,
void *ops);
515 typedef int (*eth_mtr_ops_get_t)(
struct rte_eth_dev *dev,
void *ops);
518 typedef int (*eth_get_dcb_info)(
struct rte_eth_dev *dev,
522 typedef int (*eth_pool_ops_supported_t)(
struct rte_eth_dev *dev,
543 typedef int (*eth_hairpin_cap_get_t)(
struct rte_eth_dev *dev,
571 typedef int (*eth_rx_hairpin_queue_setup_t)
572 (
struct rte_eth_dev *dev, uint16_t rx_queue_id,
601 typedef int (*eth_tx_hairpin_queue_setup_t)
602 (
struct rte_eth_dev *dev, uint16_t tx_queue_id,
610 eth_dev_configure_t dev_configure;
611 eth_dev_start_t dev_start;
612 eth_dev_stop_t dev_stop;
613 eth_dev_set_link_up_t dev_set_link_up;
614 eth_dev_set_link_down_t dev_set_link_down;
615 eth_dev_close_t dev_close;
616 eth_dev_reset_t dev_reset;
617 eth_link_update_t link_update;
621 eth_promiscuous_enable_t promiscuous_enable;
622 eth_promiscuous_disable_t promiscuous_disable;
623 eth_allmulticast_enable_t allmulticast_enable;
624 eth_allmulticast_disable_t allmulticast_disable;
625 eth_mac_addr_remove_t mac_addr_remove;
626 eth_mac_addr_add_t mac_addr_add;
627 eth_mac_addr_set_t mac_addr_set;
628 eth_set_mc_addr_list_t set_mc_addr_list;
631 eth_stats_get_t stats_get;
632 eth_stats_reset_t stats_reset;
633 eth_xstats_get_t xstats_get;
634 eth_xstats_reset_t xstats_reset;
635 eth_xstats_get_names_t xstats_get_names;
637 eth_queue_stats_mapping_set_t queue_stats_mapping_set;
640 eth_dev_infos_get_t dev_infos_get;
641 eth_rxq_info_get_t rxq_info_get;
642 eth_txq_info_get_t txq_info_get;
643 eth_burst_mode_get_t rx_burst_mode_get;
644 eth_burst_mode_get_t tx_burst_mode_get;
645 eth_fw_version_get_t fw_version_get;
646 eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
648 eth_dev_ptypes_set_t dev_ptypes_set;
651 vlan_filter_set_t vlan_filter_set;
652 vlan_tpid_set_t vlan_tpid_set;
653 vlan_strip_queue_set_t vlan_strip_queue_set;
654 vlan_offload_set_t vlan_offload_set;
655 vlan_pvid_set_t vlan_pvid_set;
657 eth_queue_start_t rx_queue_start;
658 eth_queue_stop_t rx_queue_stop;
659 eth_queue_start_t tx_queue_start;
660 eth_queue_stop_t tx_queue_stop;
661 eth_rx_queue_setup_t rx_queue_setup;
662 eth_queue_release_t rx_queue_release;
663 eth_rx_queue_count_t rx_queue_count;
665 eth_rx_descriptor_done_t rx_descriptor_done;
666 eth_rx_descriptor_status_t rx_descriptor_status;
668 eth_tx_descriptor_status_t tx_descriptor_status;
674 eth_rx_enable_intr_t rx_queue_intr_enable;
675 eth_rx_disable_intr_t rx_queue_intr_disable;
676 eth_tx_queue_setup_t tx_queue_setup;
677 eth_queue_release_t tx_queue_release;
678 eth_tx_done_cleanup_t tx_done_cleanup;
680 eth_dev_led_on_t dev_led_on;
681 eth_dev_led_off_t dev_led_off;
683 flow_ctrl_get_t flow_ctrl_get;
684 flow_ctrl_set_t flow_ctrl_set;
685 priority_flow_ctrl_set_t priority_flow_ctrl_set;
687 eth_uc_hash_table_set_t uc_hash_table_set;
688 eth_uc_all_hash_table_set_t uc_all_hash_table_set;
690 eth_mirror_rule_set_t mirror_rule_set;
691 eth_mirror_rule_reset_t mirror_rule_reset;
693 eth_udp_tunnel_port_add_t udp_tunnel_port_add;
694 eth_udp_tunnel_port_del_t udp_tunnel_port_del;
695 eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
697 eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
700 eth_set_queue_rate_limit_t set_queue_rate_limit;
702 rss_hash_update_t rss_hash_update;
703 rss_hash_conf_get_t rss_hash_conf_get;
704 reta_update_t reta_update;
705 reta_query_t reta_query;
707 eth_get_reg_t get_reg;
708 eth_get_eeprom_length_t get_eeprom_length;
709 eth_get_eeprom_t get_eeprom;
710 eth_set_eeprom_t set_eeprom;
712 eth_get_module_info_t get_module_info;
714 eth_get_module_eeprom_t get_module_eeprom;
717 eth_filter_ctrl_t filter_ctrl;
719 eth_get_dcb_info get_dcb_info;
721 eth_timesync_enable_t timesync_enable;
723 eth_timesync_disable_t timesync_disable;
725 eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
727 eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
729 eth_timesync_adjust_time timesync_adjust_time;
730 eth_timesync_read_time timesync_read_time;
731 eth_timesync_write_time timesync_write_time;
733 eth_read_clock read_clock;
735 eth_xstats_get_by_id_t xstats_get_by_id;
737 eth_xstats_get_names_by_id_t xstats_get_names_by_id;
740 eth_tm_ops_get_t tm_ops_get;
743 eth_mtr_ops_get_t mtr_ops_get;
746 eth_pool_ops_supported_t pool_ops_supported;
749 eth_hairpin_cap_get_t hairpin_cap_get;
751 eth_rx_hairpin_queue_setup_t rx_hairpin_queue_setup;
753 eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup;
762 struct rte_eth_rxtx_callback {
763 struct rte_eth_rxtx_callback *next;
782 eth_rx_burst_t rx_pkt_burst;
783 eth_tx_burst_t tx_pkt_burst;
784 eth_tx_prep_t tx_pkt_prepare;
790 struct rte_eth_dev_data *data;
791 void *process_private;
792 const struct eth_dev_ops *dev_ops;
796 struct rte_eth_dev_cb_list link_intr_cbs;
801 struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
806 struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
810 uint64_t reserved_64s[4];
811 void *reserved_ptrs[4];
814 struct rte_eth_dev_sriov;
815 struct rte_eth_dev_owner;
824 struct rte_eth_dev_data {
825 char name[RTE_ETH_NAME_MAX_LEN];
829 uint16_t nb_rx_queues;
830 uint16_t nb_tx_queues;
832 struct rte_eth_dev_sriov sriov;
842 uint32_t min_rx_buf_size;
845 uint64_t rx_mbuf_alloc_failed;
859 uint8_t promiscuous : 1,
864 uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
866 uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
873 struct rte_eth_dev_owner owner;
874 uint16_t representor_id;
879 uint64_t reserved_64s[4];
880 void *reserved_ptrs[4];
888 extern struct rte_eth_dev rte_eth_devices[];
#define ETH_NUM_RECEIVE_MAC_ADDR
int(* eth_is_removed_t)(struct rte_eth_dev *dev)
uint16_t(* rte_tx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param)
#define __rte_cache_aligned
TAILQ_HEAD(vdev_driver_list, rte_vdev_driver)
uint16_t(* rte_rx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param)