DPDK  20.11.10
rte_ethdev_driver.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation
3  */
4 
5 #ifndef _RTE_ETHDEV_DRIVER_H_
6 #define _RTE_ETHDEV_DRIVER_H_
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
22 #include <rte_ethdev.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
29 struct rte_hairpin_peer_info;
30 
31 /*
32  * Definitions of all functions exported by an Ethernet driver through the
33  * generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
34  * structure associated with an Ethernet device.
35  */
36 
37 typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
40 typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
43 typedef int (*eth_dev_stop_t)(struct rte_eth_dev *dev);
46 typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
49 typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
52 typedef int (*eth_dev_close_t)(struct rte_eth_dev *dev);
55 typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
58 typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
84 typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
85 
109 typedef int (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
110 
134 typedef int (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
135 
159 typedef int (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
160 
161 typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
162  int wait_to_complete);
165 typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
166  struct rte_eth_stats *igb_stats);
188 typedef int (*eth_stats_reset_t)(struct rte_eth_dev *dev);
189 
190 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
191  struct rte_eth_xstat *stats, unsigned int n);
194 typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
195  const uint64_t *ids,
196  uint64_t *values,
197  unsigned int n);
219 typedef int (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
220 
221 typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
222  struct rte_eth_xstat_name *xstats_names, unsigned int size);
225 typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
226  struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
227  unsigned int size);
230 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
231  uint16_t queue_id,
232  uint8_t stat_idx,
233  uint8_t is_rx);
236 typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
237  struct rte_eth_dev_info *dev_info);
240 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
255 typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
256  uint32_t ptype_mask);
257 
258 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
259  uint16_t queue_id);
262 typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
263  uint16_t queue_id);
266 typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
267  uint16_t rx_queue_id,
268  uint16_t nb_rx_desc,
269  unsigned int socket_id,
270  const struct rte_eth_rxconf *rx_conf,
271  struct rte_mempool *mb_pool);
274 typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
275  uint16_t tx_queue_id,
276  uint16_t nb_tx_desc,
277  unsigned int socket_id,
278  const struct rte_eth_txconf *tx_conf);
281 typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
282  uint16_t rx_queue_id);
285 typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
286  uint16_t rx_queue_id);
289 typedef void (*eth_queue_release_t)(void *queue);
292 typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
293  char *fw_version, size_t fw_size);
296 typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
299 typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
300  uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
301 
302 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
303  uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
304 
305 typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
306  uint16_t queue_id, struct rte_eth_burst_mode *mode);
307 
308 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
311 typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
312  uint16_t vlan_id,
313  int on);
316 typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
317  enum rte_vlan_type type, uint16_t tpid);
320 typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
323 typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
324  uint16_t vlan_id,
325  int on);
328 typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
329  uint16_t rx_queue_id,
330  int on);
333 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
334  struct rte_eth_fc_conf *fc_conf);
337 typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
338  struct rte_eth_fc_conf *fc_conf);
341 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
342  struct rte_eth_pfc_conf *pfc_conf);
345 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
346  struct rte_eth_rss_reta_entry64 *reta_conf,
347  uint16_t reta_size);
350 typedef int (*reta_query_t)(struct rte_eth_dev *dev,
351  struct rte_eth_rss_reta_entry64 *reta_conf,
352  uint16_t reta_size);
355 typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
356  struct rte_eth_rss_conf *rss_conf);
359 typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
360  struct rte_eth_rss_conf *rss_conf);
363 typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
366 typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
369 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
372 typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
373  struct rte_ether_addr *mac_addr,
374  uint32_t index,
375  uint32_t vmdq);
378 typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
379  struct rte_ether_addr *mac_addr);
382 typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
383  struct rte_ether_addr *mac_addr,
384  uint8_t on);
387 typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
388  uint8_t on);
391 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
392  uint16_t queue_idx,
393  uint16_t tx_rate);
396 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
397  struct rte_eth_mirror_conf *mirror_conf,
398  uint8_t rule_id,
399  uint8_t on);
402 typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
403  uint8_t rule_id);
406 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
407  struct rte_eth_udp_tunnel *tunnel_udp);
410 typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
411  struct rte_eth_udp_tunnel *tunnel_udp);
414 typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
415  struct rte_ether_addr *mc_addr_set,
416  uint32_t nb_mc_addr);
419 typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
422 typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
425 typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
426  struct timespec *timestamp,
427  uint32_t flags);
430 typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
431  struct timespec *timestamp);
434 typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
437 typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
438  struct timespec *timestamp);
441 typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
442  const struct timespec *timestamp);
445 typedef int (*eth_read_clock)(struct rte_eth_dev *dev,
446  uint64_t *timestamp);
449 typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev,
450  struct rte_dev_reg_info *info);
453 typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
456 typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
457  struct rte_dev_eeprom_info *info);
460 typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
461  struct rte_dev_eeprom_info *info);
464 typedef int (*eth_get_module_info_t)(struct rte_eth_dev *dev,
465  struct rte_eth_dev_module_info *modinfo);
468 typedef int (*eth_get_module_eeprom_t)(struct rte_eth_dev *dev,
469  struct rte_dev_eeprom_info *info);
476  RTE_ETH_FILTER_NONE = 0,
477  RTE_ETH_FILTER_ETHERTYPE,
478  RTE_ETH_FILTER_FLEXIBLE,
479  RTE_ETH_FILTER_SYN,
480  RTE_ETH_FILTER_NTUPLE,
481  RTE_ETH_FILTER_TUNNEL,
482  RTE_ETH_FILTER_FDIR,
483  RTE_ETH_FILTER_HASH,
484  RTE_ETH_FILTER_L2_TUNNEL,
485  RTE_ETH_FILTER_GENERIC,
486 };
487 
493 };
494 
495 typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
496  enum rte_filter_type filter_type,
497  enum rte_filter_op filter_op,
498  void *arg);
501 typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
504 typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
507 typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
508  struct rte_eth_dcb_info *dcb_info);
511 typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev,
512  const char *pool);
532 typedef int (*eth_hairpin_cap_get_t)(struct rte_eth_dev *dev,
533  struct rte_eth_hairpin_cap *cap);
534 
560 typedef int (*eth_rx_hairpin_queue_setup_t)
561  (struct rte_eth_dev *dev, uint16_t rx_queue_id,
562  uint16_t nb_rx_desc,
563  const struct rte_eth_hairpin_conf *conf);
564 
590 typedef int (*eth_tx_hairpin_queue_setup_t)
591  (struct rte_eth_dev *dev, uint16_t tx_queue_id,
592  uint16_t nb_tx_desc,
593  const struct rte_eth_hairpin_conf *hairpin_conf);
594 
623 typedef int (*eth_fec_get_capability_t)(struct rte_eth_dev *dev,
624  struct rte_eth_fec_capa *speed_fec_capa, unsigned int num);
625 
648 typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev,
649  uint32_t *fec_capa);
650 
674 typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, uint32_t fec_capa);
675 
703 typedef int (*hairpin_get_peer_ports_t)(struct rte_eth_dev *dev,
704  uint16_t *peer_ports, size_t len,
705  uint32_t direction);
706 
728 typedef int (*eth_hairpin_bind_t)(struct rte_eth_dev *dev,
729  uint16_t rx_port);
730 
752 typedef int (*eth_hairpin_unbind_t)(struct rte_eth_dev *dev,
753  uint16_t rx_port);
754 
755 typedef int (*eth_hairpin_queue_peer_update_t)
756  (struct rte_eth_dev *dev, uint16_t peer_queue,
757  struct rte_hairpin_peer_info *current_info,
758  struct rte_hairpin_peer_info *peer_info, uint32_t direction);
761 typedef int (*eth_hairpin_queue_peer_bind_t)
762  (struct rte_eth_dev *dev, uint16_t cur_queue,
763  struct rte_hairpin_peer_info *peer_info, uint32_t direction);
766 typedef int (*eth_hairpin_queue_peer_unbind_t)
767  (struct rte_eth_dev *dev, uint16_t cur_queue, uint32_t direction);
773 struct eth_dev_ops {
774  eth_dev_configure_t dev_configure;
775  eth_dev_start_t dev_start;
776  eth_dev_stop_t dev_stop;
777  eth_dev_set_link_up_t dev_set_link_up;
778  eth_dev_set_link_down_t dev_set_link_down;
779  eth_dev_close_t dev_close;
780  eth_dev_reset_t dev_reset;
781  eth_link_update_t link_update;
782  eth_is_removed_t is_removed;
785  eth_promiscuous_enable_t promiscuous_enable;
786  eth_promiscuous_disable_t promiscuous_disable;
787  eth_allmulticast_enable_t allmulticast_enable;
788  eth_allmulticast_disable_t allmulticast_disable;
789  eth_mac_addr_remove_t mac_addr_remove;
790  eth_mac_addr_add_t mac_addr_add;
791  eth_mac_addr_set_t mac_addr_set;
792  eth_set_mc_addr_list_t set_mc_addr_list;
793  mtu_set_t mtu_set;
795  eth_stats_get_t stats_get;
796  eth_stats_reset_t stats_reset;
797  eth_xstats_get_t xstats_get;
798  eth_xstats_reset_t xstats_reset;
799  eth_xstats_get_names_t xstats_get_names;
801  eth_queue_stats_mapping_set_t queue_stats_mapping_set;
804  eth_dev_infos_get_t dev_infos_get;
805  eth_rxq_info_get_t rxq_info_get;
806  eth_txq_info_get_t txq_info_get;
807  eth_burst_mode_get_t rx_burst_mode_get;
808  eth_burst_mode_get_t tx_burst_mode_get;
809  eth_fw_version_get_t fw_version_get;
810  eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
812  eth_dev_ptypes_set_t dev_ptypes_set;
815  vlan_filter_set_t vlan_filter_set;
816  vlan_tpid_set_t vlan_tpid_set;
817  vlan_strip_queue_set_t vlan_strip_queue_set;
818  vlan_offload_set_t vlan_offload_set;
819  vlan_pvid_set_t vlan_pvid_set;
821  eth_queue_start_t rx_queue_start;
822  eth_queue_stop_t rx_queue_stop;
823  eth_queue_start_t tx_queue_start;
824  eth_queue_stop_t tx_queue_stop;
825  eth_rx_queue_setup_t rx_queue_setup;
826  eth_queue_release_t rx_queue_release;
828  eth_rx_enable_intr_t rx_queue_intr_enable;
829  eth_rx_disable_intr_t rx_queue_intr_disable;
830  eth_tx_queue_setup_t tx_queue_setup;
831  eth_queue_release_t tx_queue_release;
832  eth_tx_done_cleanup_t tx_done_cleanup;
834  eth_dev_led_on_t dev_led_on;
835  eth_dev_led_off_t dev_led_off;
837  flow_ctrl_get_t flow_ctrl_get;
838  flow_ctrl_set_t flow_ctrl_set;
839  priority_flow_ctrl_set_t priority_flow_ctrl_set;
841  eth_uc_hash_table_set_t uc_hash_table_set;
842  eth_uc_all_hash_table_set_t uc_all_hash_table_set;
844  eth_mirror_rule_set_t mirror_rule_set;
845  eth_mirror_rule_reset_t mirror_rule_reset;
847  eth_udp_tunnel_port_add_t udp_tunnel_port_add;
848  eth_udp_tunnel_port_del_t udp_tunnel_port_del;
850  eth_set_queue_rate_limit_t set_queue_rate_limit;
852  rss_hash_update_t rss_hash_update;
853  rss_hash_conf_get_t rss_hash_conf_get;
854  reta_update_t reta_update;
855  reta_query_t reta_query;
857  eth_get_reg_t get_reg;
858  eth_get_eeprom_length_t get_eeprom_length;
859  eth_get_eeprom_t get_eeprom;
860  eth_set_eeprom_t set_eeprom;
862  eth_get_module_info_t get_module_info;
864  eth_get_module_eeprom_t get_module_eeprom;
867  eth_filter_ctrl_t filter_ctrl;
869  eth_get_dcb_info get_dcb_info;
871  eth_timesync_enable_t timesync_enable;
873  eth_timesync_disable_t timesync_disable;
875  eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
877  eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
879  eth_timesync_adjust_time timesync_adjust_time;
880  eth_timesync_read_time timesync_read_time;
881  eth_timesync_write_time timesync_write_time;
883  eth_read_clock read_clock;
884 
885  eth_xstats_get_by_id_t xstats_get_by_id;
887  eth_xstats_get_names_by_id_t xstats_get_names_by_id;
890  eth_tm_ops_get_t tm_ops_get;
893  eth_mtr_ops_get_t mtr_ops_get;
896  eth_pool_ops_supported_t pool_ops_supported;
899  eth_hairpin_cap_get_t hairpin_cap_get;
901  eth_rx_hairpin_queue_setup_t rx_hairpin_queue_setup;
903  eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup;
906  eth_fec_get_capability_t fec_get_capability;
908  eth_fec_get_t fec_get;
910  eth_fec_set_t fec_set;
912  hairpin_get_peer_ports_t hairpin_get_peer_ports;
914  eth_hairpin_bind_t hairpin_bind;
916  eth_hairpin_unbind_t hairpin_unbind;
918  eth_hairpin_queue_peer_update_t hairpin_queue_peer_update;
920  eth_hairpin_queue_peer_bind_t hairpin_queue_peer_bind;
922  eth_hairpin_queue_peer_unbind_t hairpin_queue_peer_unbind;
924 };
925 
938 __rte_internal
939 int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
940 
953 __rte_internal
954 int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
955 
965 __rte_internal
966 struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
967 
977 __rte_internal
978 struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
979 
991 __rte_internal
992 struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
993 
1010 __rte_internal
1011 int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
1012 
1024 __rte_internal
1025 void rte_eth_dev_internal_reset(struct rte_eth_dev *dev);
1026 
1044 __rte_internal
1045 int rte_eth_dev_callback_process(struct rte_eth_dev *dev,
1046  enum rte_eth_event_type event, void *ret_param);
1047 
1060 __rte_internal
1061 void rte_eth_dev_probing_finish(struct rte_eth_dev *dev);
1062 
1082 __rte_internal
1083 const struct rte_memzone *
1084 rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
1085  uint16_t queue_id, size_t size,
1086  unsigned align, int socket_id);
1087 
1100 __rte_internal
1101 int
1102 rte_eth_dma_zone_free(const struct rte_eth_dev *eth_dev, const char *name,
1103  uint16_t queue_id);
1104 
1120 static inline int
1121 rte_eth_linkstatus_set(struct rte_eth_dev *dev,
1122  const struct rte_eth_link *new_link)
1123 {
1124  uint64_t *dev_link = (uint64_t *)&(dev->data->dev_link);
1125  union {
1126  uint64_t val64;
1127  struct rte_eth_link link;
1128  } orig;
1129 
1130  RTE_BUILD_BUG_ON(sizeof(*new_link) != sizeof(uint64_t));
1131 
1132  orig.val64 = __atomic_exchange_n(dev_link, *(const uint64_t *)new_link,
1133  __ATOMIC_SEQ_CST);
1134 
1135  return (orig.link.link_status == new_link->link_status) ? -1 : 0;
1136 }
1137 
1147 static inline void
1148 rte_eth_linkstatus_get(const struct rte_eth_dev *dev,
1149  struct rte_eth_link *link)
1150 {
1151  uint64_t *src = (uint64_t *)&(dev->data->dev_link);
1152  uint64_t *dst = (uint64_t *)link;
1153 
1154  RTE_BUILD_BUG_ON(sizeof(*link) != sizeof(uint64_t));
1155 
1156  *dst = __atomic_load_n(src, __ATOMIC_SEQ_CST);
1157 }
1158 
1173 __rte_internal
1174 int
1175 rte_eth_switch_domain_alloc(uint16_t *domain_id);
1176 
1189 __rte_internal
1190 int
1191 rte_eth_switch_domain_free(uint16_t domain_id);
1192 
1195  uint16_t ports[RTE_MAX_ETHPORTS];
1197  uint16_t nb_ports;
1199  uint16_t representor_ports[RTE_MAX_ETHPORTS];
1203 };
1204 
1216 __rte_internal
1217 int
1218 rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs);
1219 
1220 
1221 typedef int (*ethdev_init_t)(struct rte_eth_dev *ethdev, void *init_params);
1222 typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev,
1223  void *bus_specific_init_params);
1224 
1246 __rte_internal
1247 int
1248 rte_eth_dev_create(struct rte_device *device, const char *name,
1249  size_t priv_data_size,
1250  ethdev_bus_specific_init bus_specific_init, void *bus_init_params,
1251  ethdev_init_t ethdev_init, void *init_params);
1252 
1253 
1254 typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev);
1255 
1268 __rte_internal
1269 int
1270 rte_eth_dev_destroy(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit);
1271 
1293 __rte_internal
1294 int
1295 rte_eth_hairpin_queue_peer_update(uint16_t peer_port, uint16_t peer_queue,
1296  struct rte_hairpin_peer_info *cur_info,
1297  struct rte_hairpin_peer_info *peer_info,
1298  uint32_t direction);
1299 
1320 __rte_internal
1321 int
1322 rte_eth_hairpin_queue_peer_bind(uint16_t cur_port, uint16_t cur_queue,
1323  struct rte_hairpin_peer_info *peer_info,
1324  uint32_t direction);
1325 
1340 __rte_internal
1341 struct rte_eth_dev*
1342 rte_eth_dev_get_by_name(const char *name);
1343 
1362 __rte_internal
1363 int
1364 rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue,
1365  uint32_t direction);
1366 
1367 
1368 /*
1369  * Legacy ethdev API used internally by drivers.
1370  */
1371 
1376 #define RTE_ETHTYPE_FLAGS_MAC 0x0001
1377 #define RTE_ETHTYPE_FLAGS_DROP 0x0002
1383 struct rte_eth_ethertype_filter {
1384  struct rte_ether_addr mac_addr;
1385  uint16_t ether_type;
1386  uint16_t flags;
1387  uint16_t queue;
1388 };
1389 
1396  uint8_t hig_pri;
1397  uint16_t queue;
1398 };
1399 
1403 #define ETH_TUNNEL_FILTER_OMAC 0x01
1404 #define ETH_TUNNEL_FILTER_OIP 0x02
1405 #define ETH_TUNNEL_FILTER_TENID 0x04
1406 #define ETH_TUNNEL_FILTER_IMAC 0x08
1407 #define ETH_TUNNEL_FILTER_IVLAN 0x10
1408 #define ETH_TUNNEL_FILTER_IIP 0x20
1410 #define RTE_TUNNEL_FILTER_IMAC_IVLAN (ETH_TUNNEL_FILTER_IMAC | \
1411  ETH_TUNNEL_FILTER_IVLAN)
1412 #define RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID (ETH_TUNNEL_FILTER_IMAC | \
1413  ETH_TUNNEL_FILTER_IVLAN | \
1414  ETH_TUNNEL_FILTER_TENID)
1415 #define RTE_TUNNEL_FILTER_IMAC_TENID (ETH_TUNNEL_FILTER_IMAC | \
1416  ETH_TUNNEL_FILTER_TENID)
1417 #define RTE_TUNNEL_FILTER_OMAC_TENID_IMAC (ETH_TUNNEL_FILTER_OMAC | \
1418  ETH_TUNNEL_FILTER_TENID | \
1419  ETH_TUNNEL_FILTER_IMAC)
1420 
1427 };
1428 
1433  struct rte_ether_addr outer_mac;
1434  struct rte_ether_addr inner_mac;
1435  uint16_t inner_vlan;
1436  enum rte_tunnel_iptype ip_type;
1442  union {
1443  uint32_t ipv4_addr;
1444  uint32_t ipv6_addr[4];
1445  } ip_addr;
1447  uint16_t filter_type;
1448  enum rte_eth_tunnel_type tunnel_type;
1449  uint32_t tenant_id;
1450  uint16_t queue_id;
1451 };
1452 
1453 #ifdef __cplusplus
1454 }
1455 #endif
1456 
1457 #endif /* _RTE_ETHDEV_DRIVER_H_ */
__rte_internal int rte_eth_switch_domain_free(uint16_t domain_id)
rte_tunnel_iptype
uint16_t nb_representor_ports
__rte_internal int rte_eth_dev_create(struct rte_device *device, const char *name, size_t priv_data_size, ethdev_bus_specific_init bus_specific_init, void *bus_init_params, ethdev_init_t ethdev_init, void *init_params)
__rte_internal int rte_eth_switch_domain_alloc(uint16_t *domain_id)
#define RTE_BUILD_BUG_ON(condition)
Definition: rte_common.h:380
__rte_internal const struct rte_memzone * rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, uint16_t queue_id, size_t size, unsigned align, int socket_id)
__rte_internal int rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs)
__rte_internal int rte_eth_dma_zone_free(const struct rte_eth_dev *eth_dev, const char *name, uint16_t queue_id)
int(* eth_is_removed_t)(struct rte_eth_dev *dev)
__rte_internal int rte_eth_dev_destroy(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit)
rte_vlan_type
Definition: rte_ethdev.h:422
rte_filter_type
rte_filter_op
rte_eth_tunnel_type
Definition: rte_ethdev.h:1213
rte_eth_event_type
Definition: rte_ethdev.h:3468