1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
5 #ifndef _RTE_ETHDEV_DRIVER_H_
6 #define _RTE_ETHDEV_DRIVER_H_
11 * RTE Ethernet Device PMD API
13 * These APIs for the use from Ethernet drivers, user applications shouldn't
18 #include <rte_ethdev.h>
20 /**< @internal Declaration of the hairpin peer queue information structure. */
21 struct rte_hairpin_peer_info;
24 * Definitions of all functions exported by an Ethernet driver through the
25 * generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
26 * structure associated with an Ethernet device.
29 typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
30 /**< @internal Ethernet device configuration. */
32 typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
33 /**< @internal Function used to start a configured Ethernet device. */
35 typedef int (*eth_dev_stop_t)(struct rte_eth_dev *dev);
36 /**< @internal Function used to stop a configured Ethernet device. */
38 typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
39 /**< @internal Function used to link up a configured Ethernet device. */
41 typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
42 /**< @internal Function used to link down a configured Ethernet device. */
44 typedef int (*eth_dev_close_t)(struct rte_eth_dev *dev);
45 /**< @internal Function used to close a configured Ethernet device. */
47 typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
48 /** <@internal Function used to reset a configured Ethernet device. */
50 typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
51 /**< @internal Function used to detect an Ethernet device removal. */
55 * Function used to enable the Rx promiscuous mode of an Ethernet device.
58 * ethdev handle of port.
61 * Negative errno value on error, 0 on success.
64 * Success, promiscuous mode is enabled.
66 * Promiscuous mode is not supported.
69 * @retval -E_RTE_SECONDARY
70 * Function was called from a secondary process instance and not supported.
72 * Attempt to enable promiscuos mode failed because of timeout.
74 * Failed to enable promiscuous mode.
76 typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
80 * Function used to disable the Rx promiscuous mode of an Ethernet device.
83 * ethdev handle of port.
86 * Negative errno value on error, 0 on success.
89 * Success, promiscuous mode is disabled.
91 * Promiscuous mode disabling is not supported.
94 * @retval -E_RTE_SECONDARY
95 * Function was called from a secondary process instance and not supported.
97 * Attempt to disable promiscuos mode failed because of timeout.
99 * Failed to disable promiscuous mode.
101 typedef int (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
105 * Enable the receipt of all multicast packets by an Ethernet device.
108 * ethdev handle of port.
111 * Negative errno value on error, 0 on success.
114 * Success, all-multicast mode is enabled.
116 * All-multicast mode is not supported.
119 * @retval -E_RTE_SECONDARY
120 * Function was called from a secondary process instance and not supported.
122 * Attempt to enable all-multicast mode failed because of timeout.
124 * Failed to enable all-multicast mode.
126 typedef int (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
130 * Disable the receipt of all multicast packets by an Ethernet device.
133 * ethdev handle of port.
136 * Negative errno value on error, 0 on success.
139 * Success, all-multicast mode is disabled.
141 * All-multicast mode disabling is not supported.
144 * @retval -E_RTE_SECONDARY
145 * Function was called from a secondary process instance and not supported.
147 * Attempt to disable all-multicast mode failed because of timeout.
149 * Failed to disable all-multicast mode.
151 typedef int (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
153 typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
154 int wait_to_complete);
155 /**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
157 typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
158 struct rte_eth_stats *igb_stats);
159 /**< @internal Get global I/O statistics of an Ethernet device. */
163 * Reset global I/O statistics of an Ethernet device to 0.
166 * ethdev handle of port.
169 * Negative errno value on error, 0 on success.
172 * Success, statistics has been reset.
174 * Resetting statistics is not supported.
176 * Resetting statistics is not valid.
178 * Not enough memory to get the stats.
180 typedef int (*eth_stats_reset_t)(struct rte_eth_dev *dev);
182 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
183 struct rte_eth_xstat *stats, unsigned int n);
184 /**< @internal Get extended stats of an Ethernet device. */
188 * Get extended stats of an Ethernet device.
191 * ethdev handle of port.
193 * IDs array to retrieve specific statistics. Must not be NULL.
195 * A pointer to a table to be filled with device statistics values.
198 * Element count in @p ids and @p values.
201 * - A number of filled in stats.
202 * - A negative value on error.
204 typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
211 * Reset extended stats of an Ethernet device.
214 * ethdev handle of port.
217 * Negative errno value on error, 0 on success.
220 * Success, statistics has been reset.
222 * Resetting statistics is not supported.
224 * Resetting statistics is not valid.
226 * Not enough memory to get the stats.
228 typedef int (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
230 typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
231 struct rte_eth_xstat_name *xstats_names, unsigned int size);
232 /**< @internal Get names of extended stats of an Ethernet device. */
236 * Get names of extended stats of an Ethernet device.
239 * ethdev handle of port.
241 * IDs array to retrieve specific statistics. Must not be NULL.
242 * @param xstats_names
243 * An rte_eth_xstat_name array of at least @p size elements to be filled.
246 * Element count in @p ids and @p xstats_names.
249 * - A number of filled in stats.
250 * - A negative value on error.
252 typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
253 const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
256 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
260 /**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
262 typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
263 struct rte_eth_dev_info *dev_info);
264 /**< @internal Get specific information of an Ethernet device. */
266 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
267 /**< @internal Get supported ptypes of an Ethernet device. */
271 * Inform Ethernet device about reduced range of packet types to handle.
274 * The Ethernet device identifier.
276 * The ptype family that application is interested in should be bitwise OR of
277 * RTE_PTYPE_*_MASK or 0.
281 typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
282 uint32_t ptype_mask);
284 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
286 /**< @internal Start rx and tx of a queue of an Ethernet device. */
288 typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
290 /**< @internal Stop rx and tx of a queue of an Ethernet device. */
292 typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
293 uint16_t rx_queue_id,
295 unsigned int socket_id,
296 const struct rte_eth_rxconf *rx_conf,
297 struct rte_mempool *mb_pool);
298 /**< @internal Set up a receive queue of an Ethernet device. */
300 typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
301 uint16_t tx_queue_id,
303 unsigned int socket_id,
304 const struct rte_eth_txconf *tx_conf);
305 /**< @internal Setup a transmit queue of an Ethernet device. */
307 typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
308 uint16_t rx_queue_id);
309 /**< @internal Enable interrupt of a receive queue of an Ethernet device. */
311 typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
312 uint16_t rx_queue_id);
313 /**< @internal Disable interrupt of a receive queue of an Ethernet device. */
315 typedef void (*eth_queue_release_t)(struct rte_eth_dev *dev,
317 /**< @internal Release memory resources allocated by given RX/TX queue. */
319 typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
320 char *fw_version, size_t fw_size);
321 /**< @internal Get firmware information of an Ethernet device. */
323 typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
324 /**< @internal Force mbufs to be from TX ring. */
326 typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
327 uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
329 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
330 uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
332 typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
333 uint16_t queue_id, struct rte_eth_burst_mode *mode);
335 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
336 /**< @internal Set MTU. */
338 typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
341 /**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
343 typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
344 enum rte_vlan_type type, uint16_t tpid);
345 /**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
347 typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
348 /**< @internal set VLAN offload function by an Ethernet device. */
350 typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
353 /**< @internal set port based TX VLAN insertion by an Ethernet device. */
355 typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
356 uint16_t rx_queue_id,
358 /**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
360 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
361 struct rte_eth_fc_conf *fc_conf);
362 /**< @internal Get current flow control parameter on an Ethernet device */
364 typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
365 struct rte_eth_fc_conf *fc_conf);
366 /**< @internal Setup flow control parameter on an Ethernet device */
368 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
369 struct rte_eth_pfc_conf *pfc_conf);
370 /**< @internal Setup priority flow control parameter on an Ethernet device */
372 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
373 struct rte_eth_rss_reta_entry64 *reta_conf,
375 /**< @internal Update RSS redirection table on an Ethernet device */
377 typedef int (*reta_query_t)(struct rte_eth_dev *dev,
378 struct rte_eth_rss_reta_entry64 *reta_conf,
380 /**< @internal Query RSS redirection table on an Ethernet device */
382 typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
383 struct rte_eth_rss_conf *rss_conf);
384 /**< @internal Update RSS hash configuration of an Ethernet device */
386 typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
387 struct rte_eth_rss_conf *rss_conf);
388 /**< @internal Get current RSS hash configuration of an Ethernet device */
390 typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
391 /**< @internal Turn on SW controllable LED on an Ethernet device */
393 typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
394 /**< @internal Turn off SW controllable LED on an Ethernet device */
396 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
397 /**< @internal Remove MAC address from receive address register */
399 typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
400 struct rte_ether_addr *mac_addr,
403 /**< @internal Set a MAC address into Receive Address Register */
405 typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
406 struct rte_ether_addr *mac_addr);
407 /**< @internal Set a MAC address into Receive Address Register */
409 typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
410 struct rte_ether_addr *mac_addr,
412 /**< @internal Set a Unicast Hash bitmap */
414 typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
416 /**< @internal Set all Unicast Hash bitmap */
418 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
421 /**< @internal Set queue TX rate */
423 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
424 struct rte_eth_mirror_conf *mirror_conf,
427 /**< @internal Add a traffic mirroring rule on an Ethernet device */
429 typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
431 /**< @internal Remove a traffic mirroring rule on an Ethernet device */
433 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
434 struct rte_eth_udp_tunnel *tunnel_udp);
435 /**< @internal Add tunneling UDP port */
437 typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
438 struct rte_eth_udp_tunnel *tunnel_udp);
439 /**< @internal Delete tunneling UDP port */
441 typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
442 struct rte_ether_addr *mc_addr_set,
443 uint32_t nb_mc_addr);
444 /**< @internal set the list of multicast addresses on an Ethernet device */
446 typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
447 /**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
449 typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
450 /**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
452 typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
453 struct timespec *timestamp,
455 /**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
457 typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
458 struct timespec *timestamp);
459 /**< @internal Function used to read a TX IEEE1588/802.1AS timestamp. */
461 typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
462 /**< @internal Function used to adjust the device clock */
464 typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
465 struct timespec *timestamp);
466 /**< @internal Function used to get time from the device clock. */
468 typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
469 const struct timespec *timestamp);
470 /**< @internal Function used to get time from the device clock */
472 typedef int (*eth_read_clock)(struct rte_eth_dev *dev,
473 uint64_t *timestamp);
474 /**< @internal Function used to get the current value of the device clock. */
476 typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev,
477 struct rte_dev_reg_info *info);
478 /**< @internal Retrieve registers */
480 typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
481 /**< @internal Retrieve eeprom size */
483 typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
484 struct rte_dev_eeprom_info *info);
485 /**< @internal Retrieve eeprom data */
487 typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
488 struct rte_dev_eeprom_info *info);
489 /**< @internal Program eeprom data */
491 typedef int (*eth_get_module_info_t)(struct rte_eth_dev *dev,
492 struct rte_eth_dev_module_info *modinfo);
493 /**< @internal Retrieve type and size of plugin module eeprom */
495 typedef int (*eth_get_module_eeprom_t)(struct rte_eth_dev *dev,
496 struct rte_dev_eeprom_info *info);
497 /**< @internal Retrieve plugin module eeprom data */
502 * Get flow operations.
504 * If the flow API is not supported for the specified device,
505 * the driver can return NULL.
507 typedef int (*eth_flow_ops_get_t)(struct rte_eth_dev *dev,
508 const struct rte_flow_ops **ops);
510 typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
511 /**< @internal Get Traffic Management (TM) operations on an Ethernet device */
513 typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
514 /**< @internal Get Traffic Metering and Policing (MTR) operations */
516 typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
517 struct rte_eth_dcb_info *dcb_info);
518 /**< @internal Get dcb information on an Ethernet device */
520 typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev,
522 /**< @internal Test if a port supports specific mempool ops */
526 * Get the hairpin capabilities.
529 * ethdev handle of port.
531 * returns the hairpin capabilities from the device.
534 * Negative errno value on error, 0 on success.
537 * Success, hairpin is supported.
539 * Hairpin is not supported.
541 typedef int (*eth_hairpin_cap_get_t)(struct rte_eth_dev *dev,
542 struct rte_eth_hairpin_cap *cap);
546 * Setup RX hairpin queue.
549 * ethdev handle of port.
551 * the selected RX queue index.
553 * the requested number of descriptors for this queue. 0 - use PMD default.
555 * the RX hairpin configuration structure.
558 * Negative errno value on error, 0 on success.
561 * Success, hairpin is supported.
563 * Hairpin is not supported.
565 * One of the parameters is invalid.
567 * Unable to allocate resources.
569 typedef int (*eth_rx_hairpin_queue_setup_t)
570 (struct rte_eth_dev *dev, uint16_t rx_queue_id,
572 const struct rte_eth_hairpin_conf *conf);
576 * Setup TX hairpin queue.
579 * ethdev handle of port.
581 * the selected TX queue index.
583 * the requested number of descriptors for this queue. 0 - use PMD default.
585 * the TX hairpin configuration structure.
588 * Negative errno value on error, 0 on success.
591 * Success, hairpin is supported.
593 * Hairpin is not supported.
595 * One of the parameters is invalid.
597 * Unable to allocate resources.
599 typedef int (*eth_tx_hairpin_queue_setup_t)
600 (struct rte_eth_dev *dev, uint16_t tx_queue_id,
602 const struct rte_eth_hairpin_conf *hairpin_conf);
606 * Get Forward Error Correction(FEC) capability.
609 * ethdev handle of port.
610 * @param speed_fec_capa
611 * speed_fec_capa is out only with per-speed capabilities.
613 * a number of elements in an speed_fec_capa array.
616 * Negative errno value on error, positive value on success.
618 * @retval positive value
619 * A non-negative value lower or equal to num: success. The return value
620 * is the number of entries filled in the fec capa array.
621 * A non-negative value higher than num: error, the given fec capa array
622 * is too small. The return value corresponds to the num that should
623 * be given to succeed. The entries in the fec capa array are not valid
624 * and shall not be used by the caller.
626 * Operation is not supported.
630 * *num* or *speed_fec_capa* invalid.
632 typedef int (*eth_fec_get_capability_t)(struct rte_eth_dev *dev,
633 struct rte_eth_fec_capa *speed_fec_capa, unsigned int num);
637 * Get Forward Error Correction(FEC) mode.
640 * ethdev handle of port.
642 * a bitmask of enabled FEC modes. If AUTO bit is set, other
643 * bits specify FEC modes which may be negotiated. If AUTO
644 * bit is clear, specify FEC modes to be used (only one valid
645 * mode per speed may be set).
648 * Negative errno value on error, 0 on success.
651 * Success, get FEC success.
653 * Operation is not supported.
657 typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev,
662 * Set Forward Error Correction(FEC) mode.
665 * ethdev handle of port.
667 * bitmask of allowed FEC modes. It must be only one
668 * if AUTO is disabled. If AUTO is enabled, other
669 * bits specify FEC modes which may be negotiated.
672 * Negative errno value on error, 0 on success.
675 * Success, set FEC success.
677 * Operation is not supported.
679 * Unsupported FEC mode requested.
683 typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, uint32_t fec_capa);
687 * Get all hairpin Tx/Rx peer ports of the current device, if any.
690 * ethdev handle of port.
692 * array to save the ports list.
696 * value to decide the current to peer direction
697 * positive - used as Tx to get all peer Rx ports.
698 * zero - used as Rx to get all peer Tx ports.
701 * Negative errno value on error, 0 or positive on success.
704 * Success, no peer ports.
706 * Actual number of the peer ports.
708 * Get peer ports API is not supported.
710 * One of the parameters is invalid.
712 typedef int (*hairpin_get_peer_ports_t)(struct rte_eth_dev *dev,
713 uint16_t *peer_ports, size_t len,
718 * Bind all hairpin Tx queues of one port to the Rx queues of the peer port.
721 * ethdev handle of port.
726 * Negative errno value on error, 0 on success.
729 * Success, bind successfully.
731 * Bind API is not supported.
733 * One of the parameters is invalid.
735 * Device is not started.
737 typedef int (*eth_hairpin_bind_t)(struct rte_eth_dev *dev,
742 * Unbind all hairpin Tx queues of one port from the Rx queues of the peer port.
745 * ethdev handle of port.
750 * Negative errno value on error, 0 on success.
753 * Success, unbind successfully.
755 * Bind API is not supported.
757 * One of the parameters is invalid.
759 * Device is already stopped.
761 typedef int (*eth_hairpin_unbind_t)(struct rte_eth_dev *dev,
764 typedef int (*eth_hairpin_queue_peer_update_t)
765 (struct rte_eth_dev *dev, uint16_t peer_queue,
766 struct rte_hairpin_peer_info *current_info,
767 struct rte_hairpin_peer_info *peer_info, uint32_t direction);
768 /**< @internal Update and fetch peer queue information. */
770 typedef int (*eth_hairpin_queue_peer_bind_t)
771 (struct rte_eth_dev *dev, uint16_t cur_queue,
772 struct rte_hairpin_peer_info *peer_info, uint32_t direction);
773 /**< @internal Bind peer queue to the current queue with fetched information. */
775 typedef int (*eth_hairpin_queue_peer_unbind_t)
776 (struct rte_eth_dev *dev, uint16_t cur_queue, uint32_t direction);
777 /**< @internal Unbind peer queue from the current queue. */
781 * Get address of memory location whose contents will change whenever there is
782 * new data to be received on an Rx queue.
785 * Ethdev queue pointer.
787 * The pointer to power-optimized monitoring condition structure.
789 * Negative errno value on error, 0 on success.
796 typedef int (*eth_get_monitor_addr_t)(void *rxq,
797 struct rte_power_monitor_cond *pmc);
801 * Get representor info to be able to calculate the unique representor ID.
803 * Caller should pass NULL as pointer of info to get number of entries,
804 * allocate info buffer according to returned entry number, then call
805 * again with buffer to get real info.
807 * To calculate the representor ID, caller should iterate each entry,
808 * match controller index, pf index, vf or sf start index and range,
809 * then calculate representor ID from offset to vf/sf start index.
810 * @see rte_eth_representor_id_get.
813 * Ethdev handle of port.
815 * Pointer to memory to save device representor info.
817 * Negative errno value on error, number of info entries otherwise.
820 typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev,
821 struct rte_eth_representor_info *info);
824 * @internal A structure containing the functions exported by an Ethernet driver.
827 eth_dev_configure_t dev_configure; /**< Configure device. */
828 eth_dev_start_t dev_start; /**< Start device. */
829 eth_dev_stop_t dev_stop; /**< Stop device. */
830 eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
831 eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
832 eth_dev_close_t dev_close; /**< Close device. */
833 eth_dev_reset_t dev_reset; /**< Reset device. */
834 eth_link_update_t link_update; /**< Get device link state. */
835 eth_is_removed_t is_removed;
836 /**< Check if the device was physically removed. */
838 eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
839 eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
840 eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
841 eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
842 eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
843 eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
844 eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
845 eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
846 mtu_set_t mtu_set; /**< Set MTU. */
848 eth_stats_get_t stats_get; /**< Get generic device statistics. */
849 eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
850 eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
851 eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
852 eth_xstats_get_names_t xstats_get_names;
853 /**< Get names of extended statistics. */
854 eth_queue_stats_mapping_set_t queue_stats_mapping_set;
855 /**< Configure per queue stat counter mapping. */
857 eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
858 eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
859 eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
860 eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */
861 eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */
862 eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
863 eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
864 /**< Get packet types supported and identified by device. */
865 eth_dev_ptypes_set_t dev_ptypes_set;
866 /**< Inform Ethernet device about reduced range of packet types to handle. */
868 vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
869 vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
870 vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
871 vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
872 vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
874 eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
875 eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
876 eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
877 eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
878 eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
879 eth_queue_release_t rx_queue_release; /**< Release RX queue. */
881 eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
882 eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
883 eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
884 eth_queue_release_t tx_queue_release; /**< Release TX queue. */
885 eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
887 eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
888 eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
890 flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
891 flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
892 priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
894 eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
895 eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
897 eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
898 eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
900 eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
901 eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
903 eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
905 rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
906 rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
907 reta_update_t reta_update; /** Update redirection table. */
908 reta_query_t reta_query; /** Query redirection table. */
910 eth_get_reg_t get_reg; /**< Get registers. */
911 eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
912 eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
913 eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
915 eth_get_module_info_t get_module_info;
916 /** Get plugin module eeprom attribute. */
917 eth_get_module_eeprom_t get_module_eeprom;
918 /** Get plugin module eeprom data. */
920 eth_flow_ops_get_t flow_ops_get; /**< Get flow operations. */
922 eth_get_dcb_info get_dcb_info; /** Get DCB information. */
924 eth_timesync_enable_t timesync_enable;
925 /** Turn IEEE1588/802.1AS timestamping on. */
926 eth_timesync_disable_t timesync_disable;
927 /** Turn IEEE1588/802.1AS timestamping off. */
928 eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
929 /** Read the IEEE1588/802.1AS RX timestamp. */
930 eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
931 /** Read the IEEE1588/802.1AS TX timestamp. */
932 eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
933 eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
934 eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
936 eth_read_clock read_clock;
938 eth_xstats_get_by_id_t xstats_get_by_id;
939 /**< Get extended device statistic values by ID. */
940 eth_xstats_get_names_by_id_t xstats_get_names_by_id;
941 /**< Get name of extended device statistics by ID. */
943 eth_tm_ops_get_t tm_ops_get;
944 /**< Get Traffic Management (TM) operations. */
946 eth_mtr_ops_get_t mtr_ops_get;
947 /**< Get Traffic Metering and Policing (MTR) operations. */
949 eth_pool_ops_supported_t pool_ops_supported;
950 /**< Test if a port supports specific mempool ops */
952 eth_hairpin_cap_get_t hairpin_cap_get;
953 /**< Returns the hairpin capabilities. */
954 eth_rx_hairpin_queue_setup_t rx_hairpin_queue_setup;
955 /**< Set up device RX hairpin queue. */
956 eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup;
957 /**< Set up device TX hairpin queue. */
959 eth_fec_get_capability_t fec_get_capability;
960 /**< Get Forward Error Correction(FEC) capability. */
961 eth_fec_get_t fec_get;
962 /**< Get Forward Error Correction(FEC) mode. */
963 eth_fec_set_t fec_set;
964 /**< Set Forward Error Correction(FEC) mode. */
965 hairpin_get_peer_ports_t hairpin_get_peer_ports;
966 /**< Get hairpin peer ports list. */
967 eth_hairpin_bind_t hairpin_bind;
968 /**< Bind all hairpin Tx queues of device to the peer port Rx queues. */
969 eth_hairpin_unbind_t hairpin_unbind;
970 /**< Unbind all hairpin Tx queues from the peer port Rx queues. */
971 eth_hairpin_queue_peer_update_t hairpin_queue_peer_update;
972 /**< Pass the current queue info and get the peer queue info. */
973 eth_hairpin_queue_peer_bind_t hairpin_queue_peer_bind;
974 /**< Set up the connection between the pair of hairpin queues. */
975 eth_hairpin_queue_peer_unbind_t hairpin_queue_peer_unbind;
976 /**< Disconnect the hairpin queues of a pair from each other. */
978 eth_get_monitor_addr_t get_monitor_addr;
979 /**< Get power monitoring condition for Rx queue. */
981 eth_representor_info_get_t representor_info_get;
982 /**< Get representor info. */
987 * Check if the selected Rx queue is hairpin queue.
990 * Pointer to the selected device.
992 * The selected queue.
995 * - (1) if the queue is hairpin queue, 0 otherwise.
998 int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
1002 * Check if the selected Tx queue is hairpin queue.
1005 * Pointer to the selected device.
1007 * The selected queue.
1010 * - (1) if the queue is hairpin queue, 0 otherwise.
1013 int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
1017 * Returns a ethdev slot specified by the unique identifier name.
1020 * The pointer to the Unique identifier name for each Ethernet device
1022 * - The pointer to the ethdev slot, on success. NULL on error
1025 struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
1029 * Allocates a new ethdev slot for an ethernet device and returns the pointer
1030 * to that slot for the driver to use.
1032 * @param name Unique identifier name for each Ethernet device
1034 * - Slot in the rte_dev_devices array for a new device;
1037 struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
1041 * Attach to the ethdev already initialized by the primary
1044 * @param name Ethernet device's name.
1046 * - Success: Slot in the rte_dev_devices array for attached
1048 * - Error: Null pointer.
1051 struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
1055 * Notify RTE_ETH_EVENT_DESTROY and release the specified ethdev port.
1057 * The following PMD-managed data fields will be freed:
1061 * If one of these fields should not be freed,
1062 * it must be reset to NULL by the PMD, typically in dev_close method.
1065 * Device to be detached.
1067 * - 0 on success, negative on error
1070 int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
1074 * Release device queues and clear its configuration to force the user
1075 * application to reconfigure it. It is for internal use only.
1078 * Pointer to struct rte_eth_dev.
1084 void rte_eth_dev_internal_reset(struct rte_eth_dev *dev);
1087 * @internal Executes all the user application registered callbacks for
1088 * the specific device. It is for DPDK internal user only. User
1089 * application should not call it directly.
1092 * Pointer to struct rte_eth_dev.
1094 * Eth device interrupt event type.
1096 * To pass data back to user application.
1097 * This allows the user application to decide if a particular function
1098 * is permitted or not.
1104 int rte_eth_dev_callback_process(struct rte_eth_dev *dev,
1105 enum rte_eth_event_type event, void *ret_param);
1109 * This is the last step of device probing.
1110 * It must be called after a port is allocated and initialized successfully.
1112 * The notification RTE_ETH_EVENT_NEW is sent to other entities
1113 * (libraries and applications).
1114 * The state is set as RTE_ETH_DEV_ATTACHED.
1120 void rte_eth_dev_probing_finish(struct rte_eth_dev *dev);
1123 * Create memzone for HW rings.
1124 * malloc can't be used as the physical address is needed.
1125 * If the memzone is already created, then this function returns a ptr
1129 * The *eth_dev* pointer is the address of the *rte_eth_dev* structure
1131 * The name of the memory zone
1133 * The index of the queue to add to name
1135 * The sizeof of the memory area
1137 * Alignment for resulting memzone. Must be a power of 2.
1139 * The *socket_id* argument is the socket identifier in case of NUMA.
1142 const struct rte_memzone *
1143 rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
1144 uint16_t queue_id, size_t size,
1145 unsigned align, int socket_id);
1148 * Free previously allocated memzone for HW rings.
1151 * The *eth_dev* pointer is the address of the *rte_eth_dev* structure
1153 * The name of the memory zone
1155 * The index of the queue to add to name
1157 * Negative errno value on error, 0 on success.
1161 rte_eth_dma_zone_free(const struct rte_eth_dev *eth_dev, const char *name,
1166 * Atomically set the link status for the specific device.
1167 * It is for use by DPDK device driver use only.
1168 * User applications should not call it
1171 * Pointer to struct rte_eth_dev.
1173 * New link status value.
1175 * Same convention as eth_link_update operation.
1176 * 0 if link up status has changed
1177 * -1 if link up status was unchanged
1180 rte_eth_linkstatus_set(struct rte_eth_dev *dev,
1181 const struct rte_eth_link *new_link)
1183 uint64_t *dev_link = (uint64_t *)&(dev->data->dev_link);
1186 struct rte_eth_link link;
1189 RTE_BUILD_BUG_ON(sizeof(*new_link) != sizeof(uint64_t));
1191 orig.val64 = __atomic_exchange_n(dev_link, *(const uint64_t *)new_link,
1194 return (orig.link.link_status == new_link->link_status) ? -1 : 0;
1199 * Atomically get the link speed and status.
1202 * Pointer to struct rte_eth_dev.
1204 * link status value.
1207 rte_eth_linkstatus_get(const struct rte_eth_dev *dev,
1208 struct rte_eth_link *link)
1210 uint64_t *src = (uint64_t *)&(dev->data->dev_link);
1211 uint64_t *dst = (uint64_t *)link;
1213 RTE_BUILD_BUG_ON(sizeof(*link) != sizeof(uint64_t));
1215 *dst = __atomic_load_n(src, __ATOMIC_SEQ_CST);
1219 * Allocate an unique switch domain identifier.
1221 * A pool of switch domain identifiers which can be allocated on request. This
1222 * will enabled devices which support the concept of switch domains to request
1223 * a switch domain id which is guaranteed to be unique from other devices
1224 * running in the same process.
1227 * switch domain identifier parameter to pass back to application
1230 * Negative errno value on error, 0 on success.
1234 rte_eth_switch_domain_alloc(uint16_t *domain_id);
1237 * Free switch domain.
1239 * Return a switch domain identifier to the pool of free identifiers after it is
1240 * no longer in use by device.
1243 * switch domain identifier to free
1246 * Negative errno value on error, 0 on success.
1250 rte_eth_switch_domain_free(uint16_t domain_id);
1253 * Generic Ethernet device arguments
1255 * One type of representor each structure.
1257 struct rte_eth_devargs {
1258 uint16_t mh_controllers[RTE_MAX_MULTI_HOST_CTRLS];
1259 /** controller/s number in case of multi-host */
1260 uint16_t nb_mh_controllers;
1261 /** number of controllers in multi-host controllers field */
1262 uint16_t ports[RTE_MAX_ETHPORTS];
1263 /** port/s number to enable on a multi-port single function */
1265 /** number of ports in ports field */
1266 uint16_t representor_ports[RTE_MAX_ETHPORTS];
1267 /** representor port/s identifier to enable on device */
1268 uint16_t nb_representor_ports;
1269 /** number of ports in representor port field */
1270 enum rte_eth_representor_type type; /* type of representor */
1274 * PMD helper function to get representor ID from location detail.
1276 * Get representor ID from controller, pf and (sf or vf).
1277 * The mapping is retrieved from rte_eth_representor_info_get().
1279 * For backward compatibility, if no representor info, direct
1280 * map legacy VF (no controller and pf).
1283 * Handle of ethdev port.
1287 * Controller ID, -1 if unspecified.
1289 * PF port ID, -1 if unspecified.
1290 * @param representor_port
1291 * VF or SF representor port number, -1 if unspecified.
1293 * Pointer to output representor ID.
1296 * Negative errno value on error, 0 on success.
1300 rte_eth_representor_id_get(const struct rte_eth_dev *ethdev,
1301 enum rte_eth_representor_type type,
1302 int controller, int pf, int representor_port,
1306 * PMD helper function to parse ethdev arguments
1310 * @param eth_devargs
1311 * parsed ethdev specific arguments.
1314 * Negative errno value on error, 0 on success.
1318 rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs);
1321 typedef int (*ethdev_init_t)(struct rte_eth_dev *ethdev, void *init_params);
1322 typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev,
1323 void *bus_specific_init_params);
1326 * PMD helper function for the creation of a new ethdev ports.
1329 * rte_device handle.
1332 * @param priv_data_size
1333 * size of private data required for port.
1334 * @param bus_specific_init
1335 * port bus specific initialisation callback function
1336 * @param bus_init_params
1337 * port bus specific initialisation parameters
1338 * @param ethdev_init
1339 * device specific port initialization callback function
1340 * @param init_params
1341 * port initialisation parameters
1344 * Negative errno value on error, 0 on success.
1348 rte_eth_dev_create(struct rte_device *device, const char *name,
1349 size_t priv_data_size,
1350 ethdev_bus_specific_init bus_specific_init, void *bus_init_params,
1351 ethdev_init_t ethdev_init, void *init_params);
1354 typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev);
1357 * PMD helper function for cleaning up the resources of a ethdev port on it's
1361 * ethdev handle of port.
1362 * @param ethdev_uninit
1363 * device specific port un-initialise callback function
1366 * Negative errno value on error, 0 on success.
1370 rte_eth_dev_destroy(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit);
1374 * Pass the current hairpin queue HW and/or SW information to the peer queue
1375 * and fetch back the information of the peer queue.
1378 * Peer port identifier of the Ethernet device.
1380 * Peer queue index of the port.
1382 * Pointer to the current information structure.
1384 * Pointer to the peer information, output.
1386 * Direction to pass the information.
1387 * positive - pass Tx queue information and get peer Rx queue information
1388 * zero - pass Rx queue information and get peer Tx queue information
1391 * Negative errno value on error, 0 on success.
1395 rte_eth_hairpin_queue_peer_update(uint16_t peer_port, uint16_t peer_queue,
1396 struct rte_hairpin_peer_info *cur_info,
1397 struct rte_hairpin_peer_info *peer_info,
1398 uint32_t direction);
1402 * Configure current hairpin queue with the peer information fetched to create
1403 * the connection (bind) with peer queue in the specified direction.
1404 * This function might need to be called twice to fully create the connections.
1407 * Current port identifier of the Ethernet device.
1409 * Current queue index of the port.
1411 * Pointer to the peer information, input.
1413 * Direction to create the connection.
1414 * positive - bind current Tx queue to peer Rx queue
1415 * zero - bind current Rx queue to peer Tx queue
1418 * Negative errno value on error, 0 on success.
1422 rte_eth_hairpin_queue_peer_bind(uint16_t cur_port, uint16_t cur_queue,
1423 struct rte_hairpin_peer_info *peer_info,
1424 uint32_t direction);
1428 * Reset the current queue state and configuration to disconnect (unbind) it
1429 * from the peer queue.
1430 * This function might need to be called twice to disconnect each other.
1433 * Current port identifier of the Ethernet device.
1435 * Current queue index of the port.
1437 * Direction to destroy the connection.
1438 * positive - unbind current Tx queue from peer Rx queue
1439 * zero - unbind current Rx queue from peer Tx queue
1442 * Negative errno value on error, 0 on success.
1446 rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue,
1447 uint32_t direction);
1451 * Legacy ethdev API used internally by drivers.
1454 enum rte_filter_type {
1455 RTE_ETH_FILTER_NONE = 0,
1456 RTE_ETH_FILTER_ETHERTYPE,
1457 RTE_ETH_FILTER_FLEXIBLE,
1459 RTE_ETH_FILTER_NTUPLE,
1460 RTE_ETH_FILTER_TUNNEL,
1461 RTE_ETH_FILTER_FDIR,
1462 RTE_ETH_FILTER_HASH,
1463 RTE_ETH_FILTER_L2_TUNNEL,
1467 * Define all structures for Ethertype Filter type.
1470 #define RTE_ETHTYPE_FLAGS_MAC 0x0001 /**< If set, compare mac */
1471 #define RTE_ETHTYPE_FLAGS_DROP 0x0002 /**< If set, drop packet when match */
1474 * A structure used to define the ethertype filter entry
1475 * to support RTE_ETH_FILTER_ETHERTYPE data representation.
1477 struct rte_eth_ethertype_filter {
1478 struct rte_ether_addr mac_addr; /**< Mac address to match. */
1479 uint16_t ether_type; /**< Ether type to match */
1480 uint16_t flags; /**< Flags from RTE_ETHTYPE_FLAGS_* */
1481 uint16_t queue; /**< Queue assigned to when match*/
1485 * A structure used to define the TCP syn filter entry
1486 * to support RTE_ETH_FILTER_SYN data representation.
1488 struct rte_eth_syn_filter {
1489 /** 1 - higher priority than other filters, 0 - lower priority. */
1491 uint16_t queue; /**< Queue assigned to when match */
1495 * filter type of tunneling packet
1497 #define ETH_TUNNEL_FILTER_OMAC 0x01 /**< filter by outer MAC addr */
1498 #define ETH_TUNNEL_FILTER_OIP 0x02 /**< filter by outer IP Addr */
1499 #define ETH_TUNNEL_FILTER_TENID 0x04 /**< filter by tenant ID */
1500 #define ETH_TUNNEL_FILTER_IMAC 0x08 /**< filter by inner MAC addr */
1501 #define ETH_TUNNEL_FILTER_IVLAN 0x10 /**< filter by inner VLAN ID */
1502 #define ETH_TUNNEL_FILTER_IIP 0x20 /**< filter by inner IP addr */
1504 #define RTE_TUNNEL_FILTER_IMAC_IVLAN (ETH_TUNNEL_FILTER_IMAC | \
1505 ETH_TUNNEL_FILTER_IVLAN)
1506 #define RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID (ETH_TUNNEL_FILTER_IMAC | \
1507 ETH_TUNNEL_FILTER_IVLAN | \
1508 ETH_TUNNEL_FILTER_TENID)
1509 #define RTE_TUNNEL_FILTER_IMAC_TENID (ETH_TUNNEL_FILTER_IMAC | \
1510 ETH_TUNNEL_FILTER_TENID)
1511 #define RTE_TUNNEL_FILTER_OMAC_TENID_IMAC (ETH_TUNNEL_FILTER_OMAC | \
1512 ETH_TUNNEL_FILTER_TENID | \
1513 ETH_TUNNEL_FILTER_IMAC)
1516 * Select IPv4 or IPv6 for tunnel filters.
1518 enum rte_tunnel_iptype {
1519 RTE_TUNNEL_IPTYPE_IPV4 = 0, /**< IPv4. */
1520 RTE_TUNNEL_IPTYPE_IPV6, /**< IPv6. */
1524 * Tunneling Packet filter configuration.
1526 struct rte_eth_tunnel_filter_conf {
1527 struct rte_ether_addr outer_mac; /**< Outer MAC address to match. */
1528 struct rte_ether_addr inner_mac; /**< Inner MAC address to match. */
1529 uint16_t inner_vlan; /**< Inner VLAN to match. */
1530 enum rte_tunnel_iptype ip_type; /**< IP address type. */
1532 * Outer destination IP address to match if ETH_TUNNEL_FILTER_OIP
1533 * is set in filter_type, or inner destination IP address to match
1534 * if ETH_TUNNEL_FILTER_IIP is set in filter_type.
1537 uint32_t ipv4_addr; /**< IPv4 address in big endian. */
1538 uint32_t ipv6_addr[4]; /**< IPv6 address in big endian. */
1540 /** Flags from ETH_TUNNEL_FILTER_XX - see above. */
1541 uint16_t filter_type;
1542 enum rte_eth_tunnel_type tunnel_type; /**< Tunnel Type. */
1543 uint32_t tenant_id; /**< Tenant ID to match. VNI, GRE key... */
1544 uint16_t queue_id; /**< Queue assigned to if match. */
1547 #endif /* _RTE_ETHDEV_DRIVER_H_ */