Intel DPDK API Reference
Intel DPDK API Reference
DPDK)
API Reference
January 2014
Reference Number: 326004-006
Intel
DPDK -
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY
ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN
INTELS TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS
ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES
RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER
INTELLECTUAL PROPERTY RIGHT.
A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death.
SHOULD YOU PURCHASE OR USE INTELS PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND
HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH,
HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS FEES ARISING OUT OF, DIRECTLY
OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL
APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE
INTEL PRODUCT OR ANY OF ITS PARTS.
Intel may make changes to specications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics
of any features or instructions marked "reserved" or "undened". Intel reserves these for future denition and shall have no responsibility whatsoever for
conicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not nalize a design with
this information.
The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published
specications. Current characterized errata are available on request.
Contact your local Intel sales ofce or your distributor to obtain the latest specications and before placing your product order.
Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-
4725, or go to: http://www.intel.com/design/literature.htm
Any software source code reprinted in this document is furnished under a software license and may only be used or copied in accordance with the terms
of that license.
Any software source code reprinted in this document is furnished for informational purposes only and may only be used or copied and no license, express
or implied, by estoppel or otherwise, to any of the reprinted source code is granted by this document.
Code Names are only for use by Intel to identify products, platforms, programs, services, etc. (.products.) in development by Intel that have not been
made commercially available to the public, i.e., announced, launched or shipped. They are never to be used as "commercial" names for products. Also,
they are not intended to function as trademarks.
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
*Other names and brands may be claimed as the property of others.
Copyright
2014, Intel Corporation. All Rights Reserved.
Intel
DPDK)
API Reference
2
January 2014
Reference Number: 326004-006
CONTENTS- Intel
DPDK
Contents
1 Deprecated List 8
2 Data Structure Documentation 9
2.1 rte_ring::cons Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 eth_dev_ops Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 eth_driver Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 ether_addr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 ether_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6 ipv4_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7 ipv6_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.8 malloc_heap Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.9 rte_ring::prod Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.10 rte_atomic16_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.11 rte_atomic32_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.12 rte_atomic64_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.13 rte_cong Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.14 rte_ctrlmbuf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.15 rte_dummy Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.16 rte_eth_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.17 rte_eth_dcb_rx_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.18 rte_eth_dcb_tx_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.19 rte_eth_dev Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.20 rte_eth_dev_data Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.21 rte_eth_dev_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.22 rte_eth_dev_sriov Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
3
Intel
DPDK - CONTENTS
2.23 rte_eth_fc_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.24 rte_eth_fdir Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.25 rte_eth_link Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.26 rte_eth_pfc_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.27 rte_eth_rss_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.28 rte_eth_rss_reta Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.29 rte_eth_rxconf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.30 rte_eth_rxmode Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.31 rte_eth_stats Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.32 rte_eth_thresh Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.33 rte_eth_txconf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.34 rte_eth_txmode Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.35 rte_eth_vlan_mirror Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.36 rte_eth_vmdq_dcb_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.37 rte_eth_vmdq_dcb_tx_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.38 rte_eth_vmdq_mirror_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.39 rte_eth_vmdq_rx_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.40 rte_eth_vmdq_tx_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.41 rte_fbk_hash_entry Union Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.42 rte_fbk_hash_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.43 rte_fbk_hash_table Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.44 rte_fdir_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.45 rte_fdir_lter Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.46 rte_fdir_masks Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.47 rte_hash Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.48 rte_hash_parameters Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.49 rte_intr_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.50 rte_ivshmem_metadata Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.51 rte_ivshmem_metadata_entry Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.52 rte_kni_conf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.53 rte_kni_ops Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.54 rte_logs Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.55 rte_lpm Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.56 rte_lpm6_cong Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Intel
DPDK)
API Reference
4
January 2014
Reference Number: 326004-006
CONTENTS - Intel
DPDK
2.57 rte_lpm_rule Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.58 rte_lpm_rule_info Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.59 rte_lpm_tbl24_entry Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.60 rte_lpm_tbl8_entry Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.61 rte_malloc_socket_stats Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.62 rte_mbuf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.63 rte_mem_cong Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.64 rte_mempool Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.65 rte_mempool_cache Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.66 rte_mempool_objsz Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.67 rte_memseg Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.68 rte_memzone Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.69 rte_meter_srtcm Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.70 rte_meter_srtcm_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.71 rte_meter_trtcm Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.72 rte_meter_trtcm_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.73 rte_pci_addr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
2.74 rte_pci_device Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
2.75 rte_pci_driver Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
2.76 rte_pci_id Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.77 rte_pci_resource Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.78 rte_pktmbuf Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
2.79 rte_pktmbuf_pool_private Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
2.80 rte_red Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
2.81 rte_red_cong Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
2.82 rte_red_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
2.83 rte_ring Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
2.84 rte_rwlock_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
2.85 rte_sched_pipe_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
2.86 rte_sched_port_hierarchy Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
2.87 rte_sched_port_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
2.88 rte_sched_queue_stats Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
2.89 rte_sched_subport_params Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
2.90 rte_sched_subport_stats Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
5
Intel
DPDK - CONTENTS
2.91 rte_spinlock_recursive_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
2.92 rte_spinlock_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
2.93 rte_tailq_head Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
2.94 rte_timer Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
2.95 rte_timer_status Union Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
2.96 rte_vlan_macip Union Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
2.97 sctp_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
2.98 tcp_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
2.99 udp_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
2.100vlan_hdr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
3 File Documentation 104
3.1 rte_alarm.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.2 rte_atomic.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.3 rte_branch_prediction.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
3.4 rte_byteorder.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
3.5 rte_common.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
3.6 rte_cpuags.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
3.7 rte_cycles.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
3.8 rte_debug.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.9 rte_eal.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
3.10 rte_errno.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
3.11 rte_ethdev.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
3.12 rte_ether.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
3.13 rte_fbk_hash.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
3.14 rte_hash.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
3.15 rte_hash_crc.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
3.16 rte_hexdump.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
3.17 rte_interrupts.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
3.18 rte_ip.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
3.19 rte_ivshmem.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
3.20 rte_jhash.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
3.21 rte_kni.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
3.22 rte_launch.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Intel
DPDK)
API Reference
6
January 2014
Reference Number: 326004-006
CONTENTS - Intel
DPDK
3.23 rte_lcore.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
3.24 rte_log.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
3.25 rte_lpm.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
3.26 rte_lpm6.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
3.27 rte_malloc.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
3.28 rte_mbuf.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
3.29 rte_memcpy.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
3.30 rte_memory.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
3.31 rte_mempool.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
3.32 rte_memzone.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
3.33 rte_meter.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
3.34 rte_pci.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
3.35 rte_pci_dev_ids.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
3.36 rte_per_lcore.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
3.37 rte_power.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
3.38 rte_prefetch.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
3.39 rte_random.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
3.40 rte_red.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
3.41 rte_ring.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
3.42 rte_rwlock.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
3.43 rte_sched.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
3.44 rte_sctp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
3.45 rte_spinlock.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
3.46 rte_string_fns.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
3.47 rte_tailq.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
3.48 rte_tailq_elem.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
3.49 rte_tcp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
3.50 rte_timer.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
3.51 rte_udp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
3.52 rte_version.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
3.53 rte_warnings.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
7
Intel
DPDK)
API Reference
8
January 2014
Reference Number: 326004-006
Data Structure Documentation- Intel
DPDK
Chapter 2
Data Structure Documentation
2.1 rte ring::cons Struct Reference
Data Fields
uint32_t sc_dequeue
uint32_t size
uint32_t mask
volatile uint32_t head
volatile uint32_t tail
2.1.1 Detailed Description
Ring consumer status.
2.1.2 Field Documentation
2.1.2.1 uint32 t rte_ring::cons::sc_dequeue
True, if single consumer.
2.1.2.2 uint32 t rte_ring::cons::size
Size of the ring.
2.1.2.3 uint32 t rte_ring::cons::mask
Mask (size-1) of ring.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
9
Intel
DPDK)
API Reference
10
January 2014
Reference Number: 326004-006
eth_dev_ops Struct Reference - Intel
DPDK
eth_mirror_rule_reset_t mirror_rule_reset
eth_set_vf_rx_mode_t set_vf_rx_mode
eth_set_vf_rx_t set_vf_rx
eth_set_vf_tx_t set_vf_tx
eth_set_vf_vlan_lter_t set_vf_vlan_lter
fdir_add_signature_lter_t fdir_add_signature_lter
fdir_update_signature_lter_t fdir_update_signature_lter
fdir_remove_signature_lter_t fdir_remove_signature_lter
fdir_infos_get_t fdir_infos_get
fdir_add_perfect_lter_t fdir_add_perfect_lter
fdir_update_perfect_lter_t fdir_update_perfect_lter
fdir_remove_perfect_lter_t fdir_remove_perfect_lter
fdir_set_masks_t fdir_set_masks
reta_update_t reta_update
reta_query_t reta_query
2.2.1 Field Documentation
2.2.1.1 eth dev congure t eth_dev_ops::dev_congure
Congure device.
2.2.1.2 eth dev start t eth_dev_ops::dev_start
Start device.
2.2.1.3 eth dev stop t eth_dev_ops::dev_stop
Stop device.
2.2.1.4 eth dev close t eth_dev_ops::dev_close
Close device.
2.2.1.5 eth promiscuous enable t eth_dev_ops::promiscuous_enable
Promiscuous ON.
2.2.1.6 eth promiscuous disable t eth_dev_ops::promiscuous_disable
Promiscuous OFF.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
11
Intel
DPDK)
API Reference
12
January 2014
Reference Number: 326004-006
eth_dev_ops Struct Reference - Intel
DPDK
2.2.1.17 vlan ofoad set t eth_dev_ops::vlan_ofoad_set
Set VLAN Ofoad.
2.2.1.18 eth rx queue setup t eth_dev_ops::rx_queue_setup
Set up device RX queue.
2.2.1.19 eth queue release t eth_dev_ops::rx_queue_release
Release RX queue.
2.2.1.20 eth_rx_queue_count_t eth_dev_ops::rx_queue_count
Get Rx queue count.
2.2.1.21 eth_rx_descriptor_done_t eth_dev_ops::rx_descriptor_done
Check rxd DD bit
2.2.1.22 eth tx queue setup t eth_dev_ops::tx_queue_setup
Set up device TX queue.
2.2.1.23 eth queue release t eth_dev_ops::tx_queue_release
Release TX queue.
2.2.1.24 eth dev led on t eth_dev_ops::dev_led_on
Turn on LED.
2.2.1.25 eth dev led off t eth_dev_ops::dev_led_off
Turn off LED.
2.2.1.26 ow ctrl set t eth_dev_ops::ow_ctrl_set
Setup ow control.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
13
Intel
DPDK)
API Reference
14
January 2014
Reference Number: 326004-006
eth_dev_ops Struct Reference - Intel
DPDK
2.2.1.37 eth set vf vlan lter t eth_dev_ops::set_vf_vlan_lter
Set VF VLAN lter
2.2.1.38 fdir add signature lter t eth_dev_ops::fdir_add_signature_lter
Add a signature lter.
2.2.1.39 fdir update signature lter t eth_dev_ops::fdir_update_signature_lter
Update a signature lter.
2.2.1.40 fdir remove signature lter t eth_dev_ops::fdir_remove_signature_lter
Remove a signature lter.
2.2.1.41 fdir infos get t eth_dev_ops::fdir_infos_get
Get information about FDIR status.
2.2.1.42 fdir add perfect lter t eth_dev_ops::fdir_add_perfect_lter
Add a perfect lter.
2.2.1.43 fdir update perfect lter t eth_dev_ops::fdir_update_perfect_lter
Update a perfect lter.
2.2.1.44 fdir remove perfect lter t eth_dev_ops::fdir_remove_perfect_lter
Remove a perfect lter.
2.2.1.45 fdir set masks t eth_dev_ops::fdir_set_masks
Setup masks for FDIR ltering.
2.2.1.46 reta update t eth_dev_ops::reta_update
Update redirection table.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
15
Intel
DPDK)
API Reference
16
January 2014
Reference Number: 326004-006
ether_hdr Struct Reference - Intel
DPDK
2.4.2 Field Documentation
2.4.2.1 uint8 t ether_addr::addr_bytes[ETHER ADDR LEN]
Address bytes in transmission order
2.5 ether hdr Struct Reference
Data Fields
struct ether_addr d_addr
struct ether_addr s_addr
uint16_t ether_type
2.5.1 Detailed Description
Ethernet header: Contains the destination address, source address and frame type.
2.5.2 Field Documentation
2.5.2.1 struct ether_addr ether_hdr::d_addr
Destination address.
2.5.2.2 struct ether_addr ether_hdr::s_addr
Source address.
2.5.2.3 uint16 t ether_hdr::ether_type
Frame type.
2.6 ipv4 hdr Struct Reference
Data Fields
uint8_t version_ihl
uint8_t type_of_service
uint16_t total_length
uint16_t packet_id
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
17
Intel
DPDK)
API Reference
18
January 2014
Reference Number: 326004-006
ipv6_hdr Struct Reference - Intel
DPDK
2.6.2.8 uint16 t ipv4_hdr::hdr_checksum
header checksum
2.6.2.9 uint32 t ipv4_hdr::src_addr
source address
2.6.2.10 uint32 t ipv4_hdr::dst_addr
destination address
2.7 ipv6 hdr Struct Reference
Data Fields
uint32_t vtc_ow
uint16_t payload_len
uint8_t proto
uint8_t hop_limits
uint8_t src_addr [16]
uint8_t dst_addr [16]
2.7.1 Detailed Description
IPv6 Header
2.7.2 Field Documentation
2.7.2.1 uint32 t ipv6_hdr::vtc_ow
IP version, trafc class & ow label.
2.7.2.2 uint16 t ipv6_hdr::payload_len
IP packet length - includes sizeof(ip_header).
2.7.2.3 uint8 t ipv6_hdr::proto
Protocol, next header.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
19
Intel
DPDK)
API Reference
20
January 2014
Reference Number: 326004-006
rte_atomic16_t Struct Reference - Intel
DPDK
2.9.2.2 uint32 t rte_ring::prod::sp_enqueue
True, if single producer.
2.9.2.3 uint32 t rte_ring::prod::size
Size of ring.
2.9.2.4 uint32 t rte_ring::prod::mask
Mask (size-1) of ring.
2.9.2.5 volatile uint32 t rte_ring::prod::head
Producer head.
2.9.2.6 volatile uint32 t rte_ring::prod::tail
Producer tail.
2.10 rte atomic16 t Struct Reference
Data Fields
volatile int16_t cnt
2.10.1 Detailed Description
The atomic counter structure.
2.10.2 Field Documentation
2.10.2.1 volatile int16 t rte_atomic16_t::cnt
An internal counter value.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
21
Intel
DPDK)
API Reference
22
January 2014
Reference Number: 326004-006
rte_cong Struct Reference - Intel
DPDK
uint32_t lcore_count
enum rte_lcore_role_t lcore_role [32,]
enum rte_proc_type_t process_type
unsigned ags
struct rte_mem_cong mem_cong
2.13.1 Detailed Description
The global RTE conguration structure.
2.13.2 Field Documentation
2.13.2.1 uint32 t rte_cong::version
Conguration [structure] version.
2.13.2.2 uint32 t rte_cong::magic
Magic number - Sanity check.
2.13.2.3 uint32 t rte_cong::master_lcore
Id of the master lcore
2.13.2.4 uint32 t rte_cong::lcore_count
Number of available logical cores.
2.13.2.5 enum rte_lcore_role_t rte_cong::lcore_role[32,]
State of cores.
2.13.2.6 enum rte_proc_type_t rte_cong::process_type
Primary or secondary conguration
2.13.2.7 unsigned rte_cong::ags
A set of general status ags
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
23
Intel
DPDK)
API Reference
24
January 2014
Reference Number: 326004-006
rte_eth_conf Struct Reference - Intel
DPDK
2.16 rte eth conf Struct Reference
Data Fields
uint16_t link_speed
uint16_t link_duplex
struct rte_eth_rxmode rxmode
struct rte_eth_txmode txmode
uint32_t lpbk_mode
union {
struct rte_eth_rss_conf rss_conf
struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf
struct rte_eth_dcb_rx_conf dcb_rx_conf
struct rte_eth_vmdq_rx_conf vmdq_rx_conf
} rx_adv_conf
union {
struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf
struct rte_eth_dcb_tx_conf dcb_tx_conf
struct rte_eth_vmdq_tx_conf vmdq_tx_conf
} tx_adv_conf
uint32_t dcb_capability_en
struct rte_fdir_conf fdir_conf
struct rte_intr_conf intr_conf
2.16.1 Detailed Description
A structure used to congure an Ethernet port. Depending upon the RX multi-queue mode, extra advanced
conguration settings may be needed.
2.16.2 Field Documentation
2.16.2.1 uint16 t rte_eth_conf::link_speed
ETH_LINK_SPEED_10[0|00|000], or 0 for autonegotation
2.16.2.2 uint16 t rte_eth_conf::link_duplex
ETH_LINK_[HALF_DUPLEX|FULL_DUPLEX], or 0 for autonegotation
2.16.2.3 struct rte_eth_rxmode rte_eth_conf::rxmode
Port RX conguration.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
25
Intel
DPDK)
API Reference
26
January 2014
Reference Number: 326004-006
rte_eth_dcb_rx_conf Struct Reference - Intel
DPDK
2.16.2.14 union { ... } rte_eth_conf::tx_adv_conf
Port TX DCB conguration (union).
2.16.2.15 uint32 t rte_eth_conf::dcb_capability_en
Currently,Priority Flow Control(PFC) are supported,if DCB with PFC is needed,and the variable must be set
ETH_DCB_PFC_SUPPORT.
2.16.2.16 struct rte_fdir_conf rte_eth_conf::fdir_conf
FDIR conguration.
2.16.2.17 struct rte_intr_conf rte_eth_conf::intr_conf
Interrupt mode conguration.
2.17 rte eth dcb rx conf Struct Reference
Data Fields
enum rte_eth_nb_tcs nb_tcs
uint8_t dcb_queue [ETH_DCB_NUM_USER_PRIORITIES]
2.17.1 Field Documentation
2.17.1.1 enum rte_eth_nb_tcs rte_eth_dcb_rx_conf::nb_tcs
Possible DCB TCs, 4 or 8 TCs
2.17.1.2 uint8 t rte_eth_dcb_rx_conf::dcb_queue[ETH DCB NUM USER PRIORITIES]
Possible DCB queue,4 or 8.
2.18 rte eth dcb tx conf Struct Reference
Data Fields
enum rte_eth_nb_tcs nb_tcs
uint8_t dcb_queue [ETH_DCB_NUM_USER_PRIORITIES]
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
27
Intel
DPDK)
API Reference
28
January 2014
Reference Number: 326004-006
rte_eth_dev_data Struct Reference - Intel
DPDK
2.19.1.5 struct eth_dev_ops rte_eth_dev::dev_ops
Functions exported by PMD
2.19.1.6 struct rte_pci_device rte_eth_dev::pci_dev
PCI info. supplied by probing
2.19.1.7 struct rte eth dev cb list rte_eth_dev::callbacks
User application callbacks
2.20 rte eth dev data Struct Reference
Data Fields
void rx_queues
void tx_queues
uint16_t nb_rx_queues
uint16_t nb_tx_queues
struct rte_eth_dev_sriov sriov
void dev_private
struct rte_eth_link dev_link
struct rte_eth_conf dev_conf
uint16_t max_frame_size
uint64_t rx_mbuf_alloc_failed
struct ether_addr mac_addrs
struct ether_addr hash_mac_addrs
uint8_t port_id
uint8_t promiscuous: 1
uint8_t scattered_rx: 1
uint8_t all_multicast: 1
uint8_t dev_started: 1
2.20.1 Field Documentation
2.20.1.1 void rte_eth_dev_data::rx_queues
Array of pointers to RX queues.
2.20.1.2 void rte_eth_dev_data::tx_queues
Array of pointers to TX queues.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
29
Intel
DPDK)
API Reference
30
January 2014
Reference Number: 326004-006
rte_eth_dev_info Struct Reference - Intel
DPDK
2.20.1.13 uint8 t rte_eth_dev_data::port_id
Device Ethernet MAC addresses of hash ltering. Device [external] port identier.
2.20.1.14 uint8 t rte_eth_dev_data::promiscuous
RX promiscuous mode ON(1) / OFF(0).
2.20.1.15 uint8 t rte_eth_dev_data::scattered_rx
RX of scattered packets is ON(1) / OFF(0)
2.20.1.16 uint8 t rte_eth_dev_data::all_multicast
RX all multicast mode ON(1) / OFF(0).
2.20.1.17 uint8 t rte_eth_dev_data::dev_started
Device state: STARTED(1) / STOPPED(0).
2.21 rte eth dev info Struct Reference
Data Fields
struct rte_pci_device pci_dev
const char driver_name
uint32_t min_rx_bufsize
uint32_t max_rx_pktlen
uint16_t max_rx_queues
uint16_t max_tx_queues
uint32_t max_mac_addrs
uint16_t max_vfs
uint16_t max_vmdq_pools
2.21.1 Detailed Description
A structure used to retrieve the contextual information of an Ethernet device, such as the controlling driver
of the device, its PCI context, etc...
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
31
Intel
DPDK)
API Reference
32
January 2014
Reference Number: 326004-006
rte_eth_dev_sriov Struct Reference - Intel
DPDK
2.22 rte eth dev sriov Struct Reference
Data Fields
uint8_t active
uint8_t nb_q_per_pool
uint16_t def_vmdq_idx
uint16_t def_pool_q_idx
2.22.1 Field Documentation
2.22.1.1 uint8 t rte_eth_dev_sriov::active
SRIOV is active with 16, 32 or 64 pools
2.22.1.2 uint8 t rte_eth_dev_sriov::nb_q_per_pool
rx queue number per pool
2.22.1.3 uint16 t rte_eth_dev_sriov::def_vmdq_idx
Default pool num used for PF
2.22.1.4 uint16 t rte_eth_dev_sriov::def_pool_q_idx
Default pool queue start reg index
2.23 rte eth fc conf Struct Reference
Data Fields
uint32_t high_water
uint32_t low_water
uint16_t pause_time
uint16_t send_xon
enum rte_eth_fc_mode mode
uint8_t mac_ctrl_frame_fwd
2.23.1 Detailed Description
A structure used to congure Ethernet ow control parameter. These parameters will be congured into the
register of the NIC. Please refer to the corresponding data sheet for proper value.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
33
Intel
DPDK)
API Reference
34
January 2014
Reference Number: 326004-006
rte_eth_fdir Struct Reference - Intel
DPDK
2.24.1 Detailed Description
A structure used to report the status of the ow director lters in use.
2.24.2 Field Documentation
2.24.2.1 uint16 t rte_eth_fdir::collision
Number of lters with collision indication.
2.24.2.2 uint16 t rte_eth_fdir::free
Number of free (non programmed) lters.
2.24.2.3 uint16 t rte_eth_fdir::maxhash
The Lookup hash value of the added lter that updated the value of the MAXLEN eld
2.24.2.4 uint8 t rte_eth_fdir::maxlen
Longest linked list of lters in the table.
2.24.2.5 uint64 t rte_eth_fdir::add
Number of added lters.
2.24.2.6 uint64 t rte_eth_fdir::remove
Number of removed lters.
2.24.2.7 uint64 t rte_eth_fdir::f_add
Number of failed added lters (no more space in device).
2.24.2.8 uint64 t rte_eth_fdir::f_remove
Number of failed removed lters.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
35
Intel
DPDK)
API Reference
36
January 2014
Reference Number: 326004-006
rte_eth_rss_conf Struct Reference - Intel
DPDK
2.26.2 Field Documentation
2.26.2.1 struct rte_eth_fc_conf rte_eth_pfc_conf::fc
General ow control parameter.
2.26.2.2 uint8 t rte_eth_pfc_conf::priority
VLAN User Priority.
2.27 rte eth rss conf Struct Reference
Data Fields
uint8_t rss_key
uint16_t rss_hf
2.27.1 Detailed Description
A structure used to congure the Receive Side Scaling (RSS) feature of an Ethernet port. If not NULL, the
rss_key pointer of the rss_conf structure points to an array of 40 bytes holding the RSS key to use for
hashing specic header elds of received packets. Otherwise, a default random hash key is used by the
device driver.
The rss_hf eld of the rss_conf structure indicates the different types of IPv4/IPv6 packets to which the
RSS hashing must be applied. Supplying an rss_hf equal to zero disables the RSS feature.
2.27.2 Field Documentation
2.27.2.1 uint8 t rte_eth_rss_conf::rss_key
If not NULL, 40-byte hash key.
2.27.2.2 uint16 t rte_eth_rss_conf::rss_hf
Hash functions to apply - see below.
2.28 rte eth rss reta Struct Reference
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
37
Intel
DPDK)
API Reference
38
January 2014
Reference Number: 326004-006
rte_eth_rxmode Struct Reference - Intel
DPDK
2.29.2 Field Documentation
2.29.2.1 struct rte_eth_thresh rte_eth_rxconf::rx_thresh
RX ring threshold registers.
2.29.2.2 uint16 t rte_eth_rxconf::rx_free_thresh
Drives the freeing of RX descriptors.
2.29.2.3 uint8 t rte_eth_rxconf::rx_drop_en
Drop packets if no descriptors are available.
2.30 rte eth rxmode Struct Reference
Data Fields
enum rte_eth_rx_mq_mode mq_mode
uint32_t max_rx_pkt_len
uint16_t split_hdr_size
uint8_t header_split: 1
uint8_t hw_ip_checksum: 1
uint8_t hw_vlan_lter: 1
uint8_t hw_vlan_strip: 1
uint8_t hw_vlan_extend: 1
uint8_t jumbo_frame: 1
uint8_t hw_strip_crc: 1
2.30.1 Detailed Description
A structure used to congure the RX features of an Ethernet port.
2.30.2 Field Documentation
2.30.2.1 enum rte_eth_rx_mq_mode rte_eth_rxmode::mq_mode
The multi-queue packet distribution mode to be used, e.g. RSS.
2.30.2.2 uint32 t rte_eth_rxmode::max_rx_pkt_len
Only used if jumbo_frame enabled.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
39
Intel
DPDK)
API Reference
40
January 2014
Reference Number: 326004-006
rte_eth_stats Struct Reference - Intel
DPDK
uint64_t ierrors
uint64_t oerrors
uint64_t imcasts
uint64_t rx_nombuf
uint64_t fdirmatch
uint64_t fdirmiss
uint64_t q_ipackets [RTE_ETHDEV_QUEUE_STAT_CNTRS]
uint64_t q_opackets [RTE_ETHDEV_QUEUE_STAT_CNTRS]
uint64_t q_ibytes [RTE_ETHDEV_QUEUE_STAT_CNTRS]
uint64_t q_obytes [RTE_ETHDEV_QUEUE_STAT_CNTRS]
uint64_t q_errors [RTE_ETHDEV_QUEUE_STAT_CNTRS]
uint64_t ilbpackets
uint64_t olbpackets
uint64_t ilbbytes
uint64_t olbbytes
2.31.1 Detailed Description
A structure used to retrieve statistics for an Ethernet port.
2.31.2 Field Documentation
2.31.2.1 uint64 t rte_eth_stats::ipackets
Total number of successfully received packets.
2.31.2.2 uint64 t rte_eth_stats::opackets
Total number of successfully transmitted packets.
2.31.2.3 uint64 t rte_eth_stats::ibytes
Total number of successfully received bytes.
2.31.2.4 uint64 t rte_eth_stats::obytes
Total number of successfully transmitted bytes.
2.31.2.5 uint64 t rte_eth_stats::ierrors
Total number of erroneous received packets.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
41
Intel
DPDK)
API Reference
42
January 2014
Reference Number: 326004-006
rte_eth_thresh Struct Reference - Intel
DPDK
2.31.2.16 uint64 t rte_eth_stats::ilbpackets
Total number of good packets received from loopback,VF Only
2.31.2.17 uint64 t rte_eth_stats::olbpackets
Total number of good packets transmitted to loopback,VF Only
2.31.2.18 uint64 t rte_eth_stats::ilbbytes
Total number of good bytes received from loopback,VF Only
2.31.2.19 uint64 t rte_eth_stats::olbbytes
Total number of good bytes transmitted to loopback,VF Only
2.32 rte eth thresh Struct Reference
Data Fields
uint8_t pthresh
uint8_t hthresh
uint8_t wthresh
2.32.1 Detailed Description
A structure used to congure the ring threshold registers of an RX/TX queue for an Ethernet port.
2.32.2 Field Documentation
2.32.2.1 uint8 t rte_eth_thresh::pthresh
Ring prefetch threshold.
2.32.2.2 uint8 t rte_eth_thresh::hthresh
Ring host threshold.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
43
Intel
DPDK)
API Reference
44
January 2014
Reference Number: 326004-006
rte_eth_vlan_mirror Struct Reference - Intel
DPDK
2.34.1 Detailed Description
A structure used to congure the TX features of an Ethernet port.
2.34.2 Field Documentation
2.34.2.1 enum rte_eth_tx_mq_mode rte_eth_txmode::mq_mode
TX multi-queues mode.
2.35 rte eth vlan mirror Struct Reference
Data Fields
uint64_t vlan_mask
2.35.1 Detailed Description
A structure used to congure VLAN trafc mirror of an Ethernet port.
2.35.2 Field Documentation
2.35.2.1 uint64 t rte_eth_vlan_mirror::vlan_mask
mask for valid VLAN ID.
2.36 rte eth vmdq dcb conf Struct Reference
Data Fields
enum rte_eth_nb_pools nb_queue_pools
uint8_t enable_default_pool
uint8_t default_pool
uint8_t nb_pool_maps
struct {
uint16_t vlan_id
uint64_t pools
} pool_map [ETH_VMDQ_MAX_VLAN_FILTERS]
uint8_t dcb_queue [ETH_DCB_NUM_USER_PRIORITIES]
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
45
Intel
DPDK)
API Reference
46
January 2014
Reference Number: 326004-006
rte_eth_vmdq_dcb_tx_conf Struct Reference - Intel
DPDK
2.37 rte eth vmdq dcb tx conf Struct Reference
Data Fields
enum rte_eth_nb_pools nb_queue_pools
uint8_t dcb_queue [ETH_DCB_NUM_USER_PRIORITIES]
2.37.1 Field Documentation
2.37.1.1 enum rte_eth_nb_pools rte_eth_vmdq_dcb_tx_conf::nb_queue_pools
With DCB, 16 or 32 pools.
2.37.1.2 uint8 t rte_eth_vmdq_dcb_tx_conf::dcb_queue[ETH DCB NUM USER PRIORITIES]
Possible DCB queue,4 or 8.
2.38 rte eth vmdq mirror conf Struct Reference
Data Fields
uint8_t rule_type_mask
uint8_t dst_pool
uint64_t pool_mask
struct rte_eth_vlan_mirror vlan
2.38.1 Detailed Description
A structure used to congure trafc mirror of an Ethernet port.
2.38.2 Field Documentation
2.38.2.1 uint8 t rte_eth_vmdq_mirror_conf::rule_type_mask
Mirroring rule type mask we want to set
2.38.2.2 uint8 t rte_eth_vmdq_mirror_conf::dst_pool
Destination pool for this mirror rule.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
47
Intel
DPDK)
API Reference
48
January 2014
Reference Number: 326004-006
rte_eth_vmdq_tx_conf Struct Reference - Intel
DPDK
2.39.1.5 uint16 t rte_eth_vmdq_rx_conf::vlan_id
The vlan id of the received frame
2.39.1.6 uint64 t rte_eth_vmdq_rx_conf::pools
Bitmask of pools for packet rx
2.39.1.7 struct { ... } rte_eth_vmdq_rx_conf::pool_map[ETH VMDQ MAX VLAN FILTERS]
VMDq vlan pool maps.
2.40 rte eth vmdq tx conf Struct Reference
Data Fields
enum rte_eth_nb_pools nb_queue_pools
2.40.1 Field Documentation
2.40.1.1 enum rte_eth_nb_pools rte_eth_vmdq_tx_conf::nb_queue_pools
VMDq mode, 64 pools.
2.41 rte fbk hash entry Union Reference
Data Fields
uint64_t whole_entry
struct {
uint16_t is_entry
uint16_t value
uint32_t key
} entry
2.41.1 Detailed Description
Individual entry in the four-byte key hash table.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
49
Intel
DPDK)
API Reference
50
January 2014
Reference Number: 326004-006
rte_fbk_hash_table Struct Reference - Intel
DPDK
2.42.2 Field Documentation
2.42.2.1 const char rte_fbk_hash_params::name
Name of the hash table.
2.42.2.2 uint32 t rte_fbk_hash_params::entries
Total number of entries.
2.42.2.3 uint32 t rte_fbk_hash_params::entries_per_bucket
Number of entries in a bucket.
2.42.2.4 int rte_fbk_hash_params::socket_id
Socket to allocate memory on.
2.42.2.5 rte_fbk_hash_fn rte_fbk_hash_params::hash_func
The hash function.
2.42.2.6 uint32 t rte_fbk_hash_params::init_val
For initialising hash function.
2.43 rte fbk hash table Struct Reference
Data Fields
TAILQ_ENTRY next
char name [RTE_FBK_HASH_NAMESIZE]
uint32_t entries
uint32_t entries_per_bucket
uint32_t used_entries
uint32_t bucket_mask
uint32_t bucket_shift
rte_fbk_hash_fn hash_func
uint32_t init_val
union rte_fbk_hash_entry t [0]
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
51
Intel
DPDK)
API Reference
52
January 2014
Reference Number: 326004-006
rte_fdir_conf Struct Reference - Intel
DPDK
2.43.2.9 uint32 t rte_fbk_hash_table::init_val
For initialising hash function.
2.43.2.10 union rte_fbk_hash_entry rte_fbk_hash_table::t[0]
A at table of all buckets.
2.44 rte fdir conf Struct Reference
Data Fields
enum rte_fdir_mode mode
enum rte_fdir_pballoc_type pballoc
enum rte_fdir_status_mode status
uint8_t exbytes_offset
uint8_t drop_queue
2.44.1 Detailed Description
A structure used to congure the Flow Director (FDIR) feature of an Ethernet port.
If mode is RTE_FDIR_DISABLE, the pballoc value is ignored.
2.44.2 Field Documentation
2.44.2.1 enum rte_fdir_mode rte_fdir_conf::mode
Flow Director mode.
2.44.2.2 enum rte_fdir_pballoc_type rte_fdir_conf::pballoc
Space for FDIR lters.
2.44.2.3 enum rte_fdir_status_mode rte_fdir_conf::status
How to report FDIR hash.
2.44.2.4 uint8 t rte_fdir_conf::exbytes_offset
Offset of exbytes eld in RX packets (in 16-bit word units).
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
53
Intel
DPDK)
API Reference
54
January 2014
Reference Number: 326004-006
rte_fdir_masks Struct Reference - Intel
DPDK
2.45.2.4 uint16 t rte_fdir_lter::port_dst
Destination port to match, 0 otherwise.
2.45.2.5 uint32 t rte_fdir_lter::ipv4_addr
IPv4 source address to match.
IPv4 destination address to match.
2.45.2.6 uint32 t rte_fdir_lter::ipv6_addr[4]
IPv6 source address to match.
IPv6 destination address to match
2.45.2.7 union { ... } rte_fdir_lter::ip_src
IPv4/IPv6 source address to match (union of above).
2.45.2.8 union { ... } rte_fdir_lter::ip_dst
IPv4/IPv6 destination address to match (union of above).
2.45.2.9 enum rte_l4type rte_fdir_lter::l4type
l4type to match: NONE/UDP/TCP/SCTP.
2.45.2.10 enum rte_iptype rte_fdir_lter::iptype
IP packet type to match: IPv4 or IPv6.
2.46 rte fdir masks Struct Reference
Data Fields
uint8_t only_ip_ow
uint8_t vlan_id
uint8_t vlan_prio
uint8_t exbytes
uint8_t set_ipv6_mask
uint8_t comp_ipv6_dst
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
55
Intel
DPDK)
API Reference
56
January 2014
Reference Number: 326004-006
rte_hash Struct Reference - Intel
DPDK
2.46.2.7 uint32 t rte_fdir_masks::dst_ipv4_mask
Mask of Destination IPv4 Address. All bits set to 1 dene the relevant bits to use in the destination address
of an IPv4 packet when matching it against FDIR lters.
2.46.2.8 uint32 t rte_fdir_masks::src_ipv4_mask
Mask of Source IPv4 Address. All bits set to 1 dene the relevant bits to use in the source address of an
IPv4 packet when matching it against FDIR lters.
2.46.2.9 uint16 t rte_fdir_masks::dst_ipv6_mask
Mask of Source IPv6 Address. All bits set to 1 dene the relevant BYTES to use in the source address of
an IPv6 packet when matching it against FDIR lters.
2.46.2.10 uint16 t rte_fdir_masks::src_ipv6_mask
Mask of Destination IPv6 Address. All bits set to 1 dene the relevant BYTES to use in the destination
address of an IPv6 packet when matching it against FDIR lters.
2.46.2.11 uint16 t rte_fdir_masks::src_port_mask
Mask of Source Port. All bits set to 1 dene the relevant bits to use in the source port of an IP packets when
matching it against FDIR lters.
2.46.2.12 uint16 t rte_fdir_masks::dst_port_mask
Mask of Destination Port. All bits set to 1 dene the relevant bits to use in the destination port of an IP
packet when matching it against FDIR lters.
2.47 rte hash Struct Reference
Data Fields
TAILQ_ENTRY next
char name [RTE_HASH_NAMESIZE]
uint32_t entries
uint32_t bucket_entries
uint32_t key_len
rte_hash_function hash_func
uint32_t hash_func_init_val
uint32_t num_buckets
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
57
Intel
DPDK)
API Reference
58
January 2014
Reference Number: 326004-006
rte_hash_parameters Struct Reference - Intel
DPDK
2.47.2.8 uint32 t rte_hash::num_buckets
Number of buckets in table.
2.47.2.9 uint32 t rte_hash::bucket_bitmask
Bitmask for getting bucket index from hash signature.
2.47.2.10 hash_sig_t rte_hash::sig_msb
MSB is always set in valid signatures.
2.47.2.11 uint8 t rte_hash::sig_tbl
Flat array of hash signature buckets.
2.47.2.12 uint32 t rte_hash::sig_tbl_bucket_size
Signature buckets may be padded for alignment reasons, and this is the bucket size used by sig_tbl.
2.47.2.13 uint8 t rte_hash::key_tbl
Flat array of key value buckets.
2.47.2.14 uint32 t rte_hash::key_tbl_key_size
Keys may be padded for alignment reasons, and this is the key size used by key_tbl.
2.48 rte hash parameters Struct Reference
Data Fields
const char name
uint32_t entries
uint32_t bucket_entries
uint32_t key_len
rte_hash_function hash_func
uint32_t hash_func_init_val
int socket_id
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
59
Intel
DPDK)
API Reference
60
January 2014
Reference Number: 326004-006
rte_ivshmem_metadata Struct Reference - Intel
DPDK
2.49.1 Detailed Description
A structure used to enable/disable specic device interrupts.
2.49.2 Field Documentation
2.49.2.1 uint16 t rte_intr_conf::lsc
enable/disable lsc interrupt. 0 (default) - disable, 1 enable
2.50 rte ivshmem metadata Struct Reference
Data Fields
int magic_number
char name [IVSHMEM_NAME_LEN]
struct rte_ivshmem_metadata_entry entry [RTE_LIBRTE_IVSHMEM_MAX_ENTRIES]
2.50.1 Detailed Description
Structure that holds IVSHMEM metadata.
2.50.2 Field Documentation
2.50.2.1 int rte_ivshmem_metadata::magic_number
magic number
2.50.2.2 char rte_ivshmem_metadata::name[IVSHMEM NAME LEN]
name of the metadata le
2.50.2.3 struct rte_ivshmem_metadata_entry rte_ivshmem_metadata::entry[RTE LIBRTE IVSHMEM MAX-
ENTRIES]
metadata entries
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
61
Intel
DPDK)
API Reference
62
January 2014
Reference Number: 326004-006
rte_lpm Struct Reference - Intel
DPDK
uint32_t level
FILE le
2.54.1 Detailed Description
The rte_log structure.
2.54.2 Field Documentation
2.54.2.1 uint32 t rte_logs::type
Biteld with enabled logs.
2.54.2.2 uint32 t rte_logs::level
Log level.
2.54.2.3 FILE rte_logs::le
Pointer to current FILE for logs.
2.55 rte lpm Struct Reference
Data Fields
TAILQ_ENTRY next
char name [RTE_LPM_NAMESIZE]
int mem_location
uint32_t max_rules
struct rte_lpm_rule_info rule_info [RTE_LPM_MAX_DEPTH]
struct rte_lpm_tbl24_entry struct rte_lpm_tbl8_entry tbl8 [RTE_LPM_TBL8_NUM_ENTRIES]
struct rte_lpm_tbl24_entry struct rte_lpm_tbl8_entry struct rte_lpm_rule rules_tbl [0]
2.55.1 Field Documentation
2.55.1.1 TAILQ ENTRY rte_lpm::next
Next in list.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
63
Intel
DPDK)
API Reference
64
January 2014
Reference Number: 326004-006
rte_lpm_rule Struct Reference - Intel
DPDK
2.56.2 Field Documentation
2.56.2.1 uint32 t rte_lpm6_cong::max_rules
Max number of rules.
2.56.2.2 uint32 t rte_lpm6_cong::number_tbl8s
Number of tbl8s to allocate.
2.56.2.3 int rte_lpm6_cong::ags
This eld is currently unused.
2.57 rte lpm rule Struct Reference
Data Fields
uint32_t ip
uint8_t next_hop
2.57.1 Field Documentation
2.57.1.1 uint32 t rte_lpm_rule::ip
Rule IP address.
2.57.1.2 uint8 t rte_lpm_rule::next_hop
Rule next hop.
2.58 rte lpm rule info Struct Reference
Data Fields
uint32_t used_rules
uint32_t rst_rule
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
65
Intel
DPDK)
API Reference
66
January 2014
Reference Number: 326004-006
rte_malloc_socket_stats Struct Reference - Intel
DPDK
2.60.1 Field Documentation
2.60.1.1 uint8 t rte_lpm_tbl8_entry::next_hop
next hop.
2.60.1.2 uint8 t rte_lpm_tbl8_entry::valid
Validation ag.
2.60.1.3 uint8 t rte_lpm_tbl8_entry::valid_group
Group validation ag.
2.60.1.4 uint8 t rte_lpm_tbl8_entry::depth
Rule depth.
2.61 rte malloc socket stats Struct Reference
Data Fields
size_t heap_totalsz_bytes
size_t heap_freesz_bytes
size_t greatest_free_size
unsigned free_count
unsigned alloc_count
size_t heap_allocsz_bytes
2.61.1 Detailed Description
Structure to hold heap statistics obtained from rte_malloc_get_socket_stats function.
2.61.2 Field Documentation
2.61.2.1 size t rte_malloc_socket_stats::heap_totalsz_bytes
Total bytes on heap
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
67
Intel
DPDK)
API Reference
68
January 2014
Reference Number: 326004-006
rte_mbuf Struct Reference - Intel
DPDK
2.62.2 Field Documentation
2.62.2.1 struct rte_mempool rte_mbuf::pool
Pool from which mbuf was allocated.
2.62.2.2 void rte_mbuf::buf_addr
Virtual address of segment buffer.
2.62.2.3 phys_addr_t rte_mbuf::buf_physaddr
Physical address of segment buffer.
2.62.2.4 uint16 t rte_mbuf::buf_len
Length of segment buffer.
2.62.2.5 rte_atomic16_t rte_mbuf::refcnt_atomic
Atomically accessed refcnt
2.62.2.6 uint16 t rte_mbuf::refcnt
Non-atomically accessed refcnt
2.62.2.7 union { ... }
16-bit Reference counter. It should only be accessed using the following functions: rte_mbuf_refcnt_-
update(), rte_mbuf_refcnt_read(), and rte_mbuf_refcnt_set(). The functionality of these functions (atomic,
or non-atomic) is controlled by the CONFIG_RTE_MBUF_REFCNT_ATOMIC cong option.
2.62.2.8 uint8 t rte_mbuf::type
Type of mbuf.
2.62.2.9 uint8 t rte_mbuf::reserved
Unused eld. Required for padding.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
69
Intel
DPDK)
API Reference
70
January 2014
Reference Number: 326004-006
rte_mempool Struct Reference - Intel
DPDK
2.63.2.4 rte_rwlock_t rte_mem_cong::mlock
current lock nest order
qlock->mlock (ring/hash/lpm)
mplock->qlock->mlock (mempool) Notice: ALWAYS obtain qlock rst if having to obtain both qlock
and mlock only used by memzone LIB for thread-safe.
2.63.2.5 rte_rwlock_t rte_mem_cong::qlock
used for tailq operation for thread safe.
2.63.2.6 rte_rwlock_t rte_mem_cong::mplock
only used by mempool LIB for thread-safe.
2.63.2.7 uint32 t rte_mem_cong::memzone_idx
Index of memzone
2.63.2.8 struct rte_memseg rte_mem_cong::memseg[32,]
Physmem descriptors.
2.63.2.9 struct rte_memzone rte_mem_cong::memzone[512,]
Memzone descriptors.
2.63.2.10 struct rte_tailq_head rte_mem_cong::tailq_head[32,]
Tailqs for objects
2.64 rte mempool Struct Reference
Data Fields
TAILQ_ENTRY next
char name [RTE_MEMPOOL_NAMESIZE]
struct rte_ring ring
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
71
Intel
DPDK)
API Reference
72
January 2014
Reference Number: 326004-006
rte_mempool Struct Reference - Intel
DPDK
2.64.2.6 uint32 t rte_mempool::size
Size of the mempool.
2.64.2.7 uint32 t rte_mempool::cache_size
Size of per-lcore local cache.
2.64.2.8 uint32 t rte_mempool::cache_ushthresh
Threshold before we ush excess elements.
2.64.2.9 uint32 t rte_mempool::elt_size
Size of an element.
2.64.2.10 uint32 t rte_mempool::header_size
Size of header (before elt).
2.64.2.11 uint32 t rte_mempool::trailer_size
Size of trailer (after elt).
2.64.2.12 unsigned rte_mempool::private_data_size
Size of private data.
2.64.2.13 struct rte_mempool_cache rte_mempool::local_cache[32,]
Per-lcore local cache.
2.64.2.14 uint32 t rte_mempool::pg_num
Number of elements in the elt_pa array.
2.64.2.15 uint32 t uint32 t rte_mempool::pg_shift
LOG2 of the physical pages.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
73
Intel
DPDK)
API Reference
74
January 2014
Reference Number: 326004-006
rte_mempool_objsz Struct Reference - Intel
DPDK
2.66 rte mempool objsz Struct Reference
Data Fields
uint32_t elt_size
uint32_t header_size
uint32_t trailer_size
uint32_t total_size
2.66.1 Field Documentation
2.66.1.1 uint32 t rte_mempool_objsz::elt_size
Size of an element.
2.66.1.2 uint32 t rte_mempool_objsz::header_size
Size of header (before elt).
2.66.1.3 uint32 t rte_mempool_objsz::trailer_size
Size of trailer (after elt).
2.66.1.4 uint32 t rte_mempool_objsz::total_size
Total size of an object (header + elt + trailer).
2.67 rte memseg Struct Reference
Data Fields
phys_addr_t phys_addr
size_t len
size_t hugepage_sz
int32_t socket_id
uint32_t nchannel
uint32_t nrank
void addr
uint64_t addr_64
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
75
Intel
DPDK)
API Reference
76
January 2014
Reference Number: 326004-006
rte_memzone Struct Reference - Intel
DPDK
2.68 rte memzone Struct Reference
Data Fields
char name [RTE_MEMZONE_NAMESIZE]
phys_addr_t phys_addr
size_t len
size_t hugepage_sz
int32_t socket_id
uint32_t ags
void addr
uint64_t addr_64
2.68.1 Detailed Description
A structure describing a memzone, which is a contiguous portion of physical memory identied by a name.
2.68.2 Field Documentation
2.68.2.1 char rte_memzone::name[RTE MEMZONE NAMESIZE]
Name of the memory zone.
2.68.2.2 phys_addr_t rte_memzone::phys_addr
Start physical address.
2.68.2.3 void rte_memzone::addr
Start virtual address.
2.68.2.4 uint64 t rte_memzone::addr_64
Makes sure addr is always 64-bits
2.68.2.5 size t rte_memzone::len
Length of the memzone.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
77
Intel
DPDK)
API Reference
78
January 2014
Reference Number: 326004-006
rte_meter_trtcm Struct Reference - Intel
DPDK
2.70.2.3 uint64 t rte_meter_srtcm_params::ebs
Excess Burst Size (EBS). Measured in bytes.
2.71 rte meter trtcm Struct Reference
2.72 rte meter trtcm params Struct Reference
Data Fields
uint64_t cir
uint64_t pir
uint64_t cbs
uint64_t pbs
2.72.1 Detailed Description
trTCM parameters per metered trafc ow. The CIR, PIR, CBS and PBS parameters only count bytes of IP
packets and do not include link specic headers. PIR has to be greater than or equal to CIR. Both CBS or
EBS have to be greater than zero.
2.72.2 Field Documentation
2.72.2.1 uint64 t rte_meter_trtcm_params::cir
Committed Information Rate (CIR). Measured in bytes per second.
2.72.2.2 uint64 t rte_meter_trtcm_params::pir
Peak Information Rate (PIR). Measured in bytes per second.
2.72.2.3 uint64 t rte_meter_trtcm_params::cbs
Committed Burst Size (CBS). Measured in byes.
2.72.2.4 uint64 t rte_meter_trtcm_params::pbs
Peak Burst Size (PBS). Measured in bytes.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
79
Intel
DPDK)
API Reference
80
January 2014
Reference Number: 326004-006
rte_pci_device Struct Reference - Intel
DPDK
struct rte_pci_driver driver
uint16_t max_vfs
int numa_node
unsigned int blacklisted:1
2.74.1 Detailed Description
A structure describing a PCI device.
2.74.2 Field Documentation
2.74.2.1 TAILQ ENTRY rte_pci_device::next
Next probed PCI device.
2.74.2.2 struct rte_pci_addr rte_pci_device::addr
PCI location.
2.74.2.3 struct rte_pci_id rte_pci_device::id
PCI ID.
2.74.2.4 struct rte_pci_resource rte_pci_device::mem_resource[PCI MAX RESOURCE]
PCI Memory Resource
2.74.2.5 struct rte intr handle rte_pci_device::intr_handle
Interrupt handle
2.74.2.6 struct rte_pci_driver rte_pci_device::driver
Associated driver
2.74.2.7 uint16 t rte_pci_device::max_vfs
sriov enable if not zero
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
81
Intel
DPDK)
API Reference
82
January 2014
Reference Number: 326004-006
rte_pci_id Struct Reference - Intel
DPDK
2.75.2.5 uint32 t rte_pci_driver::drv_ags
Flags contolling handling of device.
2.76 rte pci id Struct Reference
Data Fields
uint16_t vendor_id
uint16_t device_id
uint16_t subsystem_vendor_id
uint16_t subsystem_device_id
2.76.1 Detailed Description
A structure describing an ID for a PCI driver. Each driver provides a table of these IDs for each device that
it supports.
2.76.2 Field Documentation
2.76.2.1 uint16 t rte_pci_id::vendor_id
Vendor ID or PCI_ANY_ID.
2.76.2.2 uint16 t rte_pci_id::device_id
Device ID or PCI_ANY_ID.
2.76.2.3 uint16 t rte_pci_id::subsystem_vendor_id
Subsystem vendor ID or PCI_ANY_ID.
2.76.2.4 uint16 t rte_pci_id::subsystem_device_id
Subsystem device ID or PCI_ANY_ID.
2.77 rte pci resource Struct Reference
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
83
Intel
DPDK)
API Reference
84
January 2014
Reference Number: 326004-006
rte_pktmbuf Struct Reference - Intel
DPDK
2.78.1 Detailed Description
A packet message buffer.
2.78.2 Field Documentation
2.78.2.1 struct rte_mbuf rte_pktmbuf::next
Next segment of scattered packet.
2.78.2.2 void rte_pktmbuf::data
Start address of data in segment buffer.
2.78.2.3 uint16 t rte_pktmbuf::data_len
Amount of data in segment buffer.
2.78.2.4 uint8 t rte_pktmbuf::nb_segs
Number of segments.
2.78.2.5 uint8 t rte_pktmbuf::in_port
Input port.
2.78.2.6 uint32 t rte_pktmbuf::pkt_len
Total pkt len: sum of all segment data_len.
2.78.2.7 uint32 t rte_pktmbuf::rss
RSS hash result if RSS enabled
2.78.2.8 struct { ... } rte_pktmbuf::fdir
Filter identier if FDIR enabled
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
85
Intel
DPDK)
API Reference
86
January 2014
Reference Number: 326004-006
rte_red_cong Struct Reference - Intel
DPDK
2.80.2 Field Documentation
2.80.2.1 uint32 t rte_red::avg
Average queue size (avg), scaled in xed-point format
2.80.2.2 uint32 t rte_red::count
Number of packets since last marked packet (count)
2.80.2.3 uint64 t rte_red::q_time
Start of the queue idle time (q_time)
2.81 rte red cong Struct Reference
Data Fields
uint32_t min_th
uint32_t max_th
uint32_t pa_const
uint8_t maxp_inv
uint8_t wq_log2
2.81.1 Detailed Description
RED conguration parameters
2.81.2 Field Documentation
2.81.2.1 uint32 t rte_red_cong::min_th
min_th scaled in xed-point format
2.81.2.2 uint32 t rte_red_cong::max_th
max_th scaled in xed-point format
2.81.2.3 uint32 t rte_red_cong::pa_const
Precomputed constant value used for pa calculation (scaled in xed-point format)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
87
Intel
DPDK)
API Reference
88
January 2014
Reference Number: 326004-006
rte_ring Struct Reference - Intel
DPDK
2.83 rte ring Struct Reference
Data Structures
struct cons
struct prod
Data Fields
TAILQ_ENTRY next
char name [RTE_RING_NAMESIZE]
int ags
2.83.1 Detailed Description
An RTE ring structure.
The producer and the consumer have a head and a tail index. The particularity of these index is that they
are not between 0 and size(ring). These indexes are between 0 and 2
DPDK)
API Reference
89
Intel
DPDK)
API Reference
90
January 2014
Reference Number: 326004-006
rte_sched_port_hierarchy Struct Reference - Intel
DPDK
2.85.2.4 uint32 t rte_sched_pipe_params::tc_period
Enforcement period for pipe trafc class rates (measured in milliseconds)
2.85.2.5 uint8 t rte_sched_pipe_params::wrr_weights[RTE SCHED QUEUES PER PIPE]
WRR weights for the queues of the current pipe
2.86 rte sched port hierarchy Struct Reference
Data Fields
uint32_t queue:2
uint32_t trafc_class:2
uint32_t pipe:20
uint32_t subport:6
uint32_t color:2
2.86.1 Detailed Description
Path through the scheduler hierarchy used by the scheduler enqueue operation to identify the destination
queue for the current packet. Stored in the eld pkt.hash.sched of struct rte_mbuf of each packet, typically
written by the classication stage and read by scheduler enqueue.
2.86.2 Field Documentation
2.86.2.1 uint32 t rte_sched_port_hierarchy::queue
Queue ID (0 .. 3)
2.86.2.2 uint32 t rte_sched_port_hierarchy::trafc_class
Trafc class ID (0 .. 3)
2.86.2.3 uint32 t rte_sched_port_hierarchy::pipe
Pipe ID
2.86.2.4 uint32 t rte_sched_port_hierarchy::subport
Subport ID
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
91
Intel
DPDK)
API Reference
92
January 2014
Reference Number: 326004-006
rte_sched_queue_stats Struct Reference - Intel
DPDK
2.87.2.5 uint32 t rte_sched_port_params::frame_overhead
Framing overhead per packet (measured in bytes)
2.87.2.6 uint32 t rte_sched_port_params::n_subports_per_port
Number of subports for the current port scheduler instance
2.87.2.7 uint32 t rte_sched_port_params::n_pipes_per_subport
Number of pipes for each port scheduler subport
2.87.2.8 uint16 t rte_sched_port_params::qsize[RTE SCHED TRAFFIC CLASSES PER PIPE]
Packet queue size for each trafc class. All queues within the same pipe trafc class have the same size.
Queues from different pipes serving the same trafc class have the same size.
2.87.2.9 struct rte_sched_pipe_params rte_sched_port_params::pipe_proles
Pipe prole table dened for current port scheduler instance. Every pipe of the current port scheduler is
congured using one of the proles from this table.
2.87.2.10 uint32 t rte_sched_port_params::n_pipe_proles
Number of proles in the pipe prole table
2.88 rte sched queue stats Struct Reference
Data Fields
uint32_t n_pkts
uint32_t n_pkts_dropped
uint32_t n_bytes
uint32_t n_bytes_dropped
2.88.1 Detailed Description
Queue statistics
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
93
Intel
DPDK)
API Reference
94
January 2014
Reference Number: 326004-006
rte_sched_subport_stats Struct Reference - Intel
DPDK
2.89.2.2 uint32 t rte_sched_subport_params::tb_size
Subport token bucket size (measured in credits)
2.89.2.3 uint32 t rte_sched_subport_params::tc_rate[RTE SCHED TRAFFIC CLASSES PER PIPE]
Subport trafc class rates (measured in bytes per second)
2.89.2.4 uint32 t rte_sched_subport_params::tc_period
Enforcement period for trafc class rates (measured in milliseconds)
2.90 rte sched subport stats Struct Reference
Data Fields
uint32_t n_pkts_tc [RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]
uint32_t n_pkts_tc_dropped [RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]
uint32_t n_bytes_tc [RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]
uint32_t n_bytes_tc_dropped [RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE]
2.90.1 Detailed Description
Subport statistics
2.90.2 Field Documentation
2.90.2.1 uint32 t rte_sched_subport_stats::n_pkts_tc[RTE SCHED TRAFFIC CLASSES PER PIPE]
Number of packets successfully written to current subport for each trafc class
2.90.2.2 uint32 t rte_sched_subport_stats::n_pkts_tc_dropped[RTE SCHED TRAFFIC CLASSES PER PIPE]
Number of packets dropped by the current subport for each trafc class due to subport queues being full or
congested
2.90.2.3 uint32 t rte_sched_subport_stats::n_bytes_tc[RTE SCHED TRAFFIC CLASSES PER PIPE]
Number of bytes successfully written to current subport for each trafc class
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
95
Intel
DPDK)
API Reference
96
January 2014
Reference Number: 326004-006
rte_tailq_head Struct Reference - Intel
DPDK
2.92.1 Detailed Description
The rte_spinlock_t type.
2.92.2 Field Documentation
2.92.2.1 volatile int rte_spinlock_t::locked
lock status 0 = unlocked, 1 = locked
2.93 rte tailq head Struct Reference
Data Fields
struct rte_dummy_head tailq_head
2.93.1 Detailed Description
The structure dening a tailq header entry for storing in the rte_cong structure in shared memory. Each tailq
is identied by name. Any library storing a set of objects e.g. rings, mempools, hash-tables, is recommended
to use an entry here, so as to make it easy for a multi-process app to nd already-created elements in shared
memory.
2.93.2 Field Documentation
2.93.2.1 struct rte dummy head rte_tailq_head::tailq_head
NOTE: must be rst element
2.94 rte timer Struct Reference
Data Fields
uint64_t expire
union rte_timer_status status
uint64_t period
rte_timer_cb_t f
void arg
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
97
Intel
DPDK)
API Reference
98
January 2014
Reference Number: 326004-006
rte_vlan_macip Union Reference - Intel
DPDK
2.95.2 Field Documentation
2.95.2.1 uint16 t rte_timer_status::state
Stop, pending, running, cong.
2.95.2.2 int16 t rte_timer_status::owner
The lcore that owns the timer.
2.95.2.3 uint32 t rte_timer_status::u32
To atomic-set status + owner.
2.96 rte vlan macip Union Reference
2.96.1 Detailed Description
Ofoad features
2.96.2 Field Documentation
2.96.2.1 uint16 t rte_vlan_macip::l3_len
L3 (IP) Header Length.
2.96.2.2 uint16 t rte_vlan_macip::l2_len
L2 (MAC) Header Length.
2.96.2.3 uint16 t rte_vlan_macip::vlan_tci
VLAN Tag Control Identier (CPU order).
2.97 sctp hdr Struct Reference
Data Fields
uint16_t src_port
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
99
Intel
DPDK)
API Reference
100
January 2014
Reference Number: 326004-006
tcp_hdr Struct Reference - Intel
DPDK
2.98.1 Detailed Description
TCP Header
2.98.2 Field Documentation
2.98.2.1 uint16 t tcp_hdr::src_port
TCP source port.
2.98.2.2 uint16 t tcp_hdr::dst_port
TCP destination port.
2.98.2.3 uint32 t tcp_hdr::sent_seq
TX data sequence number.
2.98.2.4 uint32 t tcp_hdr::recv_ack
RX data acknowledgement sequence number.
2.98.2.5 uint8 t tcp_hdr::data_off
Data offset.
2.98.2.6 uint8 t tcp_hdr::tcp_ags
TCP ags
2.98.2.7 uint16 t tcp_hdr::rx_win
RX ow control window.
2.98.2.8 uint16 t tcp_hdr::cksum
TCP checksum.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
101
Intel
DPDK)
API Reference
102
January 2014
Reference Number: 326004-006
vlan_hdr Struct Reference - Intel
DPDK
uint16_t eth_proto
2.100.1 Detailed Description
Ethernet VLAN Header. Contains the 16-bit VLAN Tag Control Identier and the Ethernet type of the
encapsulated frame.
2.100.2 Field Documentation
2.100.2.1 uint16 t vlan_hdr::vlan_tci
Priority (3) + CFI (1) + Identier Code (12)
2.100.2.2 uint16 t vlan_hdr::eth_proto
Ethernet type of encapsulated frame.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
103
Intel
DPDK)
API Reference
104
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
3.1.3.1 int rte eal alarm set ( uint64 t us, rte_eal_alarm_callback cb, void cb arg )
Function to set a callback to be triggered when us microseconds have expired. Accuracy of timing to the
microsecond is not guaranteed. The alarm function will not be called before the requested time, but may
be called a short period of time afterwards. The alarm handler will be called only once. There is no need to
call "rte_eal_alarm_cancel" from within the callback function.
Parameters
us The time in microseconds before the callback is called
cb The function to be called when the alarm expires
cb_arg Pointer parameter to be passed to the callback function
Returns
On success, zero. On failure, a negative error number
3.1.3.2 int rte eal alarm cancel ( rte_eal_alarm_callback cb fn, void cb arg )
Function to cancel an alarm callback which has been registered before.
Parameters
cb_fn alarm callback
cb_arg Pointer parameter to be passed to the callback function. To remove all copies of a given
callback function, irrespective of parameter, (void )-1 can be used here.
Returns
The number of callbacks removed
3.2 rte atomic.h File Reference
Data Structures
struct rte_atomic16_t
struct rte_atomic32_t
struct rte_atomic64_t
Denes
#dene MPLOCKED
#dene rte_mb()
#dene rte_wmb()
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
105
Intel
DPDK)
API Reference
106
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
static int64_t rte_atomic64_sub_return (rte_atomic64_t v, int64_t dec)
static int rte_atomic64_inc_and_test (rte_atomic64_t v)
static int rte_atomic64_dec_and_test (rte_atomic64_t v)
static int rte_atomic64_test_and_set (rte_atomic64_t v)
static void rte_atomic64_clear (rte_atomic64_t v)
3.2.1 Detailed Description
Atomic Operations
This le denes a generic API for atomic operations. The implementation is architecture-specic.
See lib/librte_eal/common/include/i686/arch/rte_atomic.h See lib/librte_eal/common/include/x86_64/arch/rte-
_atomic.h
Atomic Operations on x86_64
3.2.2 Dene Documentation
3.2.2.1 #dene MPLOCKED
Insert MP lock prex.
3.2.2.2 #dene rte mb( )
General memory barrier.
Guarantees that the LOAD and STORE operations generated before the barrier occur before the LOAD and
STORE operations generated after.
3.2.2.3 #dene rte wmb( )
Write memory barrier.
Guarantees that the STORE operations generated before the barrier occur before the STORE operations
generated after.
3.2.2.4 #dene rte rmb( )
Read memory barrier.
Guarantees that the LOAD operations generated before the barrier occur before the LOAD operations
generated after.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
107
Intel
DPDK)
API Reference
108
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
3.2.3.3 static int16 t rte atomic16 read ( const rte_atomic16_t v ) [static]
Atomically read a 16-bit value from a counter.
Parameters
v A pointer to the atomic counter.
Returns
The value of the counter.
3.2.3.4 static void rte atomic16 set ( rte_atomic16_t v, int16 t new value ) [static]
Atomically set a counter to a 16-bit value.
Parameters
v A pointer to the atomic counter.
new_value The new value for the counter.
3.2.3.5 static void rte atomic16 add ( rte_atomic16_t v, int16 t inc ) [static]
Atomically add a 16-bit value to an atomic counter.
Parameters
v A pointer to the atomic counter.
inc The value to be added to the counter.
3.2.3.6 static void rte atomic16 sub ( rte_atomic16_t v, int16 t dec ) [static]
Atomically subtract a 16-bit value from an atomic counter.
Parameters
v A pointer to the atomic counter.
dec The value to be subtracted from the counter.
3.2.3.7 static void rte atomic16 inc ( rte_atomic16_t v ) [static]
Atomically increment a counter by one.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
109
Intel
DPDK)
API Reference
110
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
Returns
The value of v after the subtraction.
3.2.3.11 static int rte atomic16 inc and test ( rte_atomic16_t v ) [static]
Atomically increment a 16-bit counter by one and test.
Atomically increments the atomic counter (v) by one and returns true if the result is 0, or false in all other
cases.
Parameters
v A pointer to the atomic counter.
Returns
True if the result after the increment operation is 0; false otherwise.
3.2.3.12 static int rte atomic16 dec and test ( rte_atomic16_t v ) [static]
Atomically decrement a 16-bit counter by one and test.
Atomically decrements the atomic counter (v) by one and returns true if the result is 0, or false in all other
cases.
Parameters
v A pointer to the atomic counter.
Returns
True if the result after the decrement operation is 0; false otherwise.
3.2.3.13 static int rte atomic16 test and set ( rte_atomic16_t v ) [static]
Atomically test and set a 16-bit atomic counter.
If the counter value is already set, return 0 (failed). Otherwise, set the counter value to 1 and return 1
(success).
Parameters
v A pointer to the atomic counter.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
111
Intel
DPDK)
API Reference
112
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
Returns
The value of the counter.
3.2.3.18 static void rte atomic32 set ( rte_atomic32_t v, int32 t new value ) [static]
Atomically set a counter to a 32-bit value.
Parameters
v A pointer to the atomic counter.
new_value The new value for the counter.
3.2.3.19 static void rte atomic32 add ( rte_atomic32_t v, int32 t inc ) [static]
Atomically add a 32-bit value to an atomic counter.
Parameters
v A pointer to the atomic counter.
inc The value to be added to the counter.
3.2.3.20 static void rte atomic32 sub ( rte_atomic32_t v, int32 t dec ) [static]
Atomically subtract a 32-bit value from an atomic counter.
Parameters
v A pointer to the atomic counter.
dec The value to be subtracted from the counter.
3.2.3.21 static void rte atomic32 inc ( rte_atomic32_t v ) [static]
Atomically increment a counter by one.
Parameters
v A pointer to the atomic counter.
3.2.3.22 static void rte atomic32 dec ( rte_atomic32_t v ) [static]
Atomically decrement a counter by one.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
113
Intel
DPDK)
API Reference
114
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
Returns
True if the result after the increment operation is 0; false otherwise.
3.2.3.26 static int rte atomic32 dec and test ( rte_atomic32_t v ) [static]
Atomically decrement a 32-bit counter by one and test.
Atomically decrements the atomic counter (v) by one and returns true if the result is 0, or false in all other
cases.
Parameters
v A pointer to the atomic counter.
Returns
True if the result after the decrement operation is 0; false otherwise.
3.2.3.27 static int rte atomic32 test and set ( rte_atomic32_t v ) [static]
Atomically test and set a 32-bit atomic counter.
If the counter value is already set, return 0 (failed). Otherwise, set the counter value to 1 and return 1
(success).
Parameters
v A pointer to the atomic counter.
Returns
0 if failed; else 1, success.
3.2.3.28 static void rte atomic32 clear ( rte_atomic32_t v ) [static]
Atomically set a 32-bit counter to 0.
Parameters
v A pointer to the atomic counter.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
115
Intel
DPDK)
API Reference
116
January 2014
Reference Number: 326004-006
rte_atomic.h File Reference - Intel
DPDK
3.2.3.33 static void rte atomic64 add ( rte_atomic64_t v, int64 t inc ) [static]
Atomically add a 64-bit value to a counter.
Parameters
v A pointer to the atomic counter.
inc The value to be added to the counter.
3.2.3.34 static void rte atomic64 sub ( rte_atomic64_t v, int64 t dec ) [static]
Atomically subtract a 64-bit value from a counter.
Parameters
v A pointer to the atomic counter.
dec The value to be subtracted from the counter.
3.2.3.35 static void rte atomic64 inc ( rte_atomic64_t v ) [static]
Atomically increment a 64-bit counter by one and test.
Parameters
v A pointer to the atomic counter.
3.2.3.36 static void rte atomic64 dec ( rte_atomic64_t v ) [static]
Atomically decrement a 64-bit counter by one and test.
Parameters
v A pointer to the atomic counter.
3.2.3.37 static int64 t rte atomic64 add return ( rte_atomic64_t v, int64 t inc ) [static]
Add a 64-bit value to an atomic counter and return the result.
Atomically adds the 64-bit value (inc) to the atomic counter (v) and returns the value of v after the addition.
Parameters
v A pointer to the atomic counter.
inc The value to be added to the counter.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
117
Intel
DPDK)
API Reference
118
January 2014
Reference Number: 326004-006
rte_branch_prediction.h File Reference - Intel
DPDK
Returns
True if the result after subtraction is 0; false otherwise.
3.2.3.41 static int rte atomic64 test and set ( rte_atomic64_t v ) [static]
Atomically test and set a 64-bit atomic counter.
If the counter value is already set, return 0 (failed). Otherwise, set the counter value to 1 and return 1
(success).
Parameters
v A pointer to the atomic counter.
Returns
0 if failed; else 1, success.
3.2.3.42 static void rte atomic64 clear ( rte_atomic64_t v ) [static]
Atomically set a 64-bit counter to 0.
Parameters
v A pointer to the atomic counter.
3.3 rte branch prediction.h File Reference
Denes
#dene likely(x)
#dene unlikely(x)
3.3.1 Detailed Description
Branch Prediction Helpers in RTE
3.3.2 Dene Documentation
3.3.2.1 #dene likely( x )
Check if a branch is likely to be taken.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
119
Intel
DPDK)
API Reference
120
January 2014
Reference Number: 326004-006
rte_byteorder.h File Reference - Intel
DPDK
3.4.2.2 #dene rte bswap32( x )
Swap bytes in a 32-bit value.
3.4.2.3 #dene rte bswap64( x )
Swap bytes in a 64-bit value.
3.4.2.4 #dene rte cpu to le 16( x )
Convert a 16-bit value from CPU order to little endian.
3.4.2.5 #dene rte cpu to le 32( x )
Convert a 32-bit value from CPU order to little endian.
3.4.2.6 #dene rte cpu to le 64( x )
Convert a 64-bit value from CPU order to little endian.
3.4.2.7 #dene rte cpu to be 16( x )
Convert a 16-bit value from CPU order to big endian.
3.4.2.8 #dene rte cpu to be 32( x )
Convert a 32-bit value from CPU order to big endian.
3.4.2.9 #dene rte cpu to be 64( x )
Convert a 64-bit value from CPU order to big endian.
3.4.2.10 #dene rte le to cpu 16( x )
Convert a 16-bit value from little endian to CPU order.
3.4.2.11 #dene rte le to cpu 32( x )
Convert a 32-bit value from little endian to CPU order.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
121
Intel
DPDK)
API Reference
122
January 2014
Reference Number: 326004-006
rte_common.h File Reference - Intel
DPDK
Functions
static uintptr_t rte_align_oor_int (uintptr_t ptr, uintptr_t align)
static int rte_is_aligned (void ptr, unsigned align)
static int rte_is_power_of_2 (uint32_t n)
static uint32_t rte_align32pow2 (uint32_t x)
static uint64_t rte_align64pow2 (uint64_t v)
static uint32_t rte_bsf32 (uint32_t v)
static uint64_t rte_str_to_size (const char str)
void rte_exit (int exit_code, const char format,...)
3.5.1 Detailed Description
Generic, commonly-used macro and inline function denitions for Intel DPDK.
3.5.2 Dene Documentation
3.5.2.1 #dene rte unused
short denition to mark a function parameter unused
3.5.2.2 #dene RTE SET USED( x )
denition to mark a variable or function parameter as used so as to avoid a compiler warning
3.5.2.3 #dene RTE PTR ADD( ptr, x )
add a byte-value offset from a pointer
3.5.2.4 #dene RTE PTR SUB( ptr, x )
subtract a byte-value offset from a pointer
3.5.2.5 #dene RTE PTR DIFF( ptr1, ptr2 )
get the difference between two pointer values, i.e. how far apart in bytes are the locations they point two. It
is assumed that ptr1 is greater than ptr2.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
123
Intel
DPDK)
API Reference
124
January 2014
Reference Number: 326004-006
rte_common.h File Reference - Intel
DPDK
3.5.2.14 #dene RTE MAX( a, b )
Macro to return the maximum of two numbers
3.5.2.15 #dene offsetof( TYPE, MEMBER )
Return the offset of a eld in a structure.
3.5.2.16 #dene RTE STR( x )
Take a macro value and get a string version of it
3.5.2.17 #dene RTE LEN2MASK( ln, tp )
Mask value of type <tp> for the rst <ln> bit set.
3.5.2.18 #dene RTE DIM( a )
Number of elements in the array.
3.5.3 Function Documentation
3.5.3.1 static uintptr t rte align oor int ( uintptr t ptr, uintptr t align ) [static]
Function which rounds an unsigned int down to a given power-of-two value. Takes uintptr_t types as
parameters, as this type of operation is most commonly done for pointer alignment. (See also RTE_AL-
IGN_FLOOR, RTE_ALIGN_CEIL, RTE_ALIGN, RTE_PTR_ALIGN_FLOOR, RTE_PTR_ALIGN_CEL, RT-
E_PTR_ALIGN macros)
Parameters
ptr The value to be rounded down
align The power-of-two of which the result must be a multiple.
Returns
Function returns a properly aligned value where align is a power-of-two. If align is not a power-of-two,
result will be incorrect.
3.5.3.2 static int rte is aligned ( void ptr, unsigned align ) [static]
Checks if a pointer is aligned to a given power-of-two value
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
125
Intel
DPDK)
API Reference
126
January 2014
Reference Number: 326004-006
rte_cpuags.h File Reference - Intel
DPDK
3.5.3.6 static uint32 t rte bsf32 ( uint32 t v ) [static]
Searches the input parameter for the least signicant set bit (starting from zero). If a least signicant 1 bit
is found, its bit index is returned. If the content of the input parameter is zero, then the content of the return
value is undened.
Parameters
v input parameter, should not be zero.
Returns
least signicant set bit in the input parameter.
3.5.3.7 static uint64 t rte str to size ( const char str ) [static]
Converts a numeric string to the equivalent uint64_t value. As well as straight number conversion, also
recognises the sufxes k, m and g for kilobytes, megabytes and gigabytes respectively.
If a negative number is passed in i.e. a string with the rst non-black character being "-", zero is returned.
Zero is also returned in the case of an error with the strtoull call in the function.
Parameters
str String containing number to convert.
Returns
Number.
3.5.3.8 void rte exit ( int exit code, const char format, ... )
Function to terminate the application immediately, printing an error message and returning the exit_code
back to the shell.
This function never returns
Parameters
exit_code The exit code to be returned by the application
format The format string to be used for printing the message. This can include printf format
characters which will be expanded using any further parameters to the function.
3.6 rte cpuags.h File Reference
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
127
Intel
DPDK)
API Reference
128
January 2014
Reference Number: 326004-006
rte_cpuags.h File Reference - Intel
DPDK
RTE_CPUFLAG_MONITOR MONITOR
RTE_CPUFLAG_DS_CPL DS_CPL
RTE_CPUFLAG_VMX VMX
RTE_CPUFLAG_SMX SMX
RTE_CPUFLAG_EIST EIST
RTE_CPUFLAG_TM2 TM2
RTE_CPUFLAG_SSSE3 SSSE3
RTE_CPUFLAG_CNXT_ID CNXT_ID
RTE_CPUFLAG_FMA FMA
RTE_CPUFLAG_CMPXCHG16B CMPXCHG16B
RTE_CPUFLAG_XTPR XTPR
RTE_CPUFLAG_PDCM PDCM
RTE_CPUFLAG_PCID PCID
RTE_CPUFLAG_DCA DCA
RTE_CPUFLAG_SSE4_1 SSE4_1
RTE_CPUFLAG_SSE4_2 SSE4_2
RTE_CPUFLAG_X2APIC X2APIC
RTE_CPUFLAG_MOVBE MOVBE
RTE_CPUFLAG_POPCNT POPCNT
RTE_CPUFLAG_TSC_DEADLINE TSC_DEADLINE
RTE_CPUFLAG_AES AES
RTE_CPUFLAG_XSAVE XSAVE
RTE_CPUFLAG_OSXSAVE OSXSAVE
RTE_CPUFLAG_AVX AVX
RTE_CPUFLAG_F16C F16C
RTE_CPUFLAG_RDRAND RDRAND
RTE_CPUFLAG_FPU FPU
RTE_CPUFLAG_VME VME
RTE_CPUFLAG_DE DE
RTE_CPUFLAG_PSE PSE
RTE_CPUFLAG_TSC TSC
RTE_CPUFLAG_MSR MSR
RTE_CPUFLAG_PAE PAE
RTE_CPUFLAG_MCE MCE
RTE_CPUFLAG_CX8 CX8
RTE_CPUFLAG_APIC APIC
RTE_CPUFLAG_SEP SEP
RTE_CPUFLAG_MTRR MTRR
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
129
Intel
DPDK)
API Reference
130
January 2014
Reference Number: 326004-006
rte_cycles.h File Reference - Intel
DPDK
RTE_CPUFLAG_XD XD
RTE_CPUFLAG_1GB_PG 1GB_PG
RTE_CPUFLAG_RDTSCP RDTSCP
RTE_CPUFLAG_EM64T EM64T
RTE_CPUFLAG_INVTSC INVTSC
RTE_CPUFLAG_NUMFLAGS This should always be the last!
3.6.3 Function Documentation
3.6.3.1 int rte cpu get ag enabled ( enum rte_cpu_ag_t ag )
Function for checking a CPU ag availability
Parameters
ag CPU ag to query CPU for
Returns
1 if ag is available 0 if ag is not available -ENOENT if ag is invalid
3.6.3.2 void rte cpu check supported ( void )
This function checks that the currently used CPU supports the CPU features that were specied at compile
time. It is called automatically within the EAL, so does not need to be used by applications.
3.7 rte cycles.h File Reference
Functions
static uint64_t rte_rdtsc (void)
uint64_t rte_get_tsc_hz (void)
static uint64_t rte_get_tsc_cycles (void)
uint64_t rte_get_hpet_cycles (void)
uint64_t rte_get_hpet_hz (void)
int rte_eal_hpet_init (int make_default)
static uint64_t rte_get_timer_cycles (void)
static uint64_t rte_get_timer_hz (void)
void rte_delay_us (unsigned us)
static void rte_delay_ms (unsigned ms)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
131
Intel
DPDK)
API Reference
132
January 2014
Reference Number: 326004-006
rte_cycles.h File Reference - Intel
DPDK
3.7.2.5 uint64 t rte get hpet hz ( void )
Get the number of HPET cycles in one second.
Returns
The number of cycles in one second.
3.7.2.6 int rte eal hpet init ( int make default )
Initialise the HPET for use. This must be called before the rte_get_hpet_hz and rte_get_hpet_cycles APIs
are called. If this function does not succeed, then the HPET functions are unavailable and should not be
called.
Parameters
make_default If set, the hpet timer becomes the default timer whose values are returned by the rte_-
get_timer_hz/cycles API calls
Returns
0 on success, -1 on error, and the make_default parameter is ignored.
3.7.2.7 static uint64 t rte get timer cycles ( void ) [static]
Get the number of cycles since boot from the default timer.
Returns
The number of cycles
3.7.2.8 static uint64 t rte get timer hz ( void ) [static]
Get the number of cycles in one second for the default timer.
Returns
The number of cycles in one second.
3.7.2.9 void rte delay us ( unsigned us )
Wait at least us microseconds.
Parameters
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
133
Intel
DPDK)
API Reference
134
January 2014
Reference Number: 326004-006
rte_eal.h File Reference - Intel
DPDK
3.8.3 Function Documentation
3.8.3.1 void rte dump stack ( void )
Dump the stack of the calling core to the console.
3.8.3.2 void rte dump registers ( void )
Dump the registers of the calling core to the console.
Note: Not implemented in a userapp environment; use gdb instead.
3.9 rte eal.h File Reference
Data Structures
struct rte_cong
Denes
#dene RTE_VERSION
#dene RTE_MAGIC
#dene EAL_FLG_HIGH_IOPL
#dene RTE_EAL_TAILQ_RWLOCK
#dene RTE_EAL_MEMPOOL_RWLOCK
#dene RTE_EAL_TAILQ_INSERT_TAIL(idx, type, elm)
#dene RTE_EAL_TAILQ_REMOVE(idx, type, elm)
#dene RTE_EAL_TAILQ_EXIST_CHECK(idx)
Typedefs
typedef void( rte_usage_hook_t )(const char prgname)
Enumerations
enum rte_lcore_role_t
enum rte_proc_type_t
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
135
Intel
DPDK)
API Reference
136
January 2014
Reference Number: 326004-006
rte_eal.h File Reference - Intel
DPDK
3.9.2.7 #dene RTE EAL TAILQ REMOVE( idx, type, elm )
Utility macro to do a thread-safe tailq REMOVE of rte_mem_cong
Parameters
idx a kind of tailq dene in enum rte_tailq_t
type type of list(tailq head)
elm The element will be remove from the list
3.9.2.8 #dene RTE EAL TAILQ EXIST CHECK( idx )
macro to check TAILQ exist
Parameters
idx a kind of tailq dene in enum rte_tailq_t
3.9.3 Typedef Documentation
3.9.3.1 typedef void( rte_usage_hook_t)(const char prgname)
Usage function typedef used by the application usage function.
Use this function typedef to dene and call rte_set_applcation_usage_hook() routine.
3.9.4 Enumeration Type Documentation
3.9.4.1 enum rte_lcore_role_t
The lcore role (used in RTE or not).
3.9.4.2 enum rte_proc_type_t
The type of process in a linuxapp, multi-process setup
3.9.5 Function Documentation
3.9.5.1 struct rte_cong rte eal get conguration ( void ) [read]
Get the global conguration structure.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
137
Intel
DPDK)
API Reference
138
January 2014
Reference Number: 326004-006
rte_errno.h File Reference - Intel
DPDK
Returns
On success, the number of parsed arguments, which is greater or equal to zero. After the call to
rte_eal_init(), all arguments argv[x] with x < ret may be modied and should not be accessed by
the application.
On failure, a negative error value.
3.9.5.5 rte_usage_hook_t rte set application usage hook ( rte_usage_hook_t usage func )
Add application usage routine callout from the eal_usage() routine.
This function allows the application to include its usage message in the EAL system usage message. -
The routine rte_set_application_usage_hook() needs to be called before the rte_eal_init() routine in the
application.
This routine is optional for the application and will behave as if the set routine was never called as the default
behavior.
Parameters
func The func argument is a function pointer to the application usage routine. Called function
is dened using rte_usage_hook_t typedef, which is of the form void rte_usage_-
func(const char prgname).
Calling this routine with a NULL value will reset the usage hook routine and return the current value, which
could be NULL.
Returns
Returns the current value of the rte_application_usage pointer to allow the caller to daisy chain the
usage routines if needing more then one.
3.10 rte errno.h File Reference
Denes
#dene rte_errno
#dene __ELASTERROR
Enumerations
enum { RTE_MIN_ERRNO, E_RTE_SECONDARY, E_RTE_NO_CONFIG, E_RTE_NO_TAILQ, R-
TE_MAX_ERRNO }
Functions
RTE_DECLARE_PER_LCORE (int, _rte_errno)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
139
Intel
DPDK)
API Reference
140
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.10.4.2 const char rte strerror ( int errnum )
Function which returns a printable string describing a particular error code. For non-RTE-specic error
codes, this function returns the value from the libc strerror function.
Parameters
errnum The error number to be looked up - generally the value of rte_errno
Returns
A pointer to a thread-local string containing the text describing the error.
3.11 rte ethdev.h File Reference
Data Structures
struct rte_eth_stats
struct rte_eth_link
struct rte_eth_thresh
struct rte_eth_rxmode
struct rte_eth_rss_conf
struct rte_eth_vlan_mirror
struct rte_eth_vmdq_mirror_conf
struct rte_eth_rss_reta
struct rte_eth_dcb_rx_conf
struct rte_eth_vmdq_dcb_tx_conf
struct rte_eth_dcb_tx_conf
struct rte_eth_vmdq_tx_conf
struct rte_eth_vmdq_dcb_conf
struct rte_eth_vmdq_rx_conf
struct rte_eth_txmode
struct rte_eth_rxconf
struct rte_eth_txconf
struct rte_eth_fc_conf
struct rte_eth_pfc_conf
struct rte_fdir_conf
struct rte_fdir_lter
struct rte_fdir_masks
struct rte_eth_fdir
struct rte_intr_conf
struct rte_eth_conf
struct rte_eth_dev_info
struct eth_dev_ops
struct rte_eth_dev
struct rte_eth_dev_sriov
struct rte_eth_dev_data
struct eth_driver
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
141
Intel
DPDK)
API Reference
142
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
#dene ETH_TXQ_FLAGS_NOMULTSEGS
#dene ETH_TXQ_FLAGS_NOREFCOUNT
#dene ETH_TXQ_FLAGS_NOMULTMEMP
#dene ETH_TXQ_FLAGS_NOVLANOFFL
#dene ETH_TXQ_FLAGS_NOXSUMSCTP
#dene ETH_TXQ_FLAGS_NOXSUMUDP
#dene ETH_TXQ_FLAGS_NOXSUMTCP
Typedefs
typedef uint32_t( eth_rx_queue_count_t )(struct rte_eth_dev dev, uint16_t rx_queue_id)
typedef int( eth_rx_descriptor_done_t )(void rxq, uint16_t offset)
typedef void( rte_eth_dev_cb_fn )(uint8_t port_id, enum rte_eth_event_type event, void cb_arg)
Enumerations
enum rte_eth_rx_mq_mode { ETH_MQ_RX_NONE, ETH_MQ_RX_RSS, ETH_MQ_RX_DCB, ETH-
_MQ_RX_DCB_RSS, ETH_MQ_RX_VMDQ_ONLY, ETH_MQ_RX_VMDQ_RSS, ETH_MQ_RX_V-
MDQ_DCB, ETH_MQ_RX_VMDQ_DCB_RSS }
enum rte_eth_tx_mq_mode { ETH_MQ_TX_NONE, ETH_MQ_TX_DCB, ETH_MQ_TX_VMDQ_DCB,
ETH_MQ_TX_VMDQ_ONLY }
enum rte_eth_nb_tcs { ETH_4_TCS, ETH_8_TCS }
enum rte_eth_nb_pools { ETH_8_POOLS, ETH_16_POOLS, ETH_32_POOLS, ETH_64_POOLS }
enum rte_eth_fc_mode { RTE_FC_NONE, RTE_FC_RX_PAUSE, RTE_FC_TX_PAUSE, RTE_FC_-
FULL }
enum rte_fdir_mode { RTE_FDIR_MODE_NONE, RTE_FDIR_MODE_SIGNATURE, RTE_FDIR_M-
ODE_PERFECT }
enum rte_fdir_pballoc_type { RTE_FDIR_PBALLOC_64K, RTE_FDIR_PBALLOC_128K, RTE_FDIR-
_PBALLOC_256K }
enum rte_fdir_status_mode { RTE_FDIR_NO_REPORT_STATUS, RTE_FDIR_REPORT_STATUS,
RTE_FDIR_REPORT_STATUS_ALWAYS }
enum rte_l4type { RTE_FDIR_L4TYPE_NONE, RTE_FDIR_L4TYPE_UDP, RTE_FDIR_L4TYPE_T-
CP, RTE_FDIR_L4TYPE_SCTP }
enum rte_iptype { RTE_FDIR_IPTYPE_IPV4, RTE_FDIR_IPTYPE_IPV6 }
enum rte_eth_event_type { RTE_ETH_EVENT_UNKNOWN, RTE_ETH_EVENT_INTR_LSC, RTE_-
ETH_EVENT_MAX }
Functions
uint8_t rte_eth_dev_count (void)
struct rte_eth_dev rte_eth_dev_allocate (void)
int rte_igb_pmd_init (void)
int rte_em_pmd_init (void)
int rte_igbvf_pmd_init (void)
int rte_ixgbe_pmd_init (void)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
143
Intel
DPDK)
API Reference
144
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
int rte_eth_dev_fdir_update_perfect_lter (uint8_t port_id, struct rte_fdir_lter fdir_lter, uint16_t soft-
_id, uint8_t rx_queue, uint8_t drop)
int rte_eth_dev_fdir_remove_perfect_lter (uint8_t port_id, struct rte_fdir_lter fdir_lter, uint16_-
t soft_id)
int rte_eth_dev_fdir_set_masks (uint8_t port_id, struct rte_fdir_masks fdir_mask)
int rte_eth_dev_callback_register (uint8_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn
cb_fn, void cb_arg)
int rte_eth_dev_callback_unregister (uint8_t port_id, enum rte_eth_event_type event, rte_eth_dev_-
cb_fn cb_fn, void cb_arg)
int rte_eth_led_on (uint8_t port_id)
int rte_eth_led_off (uint8_t port_id)
int rte_eth_dev_ow_ctrl_set (uint8_t port_id, struct rte_eth_fc_conf fc_conf)
int rte_eth_dev_priority_ow_ctrl_set (uint8_t port_id, struct rte_eth_pfc_conf pfc_conf)
int rte_eth_dev_mac_addr_add (uint8_t port, struct ether_addr mac_addr, uint32_t pool)
int rte_eth_dev_mac_addr_remove (uint8_t port, struct ether_addr mac_addr)
int rte_eth_dev_rss_reta_update (uint8_t port, struct rte_eth_rss_reta reta_conf)
int rte_eth_dev_rss_reta_query (uint8_t port, struct rte_eth_rss_reta reta_conf)
int rte_eth_dev_uc_hash_table_set (uint8_t port, struct ether_addr addr, uint8_t on)
int rte_eth_dev_uc_all_hash_table_set (uint8_t port, uint8_t on)
int rte_eth_dev_set_vf_rxmode (uint8_t port, uint16_t vf, uint16_t rx_mode, uint8_t on)
int rte_eth_dev_set_vf_tx (uint8_t port, uint16_t vf, uint8_t on)
int rte_eth_dev_set_vf_rx (uint8_t port, uint16_t vf, uint8_t on)
int rte_eth_dev_set_vf_vlan_lter (uint8_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t vlan_on)
int rte_eth_mirror_rule_set (uint8_t port_id, struct rte_eth_vmdq_mirror_conf mirror_conf, uint8_t
rule_id, uint8_t on)
int rte_eth_mirror_rule_reset (uint8_t port_id, uint8_t rule_id)
int rte_eth_dev_bypass_init (uint8_t port)
int rte_eth_dev_bypass_state_show (uint8_t port, uint32_t state)
int rte_eth_dev_bypass_state_set (uint8_t port, uint32_t new_state)
int rte_eth_dev_bypass_event_show (uint8_t port, uint32_t event, uint32_t state)
int rte_eth_dev_bypass_event_store (uint8_t port, uint32_t event, uint32_t state)
int rte_eth_dev_wd_timeout_store (uint8_t port, uint32_t timeout)
int rte_eth_dev_bypass_ver_show (uint8_t port, uint32_t ver)
int rte_eth_dev_bypass_wd_timeout_show (uint8_t port, uint32_t wd_timeout)
int rte_eth_dev_bypass_wd_reset (uint8_t port)
3.11.1 Detailed Description
RTE Ethernet Device API
The Ethernet Device API is composed of two parts:
The application-oriented Ethernet API that includes functions to setup an Ethernet device (congure
it, setup its RX and TX queues and start it), to get its MAC address, the speed and the status of its
physical link, to receive and to transmit packets, and so on.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
145
Intel
DPDK)
API Reference
146
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
receive mode conguration (promiscuous mode, hardware checksum mode, RSS/VMDQ settings etc.)
VLAN ltering conguration
MAC addresses supplied to MAC address array
ow director ltering mode (but not ltering rules)
NIC queue statistics mappings
Any other conguration will not be stored and will need to be re-entered after a call to rte_eth_dev_start().
Finally, a network application can close an Ethernet device by invoking the rte_eth_dev_close() function.
Each function of the application Ethernet API invokes a specic function of the PMD that controls the target
device designated by its port identier. For this purpose, all device-specic functions of an Ethernet driver
are supplied through a set of pointers contained in a generic structure of type eth_dev_ops. The address
of the eth_dev_ops structure is stored in the rte_eth_dev structure by the device init function of the
Ethernet driver, which is invoked during the PCI probing phase, as explained earlier.
In other words, each function of the Ethernet API simply retrieves the rte_eth_dev structure associated
with the device port identier and performs an indirect invocation of the corresponding driver function
supplied in the eth_dev_ops structure of the rte_eth_dev structure.
For performance reasons, the address of the burst-oriented RX and TX functions of the Ethernet driver
are not contained in the eth_dev_ops structure. Instead, they are directly stored at the beginning of the
rte_eth_dev structure to avoid an extra indirect memory access during their invocation.
RTE ethernet device drivers do not use interrupts for transmitting or receiving. Instead, Ethernet drivers
export Poll-Mode receive and transmit functions to applications. Both receive and transmit functions are
packet-burst oriented to minimize their cost per packet through the following optimizations:
Sharing among multiple packets the incompressible cost of the invocation of receive/transmit functions.
Enabling receive/transmit functions to take advantage of burst-oriented hardware features (L1 cache,
prefetch instructions, NIC head/tail registers) to minimize the number of CPU cycles per packet, for
instance, by avoiding useless read memory accesses to ring descriptors, or by systematically using
arrays of pointers that exactly t L1 cache line boundaries and sizes.
The burst-oriented receive function does not provide any error notication, to avoid the corresponding
overhead. As a hint, the upper-level application might check the status of the device link once being
systematically returned a 0 value by the receive function of the driver for a given number of tries.
3.11.2 Dene Documentation
3.11.2.1 #dene ETH LINK SPEED AUTONEG
Auto-negotiate link speed.
3.11.2.2 #dene ETH LINK SPEED 10
10 megabits/second.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
147
Intel
DPDK)
API Reference
148
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.2.13 #dene ETH RSS IPV6
IPv6 packet.
3.11.2.14 #dene ETH RSS IPV6 EX
IPv6 packet with extension headers.
3.11.2.15 #dene ETH RSS IPV6 TCP
IPv6/TCP packet.
3.11.2.16 #dene ETH RSS IPV6 TCP EX
IPv6/TCP with extension headers.
3.11.2.17 #dene ETH RSS IPV4 UDP
IPv4/UDP packet.
3.11.2.18 #dene ETH RSS IPV6 UDP
IPv6/UDP packet.
3.11.2.19 #dene ETH RSS IPV6 UDP EX
IPv6/UDP with extension headers.
3.11.2.20 #dene ETH VMDQ MAX VLAN FILTERS
Maximum nb. of VMDQ vlan lters.
3.11.2.21 #dene ETH DCB NUM USER PRIORITIES
Maximum nb. of DCB priorities.
3.11.2.22 #dene ETH VMDQ DCB NUM QUEUES
Maximum nb. of VMDQ DCB queues.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
149
Intel
DPDK)
API Reference
150
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.2.33 #dene ETH NUM RECEIVE MAC ADDR
Maximum nb. of receive mac addr.
3.11.2.34 #dene ETH VMDQ NUM UC HASH ARRAY
Maximum nb. of UC hash array.
3.11.2.35 #dene ETH VMDQ ACCEPT UNTAG
accept untagged packets.
3.11.2.36 #dene ETH VMDQ ACCEPT HASH MC
accept packets in multicast table .
3.11.2.37 #dene ETH VMDQ ACCEPT HASH UC
accept packets in unicast table.
3.11.2.38 #dene ETH VMDQ ACCEPT BROADCAST
accept broadcast packets.
3.11.2.39 #dene ETH VMDQ ACCEPT MULTICAST
multicast promiscuous.
3.11.2.40 #dene ETH VMDQ NUM MIRROR RULE
Maximum nb. of mirror rules. .
3.11.2.41 #dene ETH VMDQ POOL MIRROR
Virtual Pool Mirroring.
3.11.2.42 #dene ETH VMDQ UPLINK MIRROR
Uplink Port Mirroring.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
151
Intel
DPDK)
API Reference
152
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.3.1 typedef uint32 t( eth_rx_queue_count_t)(struct rte_eth_dev dev, uint16 t rx queue id)
number of available descriptors on a receive queue of an Ethernet device.
3.11.3.2 typedef int( eth_rx_descriptor_done_t)(void rxq, uint16 t offset)
DD bit of specic RX descriptor
3.11.3.3 typedef void( rte_eth_dev_cb_fn)(uint8 t port id, enum rte_eth_event_type event, void cb arg)
user application callback to be registered for interrupts
3.11.4 Enumeration Type Documentation
3.11.4.1 enum rte_eth_rx_mq_mode
A set of values to identify what method is to be used to route packets to multiple queues.
Enumerator:
ETH_MQ_RX_NONE None of DCB,RSS or VMDQ mode
ETH_MQ_RX_RSS For RX side, only RSS is on
ETH_MQ_RX_DCB For RX side,only DCB is on.
ETH_MQ_RX_DCB_RSS Both DCB and RSS enable
ETH_MQ_RX_VMDQ_ONLY Only VMDQ, no RSS nor DCB
ETH_MQ_RX_VMDQ_RSS RSS mode with VMDQ
ETH_MQ_RX_VMDQ_DCB Use VMDQ+DCB to route trafc to queues
ETH_MQ_RX_VMDQ_DCB_RSS Enable both VMDQ and DCB in VMDq
3.11.4.2 enum rte_eth_tx_mq_mode
A set of values to identify what method is to be used to transmit packets using multi-TCs.
Enumerator:
ETH_MQ_TX_NONE It is in neither DCB nor VT mode.
ETH_MQ_TX_DCB For TX side,only DCB is on.
ETH_MQ_TX_VMDQ_DCB For TX side,both DCB and VT is on.
ETH_MQ_TX_VMDQ_ONLY Only VT on, no DCB
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
153
Intel
DPDK)
API Reference
154
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.4.7 enum rte_fdir_pballoc_type
Memory space that can be congured to store Flow Director lters in the board memory.
Enumerator:
RTE_FDIR_PBALLOC_64K 64k.
RTE_FDIR_PBALLOC_128K 128k.
RTE_FDIR_PBALLOC_256K 256k.
3.11.4.8 enum rte_fdir_status_mode
Select report mode of FDIR hash information in RX descriptors.
Enumerator:
RTE_FDIR_NO_REPORT_STATUS Never report FDIR hash.
RTE_FDIR_REPORT_STATUS Only report FDIR hash for matching pkts.
RTE_FDIR_REPORT_STATUS_ALWAYS Always report FDIR hash.
3.11.4.9 enum rte_l4type
Possible l4type of FDIR lters.
Enumerator:
RTE_FDIR_L4TYPE_NONE None.
RTE_FDIR_L4TYPE_UDP UDP.
RTE_FDIR_L4TYPE_TCP TCP.
RTE_FDIR_L4TYPE_SCTP SCTP.
3.11.4.10 enum rte_iptype
Select IPv4 or IPv6 FDIR lters.
Enumerator:
RTE_FDIR_IPTYPE_IPV4 IPv4.
RTE_FDIR_IPTYPE_IPV6 IPv6.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
155
Intel
DPDK)
API Reference
156
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Returns
0 on success
3.11.5.5 int rte igbvf pmd init ( void )
The initialization function of the driver for 1Gbps Intel IGB_VF Ethernet devices. Invoked once at EAL start
time.
Returns
0 on success
3.11.5.6 int rte ixgbe pmd init ( void )
The initialization function of the driver for 10Gbps Intel IXGBE Ethernet devices. Invoked once at EAL start
time.
Returns
0 on success
3.11.5.7 int rte ixgbevf pmd init ( void )
The initialization function of the driver for 10Gbps Intel IXGBE_VF Ethernet devices. Invoked once at EAL
start time.
Returns
0 on success
3.11.5.8 int rte virtio pmd init ( void )
The initialization function of the driver for Qumranet virtio-net Ethernet devices. Invoked once at EAL start
time.
Returns
0 on success
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
157
Intel
DPDK)
API Reference
158
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Embedding all conguration information in a single data structure is the more exible method that allows the
addition of new features without changing the syntax of the API.
Returns
0: Success, device congured.
<0: Error code returned by the driver conguration function.
3.11.5.12 int rte eth rx queue setup ( uint8 t port id, uint16 t rx queue id, uint16 t nb rx desc, unsigned int
socket id, const struct rte_eth_rxconf rx conf, struct rte_mempool mb pool )
Allocate and set up a receive queue for an Ethernet device.
The function allocates a contiguous block of memory for nb_rx_desc receive descriptors from a memory
zone associated with socket_id and initializes each receive descriptor with a network buffer allocated from
the memory pool mb_pool.
Parameters
port_id The port identier of the Ethernet device.
rx_queue_id The index of the receive queue to set up. The value must be in the range [0, nb_rx_-
queue - 1] previously supplied to rte_eth_dev_congure().
nb_rx_desc The number of receive descriptors to allocate for the receive ring.
socket_id The socket_id argument is the socket identier in case of NUMA. The value can be
SOCKET_ID_ANY if there is no NUMA constraint for the DMA memory allocated for
the receive descriptors of the ring.
rx_conf The pointer to the conguration data to be used for the receive queue. The rx_conf
structure contains an rx_thresh structure with the values of the Prefetch, Host, and
Write-Back threshold registers of the receive ring.
mb_pool The pointer to the memory pool from which to allocate rte_mbuf network memory
buffers to populate each descriptor of the receive ring.
Returns
0: Success, receive queue correctly set up.
-EINVAL: The size of network buffers which can be allocated from the memory pool does not t
the various buffer sizes allowed by the device controller.
-ENOMEM: Unable to allocate the receive ring descriptors or to allocate network memory buffers
from the memory pool when initializing receive descriptors.
3.11.5.13 int rte eth tx queue setup ( uint8 t port id, uint16 t tx queue id, uint16 t nb tx desc, unsigned int
socket id, const struct rte_eth_txconf tx conf )
Allocate and set up a transmit queue for an Ethernet device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
159
Intel
DPDK)
API Reference
160
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Returns
0: Success, Ethernet device started.
<0: Error code of the driver device start function.
3.11.5.15 void rte eth dev stop ( uint8 t port id )
Stop an Ethernet device. The device can be restarted with a call to rte_eth_dev_start()
Parameters
port_id The port identier of the Ethernet device.
3.11.5.16 void rte eth dev close ( uint8 t port id )
Close an Ethernet device. The device cannot be restarted!
Parameters
port_id The port identier of the Ethernet device.
3.11.5.17 void rte eth promiscuous enable ( uint8 t port id )
Enable receipt in promiscuous mode for an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
3.11.5.18 void rte eth promiscuous disable ( uint8 t port id )
Disable receipt in promiscuous mode for an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
3.11.5.19 int rte eth promiscuous get ( uint8 t port id )
Return the value of promiscuous mode for an Ethernet device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
161
Intel
DPDK)
API Reference
162
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.5.23 void rte eth link get ( uint8 t port id, struct rte_eth_link link )
Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX or FULL-DUPLEX) of the
physical link of an Ethernet device. It might need to wait up to 9 seconds in it.
Parameters
port_id The port identier of the Ethernet device.
link A pointer to an rte_eth_link structure to be lled with the status, the speed and the
mode of the Ethernet device link.
3.11.5.24 void rte eth link get nowait ( uint8 t port id, struct rte_eth_link link )
Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX or FULL-DUPLEX) of the
physical link of an Ethernet device. It is a no-wait version of rte_eth_link_get().
Parameters
port_id The port identier of the Ethernet device.
link A pointer to an rte_eth_link structure to be lled with the status, the speed and the
mode of the Ethernet device link.
3.11.5.25 void rte eth stats get ( uint8 t port id, struct rte_eth_stats stats )
Retrieve the general I/O statistics of an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
stats A pointer to a structure of type rte_eth_stats to be lled with the values of device
counters for the following set of statistics:
ipackets with the total of successfully received packets.
opackets with the total of successfully transmitted packets.
ibytes with the total of successfully received bytes.
obytes with the total of successfully transmitted bytes.
ierrors with the total of erroneous received packets.
oerrors with the total of failed transmitted packets.
3.11.5.26 void rte eth stats reset ( uint8 t port id )
Reset the general I/O statistics of an Ethernet device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
163
Intel
DPDK)
API Reference
164
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Parameters
port_id The port identier of the Ethernet device.
mac_addr A pointer to a structure of type ether_addr to be lled with the Ethernet address of the
Ethernet device.
3.11.5.30 void rte eth dev info get ( uint8 t port id, struct rte_eth_dev_info dev info )
Retrieve the contextual information of an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
dev_info A pointer to a structure of type rte_eth_dev_info to be lled with the contextual
information of the Ethernet device.
3.11.5.31 int rte eth dev vlan lter ( uint8 t port id, uint16 t vlan id, int on )
Enable/Disable hardware ltering by an Ethernet device of received VLAN packets tagged with a given VLAN
Tag Identier.
Parameters
port_id The port identier of the Ethernet device.
vlan_id The VLAN Tag Identier whose ltering must be enabled or disabled.
on If > 0, enable VLAN ltering of VLAN packets tagged with vlan_id. Otherwise, disable
VLAN ltering of VLAN packets tagged with vlan_id.
Returns
(0) if successful.
(-ENOSUP) if hardware-assisted VLAN ltering not congured.
(-ENODEV) if port_id invalid.
(-ENOSYS) if VLAN ltering on port_id disabled.
(-EINVAL) if vlan_id > 4095.
3.11.5.32 int rte eth dev set vlan strip on queue ( uint8 t port id, uint16 t rx queue id, int on )
Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. 82599/X540 can support VLAN
stripping at the rx queue level
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
165
Intel
DPDK)
API Reference
166
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Returns
(0) if successful.
(-ENOSUP) if hardware-assisted VLAN ltering not congured.
(-ENODEV) if port_id invalid.
3.11.5.35 int rte eth dev get vlan ofoad ( uint8 t port id )
Read VLAN Ofoad conguration from an Ethernet device
Parameters
port_id The port identier of the Ethernet device.
Returns
(>0) if successful. Bit mask to indicate ETH_VLAN_STRIP_OFFLOAD ETH_VLAN_FILTER_OF-
FLOAD ETH_VLAN_EXTEND_OFFLOAD
(-ENODEV) if port_id invalid.
3.11.5.36 static uint16 t rte eth rx burst ( uint8 t port id, uint16 t queue id, struct rte_mbuf rx pkts, uint16 t
nb pkts ) [static]
Retrieve a burst of input packets from a receive queue of an Ethernet device. The retrieved packets are
stored in rte_mbuf structures whose pointers are supplied in the rx_pkts array.
The rte_eth_rx_burst() function loops, parsing the RX ring of the receive queue, up to nb_pkts packets,
and for each completed RX descriptor in the ring, it performs the following operations:
Initialize the rte_mbuf data structure associated with the RX descriptor according to the information
provided by the NIC into that RX descriptor.
Store the rte_mbuf data structure into the next entry of the rx_pkts array.
Replenish the RX descriptor with a new rte_mbuf buffer allocated from the memory pool associated
with the receive queue at initialization time.
When retrieving an input packet that was scattered by the controller into multiple receive descriptors, the
rte_eth_rx_burst() function appends the associated rte_mbuf buffers to the rst buffer of the packet.
The rte_eth_rx_burst() function returns the number of packets actually retrieved, which is the number of
rte_mbuf data structures effectively supplied into the rx_pkts array. A return value equal to nb_-
pkts indicates that the RX queue contained at least rx_pkts packets, and this is likely to signify that
other received packets remain in the input queue. Applications implementing a "retrieve as much received
packets as possible" policy can check this specic case and keep invoking the rte_eth_rx_burst() function
until a value less than nb_pkts is returned.
This receive method has the following advantages:
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
167
Intel
DPDK)
API Reference
168
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.5.38 static int rte eth rx descriptor done ( uint8 t port id, uint16 t queue id, uint16 t offset ) [static]
Check if the DD bit of the specic RX descriptor in the queue has been set
Parameters
port_id The port identier of the Ethernet device.
queue_id The queue id on the specic port. The offset of the descriptor ID from tail.
Returns
(1) if the specic DD bit is set.
(0) if the specic DD bit is not set.
(-ENODEV) if port_id invalid.
3.11.5.39 static uint16 t rte eth tx burst ( uint8 t port id, uint16 t queue id, struct rte_mbuf tx pkts, uint16 t
nb pkts ) [static]
Send a burst of output packets on a transmit queue of an Ethernet device.
The rte_eth_tx_burst() function is invoked to transmit output packets on the output queue queue_id of the
Ethernet device designated by its port_id. The nb_pkts parameter is the number of packets to send
which are supplied in the tx_pkts array of rte_mbuf structures. The rte_eth_tx_burst() function loops,
sending nb_pkts packets, up to the number of transmit descriptors available in the TX ring of the transmit
queue. For each packet to send, the rte_eth_tx_burst() function performs the following operations:
Pick up the next available descriptor in the transmit ring.
Free the network buffer previously sent with that descriptor, if any.
Initialize the transmit descriptor with the information provided in the rte_mbuf data structure.
In the case of a segmented packet composed of a list of rte_mbuf buffers, the rte_eth_tx_burst() function
uses several transmit descriptors of the ring.
The rte_eth_tx_burst() function returns the number of packets it actually sent. A return value equal to nb-
_pkts means that all packets have been sent, and this is likely to signify that other output packets could
be immediately transmitted again. Applications that implement a "send as many packets to transmit as
possible" policy can check this specic case and keep invoking the rte_eth_tx_burst() function until a value
less than nb_pkts is returned.
It is the responsibility of the rte_eth_tx_burst() function to transparently free the memory buffers of packets
previously sent. This feature is driven by the tx_free_thresh value supplied to the rte_eth_dev_congure()
function at device conguration time. When the number of previously sent packets reached the "minimum
transmit packets to free" threshold, the rte_eth_tx_burst() function must [attempt to] free the rte_mbuf
buffers of those packets whose transmission was effectively completed.
Parameters
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
169
Intel
DPDK)
API Reference
170
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Parameters
port_id The port identier of the Ethernet device.
fdir_ftr The pointer to the structure describing the signature lter rule. The rte_fdir_lter
structure includes the values of the different elds to match: source and destination
IP addresses, vlan id, exbytes, source and destination ports, and so on.
rx_queue The index of the RX queue where to store RX packets matching the added signature
lter dened in fdir_ftr.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support ow director mode.
(-ENODEV) if port_id invalid.
(-ENOSYS) if the ow director mode is not congured in signature mode on port_id.
(-EINVAL) if the fdir_lter information is not correct.
3.11.5.42 int rte eth dev fdir remove signature lter ( uint8 t port id, struct rte_fdir_lter fdir ftr )
Remove a signature lter rule on an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
fdir_ftr The pointer to the structure describing the signature lter rule. The rte_fdir_lter
structure includes the values of the different elds to match: source and destination
IP addresses, vlan id, exbytes, source and destination ports, and so on.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support ow director mode.
(-ENODEV) if port_id invalid.
(-ENOSYS) if the ow director mode is not congured in signature mode on port_id.
(-EINVAL) if the fdir_lter information is not correct.
3.11.5.43 int rte eth dev fdir get infos ( uint8 t port id, struct rte_eth_fdir fdir )
Retrieve the ow director information of an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
fdir A pointer to a structure of type rte_eth_dev_fdir to be lled with the ow director
information of the Ethernet device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
171
Intel
DPDK)
API Reference
172
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
soft_id The 16-bit value supplied in the eld hash.fdir.id of mbuf for RX packets matching the
perfect lter.
rx_queue The index of the RX queue where to store RX packets matching the added perfect lter
dened in fdir_lter.
drop If drop is set to 1, matching RX packets are stored into the RX drop queue dened in
the rte_fdir_conf.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support ow director mode.
(-ENODEV) if port_id invalid.
(-ENOSYS) if the ow director mode is not congured in perfect mode on port_id.
(-EINVAL) if the fdir_lter information is not correct.
3.11.5.46 int rte eth dev fdir remove perfect lter ( uint8 t port id, struct rte_fdir_lter fdir lter, uint16 t soft id
)
Remove a perfect lter rule on an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
fdir_lter The pointer to the structure describing the perfect lter rule. The rte_fdir_lter
structure includes the values of the different elds to match: source and destination
IP addresses, vlan id, exbytes, source and destination ports, and so on. IPv6 are not
supported.
soft_id The soft_id value provided when adding/updating the removed lter.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support ow director mode.
(-ENODEV) if port_id invalid.
(-ENOSYS) if the ow director mode is not congured in perfect mode on port_id.
(-EINVAL) if the fdir_lter information is not correct.
3.11.5.47 int rte eth dev fdir set masks ( uint8 t port id, struct rte_fdir_masks fdir mask )
Congure globally the masks for ow director mode for an Ethernet device. For example, the device can
match packets with only the rst 24 bits of the IPv4 source address.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
173
Intel
DPDK)
API Reference
174
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Parameters
port_id Port id.
event Event interested.
cb_fn User supplied callback function to be called.
cb_arg Pointer to the parameters for the registered callback. -1 means to remove all for the
same callback address and same event.
Returns
On success, zero.
On failure, a negative value.
3.11.5.50 int rte eth led on ( uint8 t port id )
Turn on the LED on the Ethernet device. This function turns on the LED on the Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
Returns
(0) if successful.
(-ENOTSUP) if underlying hardware OR driver doesnt support that operation.
(-ENODEV) if port_id invalid.
3.11.5.51 int rte eth led off ( uint8 t port id )
Turn off the LED on the Ethernet device. This function turns off the LED on the Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
Returns
(0) if successful.
(-ENOTSUP) if underlying hardware OR driver doesnt support that operation.
(-ENODEV) if port_id invalid.
3.11.5.52 int rte eth dev ow ctrl set ( uint8 t port id, struct rte_eth_fc_conf fc conf )
Congure the Ethernet link ow control for Ethernet device
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
175
Intel
DPDK)
API Reference
176
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Returns
(0) if successfully added or mac_addr" was already added.
(-ENOTSUP) if hardware doesnt support this feature.
(-ENODEV) if port is invalid.
(-ENOSPC) if no more MAC addresses can be added.
(-EINVAL) if MAC address is invalid.
3.11.5.55 int rte eth dev mac addr remove ( uint8 t port, struct ether_addr mac addr )
Remove a MAC address from the internal array of addresses.
Parameters
port The port identier of the Ethernet device.
mac_addr MAC address to remove.
Returns
(0) if successful, or mac_addr didnt exist.
(-ENOTSUP) if hardware doesnt support.
(-ENODEV) if port invalid.
(-EADDRINUSE) if attempting to remove the default MAC address
3.11.5.56 int rte eth dev rss reta update ( uint8 t port, struct rte_eth_rss_reta reta conf )
Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
Parameters
port The port identier of the Ethernet device.
reta_conf RETA to update.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
(-EINVAL) if bad parameter.
3.11.5.57 int rte eth dev rss reta query ( uint8 t port, struct rte_eth_rss_reta reta conf )
Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
177
Intel
DPDK)
API Reference
178
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
(-ENODEV) if port_id invalid.
(-EINVAL) if bad parameter.
3.11.5.60 int rte eth dev set vf rxmode ( uint8 t port, uint16 t vf, uint16 t rx mode, uint8 t on )
Set RX L2 Filtering mode of a VF of an Ethernet device.
Parameters
port The port identier of the Ethernet device.
vf VF id.
rx_mode The RX mode mask, which is one or more of accepting Untagged Packets, packets
that match the PFUTA table, Broadcast and Multicast Promiscuous. ETH_VMDQ_AC-
CEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC, ETH_VMDQ_ACCEPT_BROADC-
AST and ETH_VMDQ_ACCEPT_MULTICAST will be used in rx_mode.
on 1 - Enable a VF RX mode. 0 - Disable a VF RX mode.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
(-ENOTSUP) if hardware doesnt support.
(-EINVAL) if bad parameter.
3.11.5.61 int rte eth dev set vf tx ( uint8 t port, uint16 t vf, uint8 t on )
Enable or disable a VF trafc transmit of the Ethernet device.
Parameters
port The port identier of the Ethernet device.
vf VF id.
on 1 - Enable a VF trafc transmit. 0 - Disable a VF trafc transmit.
Returns
(0) if successful.
(-ENODEV) if port_id invalid.
(-ENOTSUP) if hardware doesnt support.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
179
Intel
DPDK)
API Reference
180
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Parameters
port_id The port identier of the Ethernet device.
mirror_conf The pointer to the trafc mirroring structure describing the mirroring rule. The rte_eth-
_vm_mirror_conf structure includes the type of mirroring rule, destination pool and the
value of rule if enable vlan or pool mirroring.
rule_id The index of trafc mirroring rule, we support four separated rules.
on 1 - Enable a mirroring rule. 0 - Disable a mirroring rule.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support this feature.
(-ENODEV) if port_id invalid.
(-EINVAL) if the mr_conf information is not correct.
3.11.5.65 int rte eth mirror rule reset ( uint8 t port id, uint8 t rule id )
Reset a trafc mirroring rule on an Ethernet device.
Parameters
port_id The port identier of the Ethernet device.
rule_id The index of trafc mirroring rule, we support four separated rules.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support this feature.
(-ENODEV) if port_id invalid.
(-EINVAL) if bad parameter.
3.11.5.66 int rte eth dev bypass init ( uint8 t port )
Initialize bypass logic. This function needs to be called before executing any other bypass API.
Parameters
port The port identier of the Ethernet device.
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
181
Intel
DPDK)
API Reference
182
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
3.11.5.69 int rte eth dev bypass event show ( uint8 t port, uint32 t event, uint32 t state )
Return bypass state when given event occurs.
Parameters
port The port identier of the Ethernet device.
event The bypass event
(1) Main power on (power button is pushed)
(2) Auxiliary power on (power supply is being plugged)
(3) Main power off (system shutdown and power supply is left plugged in)
(4) Auxiliary power off (power supply is being unplugged)
(5) Display or set the watchdog timer
state The bypass state when given event occurred.
(1) Normal mode
(2) Bypass mode
(3) Isolate mode
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
(-EINVAL) if bad parameter.
3.11.5.70 int rte eth dev bypass event store ( uint8 t port, uint32 t event, uint32 t state )
Set bypass state when given event occurs.
Parameters
port The port identier of the Ethernet device.
event The bypass event
(1) Main power on (power button is pushed)
(2) Auxiliary power on (power supply is being plugged)
(3) Main power off (system shutdown and power supply is left plugged in)
(4) Auxiliary power off (power supply is being unplugged)
(5) Display or set the watchdog timer
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
183
Intel
DPDK)
API Reference
184
January 2014
Reference Number: 326004-006
rte_ethdev.h File Reference - Intel
DPDK
Parameters
port The port identier of the Ethernet device.
ver The rmware version
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
(-EINVAL) if bad parameter.
3.11.5.73 int rte eth dev bypass wd timeout show ( uint8 t port, uint32 t wd timeout )
Return bypass watchdog timeout in seconds
Parameters
port The port identier of the Ethernet device.
wd_timeout The return watchdog timeout. "0" represents timer expired
(0) 0 seconds (timer is off)
(1) 1.5 seconds
(2) 2 seconds
(3) 3 seconds
(4) 4 seconds
(5) 8 seconds
(6) 16 seconds
(7) 32 seconds
Returns
(0) if successful.
(-ENOTSUP) if hardware doesnt support.
(-EINVAL) if bad parameter.
3.11.5.74 int rte eth dev bypass wd reset ( uint8 t port )
Reset bypass watchdog timer
Parameters
port The port identier of the Ethernet device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
185
Intel
DPDK)
API Reference
186
January 2014
Reference Number: 326004-006
rte_ether.h File Reference - Intel
DPDK
3.12.1 Detailed Description
Ethernet Helpers in RTE
3.12.2 Dene Documentation
3.12.2.1 #dene ETHER ADDR LEN
Length of Ethernet address.
3.12.2.2 #dene ETHER TYPE LEN
Length of Ethernet type eld.
3.12.2.3 #dene ETHER CRC LEN
Length of Ethernet CRC.
3.12.2.4 #dene ETHER HDR LEN
Length of Ethernet header.
3.12.2.5 #dene ETHER MIN LEN
Minimum frame len, including CRC.
3.12.2.6 #dene ETHER MAX LEN
Maximum frame len, including CRC.
3.12.2.7 #dene ETHER MTU
Ethernet MTU.
3.12.2.8 #dene ETHER MAX VLAN FRAME LEN
Maximum VLAN frame length, including CRC.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
187
Intel
DPDK)
API Reference
188
January 2014
Reference Number: 326004-006
rte_ether.h File Reference - Intel
DPDK
3.12.3 Function Documentation
3.12.3.1 static int is zero ether addr ( const struct ether_addr ea ) [static]
Check if an Ethernet address is lled with zeros.
Parameters
ea A pointer to a ether_addr structure containing the ethernet address to check.
Returns
True (1) if the given ethernet address is lled with zeros; false (0) otherwise.
3.12.3.2 static int is unicast ether addr ( const struct ether_addr ea ) [static]
Check if an Ethernet address is a unicast address.
Parameters
ea A pointer to a ether_addr structure containing the ethernet address to check.
Returns
True (1) if the given ethernet address is a unicast address; false (0) otherwise.
3.12.3.3 static int is multicast ether addr ( const struct ether_addr ea ) [static]
Check if an Ethernet address is a multicast address.
Parameters
ea A pointer to a ether_addr structure containing the ethernet address to check.
Returns
True (1) if the given ethernet address is a multicast address; false (0) otherwise.
3.12.3.4 static int is broadcast ether addr ( const struct ether_addr ea ) [static]
Check if an Ethernet address is a broadcast address.
Parameters
ea A pointer to a ether_addr structure containing the ethernet address to check.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
189
Intel
DPDK)
API Reference
190
January 2014
Reference Number: 326004-006
rte_fbk_hash.h File Reference - Intel
DPDK
Parameters
addr A pointer to Ethernet address.
3.12.3.9 static void ether addr copy ( const struct ether_addr ea from, struct ether_addr ea to ) [static]
Fast copy an Ethernet address.
Parameters
ea_from A pointer to a ether_addr structure holding the Ethernet address to copy.
ea_to A pointer to a ether_addr structure where to copy the Ethernet address.
3.13 rte fbk hash.h File Reference
Data Structures
struct rte_fbk_hash_params
union rte_fbk_hash_entry
struct rte_fbk_hash_table
Denes
#dene RTE_FBK_HASH_INIT_VAL_DEFAULT
#dene RTE_FBK_HASH_ENTRIES_MAX
#dene RTE_FBK_HASH_ENTRIES_PER_BUCKET_MAX
#dene RTE_FBK_HASH_NAMESIZE
Typedefs
typedef uint32_t( rte_fbk_hash_fn )(uint32_t key, uint32_t init_val)
Functions
static uint32_t rte_fbk_hash_get_bucket (const struct rte_fbk_hash_table ht, uint32_t key)
static int rte_fbk_hash_add_key_with_bucket (struct rte_fbk_hash_table ht, uint32_t key, uint16_-
t value, uint32_t bucket)
static int rte_fbk_hash_add_key (struct rte_fbk_hash_table ht, uint32_t key, uint16_t value)
static int rte_fbk_hash_delete_key_with_bucket (struct rte_fbk_hash_table ht, uint32_t key, uint32_t
bucket)
static int rte_fbk_hash_delete_key (struct rte_fbk_hash_table ht, uint32_t key)
static int rte_fbk_hash_lookup_with_bucket (const struct rte_fbk_hash_table ht, uint32_t key, uint32_t
bucket)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
191
Intel
DPDK)
API Reference
192
January 2014
Reference Number: 326004-006
rte_fbk_hash.h File Reference - Intel
DPDK
3.13.4 Function Documentation
3.13.4.1 static uint32 t rte fbk hash get bucket ( const struct rte_fbk_hash_table ht, uint32 t key )
[static]
Find the offset into hash table of the bucket containing a particular key.
Parameters
ht Pointer to hash table.
key Key to calculate bucket for.
Returns
Offset into hash table.
3.13.4.2 static int rte fbk hash add key with bucket ( struct rte_fbk_hash_table ht, uint32 t key, uint16 t value,
uint32 t bucket ) [static]
Add a key to an existing hash table with bucket id. This operation is not multi-thread safe and should only
be called from one thread.
Parameters
ht Hash table to add the key to.
key Key to add to the hash table.
value Value to associate with key.
bucket Bucket to associate with key.
Returns
0 if ok, or negative value on error.
3.13.4.3 static int rte fbk hash add key ( struct rte_fbk_hash_table ht, uint32 t key, uint16 t value )
[static]
Add a key to an existing hash table. This operation is not multi-thread safe and should only be called from
one thread.
Parameters
ht Hash table to add the key to.
key Key to add to the hash table.
value Value to associate with key.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
193
Intel
DPDK)
API Reference
194
January 2014
Reference Number: 326004-006
rte_fbk_hash.h File Reference - Intel
DPDK
Returns
The value that was associated with the key, or negative value on error.
3.13.4.7 static int rte fbk hash lookup ( const struct rte_fbk_hash_table ht, uint32 t key ) [static]
Find a key in the hash table. This operation is multi-thread safe.
Parameters
ht Hash table to look in.
key Key to nd.
Returns
The value that was associated with the key, or negative value on error.
3.13.4.8 static void rte fbk hash clear all ( struct rte_fbk_hash_table ht ) [static]
Delete all entries in a hash table. This operation is not multi-thread safe and should only be called from one
thread.
Parameters
ht Hash table to delete entries in.
3.13.4.9 static double rte fbk hash get load factor ( struct rte_fbk_hash_table ht ) [static]
Find what fraction of entries are being used.
Parameters
ht Hash table to nd how many entries are being used in.
Returns
Load factor of the hash table, or negative value on error.
3.13.4.10 struct rte_fbk_hash_table rte fbk hash nd existing ( const char name ) [read]
Performs a lookup for an existing hash table, and returns a pointer to the table if found.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
195
Intel
DPDK)
API Reference
196
January 2014
Reference Number: 326004-006
rte_hash.h File Reference - Intel
DPDK
Data Structures
struct rte_hash_parameters
struct rte_hash
Denes
#dene RTE_HASH_ENTRIES_MAX
#dene RTE_HASH_BUCKET_ENTRIES_MAX
#dene RTE_HASH_KEY_LENGTH_MAX
#dene RTE_HASH_LOOKUP_BULK_MAX
#dene RTE_HASH_NAMESIZE
Typedefs
typedef uint32_t hash_sig_t
typedef uint32_t( rte_hash_function )(const void key, uint32_t key_len, uint32_t init_val)
Functions
struct rte_hash rte_hash_create (const struct rte_hash_parameters params)
struct rte_hash rte_hash_nd_existing (const char name)
void rte_hash_free (struct rte_hash h)
int32_t rte_hash_add_key (const struct rte_hash h, const void key)
int32_t rte_hash_add_key_with_hash (const struct rte_hash h, const void key, hash_sig_t sig)
int32_t rte_hash_del_key (const struct rte_hash h, const void key)
int32_t rte_hash_del_key_with_hash (const struct rte_hash h, const void key, hash_sig_t sig)
int32_t rte_hash_lookup (const struct rte_hash h, const void key)
int32_t rte_hash_lookup_with_hash (const struct rte_hash h, const void key, hash_sig_t sig)
static hash_sig_t rte_hash_hash (const struct rte_hash h, const void key)
int rte_hash_lookup_bulk (const struct rte_hash h, const void keys, uint32_t num_keys, int32_t
positions)
3.14.1 Detailed Description
RTE Hash Table
3.14.2 Dene Documentation
3.14.2.1 #dene RTE HASH ENTRIES MAX
Maximum size of hash table that can be created.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
197
Intel
DPDK)
API Reference
198
January 2014
Reference Number: 326004-006
rte_hash.h File Reference - Intel
DPDK
E_RTE_NO_TAILQ - no tailq list could be got for the hash table list
ENOENT - missing entry
EINVAL - invalid parameter passed to function
ENOSPC - the maximum number of memzones has already been allocated
EEXIST - a memzone with the same name already exists
ENOMEM - no appropriate memory area found in which to create memzone
3.14.4.2 struct rte_hash rte hash nd existing ( const char name ) [read]
Find an existing hash table object and return a pointer to it.
Parameters
name Name of the hash table as passed to rte_hash_create()
Returns
Pointer to hash table or NULL if object not found with rte_errno set appropriately. Possible rte_errno
values include:
ENOENT - value not available for return
3.14.4.3 void rte hash free ( struct rte_hash h )
De-allocate all memory used by hash table.
Parameters
h Hash table to free
3.14.4.4 int32 t rte hash add key ( const struct rte_hash h, const void key )
Add a key to an existing hash table. This operation is not multi-thread safe and should only be called from
one thread.
Parameters
h Hash table to add the key to.
key Key to add to the hash table.
Returns
-EINVAL if the parameters are invalid.
-ENOSPC if there is no space in the hash for this key.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
199
Intel
DPDK)
API Reference
200
January 2014
Reference Number: 326004-006
rte_hash.h File Reference - Intel
DPDK
Parameters
h Hash table to remove the key from.
key Key to remove from the hash table.
sig Hash value to remove from the hash table.
Returns
-EINVAL if the parameters are invalid.
-ENOENT if the key is not found.
A positive value that can be used by the caller as an offset into an array of user data. This value is
unique for this key, and is the same value that was returned when the key was added.
3.14.4.8 int32 t rte hash lookup ( const struct rte_hash h, const void key )
Find a key in the hash table. This operation is multi-thread safe.
Parameters
h Hash table to look in.
key Key to nd.
Returns
-EINVAL if the parameters are invalid.
-ENOENT if the key is not found.
A positive value that can be used by the caller as an offset into an array of user data. This value is
unique for this key, and is the same value that was returned when the key was added.
3.14.4.9 int32 t rte hash lookup with hash ( const struct rte_hash h, const void key, hash_sig_t sig )
Find a key in the hash table. This operation is multi-thread safe.
Parameters
h Hash table to look in.
key Key to nd.
sig Hash value to nd.
Returns
-EINVAL if the parameters are invalid.
-ENOENT if the key is not found.
A positive value that can be used by the caller as an offset into an array of user data. This value is
unique for this key, and is the same value that was returned when the key was added.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
201
Intel
DPDK)
API Reference
202
January 2014
Reference Number: 326004-006
rte_hexdump.h File Reference - Intel
DPDK
3.15.2 Function Documentation
3.15.2.1 static uint32 t rte hash crc 4byte ( uint32 t data, uint32 t init val ) [static]
Use single crc32 instruction to perform a hash on a 4 byte value.
Parameters
data Data to perform hash on.
init_val Value to initialise hash generator.
Returns
32bit calculated hash value.
3.15.2.2 static uint32 t rte hash crc ( const void data, uint32 t data len, uint32 t init val ) [static]
Use crc32 instruction to perform a hash.
Parameters
data Data to perform hash on.
data_len How many bytes to use to calculate hash value.
init_val Value to initialise hash generator.
Returns
32bit calculated hash value.
3.16 rte hexdump.h File Reference
Functions
void rte_hexdump (const char title, const void buf, unsigned int len)
void rte_memdump (const char title, const void buf, unsigned int len)
3.16.1 Detailed Description
Simple API to dump out memory in a special hex format.
3.16.2 Function Documentation
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
203
Intel
DPDK)
API Reference
204
January 2014
Reference Number: 326004-006
rte_interrupts.h File Reference - Intel
DPDK
3.17.1 Detailed Description
The RTE interrupt interface provides functions to register/unregister callbacks for a specic interrupt.
3.17.2 Typedef Documentation
3.17.2.1 typedef void( rte_intr_callback_fn)(struct rte intr handle intr handle, void cb arg)
Function to be registered for the specic interrupt
3.17.3 Function Documentation
3.17.3.1 int rte intr callback register ( struct rte intr handle intr handle, rte_intr_callback_fn cb, void cb arg )
It registers the callback for the specic interrupt. Multiple callbacks cal be registered at the same time.
Parameters
intr_handle Pointer to the interrupt handle.
cb callback address.
cb_arg address of parameter for callback.
Returns
On success, zero.
On failure, a negative value.
3.17.3.2 int rte intr callback unregister ( struct rte intr handle intr handle, rte_intr_callback_fn cb, void
cb arg )
It unregisters the callback according to the specied interrupt handle.
Parameters
intr_handle pointer to the interrupt handle.
cb callback address.
cb_arg address of parameter for callback, (void )-1 means to remove all registered which has
the same callback address.
Returns
On success, return the number of callback entities removed.
On failure, a negative value.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
205
Intel
DPDK)
API Reference
206
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
#dene IPPROTO_ST
#dene IPPROTO_EGP
#dene IPPROTO_PIGP
#dene IPPROTO_RCCMON
#dene IPPROTO_NVPII
#dene IPPROTO_PUP
#dene IPPROTO_ARGUS
#dene IPPROTO_EMCON
#dene IPPROTO_XNET
#dene IPPROTO_CHAOS
#dene IPPROTO_UDP
#dene IPPROTO_MUX
#dene IPPROTO_MEAS
#dene IPPROTO_HMP
#dene IPPROTO_PRM
#dene IPPROTO_IDP
#dene IPPROTO_TRUNK1
#dene IPPROTO_TRUNK2
#dene IPPROTO_LEAF1
#dene IPPROTO_LEAF2
#dene IPPROTO_RDP
#dene IPPROTO_IRTP
#dene IPPROTO_TP
#dene IPPROTO_BLT
#dene IPPROTO_NSP
#dene IPPROTO_INP
#dene IPPROTO_SEP
#dene IPPROTO_3PC
#dene IPPROTO_IDPR
#dene IPPROTO_XTP
#dene IPPROTO_DDP
#dene IPPROTO_CMTP
#dene IPPROTO_TPXX
#dene IPPROTO_IL
#dene IPPROTO_IPV6
#dene IPPROTO_SDRP
#dene IPPROTO_ROUTING
#dene IPPROTO_FRAGMENT
#dene IPPROTO_IDRP
#dene IPPROTO_RSVP
#dene IPPROTO_GRE
#dene IPPROTO_MHRP
#dene IPPROTO_BHA
#dene IPPROTO_ESP
#dene IPPROTO_AH
#dene IPPROTO_INLSP
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
207
Intel
DPDK)
API Reference
208
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
#dene IPPROTO_PIM
#dene IPPROTO_PGM
#dene IPPROTO_SCTP
#dene IPPROTO_DIVERT
#dene IPPROTO_RAW
#dene IPPROTO_MAX
#dene IPV4_ANY
#dene IPV4_LOOPBACK
#dene IPV4_BROADCAST
#dene IPV4_ALLHOSTS_GROUP
#dene IPV4_ALLRTRS_GROUP
#dene IPV4_MAX_LOCAL_GROUP
#dene IPV4_MIN_MCAST
#dene IPV4_MAX_MCAST
#dene IS_IPV4_MCAST(x)
3.18.1 Detailed Description
IP-related denes
3.18.2 Dene Documentation
3.18.2.1 #dene IPv4( a, b, c, d )
Create IPv4 address
3.18.2.2 #dene IPPROTO IP
dummy for IP
3.18.2.3 #dene IPPROTO HOPOPTS
IP6 hop-by-hop options
3.18.2.4 #dene IPPROTO ICMP
control message protocol
3.18.2.5 #dene IPPROTO IGMP
group mgmt protocol
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
209
Intel
2 (deprecated)
3.18.2.7 #dene IPPROTO IPV4
IPv4 encapsulation
3.18.2.8 #dene IPPROTO TCP
tcp
3.18.2.9 #dene IPPROTO ST
Stream protocol II
3.18.2.10 #dene IPPROTO EGP
exterior gateway protocol
3.18.2.11 #dene IPPROTO PIGP
private interior gateway
3.18.2.12 #dene IPPROTO RCCMON
BBN RCC Monitoring
3.18.2.13 #dene IPPROTO NVPII
network voice protocol
3.18.2.14 #dene IPPROTO PUP
pup
3.18.2.15 #dene IPPROTO ARGUS
Argus
Intel
DPDK)
API Reference
210
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
3.18.2.16 #dene IPPROTO EMCON
EMCON
3.18.2.17 #dene IPPROTO XNET
Cross Net Debugger
3.18.2.18 #dene IPPROTO CHAOS
Chaos
3.18.2.19 #dene IPPROTO UDP
user datagram protocol
3.18.2.20 #dene IPPROTO MUX
Multiplexing
3.18.2.21 #dene IPPROTO MEAS
DCN Measurement Subsystems
3.18.2.22 #dene IPPROTO HMP
Host Monitoring
3.18.2.23 #dene IPPROTO PRM
Packet Radio Measurement
3.18.2.24 #dene IPPROTO IDP
xns idp
3.18.2.25 #dene IPPROTO TRUNK1
Trunk-1
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
211
Intel
DPDK)
API Reference
212
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
3.18.2.36 #dene IPPROTO 3PC
Third Party Connect
3.18.2.37 #dene IPPROTO IDPR
InterDomain Policy Routing
3.18.2.38 #dene IPPROTO XTP
XTP
3.18.2.39 #dene IPPROTO DDP
Datagram Delivery
3.18.2.40 #dene IPPROTO CMTP
Control Message Transport
3.18.2.41 #dene IPPROTO TPXX
TP++ Transport
3.18.2.42 #dene IPPROTO IL
IL transport protocol
3.18.2.43 #dene IPPROTO IPV6
IP6 header
3.18.2.44 #dene IPPROTO SDRP
Source Demand Routing
3.18.2.45 #dene IPPROTO ROUTING
IP6 routing header
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
213
Intel
DPDK)
API Reference
214
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
3.18.2.56 #dene IPPROTO NHRP
Next Hop Resolution
3.18.2.57 #dene IPPROTO ICMPV6
ICMP6
3.18.2.58 #dene IPPROTO NONE
IP6 no next header
3.18.2.59 #dene IPPROTO DSTOPTS
IP6 destination option
3.18.2.60 #dene IPPROTO AHIP
any host internal protocol
3.18.2.61 #dene IPPROTO CFTP
CFTP
3.18.2.62 #dene IPPROTO HELLO
"hello" routing protocol
3.18.2.63 #dene IPPROTO SATEXPAK
SATNET/Backroom EXPAK
3.18.2.64 #dene IPPROTO KRYPTOLAN
Kryptolan
3.18.2.65 #dene IPPROTO RVD
Remote Virtual Disk
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
215
Intel
DPDK)
API Reference
216
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
3.18.2.76 #dene IPPROTO ND
Sun net disk proto (temp.)
3.18.2.77 #dene IPPROTO WBMON
WIDEBAND Monitoring
3.18.2.78 #dene IPPROTO WBEXPAK
WIDEBAND EXPAK
3.18.2.79 #dene IPPROTO EON
ISO cnlp
3.18.2.80 #dene IPPROTO VMTP
VMTP
3.18.2.81 #dene IPPROTO SVMTP
Secure VMTP
3.18.2.82 #dene IPPROTO VINES
Banyon VINES
3.18.2.83 #dene IPPROTO TTP
TTP
3.18.2.84 #dene IPPROTO IGP
NSFNET-IGP
3.18.2.85 #dene IPPROTO DGP
dissimilar gateway prot.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
217
Intel
DPDK)
API Reference
218
January 2014
Reference Number: 326004-006
rte_ip.h File Reference - Intel
DPDK
3.18.2.96 #dene IPPROTO ETHERIP
Ethernet IP encapsulation
3.18.2.97 #dene IPPROTO ENCAP
encapsulation header
3.18.2.98 #dene IPPROTO APES
any private encr. scheme
3.18.2.99 #dene IPPROTO GMTP
GMTP
3.18.2.100 #dene IPPROTO IPCOMP
payload compression (IPComp)
3.18.2.101 #dene IPPROTO PIM
Protocol Independent Mcast
3.18.2.102 #dene IPPROTO PGM
PGM
3.18.2.103 #dene IPPROTO SCTP
Stream Control Transport Protocol
3.18.2.104 #dene IPPROTO DIVERT
divert pseudo-protocol
3.18.2.105 #dene IPPROTO RAW
raw IP packet
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
219
Intel
DPDK)
API Reference
220
January 2014
Reference Number: 326004-006
rte_ivshmem.h File Reference - Intel
DPDK
3.19 rte ivshmem.h File Reference
Data Structures
struct rte_ivshmem_metadata_entry
struct rte_ivshmem_metadata
Functions
int rte_ivshmem_metadata_create (const char name)
int rte_ivshmem_metadata_add_memzone (const struct rte_memzone mz, const char md_name)
int rte_ivshmem_metadata_add_ring (const struct rte_ring r, const char md_name)
int rte_ivshmem_metadata_add_mempool (const struct rte_mempool mp, const char md_name)
int rte_ivshmem_metadata_cmdline_generate (char buffer, unsigned size, const char name)
Dump all metadata entries from a given metadata le to the console.
Name of the metadata le to be dumped to console.
3.19.1 Detailed Description
The RTE IVSHMEM interface provides functions to create metadata les describing memory segments to
be shared via QEMU IVSHMEM.
3.19.2 Function Documentation
3.19.2.1 int rte ivshmem metadata create ( const char name )
Creates metadata le with a given name
Parameters
name Name of metadata le to be created
Returns
On success, zero
On failure, a negative value
3.19.2.2 int rte ivshmem metadata add memzone ( const struct rte_memzone mz, const char md name )
Adds memzone to a specic metadata le
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
221
Intel
DPDK)
API Reference
222
January 2014
Reference Number: 326004-006
rte_jhash.h File Reference - Intel
DPDK
Parameters
buffer Buffer to be lled with the command line arguments.
size Size of the buffer.
name Name of metadata le to generate QEMU command-line parameters for
Returns
On success, zero
On failure, a negative value
3.20 rte jhash.h File Reference
Denes
#dene RTE_JHASH_GOLDEN_RATIO
Functions
static uint32_t rte_jhash (const void key, uint32_t length, uint32_t initval)
static uint32_t rte_jhash2 (uint32_t k, uint32_t length, uint32_t initval)
static uint32_t rte_jhash_3words (uint32_t a, uint32_t b, uint32_t c, uint32_t initval)
static uint32_t rte_jhash_2words (uint32_t a, uint32_t b, uint32_t initval)
static uint32_t rte_jhash_1word (uint32_t a, uint32_t initval)
3.20.1 Detailed Description
jhash functions.
3.20.2 Dene Documentation
3.20.2.1 #dene RTE JHASH GOLDEN RATIO
The golden ratio: an arbitrary value.
3.20.3 Function Documentation
3.20.3.1 static uint32 t rte jhash ( const void key, uint32 t length, uint32 t initval ) [static]
The most generic version, hashes an arbitrary sequence of bytes. No alignment or length assumptions are
made about the input key.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
223
Intel
DPDK)
API Reference
224
January 2014
Reference Number: 326004-006
rte_kni.h File Reference - Intel
DPDK
Parameters
a First word to calcuate hash of.
b Second word to calcuate hash of.
initval Initialising value of hash.
Returns
Calculated hash value.
3.20.3.5 static uint32 t rte jhash 1word ( uint32 t a, uint32 t initval ) [static]
A special ultra-optimized versions that knows it is hashing exactly 1 word.
Parameters
a Word to calcuate hash of.
initval Initialising value of hash.
Returns
Calculated hash value.
3.21 rte kni.h File Reference
Data Structures
struct rte_kni_ops
struct rte_kni_conf
Functions
struct rte_kni rte_kni_alloc (struct rte_mempool pktmbuf_pool, const struct rte_kni_conf conf,
struct rte_kni_ops ops)
struct rte_kni rte_kni_create (uint8_t port_id, unsigned mbuf_size, struct rte_mempool pktmbuf_-
pool, struct rte_kni_ops ops)
int rte_kni_release (struct rte_kni kni)
int rte_kni_handle_request (struct rte_kni kni)
unsigned rte_kni_rx_burst (struct rte_kni kni, struct rte_mbuf mbufs, unsigned num)
unsigned rte_kni_tx_burst (struct rte_kni kni, struct rte_mbuf mbufs, unsigned num)
uint8_t rte_kni_get_port_id (struct rte_kni kni)
struct rte_kni rte_kni_get (const char name)
struct rte_kni rte_kni_info_get (uint8_t port_id)
int rte_kni_register_handlers (struct rte_kni kni, struct rte_kni_ops ops)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
225
Intel
DPDK)
API Reference
226
January 2014
Reference Number: 326004-006
rte_kni.h File Reference - Intel
DPDK
Returns
The pointer to the context of a KNI interface.
NULL indicate error.
3.21.2.3 int rte kni release ( struct rte kni kni )
Release KNI interface according to the context. It will also release the paired KNI interface in kernel space.
All processing on the specic KNI context need to be stopped before calling this interface.
Parameters
kni The pointer to the context of an existant KNI interface.
Returns
0 indicates success.
negative value indicates failure.
3.21.2.4 int rte kni handle request ( struct rte kni kni )
It is used to handle the request mbufs sent from kernel space. Then analyzes it and calls the specic actions
for the specic requests. Finally constructs the response mbuf and puts it back to the resp_q.
Parameters
kni The pointer to the context of an existant KNI interface.
Returns
0
negative value indicates failure.
3.21.2.5 unsigned rte kni rx burst ( struct rte kni kni, struct rte_mbuf mbufs, unsigned num )
Retrieve a burst of packets from a KNI interface. The retrieved packets are stored in rte_mbuf structures
whose pointers are supplied in the array of mbufs, and the maximum number is indicated by num. It handles
the freeing of the mbufs in the free queue of KNI interface.
Parameters
kni The KNI interface context.
mbufs The array to store the pointers of mbufs.
num The maximum number per burst.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
227
Intel
DPDK)
API Reference
228
January 2014
Reference Number: 326004-006
rte_kni.h File Reference - Intel
DPDK
3.21.2.9 struct rte kni rte kni info get ( uint8 t port id ) [read]
Get the KNI context of the specic port.
Note: It is deprecated and just for backward compatibility.
Parameters
port_id the port id.
Returns
On success: Pointer to KNI interface. On failure: NULL
3.21.2.10 int rte kni register handlers ( struct rte kni kni, struct rte_kni_ops ops )
Register KNI request handling for a specied port,and it can be called by master process or slave process.
Parameters
kni pointer to struct rte_kni.
ops ponter to struct rte_kni_ops.
Returns
On success: 0 On failure: -1
3.21.2.11 int rte kni unregister handlers ( struct rte kni kni )
Unregister KNI request handling for a specied port.
Parameters
kni pointer to struct rte_kni.
Returns
On success: 0 On failure: -1
3.21.2.12 void rte kni close ( void )
close KNI device.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
229
Intel
DPDK)
API Reference
230
January 2014
Reference Number: 326004-006
rte_launch.h File Reference - Intel
DPDK
3.22.3 Enumeration Type Documentation
3.22.3.1 enum rte_lcore_state_t
State of an lcore.
Enumerator:
WAIT waiting a new command
RUNNING executing command
FINISHED command executed
3.22.3.2 enum rte_rmt_call_master_t
This enum indicates whether the master core must execute the handler launched on all logical cores.
Enumerator:
SKIP_MASTER lcore handler not executed by master core.
CALL_MASTER lcore handler executed by master core.
3.22.4 Function Documentation
3.22.4.1 int rte eal remote launch ( lcore_function_t f, void arg, unsigned slave id )
Launch a function on another lcore.
To be executed on the MASTER lcore only.
Sends a message to a slave lcore (identied by the slave_id) that is in the WAIT state (this is true after the
rst call to rte_eal_init()). This can be checked by rst calling rte_eal_wait_lcore(slave_id).
When the remote lcore receives the message, it switches to the RUNNING state, then calls the function f
with argument arg. Once the execution is done, the remote lcore switches to a FINISHED state and the
return value of f is stored in a local variable to be read using rte_eal_wait_lcore().
The MASTER lcore returns as soon as the message is sent and knows nothing about the completion of f.
Note: This function is not designed to offer optimum performance. It is just a practical way to launch a
function on another lcore at initialization time.
Parameters
f The function to be called.
arg The argument for the function.
slave_id The identier of the lcore on which the function should be executed.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
231
Intel
DPDK)
API Reference
232
January 2014
Reference Number: 326004-006
rte_lcore.h File Reference - Intel
DPDK
If the slave lcore identied by the slave_id is in a FINISHED state, switch to the WAIT state. If the lcore is in
RUNNING state, wait until the lcore nishes its job and moves to the FINISHED state.
Parameters
slave_id The identier of the lcore.
Returns
0: If the lcore identied by the slave_id is in a WAIT state.
The value that was returned by the previous remote launch function call if the lcore identied by
the slave_id was in a FINISHED or RUNNING state. In this case, it changes the state of the lcore
to WAIT.
3.22.4.5 void rte eal mp wait lcore ( void )
Wait until all lcores nish their jobs.
To be executed on the MASTER lcore only. Issue an rte_eal_wait_lcore() for every lcore. The return values
are ignored.
After a call to rte_eal_mp_wait_lcore(), the caller can assume that all slave lcores are in a WAIT state.
3.23 rte lcore.h File Reference
Denes
#dene LCORE_ID_ANY
#dene RTE_LCORE_FOREACH(i)
#dene RTE_LCORE_FOREACH_SLAVE(i)
Functions
RTE_DECLARE_PER_LCORE (unsigned, _lcore_id)
static unsigned rte_lcore_id (void)
static unsigned rte_get_master_lcore (void)
static unsigned rte_lcore_count (void)
static unsigned rte_socket_id (void)
static unsigned rte_lcore_to_socket_id (unsigned lcore_id)
static int rte_lcore_is_enabled (unsigned lcore_id)
static unsigned rte_get_next_lcore (unsigned i, int skip_master, int wrap)
3.23.1 Detailed Description
API for lcore and Socket Manipulation. Parts of this are execution environment specic.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
233
Intel
DPDK)
API Reference
234
January 2014
Reference Number: 326004-006
rte_lcore.h File Reference - Intel
DPDK
3.23.3.5 static unsigned rte socket id ( void ) [static]
Return the ID of the physical socket of the logical core we are running on.
Returns
the ID of current lcoreids physical socket
3.23.3.6 static unsigned rte lcore to socket id ( unsigned lcore id ) [static]
Get the ID of the physical socket of the specied lcore
Parameters
lcore_id the targeted lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
Returns
the ID of lcoreids physical socket
3.23.3.7 static int rte lcore is enabled ( unsigned lcore id ) [static]
Test if an lcore is enabled.
Parameters
lcore_id The identier of the lcore, which MUST be between 0 and RTE_MAX_LCORE-1.
Returns
True if the given lcore is enabled; false otherwise.
3.23.3.8 static unsigned rte get next lcore ( unsigned i, int skip master, int wrap ) [static]
Get the next enabled lcore ID.
Parameters
i The current lcore (reference).
skip_master If true, do not return the ID of the master lcore.
wrap If true, go back to 0 when RTE_MAX_LCORE is reached; otherwise, return RTE_MAX-
_LCORE.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
235
Intel
DPDK)
API Reference
236
January 2014
Reference Number: 326004-006
rte_log.h File Reference - Intel
DPDK
Functions
int rte_openlog_stream (FILE f)
void rte_set_log_level (uint32_t level)
void rte_set_log_type (uint32_t type, int enable)
int rte_log_cur_msg_loglevel (void)
int rte_log_cur_msg_logtype (void)
void rte_log_set_history (int enable)
void rte_log_dump_history (void)
int rte_log_add_in_history (const char buf, size_t size)
int rte_log (uint32_t level, uint32_t logtype, const char format,...)
int rte_vlog (uint32_t level, uint32_t logtype, const char format, va_list ap)
Variables
struct rte_logs rte_logs
FILE eal_default_log_stream
3.24.1 Detailed Description
RTE Logs API
This le provides a log API to RTE applications.
3.24.2 Dene Documentation
3.24.2.1 #dene RTE LOGTYPE EAL
Log related to eal.
3.24.2.2 #dene RTE LOGTYPE MALLOC
Log related to malloc.
3.24.2.3 #dene RTE LOGTYPE RING
Log related to ring.
3.24.2.4 #dene RTE LOGTYPE MEMPOOL
Log related to mempool.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
237
Intel
DPDK)
API Reference
238
January 2014
Reference Number: 326004-006
rte_log.h File Reference - Intel
DPDK
3.24.2.15 #dene RTE LOGTYPE USER2
User-dened log type 2.
3.24.2.16 #dene RTE LOGTYPE USER3
User-dened log type 3.
3.24.2.17 #dene RTE LOGTYPE USER4
User-dened log type 4.
3.24.2.18 #dene RTE LOGTYPE USER5
User-dened log type 5.
3.24.2.19 #dene RTE LOGTYPE USER6
User-dened log type 6.
3.24.2.20 #dene RTE LOGTYPE USER7
User-dened log type 7.
3.24.2.21 #dene RTE LOGTYPE USER8
User-dened log type 8.
3.24.2.22 #dene RTE LOG EMERG
System is unusable.
3.24.2.23 #dene RTE LOG ALERT
Action must be taken immediately.
3.24.2.24 #dene RTE LOG CRIT
Critical conditions.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
239
Intel
DPDK)
API Reference
240
January 2014
Reference Number: 326004-006
rte_log.h File Reference - Intel
DPDK
Returns
0: Success.
Negative on error.
3.24.3 Function Documentation
3.24.3.1 int rte openlog stream ( FILE f )
Change the stream that will be used by the logging system.
This can be done at any time. The f argument represents the stream to be used to send the logs. If f is
NULL, the default output is used, which is the serial line in case of bare metal, or directly sent to syslog in
case of linux application.
Parameters
f Pointer to the stream.
Returns
0 on success.
Negative on error.
3.24.3.2 void rte set log level ( uint32 t level )
Set the global log level.
After this call, all logs that are lower or equal than level and lower or equal than the RTE_LOG_LEVEL
conguration option will be displayed.
Parameters
level Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8).
3.24.3.3 void rte set log type ( uint32 t type, int enable )
Enable or disable the log type.
Parameters
type Log type, for example, RTE_LOGTYPE_EAL.
enable True for enable; false for disable.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
241
Intel
DPDK)
API Reference
242
January 2014
Reference Number: 326004-006
rte_log.h File Reference - Intel
DPDK
Parameters
buf A data buffer containing the message to be saved in the history.
size The length of the data buffer.
Returns
0: Success.
(-ENOBUFS) if there is no room to store the message.
3.24.3.9 int rte log ( uint32 t level, uint32 t logtype, const char format, ... )
Generates a log message.
The message will be sent in the stream dened by the previous call to rte_openlog_stream().
The level argument determines if the log should be displayed or not, depending on the global rte_logs
variable.
The preferred alternative is the RTE_LOG() function because debug logs may be removed at compilation
time if optimization is enabled. Moreover, logs are automatically prexed by type when using the macro.
Parameters
level Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8).
logtype The log type, for example, RTE_LOGTYPE_EAL.
format The format string, as in printf(3), followed by the variable arguments required by the
format.
Returns
0: Success.
Negative on error.
3.24.3.10 int rte vlog ( uint32 t level, uint32 t logtype, const char format, va list ap )
Generates a log message.
The message will be sent in the stream dened by the previous call to rte_openlog_stream().
The level argument determines if the log should be displayed or not, depending on the global rte_logs
variable. A trailing newline may be added if needed.
The preferred alternative is the RTE_LOG() because debug logs may be removed at compilation time.
Parameters
level Log level. A value between RTE_LOG_EMERG (1) and RTE_LOG_DEBUG (8).
logtype The log type, for example, RTE_LOGTYPE_EAL.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
243
Intel
DPDK)
API Reference
244
January 2014
Reference Number: 326004-006
rte_lpm.h File Reference - Intel
DPDK
Functions
struct rte_lpm rte_lpm_create (const char name, int socket_id, int max_rules, int ags)
struct rte_lpm rte_lpm_nd_existing (const char name)
void rte_lpm_free (struct rte_lpm lpm)
int rte_lpm_add (struct rte_lpm lpm, uint32_t ip, uint8_t depth, uint8_t next_hop)
int rte_lpm_delete (struct rte_lpm lpm, uint32_t ip, uint8_t depth)
void rte_lpm_delete_all (struct rte_lpm lpm)
static int rte_lpm_lookup (struct rte_lpm lpm, uint32_t ip, uint8_t next_hop)
3.25.1 Detailed Description
RTE Longest Prex Match (LPM)
3.25.2 Dene Documentation
3.25.2.1 #dene RTE LPM NAMESIZE
Max number of characters in LPM name.
3.25.2.2 #dene RTE LPM HEAP
Deprecated Possible location to allocate memory. This was for last parameter of rte_lpm_create(), but is
now redundant. The LPM table is always allocated in memory using librte_malloc which uses
a memzone.
3.25.2.3 #dene RTE LPM MEMZONE
Deprecated Possible location to allocate memory. This was for last parameter of rte_lpm_create(), but is
now redundant. The LPM table is always allocated in memory using librte_malloc which uses
a memzone.
3.25.2.4 #dene RTE LPM MAX DEPTH
Maximum depth value possible for IPv4 LPM.
3.25.2.5 #dene RTE LPM LOOKUP SUCCESS
Bitmask used to indicate successful lookup
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
245
Intel
DPDK)
API Reference
246
January 2014
Reference Number: 326004-006
rte_lpm.h File Reference - Intel
DPDK
3.25.3.2 struct rte_lpm rte lpm nd existing ( const char name ) [read]
Find an existing LPM object and return a pointer to it.
Parameters
name Name of the lpm object as passed to rte_lpm_create()
Returns
Pointer to lpm object or NULL if object not found with rte_errno set appropriately. Possible rte_errno
values include:
ENOENT - required entry not available to return.
3.25.3.3 void rte lpm free ( struct rte_lpm lpm )
Free an LPM object.
Parameters
lpm LPM object handle
Returns
None
3.25.3.4 int rte lpm add ( struct rte_lpm lpm, uint32 t ip, uint8 t depth, uint8 t next hop )
Add a rule to the LPM table.
Parameters
lpm LPM object handle
ip IP of the rule to be added to the LPM table
depth Depth of the rule to be added to the LPM table
next_hop Next hop of the rule to be added to the LPM table
Returns
0 on success, negative value otherwise
3.25.3.5 int rte lpm delete ( struct rte_lpm lpm, uint32 t ip, uint8 t depth )
Delete a rule from the LPM table.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
247
Intel
DPDK)
API Reference
248
January 2014
Reference Number: 326004-006
rte_lpm6.h File Reference - Intel
DPDK
Functions
struct rte_lpm6 rte_lpm6_create (const char name, int socket_id, const struct rte_lpm6_cong
cong)
struct rte_lpm6 rte_lpm6_nd_existing (const char name)
void rte_lpm6_free (struct rte_lpm6 lpm)
int rte_lpm6_add (struct rte_lpm6 lpm, uint8_t ip, uint8_t depth, uint8_t next_hop)
int rte_lpm6_delete (struct rte_lpm6 lpm, uint8_t ip, uint8_t depth)
int rte_lpm6_delete_bulk_func (struct rte_lpm6 lpm, uint8_t ips[ ][RTE_LPM6_IPV6_ADDR_SIZE],
uint8_t depths, unsigned n)
void rte_lpm6_delete_all (struct rte_lpm6 lpm)
int rte_lpm6_lookup (const struct rte_lpm6 lpm, uint8_t ip, uint8_t next_hop)
int rte_lpm6_lookup_bulk_func (const struct rte_lpm6 lpm, uint8_t ips[ ][RTE_LPM6_IPV6_ADDR_S-
IZE], int16_t next_hops, unsigned n)
3.26.1 Detailed Description
RTE Longest Prex Match for IPv6 (LPM6)
3.26.2 Dene Documentation
3.26.2.1 #dene RTE LPM6 NAMESIZE
Max number of characters in LPM name.
3.26.3 Function Documentation
3.26.3.1 struct rte lpm6 rte lpm6 create ( const char name, int socket id, const struct rte_lpm6_cong cong
) [read]
Create an LPM object.
Parameters
name LPM object name
socket_id NUMA socket ID for LPM table memory allocation
cong Structure containing the conguration
Returns
Handle to LPM object on success, NULL otherwise with rte_errno set to an appropriate values. Possible
rte_errno values include:
E_RTE_NO_CONFIG - function could not get pointer to rte_cong structure
E_RTE_SECONDARY - function was called from a secondary process instance
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
249
Intel
DPDK)
API Reference
250
January 2014
Reference Number: 326004-006
rte_lpm6.h File Reference - Intel
DPDK
Returns
0 on success, negative value otherwise
3.26.3.5 int rte lpm6 delete ( struct rte lpm6 lpm, uint8 t ip, uint8 t depth )
Delete a rule from the LPM table.
Parameters
lpm LPM object handle
ip IP of the rule to be deleted from the LPM table
depth Depth of the rule to be deleted from the LPM table
Returns
0 on success, negative value otherwise
3.26.3.6 int rte lpm6 delete bulk func ( struct rte lpm6 lpm, uint8 t ips[ ][RTE LPM6 IPV6 ADDR SIZE], uint8 t
depths, unsigned n )
Delete a rule from the LPM table.
Parameters
lpm LPM object handle
ips Array of IPs to be deleted from the LPM table
depths Array of depths of the rules to be deleted from the LPM table
n Number of rules to be deleted from the LPM table
Returns
0 on success, negative value otherwise.
3.26.3.7 void rte lpm6 delete all ( struct rte lpm6 lpm )
Delete all rules from the LPM table.
Parameters
lpm LPM object handle
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
251
Intel
DPDK)
API Reference
252
January 2014
Reference Number: 326004-006
rte_malloc.h File Reference - Intel
DPDK
void rte_malloc_socket (const char type, size_t size, unsigned align, int socket)
void rte_zmalloc_socket (const char type, size_t size, unsigned align, int socket)
void rte_calloc_socket (const char type, size_t num, size_t size, unsigned align, int socket)
void rte_free (void ptr)
int rte_malloc_validate (void ptr, size_t size)
int rte_malloc_get_socket_stats (int socket, struct rte_malloc_socket_stats socket_stats)
void rte_malloc_dump_stats (const char type)
int rte_malloc_set_limit (const char type, size_t max)
3.27.1 Detailed Description
RTE Malloc. This library provides methods for dynamically allocating memory from hugepages.
3.27.2 Function Documentation
3.27.2.1 void rte malloc ( const char type, size t size, unsigned align )
This function allocates memory from the huge-page area of memory. The memory is not cleared. In NUMA
systems, the memory allocated resides on the same NUMA socket as the core that calls this function.
Parameters
type A string identifying the type of allocated objects (useful for debug purposes, such as
identifying the cause of a memory leak). Can be NULL.
size Size (in bytes) to be allocated.
align If 0, the return is a pointer that is suitably aligned for any kind of variable (in the same
manner as malloc()). Otherwise, the return is a pointer that is a multiple of align. -
In this case, it must be a power of two. (Minimum alignment is the cacheline size, i.e.
64-bytes)
Returns
NULL on error. Not enough memory, or invalid arguments (size is 0, align is not a power of two).
Otherwise, the pointer to the allocated object.
3.27.2.2 void rte zmalloc ( const char type, size t size, unsigned align )
Allocate zeroed memory from the heap.
Equivalent to rte_malloc() except that the memory zone is initialised with zeros. In NUMA systems, the
memory allocated resides on the same NUMA socket as the core that calls this function.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
253
Intel
DPDK)
API Reference
254
January 2014
Reference Number: 326004-006
rte_malloc.h File Reference - Intel
DPDK
align If 0, the return is a pointer that is suitably aligned for any kind of variable (in the same
manner as malloc()). Otherwise, the return is a pointer that is a multiple of align. In
this case, it must obviously be a power of two. (Minimum alignment is the cacheline size,
i.e. 64-bytes)
Returns
NULL on error. Not enough memory, or invalid arguments (size is 0, align is not a power of two).
Otherwise, the pointer to the reallocated memory.
3.27.2.5 void rte malloc socket ( const char type, size t size, unsigned align, int socket )
This function allocates memory from the huge-page area of memory. The memory is not cleared.
Parameters
type A string identifying the type of allocated objects (useful for debug purposes, such as
identifying the cause of a memory leak). Can be NULL.
size Size (in bytes) to be allocated.
align If 0, the return is a pointer that is suitably aligned for any kind of variable (in the same
manner as malloc()). Otherwise, the return is a pointer that is a multiple of align. -
In this case, it must be a power of two. (Minimum alignment is the cacheline size, i.e.
64-bytes)
socket NUMA socket to allocate memory on. If SOCKET_ID_ANY is used, this function will
behave the same as rte_malloc().
Returns
NULL on error. Not enough memory, or invalid arguments (size is 0, align is not a power of two).
Otherwise, the pointer to the allocated object.
3.27.2.6 void rte zmalloc socket ( const char type, size t size, unsigned align, int socket )
Allocate zeroed memory from the heap.
Equivalent to rte_malloc() except that the memory zone is initialised with zeros.
Parameters
type A string identifying the type of allocated objects (useful for debug purposes, such as
identifying the cause of a memory leak). Can be NULL.
size Size (in bytes) to be allocated.
align If 0, the return is a pointer that is suitably aligned for any kind of variable (in the same
manner as malloc()). Otherwise, the return is a pointer that is a multiple of align. In
this case, it must obviously be a power of two. (Minimum alignment is the cacheline size,
i.e. 64-bytes)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
255
Intel
DPDK)
API Reference
256
January 2014
Reference Number: 326004-006
rte_malloc.h File Reference - Intel
DPDK
3.27.2.9 int rte malloc validate ( void ptr, size t size )
If malloc debug is enabled, check a memory block for header and trailer markers to indicate that all is well
with the block. If size is non-null, also return the size of the block.
Parameters
ptr pointer to the start of a data block, must have been returned by a previous call to rte_-
malloc(), rte_zmalloc(), rte_calloc() or rte_realloc()
size if non-null, and memory block pointer is valid, returns the size of the memory block
Returns
-1 on error, invalid pointer passed or header and trailer markers are missing or corrupted 0 on success
3.27.2.10 int rte malloc get socket stats ( int socket, struct rte_malloc_socket_stats socket stats )
Get heap statistics for the specied heap.
Parameters
socket An unsigned integer specifying the socket to get heap statistics for
socket_stats A structure which provides memory to store statistics
Returns
Null on error Pointer to structure storing statistics on success
3.27.2.11 void rte malloc dump stats ( const char type )
Dump statistics.
Dump for the specied type to the console. If the type argument is NULL, all memory types will be dumped.
Parameters
type A string identifying the type of objects to dump, or NULL to dump all objects.
3.27.2.12 int rte malloc set limit ( const char type, size t max )
Set the maximum amount of allocated memory for this type.
This is not yet implemented
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
257
Intel
DPDK)
API Reference
258
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
#dene TX_IP_LEN_CMP_MASK
#dene RTE_MBUF_FROM_BADDR(ba)
#dene RTE_MBUF_TO_BADDR(mb)
#dene RTE_MBUF_INDIRECT(mb)
#dene RTE_MBUF_DIRECT(mb)
#dene __rte_mbuf_sanity_check(m, t, is_h)
#dene __rte_mbuf_sanity_check_raw(m, t, is_h)
#dene RTE_MBUF_ASSERT(exp)
#dene RTE_MBUF_PREFETCH_TO_FREE(m)
#dene rte_ctrlmbuf_data(m)
#dene rte_ctrlmbuf_len(m)
#dene rte_pktmbuf_mtod(m, t)
#dene rte_pktmbuf_pkt_len(m)
#dene rte_pktmbuf_data_len(m)
Enumerations
enum rte_mbuf_type { RTE_MBUF_CTRL, RTE_MBUF_PKT }
Functions
static uint16_t rte_mbuf_refcnt_update (struct rte_mbuf m, int16_t value)
static uint16_t rte_mbuf_refcnt_read (const struct rte_mbuf m)
static void rte_mbuf_refcnt_set (struct rte_mbuf m, uint16_t new_value)
void rte_mbuf_sanity_check (const struct rte_mbuf m, enum rte_mbuf_type t, int is_header)
void rte_ctrlmbuf_init (struct rte_mempool mp, void opaque_arg, void m, unsigned i)
static struct rte_mbuf rte_ctrlmbuf_alloc (struct rte_mempool mp)
static void rte_ctrlmbuf_free (struct rte_mbuf m)
void rte_pktmbuf_init (struct rte_mempool mp, void opaque_arg, void m, unsigned i)
void rte_pktmbuf_pool_init (struct rte_mempool mp, void opaque_arg)
static void rte_pktmbuf_reset (struct rte_mbuf m)
static struct rte_mbuf rte_pktmbuf_alloc (struct rte_mempool mp)
static void rte_pktmbuf_attach (struct rte_mbuf mi, struct rte_mbuf md)
static void rte_pktmbuf_detach (struct rte_mbuf m)
static void rte_pktmbuf_free_seg (struct rte_mbuf m)
static void rte_pktmbuf_free (struct rte_mbuf m)
static struct rte_mbuf rte_pktmbuf_clone (struct rte_mbuf md, struct rte_mempool mp)
static void rte_pktmbuf_refcnt_update (struct rte_mbuf m, int16_t v)
static uint16_t rte_pktmbuf_headroom (const struct rte_mbuf m)
static uint16_t rte_pktmbuf_tailroom (const struct rte_mbuf m)
static struct rte_mbuf rte_pktmbuf_lastseg (struct rte_mbuf m)
static char rte_pktmbuf_prepend (struct rte_mbuf m, uint16_t len)
static char rte_pktmbuf_append (struct rte_mbuf m, uint16_t len)
static char rte_pktmbuf_adj (struct rte_mbuf m, uint16_t len)
static int rte_pktmbuf_trim (struct rte_mbuf m, uint16_t len)
static int rte_pktmbuf_is_contiguous (const struct rte_mbuf m)
void rte_pktmbuf_dump (const struct rte_mbuf m, unsigned dump_len)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
259
Intel
DPDK)
API Reference
260
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
3.28.2.7 #dene PKT RX IPV4 HDR EXT
RX packet with extended IPv4 header.
3.28.2.8 #dene PKT RX IPV6 HDR
RX packet with IPv6 header.
3.28.2.9 #dene PKT RX IPV6 HDR EXT
RX packet with extended IPv6 header.
3.28.2.10 #dene PKT RX IEEE1588 PTP
RX IEEE1588 L2 Ethernet PT Packet.
3.28.2.11 #dene PKT RX IEEE1588 TMST
RX IEEE1588 L2/L4 timestamped packet.
3.28.2.12 #dene PKT TX VLAN PKT
TX packet is a 802.1q VLAN packet.
3.28.2.13 #dene PKT TX IP CKSUM
IP cksum of TX pkt. computed by NIC.
3.28.2.14 #dene PKT TX L4 MASK
Mask bits for L4 checksum ofoad request.
3.28.2.15 #dene PKT TX L4 NO CKSUM
Disable L4 cksum of TX pkt.
3.28.2.16 #dene PKT TX TCP CKSUM
TCP cksum of TX pkt. computed by NIC.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
261
Intel
DPDK)
API Reference
262
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
3.28.2.27 #dene RTE MBUF DIRECT( mb )
Returns TRUE if given mbuf is direct, or FALSE otherwise.
3.28.2.28 #dene rte mbuf sanity check( m, t, is h )
check mbuf type in debug mode
3.28.2.29 #dene rte mbuf sanity check raw( m, t, is h )
check mbuf type in debug mode if mbuf pointer is not null
3.28.2.30 #dene RTE MBUF ASSERT( exp )
MBUF asserts in debug mode
3.28.2.31 #dene RTE MBUF PREFETCH TO FREE( m )
Mbuf prefetch
3.28.2.32 #dene rte ctrlmbuf data( m )
A macro that returns the pointer to the carried data.
The value that can be read or assigned.
Parameters
m The control mbuf.
3.28.2.33 #dene rte ctrlmbuf len( m )
A macro that returns the length of the carried data.
The value that can be read or assigned.
Parameters
m The control mbuf.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
263
Intel
DPDK)
API Reference
264
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
3.28.4.1 static uint16 t rte mbuf refcnt update ( struct rte_mbuf m, int16 t value ) [static]
Adds given value to an mbufs refcnt and returns its new value.
Parameters
m Mbuf to update
value Value to add/subtract
Returns
Updated value
3.28.4.2 static uint16 t rte mbuf refcnt read ( const struct rte_mbuf m ) [static]
Reads the value of an mbufs refcnt.
Parameters
m Mbuf to read
Returns
Reference count number.
3.28.4.3 static void rte mbuf refcnt set ( struct rte_mbuf m, uint16 t new value ) [static]
Sets an mbufs refcnt to a dened value.
Parameters
m Mbuf to update
new_value Value set
3.28.4.4 void rte mbuf sanity check ( const struct rte_mbuf m, enum rte_mbuf_type t, int is header )
Sanity checks on an mbuf.
Check the consistency of the given mbuf. The function will cause a panic if corruption is detected.
Parameters
m The mbuf to be checked.
t The expected type of the mbuf.
is_header True if the mbuf is a packet header, false if it is a sub-segment of a packet (in this case,
some elds like nb_segs are not checked)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
265
Intel
DPDK)
API Reference
266
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
Parameters
mp The mempool from which mbufs originate.
opaque_arg A pointer that can be used by the user to retrieve useful information for mbuf initialization.
This pointer comes from the init_arg parameter of rte_mempool_create().
m The mbuf to initialize.
i The index of the mbuf in the pool table.
3.28.4.9 void rte pktmbuf pool init ( struct rte_mempool mp, void opaque arg )
A packet mbuf pool constructor.
This function initializes the mempool private data in the case of a pktmbuf pool. This private data is needed
by the driver. The function is given as a callback function to rte_mempool_create() at pool creation. It can
be extended by the user, for example, to provide another packet size.
Parameters
mp The mempool from which mbufs originate.
opaque_arg A pointer that can be used by the user to retrieve useful information for mbuf initialization.
This pointer comes from the init_arg parameter of rte_mempool_create().
3.28.4.10 static void rte pktmbuf reset ( struct rte_mbuf m ) [static]
Reset the elds of a packet mbuf to their default values.
The given mbuf must have only one segment.
Parameters
m The packet mbuf to be resetted.
3.28.4.11 static struct rte_mbuf rte pktmbuf alloc ( struct rte_mempool mp ) [static, read]
Allocate a new mbuf (type is pkt) from a mempool.
This new mbuf contains one segment, which has a length of 0. The pointer to data is initialized to have
some bytes of headroom in the buffer (if buffer size allows).
Parameters
mp The mempool from which the mbuf is allocated.
Returns
The pointer to the new mbuf on success.
NULL if allocation failed.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
267
Intel
DPDK)
API Reference
268
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
Parameters
m The packet mbuf to be freed.
3.28.4.16 static struct rte_mbuf rte pktmbuf clone ( struct rte_mbuf md, struct rte_mempool mp )
[static, read]
Creates a "clone" of the given packet mbuf.
Walks through all segments of the given packet mbuf, and for each of them:
Creates a new packet mbuf from the given pool.
Attaches newly created mbuf to the segment. Then updates pkt_len and nb_segs of the "clone" packet
mbuf to match values from the original packet mbuf.
Parameters
md The packet mbuf to be cloned.
mp The mempool from which the "clone" mbufs are allocated.
Returns
The pointer to the new "clone" mbuf on success.
NULL if allocation fails.
3.28.4.17 static void rte pktmbuf refcnt update ( struct rte_mbuf m, int16 t v ) [static]
Adds given value to the refcnt of all packet mbuf segments.
Walks through all segments of given packet mbuf and for each of them invokes rte_mbuf_refcnt_update().
Parameters
m The packet mbuf whose refcnt to be updated.
v The value to add to the mbufs segments refcnt.
3.28.4.18 static uint16 t rte pktmbuf headroom ( const struct rte_mbuf m ) [static]
Get the headroom in a packet mbuf.
Parameters
m The packet mbuf.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
269
Intel
DPDK)
API Reference
270
January 2014
Reference Number: 326004-006
rte_mbuf.h File Reference - Intel
DPDK
3.28.4.22 static char rte pktmbuf append ( struct rte_mbuf m, uint16 t len ) [static]
Append len bytes to an mbuf.
Append len bytes to an mbuf and return a pointer to the start address of the added data. If there is not
enough tailroom in the last segment, the function will return NULL, without modifying the mbuf.
Parameters
m The packet mbuf.
len The amount of data to append (in bytes).
Returns
A pointer to the start of the newly appended data, or NULL if there is not enough tailroom space in the
last segment
3.28.4.23 static char rte pktmbuf adj ( struct rte_mbuf m, uint16 t len ) [static]
Remove len bytes at the beginning of an mbuf.
Returns a pointer to the start address of the new data area. If the length is greater than the length of the
rst segment, then the function will fail and return NULL, without modifying the mbuf.
Parameters
m The packet mbuf.
len The amount of data to remove (in bytes).
Returns
A pointer to the new start of the data.
3.28.4.24 static int rte pktmbuf trim ( struct rte_mbuf m, uint16 t len ) [static]
Remove len bytes of data at the end of the mbuf.
If the length is greater than the length of the last segment, the function will fail and return -1 without modifying
the mbuf.
Parameters
m The packet mbuf.
len The amount of data to remove (in bytes).
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
271
Intel
DPDK)
API Reference
272
January 2014
Reference Number: 326004-006
rte_memcpy.h File Reference - Intel
DPDK
3.29.1 Detailed Description
Functions for SSE implementation of memcpy().
3.29.2 Dene Documentation
3.29.2.1 #dene rte memcpy( dst, src, n )
Copy bytes from one location to another. The locations must not overlap.
Note
This is implemented as a macro, so its address should not be taken and care is needed as parameter
expressions may be evaluated multiple times.
Parameters
dst Pointer to the destination of the data.
src Pointer to the source data.
n Number of bytes to copy.
Returns
Pointer to the destination data.
3.29.3 Function Documentation
3.29.3.1 static void rte mov16 ( uint8 t dst, const uint8 t src ) [static]
Copy 16 bytes from one location to another using optimised SSE instructions. The locations should not
overlap.
Parameters
dst Pointer to the destination of the data.
src Pointer to the source data.
3.29.3.2 static void rte mov32 ( uint8 t dst, const uint8 t src ) [static]
Copy 32 bytes from one location to another using optimised SSE instructions. The locations should not
overlap.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
273
Intel
DPDK)
API Reference
274
January 2014
Reference Number: 326004-006
rte_memory.h File Reference - Intel
DPDK
3.30 rte memory.h File Reference
Data Structures
struct rte_memseg
Denes
#dene SOCKET_ID_ANY
#dene CACHE_LINE_SIZE
#dene CACHE_LINE_MASK
#dene CACHE_LINE_ROUNDUP(size)
#dene __rte_cache_aligned
Typedefs
typedef uint64_t phys_addr_t
Functions
struct rte_memseg rte_eal_get_physmem_layout (void)
void rte_dump_physmem_layout (void)
uint64_t rte_eal_get_physmem_size (void)
unsigned rte_memory_get_nchannel (void)
unsigned rte_memory_get_nrank (void)
3.30.1 Detailed Description
Memory-related RTE API.
3.30.2 Dene Documentation
3.30.2.1 #dene SOCKET ID ANY
Any NUMA socket.
3.30.2.2 #dene CACHE LINE SIZE
Cache line size.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
275
Intel
DPDK)
API Reference
276
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
Returns
The total amount of available physical memory in bytes.
3.30.4.4 unsigned rte memory get nchannel ( void )
Get the number of memory channels.
Returns
The number of memory channels on the system. The value is 0 if unknown or not the same on all
devices.
3.30.4.5 unsigned rte memory get nrank ( void )
Get the number of memory ranks.
Returns
The number of memory ranks on the system. The value is 0 if unknown or not the same on all devices.
3.31 rte mempool.h File Reference
Data Structures
struct rte_mempool_cache
struct rte_mempool_objsz
struct rte_mempool
Denes
#dene RTE_MEMPOOL_HEADER_COOKIE1
#dene RTE_MEMPOOL_HEADER_COOKIE2
#dene RTE_MEMPOOL_TRAILER_COOKIE
#dene RTE_MEMPOOL_NAMESIZE
#dene MEMPOOL_PG_NUM_DEFAULT
#dene MEMPOOL_F_NO_SPREAD
#dene MEMPOOL_F_NO_CACHE_ALIGN
#dene MEMPOOL_F_SP_PUT
#dene MEMPOOL_F_SC_GET
#dene MEMPOOL_HEADER_SIZE(mp, pgn)
#dene MEMPOOL_IS_CONTIG(mp)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
277
Intel
DPDK)
API Reference
278
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
3.31.1 Detailed Description
RTE Mempool.
A memory pool is an allocator of xed-size object. It is identied by its name, and uses a ring to store free
objects. It provides some other optional services, like a per-core object cache, and an alignment helper to
ensure that objects are padded to spread them equally on all RAM channels, ranks, and so on.
Objects owned by a mempool should never be added in another mempool. When an object is freed using
rte_mempool_put() or equivalent, the object data is not modied; the user can save some meta-data in the
object data and retrieve them when allocating a new object.
Note: the mempool implementation is not preemptable. A lcore must not be interrupted by another task
that uses the same mempool (because it uses a ring which is not preemptable). Also, mempool functions
must not be used outside the DPDK environment: for example, in linuxapp environment, a thread that is
not created by the EAL must not use mempools. This is due to the per-lcore cache that wont work as
rte_lcore_id() will not return a correct value.
3.31.2 Dene Documentation
3.31.2.1 #dene RTE MEMPOOL HEADER COOKIE1
Header cookie.
3.31.2.2 #dene RTE MEMPOOL HEADER COOKIE2
Header cookie.
3.31.2.3 #dene RTE MEMPOOL TRAILER COOKIE
Trailer cookie.
3.31.2.4 #dene RTE MEMPOOL NAMESIZE
Maximum length of a memory pool.
3.31.2.5 #dene MEMPOOL PG NUM DEFAULT
Mempool over one chunk of physically continuous memory
3.31.2.6 #dene MEMPOOL F NO SPREAD
Do not spread in memory.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
279
Intel
DPDK)
API Reference
280
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
3.31.4 Function Documentation
3.31.4.1 static struct rte_mempool rte mempool from obj ( void obj ) [static, read]
Return a pointer to the mempool owning this object.
Parameters
obj An object that is owned by a pool. If this is not the case, the behavior is undened.
Returns
A pointer to the mempool structure.
3.31.4.2 struct rte_mempool rte mempool create ( const char name, unsigned n, unsigned elt size,
unsigned cache size, unsigned private data size, rte_mempool_ctor_t mp init, void mp init arg,
rte_mempool_obj_ctor_t obj init, void obj init arg, int socket id, unsigned ags ) [read]
Creates a new mempool named name in memory.
This function uses memzone_reserve() to allocate memory. The pool contains n elements of elt_size. -
Its size is set to n. All elements of the mempool are allocated together with the mempool header, in one
physically continuous chunk of memory.
Parameters
name The name of the mempool.
n The number of elements in the mempool. The optimum size (in terms of memory usage)
for a mempool is when n is a power of two minus one: n = (2
q - 1).
elt_size The size of each element.
cache_size If cache_size is non-zero, the rte_mempool library will try to limit the accesses to the
common lockless pool, by maintaining a per-lcore object cache. This argument must
be lower or equal to CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE. It is advised to
choose cache_size to have "n modulo cache_size == 0": if this is not the case, some
elements will always stay in the pool and will never be used. The access to the per-
lcore table is of course faster than the multi-producer/consumer pool. The cache can be
disabled if the cache_size argument is set to 0; it can be useful to avoid loosing objects
in cache. Note that even if not used, the memory space for cache is always reserved in
a mempool structure, except if CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE is set
to 0.
private_data_-
size
The size of the private data appended after the mempool structure. This is useful for
storing some private data after the mempool structure, as is done for rte_mbuf_pool for
example.
mp_init A function pointer that is called for initialization of the pool, before object initialization.
The user can initialize the private data in this function if needed. This parameter can be
NULL if not needed.
mp_init_arg An opaque pointer to data that can be used in the mempool constructor function.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
281
Intel
DPDK)
API Reference
282
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
This function uses memzone_reserve() to allocate memory. The pool contains n elements of elt_size. Its
size is set to n. Depending on the input parameters, mempool elements can be either allocated together
with the mempool header, or an externally provided memory buffer could be used to store mempool objects.
In later case, that external memory buffer can consist of set of disjoint phyiscal pages.
Parameters
name The name of the mempool.
n The number of elements in the mempool. The optimum size (in terms of memory usage)
for a mempool is when n is a power of two minus one: n = (2
q - 1).
elt_size The size of each element.
cache_size If cache_size is non-zero, the rte_mempool library will try to limit the accesses to the
common lockless pool, by maintaining a per-lcore object cache. This argument must
be lower or equal to CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE. It is advised to
choose cache_size to have "n modulo cache_size == 0": if this is not the case, some
elements will always stay in the pool and will never be used. The access to the per-
lcore table is of course faster than the multi-producer/consumer pool. The cache can be
disabled if the cache_size argument is set to 0; it can be useful to avoid loosing objects
in cache. Note that even if not used, the memory space for cache is always reserved in
a mempool structure, except if CONFIG_RTE_MEMPOOL_CACHE_MAX_SIZE is set
to 0.
private_data_-
size
The size of the private data appended after the mempool structure. This is useful for
storing some private data after the mempool structure, as is done for rte_mbuf_pool for
example.
mp_init A function pointer that is called for initialization of the pool, before object initialization.
The user can initialize the private data in this function if needed. This parameter can be
NULL if not needed.
mp_init_arg An opaque pointer to data that can be used in the mempool constructor function.
obj_init A function pointer that is called for each object at initialization of the pool. The user can
set some meta data in objects if needed. This parameter can be NULL if not needed.
The obj_init() function takes the mempool pointer, the init_arg, the object pointer and the
object number as parameters.
obj_init_arg An opaque pointer to data that can be used as an argument for each call to the object
constructor function.
socket_id The socket_id argument is the socket identier in the case of NUMA. The value can
be SOCKET_ID_ANY if there is no NUMA constraint for the reserved zone.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
283
Intel
DPDK)
API Reference
284
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
3.31.4.5 static void rte mempool mp put bulk ( struct rte_mempool mp, void const obj table, unsigned n )
[static]
Put several objects back in the mempool (multi-producers safe).
Parameters
mp A pointer to the mempool structure.
obj_table A pointer to a table of void pointers (objects).
n The number of objects to add in the mempool from the obj_table.
3.31.4.6 static void rte mempool sp put bulk ( struct rte_mempool mp, void const obj table, unsigned n )
[static]
Put several objects back in the mempool (NOT multi-producers safe).
Parameters
mp A pointer to the mempool structure.
obj_table A pointer to a table of void pointers (objects).
n The number of objects to add in the mempool from obj_table.
3.31.4.7 static void rte mempool put bulk ( struct rte_mempool mp, void const obj table, unsigned n )
[static]
Put several objects back in the mempool.
This function calls the multi-producer or the single-producer version depending on the default behavior that
was specied at mempool creation time (see ags).
Parameters
mp A pointer to the mempool structure.
obj_table A pointer to a table of void pointers (objects).
n The number of objects to add in the mempool from obj_table.
3.31.4.8 static void rte mempool mp put ( struct rte_mempool mp, void obj ) [static]
Put one object in the mempool (multi-producers safe).
Parameters
mp A pointer to the mempool structure.
obj A pointer to the object to be added.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
285
Intel
DPDK)
API Reference
286
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
If cache is enabled, objects will be retrieved rst from cache, subsequently from the common pool. Note that
it can return -ENOENT when the local cache and common pool are empty, even if cache from other lcores
are full.
Parameters
mp A pointer to the mempool structure.
obj_table A pointer to a table of void pointers (objects) that will be lled.
n The number of objects to get from the mempool to obj_table.
Returns
0: Success; objects taken.
-ENOENT: Not enough entries in the mempool; no object is retrieved.
3.31.4.13 static int rte mempool get bulk ( struct rte_mempool mp, void obj table, unsigned n ) [static]
Get several objects from the mempool.
This function calls the multi-consumers or the single-consumer version, depending on the default behaviour
that was specied at mempool creation time (see ags).
If cache is enabled, objects will be retrieved rst from cache, subsequently from the common pool. Note that
it can return -ENOENT when the local cache and common pool are empty, even if cache from other lcores
are full.
Parameters
mp A pointer to the mempool structure.
obj_table A pointer to a table of void pointers (objects) that will be lled.
n The number of objects to get from the mempool to obj_table.
Returns
0: Success; objects taken
-ENOENT: Not enough entries in the mempool; no object is retrieved.
3.31.4.14 static int rte mempool mc get ( struct rte_mempool mp, void obj p ) [static]
Get one object from the mempool (multi-consumers safe).
If cache is enabled, objects will be retrieved rst from cache, subsequently from the common pool. Note that
it can return -ENOENT when the local cache and common pool are empty, even if cache from other lcores
are full.
Parameters
mp A pointer to the mempool structure.
obj_p A pointer to a void pointer (object) that will be lled.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
287
Intel
DPDK)
API Reference
288
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
When cache is enabled, this function has to browse the length of all lcores, so it should not be used in a
data path, but only for debug purposes.
Parameters
mp A pointer to the mempool structure.
Returns
The number of entries in the mempool.
3.31.4.18 static unsigned rte mempool free count ( const struct rte_mempool mp ) [static]
Return the number of free entries in the mempool ring. i.e. how many entries can be freed back to the
mempool.
NOTE: This corresponds to the number of elements allocated from the memory pool, not the number of
elements in the pool itself. To count the number elements currently available in the pool, use "rte_mempool-
_count"
When cache is enabled, this function has to browse the length of all lcores, so it should not be used in a
data path, but only for debug purposes.
Parameters
mp A pointer to the mempool structure.
Returns
The number of free entries in the mempool.
3.31.4.19 static int rte mempool full ( const struct rte_mempool mp ) [static]
Test if the mempool is full.
When cache is enabled, this function has to browse the length of all lcores, so it should not be used in a
data path, but only for debug purposes.
Parameters
mp A pointer to the mempool structure.
Returns
1: The mempool is full.
0: The mempool is not full.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
289
Intel
DPDK)
API Reference
290
January 2014
Reference Number: 326004-006
rte_mempool.h File Reference - Intel
DPDK
Parameters
mp A pointer to the mempool structure.
Returns
A pointer to the private data.
3.31.4.24 void rte mempool list dump ( void )
Dump the status of all mempools on the console
3.31.4.25 struct rte_mempool rte mempool lookup ( const char name ) [read]
Search a mempool from its name
Parameters
name The name of the mempool.
Returns
The pointer to the mempool matching the name, or NULL if not found. NULL on error with rte_errno set
appropriately. Possible rte_errno values include:
ENOENT - required entry not available to return.
3.31.4.26 uint32 t rte mempool calc obj size ( uint32 t elt size, uint32 t ags, struct rte_mempool_objsz sz )
Given a desired size of the mempool element and mempool ags, caluclates header, trailer, body and total
sizes of the mempool object.
Parameters
elt_size The size of each element.
ags The ags used for the mempool creation. Consult rte_mempool_create() for more
information about possible values. The size of each element.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
291
Intel
DPDK)
API Reference
292
January 2014
Reference Number: 326004-006
rte_memzone.h File Reference - Intel
DPDK
Data Structures
struct rte_memzone
Denes
#dene RTE_MEMZONE_2MB
#dene RTE_MEMZONE_1GB
#dene RTE_MEMZONE_SIZE_HINT_ONLY
#dene RTE_MEMZONE_NAMESIZE
Functions
struct rte_memzone rte_memzone_reserve (const char name, size_t len, int socket_id, unsigned
ags)
struct rte_memzone rte_memzone_reserve_aligned (const char name, size_t len, int socket_id,
unsigned ags, unsigned align)
struct rte_memzone rte_memzone_reserve_bounded (const char name, size_t len, int socket_id,
unsigned ags, unsigned align, unsigned bound)
struct rte_memzone rte_memzone_lookup (const char name)
void rte_memzone_dump (void)
3.32.1 Detailed Description
RTE Memzone
The goal of the memzone allocator is to reserve contiguous portions of physical memory. These zones are
identied by a name.
The memzone descriptors are shared by all partitions and are located in a known place of physical memory.
This zone is accessed using rte_eal_get_conguration(). The lookup (by name) of a memory zone can be
done in any partition and returns the same physical address.
A reserved memory zone cannot be unreserved. The reservation shall be done at initialization time only.
3.32.2 Dene Documentation
3.32.2.1 #dene RTE MEMZONE 2MB
Use 2MB pages.
3.32.2.2 #dene RTE MEMZONE 1GB
Use 1GB pages.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
293
Intel
DPDK)
API Reference
294
January 2014
Reference Number: 326004-006
rte_memzone.h File Reference - Intel
DPDK
3.32.3.2 struct rte_memzone rte memzone reserve aligned ( const char name, size t len, int socket id,
unsigned ags, unsigned align ) [read]
Reserve a portion of physical memory with alignment on a specied boundary.
This function reserves some memory with alignment on a specied boundary, and returns a pointer to a
correctly lled memzone descriptor. If the allocation cannot be done or if the alignment is not a power of 2,
returns NULL. Note: A reserved zone cannot be freed.
Parameters
name The name of the memzone. If it already exists, the function will fail and return NULL.
len The size of the memory to be reserved. If it is 0, the biggest contiguous zone will be
reserved.
socket_id The socket identier in the case of NUMA. The value can be SOCKET_ID_ANY if there
is no NUMA constraint for the reserved zone.
ags The ags parameter is used to request memzones to be taken from 1GB or 2MB
hugepages.
RTE_MEMZONE_2MB - Reserve from 2MB pages
RTE_MEMZONE_1GB - Reserve from 1GB pages
RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if
the requested page size is unavailable. If this ag is not set, the function will return
error on an unavailable size request.
align Alignment for resulting memzone. Must be a power of 2.
Returns
A pointer to a correctly-lled read-only memzone descriptor, or NULL on error. On error case, rte_errno
will be set appropriately:
E_RTE_NO_CONFIG - function could not get pointer to rte_cong structure
E_RTE_SECONDARY - function was called from a secondary process instance
ENOSPC - the maximum number of memzones has already been allocated
EEXIST - a memzone with the same name already exists
ENOMEM - no appropriate memory area found in which to create memzone
EINVAL - invalid parameters
3.32.3.3 struct rte_memzone rte memzone reserve bounded ( const char name, size t len, int socket id,
unsigned ags, unsigned align, unsigned bound ) [read]
Reserve a portion of physical memory with specied alignment and boundary.
This function reserves some memory with specied alignment and boundary, and returns a pointer to a
correctly lled memzone descriptor. If the allocation cannot be done or if the alignment or boundary are not
a power of 2, returns NULL. Memory buffer is reserved in a way, that it wouldnt cross specied boundary.
That implies that requested length should be less or equal then boundary. Note: A reserved zone cannot be
freed.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
295
Intel
DPDK)
API Reference
296
January 2014
Reference Number: 326004-006
rte_meter.h File Reference - Intel
DPDK
3.32.3.5 void rte memzone dump ( void )
Dump all reserved memzones to the console.
3.33 rte meter.h File Reference
Data Structures
struct rte_meter_srtcm_params
struct rte_meter_trtcm_params
struct rte_meter_srtcm
struct rte_meter_trtcm
Enumerations
enum rte_meter_color { e_RTE_METER_GREEN, e_RTE_METER_YELLOW, e_RTE_METER_RE-
D, e_RTE_METER_COLORS }
Functions
int rte_meter_srtcm_cong (struct rte_meter_srtcm m, struct rte_meter_srtcm_params params)
int rte_meter_trtcm_cong (struct rte_meter_trtcm m, struct rte_meter_trtcm_params params)
static enum rte_meter_color rte_meter_srtcm_color_blind_check (struct rte_meter_srtcm m, uint64_t
time, uint32_t pkt_len)
static enumrte_meter_color rte_meter_srtcm_color_aware_check (struct rte_meter_srtcmm, uint64-
_t time, uint32_t pkt_len, enum rte_meter_color pkt_color)
static enum rte_meter_color rte_meter_trtcm_color_blind_check (struct rte_meter_trtcm m, uint64_t
time, uint32_t pkt_len)
static enum rte_meter_color rte_meter_trtcm_color_aware_check (struct rte_meter_trtcm m, uint64-
_t time, uint32_t pkt_len, enum rte_meter_color pkt_color)
3.33.1 Detailed Description
RTE Trafc Metering
Trafc metering algorithms: 1. Single Rate Three Color Marker (srTCM): dened by IETF RFC 2697 2. Two
Rate Three Color Marker (trTCM): dened by IETF RFC 2698
3.33.2 Enumeration Type Documentation
3.33.2.1 enum rte_meter_color
Packet Color Set
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
297
Intel
DPDK)
API Reference
298
January 2014
Reference Number: 326004-006
rte_meter.h File Reference - Intel
DPDK
Returns
Color assigned to the current IP packet
3.33.3.4 static enum rte_meter_color rte meter srtcm color aware check ( struct rte_meter_srtcm m, uint64 t
time, uint32 t pkt len, enum rte_meter_color pkt color ) [static]
srTCM color aware trafc metering
Parameters
m Handle to srTCM instance
time Current CPU time stamp (measured in CPU cycles)
pkt_length Length of the current IP packet (measured in bytes)
pkt_color Input color of the current IP packet
Returns
Color assigned to the current IP packet
3.33.3.5 static enum rte_meter_color rte meter trtcm color blind check ( struct rte_meter_trtcm m, uint64 t
time, uint32 t pkt len ) [static]
trTCM color blind trafc metering
Parameters
m Handle to trTCM instance
time Current CPU time stamp (measured in CPU cycles)
pkt_length Length of the current IP packet (measured in bytes)
Returns
Color assigned to the current IP packet
3.33.3.6 static enum rte_meter_color rte meter trtcm color aware check ( struct rte_meter_trtcm m, uint64 t
time, uint32 t pkt len, enum rte_meter_color pkt color ) [static]
trTCM color aware trafc metering
Parameters
m Handle to trTCM instance
time Current CPU time stamp (measured in CPU cycles)
pkt_length Length of the current IP packet (measured in bytes)
pkt_color Input color of the current IP packet
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
299
Intel
DPDK)
API Reference
300
January 2014
Reference Number: 326004-006
rte_pci.h File Reference - Intel
DPDK
Variables
struct pci_driver_list driver_list
struct pci_device_list device_list
3.34.1 Detailed Description
RTE PCI Interface
3.34.2 Dene Documentation
3.34.2.1 #dene SYSFS PCI DEVICES
Pathname of PCI devices directory.
3.34.2.2 #dene PCI PRI FMT
Formatting string for PCI device identier: Ex: 0000:00:01.0
3.34.2.3 #dene PCI SHORT PRI FMT
Short formatting string, without domain, for PCI device: Ex: 00:01.0
3.34.2.4 #dene PCI FMT NVAL
Nb. of values in PCI device identier format string.
3.34.2.5 #dene PCI RESOURCE FMT NVAL
Nb. of values in PCI resource format.
3.34.2.6 #dene PCI MAX RESOURCE
Maximum number of PCI resources.
3.34.2.7 #dene PCI ANY ID
Any PCI device identier (vendor, device, ...)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
301
Intel
DPDK)
API Reference
302
January 2014
Reference Number: 326004-006
rte_pci.h File Reference - Intel
DPDK
Returns
0 on success, negative on error.
3.34.4.4 static int eal parse pci DomBDF ( const char input, struct rte_pci_addr dev addr ) [static]
Utility function to produce a PCI Bus-Device-Function value given a string representation. Assumes that the
BDF is provided including a domain prex.
Parameters
input The input string to be parsed. Should have the format XXXX:XX:XX.X
dev_addr The PCI Bus-Device-Function address to be returned
Returns
0 on success, negative on error.
3.34.4.5 int rte eal pci probe ( void )
Probe the PCI bus for registered drivers.
Scan the content of the PCI bus, and call the probe() function for all registered drivers that have a matching
entry in its id_table for discovered devices.
Returns
0 on success.
Negative on error.
3.34.4.6 void rte eal pci dump ( void )
Dump the content of the PCI bus.
3.34.4.7 void rte eal pci register ( struct rte_pci_driver driver )
Register a PCI driver.
Parameters
driver A pointer to a rte_pci_driver structure describing the driver to be registered.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
303
Intel
DPDK)
API Reference
304
January 2014
Reference Number: 326004-006
rte_per_lcore.h File Reference - Intel
DPDK
virtual machine. The inclusion of these in an array built using this le depends on the denition of RTE_-
PCI_DEV_ID_DECL_EM RTE_PCI_DEV_ID_DECL_IGB RTE_PCI_DEV_ID_DECL_IGBVF RTE_PCI_D-
EV_ID_DECL_IXGBE RTE_PCI_DEV_ID_DECL_IXGBEVF RTE_PCI_DEV_ID_DECL_VIRTIO at the time
when this le is included.
In order to populate an array, the user of this le must dene this macro: RTE_PCI_DEV_ID_DECL_IXGB-
E(vendorID, deviceID). For example:
struct device {
int vend;
int dev;
};
struct device devices[] = {
#define RTE_PCI_DEV_ID_DECL_IXGBE(vendorID, deviceID) {vend, dev},
#include <rte_pci_dev_ids.h>
};
Note that this le can be included multiple times within the same le.
3.35.2 Dene Documentation
3.35.2.1 #dene PCI VENDOR ID INTEL
Vendor ID used by Intel devices
3.35.2.2 #dene PCI VENDOR ID QUMRANET
Vendor ID used by virtio devices
3.35.2.3 #dene PCI VENDOR ID VMWARE
Vendor ID used by VMware devices
3.36 rte per lcore.h File Reference
Denes
#dene RTE_DEFINE_PER_LCORE(type, name)
#dene RTE_DECLARE_PER_LCORE(type, name)
#dene RTE_PER_LCORE(name)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
305
Intel
DPDK)
API Reference
306
January 2014
Reference Number: 326004-006
rte_power.h File Reference - Intel
DPDK
3.37.2 Function Documentation
3.37.2.1 int rte power init ( unsigned lcore id )
Initialize power management for a specic lcore. It will check and set the governor to userspace for the lcore,
get the available frequencies, and prepare to set new lcore frequency.
Parameters
lcore_id lcore id.
Returns
0 on success.
Negative on error.
3.37.2.2 int rte power exit ( unsigned lcore id )
Exit power management on a specic lcore. It will set the governor to which is before initialized.
Parameters
lcore_id lcore id.
Returns
0 on success.
Negative on error.
3.37.2.3 uint32 t rte power freqs ( unsigned lcore id, uint32 t freqs, uint32 t num )
Get the available frequencies of a specic lcore. The return value will be the minimal one of the total number
of available frequencies and the number of buffer. The index of available frequencies used in other interfaces
should be in the range of 0 to this return value. It should be protected outside of this function for threadsafe.
Parameters
lcore_id lcore id.
freqs The buffer array to save the frequencies.
num The number of frequencies to get.
Returns
The number of available frequencies.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
307
Intel
DPDK)
API Reference
308
January 2014
Reference Number: 326004-006
rte_power.h File Reference - Intel
DPDK
3.37.2.7 int rte power freq down ( unsigned lcore id )
Scale down the frequency of a specic lcore according to the available frequencies. It should be protected
outside of this function for threadsafe.
Parameters
lcore_id lcore id.
Returns
1 on success with frequency changed.
0 on success without frequency chnaged.
Negative on error.
3.37.2.8 int rte power freq max ( unsigned lcore id )
Scale up the frequency of a specic lcore to the highest according to the available frequencies. It should be
protected outside of this function for threadsafe.
Parameters
lcore_id lcore id.
Returns
1 on success with frequency changed.
0 on success without frequency chnaged.
Negative on error.
3.37.2.9 int rte power freq min ( unsigned lcore id )
Scale down the frequency of a specic lcore to the lowest according to the available frequencies. It should
be protected outside of this function for threadsafe.
Parameters
lcore_id lcore id.
Returns
1 on success with frequency changed.
0 on success without frequency chnaged.
Negative on error.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
309
Intel
DPDK)
API Reference
310
January 2014
Reference Number: 326004-006
rte_red.h File Reference - Intel
DPDK
3.39 rte random.h File Reference
Functions
static void rte_srand (uint64_t seedval)
static uint64_t rte_rand (void)
3.39.1 Detailed Description
Pseudo-random Generators in RTE
3.39.2 Function Documentation
3.39.2.1 static void rte srand ( uint64 t seedval ) [static]
Seed the pseudo-random generator.
The generator is automatically seeded by the EAL init with a timer value. It may need to be re-seeded by
the user with a real random value.
Parameters
seedval The value of the seed.
3.39.2.2 static uint64 t rte rand ( void ) [static]
Get a pseudo-random value.
This function generates pseudo-random numbers using the linear congruential algorithm and 48-bit integer
arithmetic, called twice to generate a 64-bit value.
Returns
A pseudo-random value between 0 and (1<<64)-1.
3.40 rte red.h File Reference
Data Structures
struct rte_red_params
struct rte_red_cong
struct rte_red
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
311
Intel
DPDK)
API Reference
312
January 2014
Reference Number: 326004-006
rte_red.h File Reference - Intel
DPDK
3.40.2.3 #dene RTE RED MAX TH MAX
Max threshold limit in xed point format
3.40.2.4 #dene RTE RED WQ LOG2 MIN
Min inverse lter weight value
3.40.2.5 #dene RTE RED WQ LOG2 MAX
Max inverse lter weight value
3.40.2.6 #dene RTE RED MAXP INV MIN
Min inverse mark probability value
3.40.2.7 #dene RTE RED MAXP INV MAX
Max inverse mark probability value
3.40.2.8 #dene RTE RED 2POW16
2 power 16
3.40.3 Function Documentation
3.40.3.1 int rte red rt data init ( struct rte_red red )
Initialises run-time data.
Parameters
in,out data pointer to RED runtime data
Returns
Operation status
Return values
0 success
!0 error
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
313
Intel
22 - 1)
3.40.3.4 static uint16 t rte red calc qempty factor ( uint8 t wq log2, uint16 t m ) [static]
calculate factor to scale average queue size when queue becomes empty
Parameters
in wq_log2,where EWMA lter weight wq = 1/(2
wq_log2)
in m exponent in the computed value (1 - wq)
m
Intel
DPDK)
API Reference
314
January 2014
Reference Number: 326004-006
rte_red.h File Reference - Intel
DPDK
Returns
computed value
Return values
((1 - wq)
m) scaled in xed-point format
Basic math tells us that: a
b = 2
(b log2(a) )
in our case: a = (1-Wq) b = m Wq = 1/ (2
log2n)
So we are computing this equation: factor = 2
( m log2(1-Wq))
First we are computing: n = m log2(1-Wq)
To avoid dealing with signed numbers log2 values are positive but they should be negative because (1-Wq)
is always < 1. Contents of log2 table values are also scaled for precision.
The tricky part is computing 2
n, for this I split n into integer part and fraction part. f - is fraction part of n n -
is integer part of original n
Now using basic math we compute 2
n: 2
(f+n) = 2
f 2
n 2
n - can be replaced
with bit shift right oeprations
3.40.3.5 static int rte red enqueue empty ( const struct rte_red_cong red cfg, struct rte_red red, const
uint64 t time ) [static]
Updates queue average in condition when queue is empty.
Note: packet is never dropped in this particular case.
Parameters
in cong pointer to a RED conguration parameter structure
in,out data pointer to RED runtime data
in time current time stamp
Returns
Operation status
Return values
0 enqueue the packet
1 drop the packet based on max threshold criterion
2 drop the packet based on mark probability criterion
We compute avg but we dont compare avg against min_th or max_th, nor calculate drop probability
m is the number of packets that might have arrived while the queue was empty. In this case we have time
stamps provided by scheduler in byte units (bytes transmitted on network port). Such time stamp translates
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
315
Intel
DPDK)
API Reference
316
January 2014
Reference Number: 326004-006
rte_red.h File Reference - Intel
DPDK
Returns
Operation status
Return values
0 enqueue the packet
1 drop the packet based on max threshold criterion
2 drop the packet based on mark probability criterion
EWMA lter (Sally Floyd and Van Jacobson): avg = (1 - wq) avg + wq q avg = avg + q wq - avg wq
We select: wq = 2
N - avg_s 2
(-n)
By using shift left/right operations, we get: avg_s = avg_s + (q << N) - (avg_s >> n) avg_s += (q << N) -
(avg_s >> n)
3.40.3.8 static int rte red enqueue ( const struct rte_red_cong red cfg, struct rte_red red, const unsigned q,
const uint64 t time ) [static]
Decides if new packet should be enqeued or dropped Updates run time data based on new queue size
value. Based on new queue average and RED conguration parameters gives verdict whether to enqueue
or drop the packet.
Parameters
in cong pointer to a RED conguration parameter structure
in,out data pointer to RED runtime data
in q updated queue size in packets
in time current time stamp
Returns
Operation status
Return values
0 enqueue the packet
1 drop the packet based on max threshold criteria
2 drop the packet based on mark probability criteria
3.40.3.9 static void rte red mark queue empty ( struct rte_red red, const uint64 t time ) [static]
Callback to records time that queue became empty.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
317
Intel
DPDK)
API Reference
318
January 2014
Reference Number: 326004-006
rte_ring.h File Reference - Intel
DPDK
static int rte_ring_dequeue (struct rte_ring r, void obj_p)
static int rte_ring_full (const struct rte_ring r)
static int rte_ring_empty (const struct rte_ring r)
static unsigned rte_ring_count (const struct rte_ring r)
static unsigned rte_ring_free_count (const struct rte_ring r)
void rte_ring_list_dump (void)
struct rte_ring rte_ring_lookup (const char name)
static int rte_ring_mp_enqueue_burst (struct rte_ring r, void const obj_table, unsigned n)
static int rte_ring_sp_enqueue_burst (struct rte_ring r, void const obj_table, unsigned n)
static int rte_ring_enqueue_burst (struct rte_ring r, void const obj_table, unsigned n)
static int rte_ring_mc_dequeue_burst (struct rte_ring r, void obj_table, unsigned n)
static int rte_ring_sc_dequeue_burst (struct rte_ring r, void obj_table, unsigned n)
static int rte_ring_dequeue_burst (struct rte_ring r, void obj_table, unsigned n)
3.41.1 Detailed Description
RTE Ring
The Ring Manager is a xed-size queue, implemented as a table of pointers. Head and tail pointers are
modied atomically, allowing concurrent access to it. It has the following features:
FIFO (First In First Out)
Maximum size is xed; the pointers are stored in a table.
Lockless implementation.
Multi- or single-consumer dequeue.
Multi- or single-producer enqueue.
Bulk dequeue.
Bulk enqueue.
Note: the ring implementation is not preemptable. A lcore must not be interrupted by another task that uses
the same ring.
3.41.2 Dene Documentation
3.41.2.1 #dene RTE RING NAMESIZE
The maximum length of a ring name.
3.41.2.2 #dene RING F SP ENQ
The default enqueue is "single-producer".
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
319
Intel
DPDK)
API Reference
320
January 2014
Reference Number: 326004-006
rte_ring.h File Reference - Intel
DPDK
EINVAL - count provided is not a power of 2
ENOSPC - the maximum number of memzones has already been allocated
EEXIST - a memzone with the same name already exists
ENOMEM - no appropriate memory area found in which to create memzone
3.41.3.2 int rte ring set water mark ( struct rte_ring r, unsigned count )
Change the high water mark.
If count is 0, water marking is disabled. Otherwise, it is set to the count value. The count value must
be greater than 0 and less than the ring size.
This function can be called at any time (not necessarily at initialization).
Parameters
r A pointer to the ring structure.
count The new water mark value.
Returns
0: Success; water mark changed.
-EINVAL: Invalid water mark value.
3.41.3.3 void rte ring dump ( const struct rte_ring r )
Dump the status of the ring to the console.
Parameters
r A pointer to the ring structure.
3.41.3.4 static int rte ring mp enqueue bulk ( struct rte_ring r, void const obj table, unsigned n ) [static]
Enqueue several objects on the ring (multi-producers safe).
This function uses a "compare and set" instruction to move the producer index atomically.
Parameters
r A pointer to the ring structure.
obj_table A pointer to a table of void pointers (objects).
n The number of objects to add in the ring from the obj_table.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
321
Intel
DPDK)
API Reference
322
January 2014
Reference Number: 326004-006
rte_ring.h File Reference - Intel
DPDK
3.41.3.7 static int rte ring mp enqueue ( struct rte_ring r, void obj ) [static]
Enqueue one object on a ring (multi-producers safe).
This function uses a "compare and set" instruction to move the producer index atomically.
Parameters
r A pointer to the ring structure.
obj A pointer to the object to be added.
Returns
0: Success; objects enqueued.
-EDQUOT: Quota exceeded. The objects have been enqueued, but the high water mark is
exceeded.
-ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
3.41.3.8 static int rte ring sp enqueue ( struct rte_ring r, void obj ) [static]
Enqueue one object on a ring (NOT multi-producers safe).
Parameters
r A pointer to the ring structure.
obj A pointer to the object to be added.
Returns
0: Success; objects enqueued.
-EDQUOT: Quota exceeded. The objects have been enqueued, but the high water mark is
exceeded.
-ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
3.41.3.9 static int rte ring enqueue ( struct rte_ring r, void obj ) [static]
Enqueue one object on a ring.
This function calls the multi-producer or the single-producer version, depending on the default behaviour
that was specied at ring creation time (see ags).
Parameters
r A pointer to the ring structure.
obj A pointer to the object to be added.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
323
Intel
DPDK)
API Reference
324
January 2014
Reference Number: 326004-006
rte_ring.h File Reference - Intel
DPDK
Parameters
r A pointer to the ring structure.
obj_table A pointer to a table of void pointers (objects) that will be lled.
n The number of objects to dequeue from the ring to the obj_table.
Returns
0: Success; objects dequeued.
-ENOENT: Not enough entries in the ring to dequeue, no object is dequeued.
3.41.3.13 static int rte ring mc dequeue ( struct rte_ring r, void obj p ) [static]
Dequeue one object from a ring (multi-consumers safe).
This function uses a "compare and set" instruction to move the consumer index atomically.
Parameters
r A pointer to the ring structure.
obj_p A pointer to a void pointer (object) that will be lled.
Returns
0: Success; objects dequeued.
-ENOENT: Not enough entries in the ring to dequeue; no object is dequeued.
3.41.3.14 static int rte ring sc dequeue ( struct rte_ring r, void obj p ) [static]
Dequeue one object from a ring (NOT multi-consumers safe).
Parameters
r A pointer to the ring structure.
obj_p A pointer to a void pointer (object) that will be lled.
Returns
0: Success; objects dequeued.
-ENOENT: Not enough entries in the ring to dequeue, no object is dequeued.
3.41.3.15 static int rte ring dequeue ( struct rte_ring r, void obj p ) [static]
Dequeue one object from a ring.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
325
Intel
DPDK)
API Reference
326
January 2014
Reference Number: 326004-006
rte_ring.h File Reference - Intel
DPDK
Parameters
r A pointer to the ring structure.
Returns
The number of entries in the ring.
3.41.3.19 static unsigned rte ring free count ( const struct rte_ring r ) [static]
Return the number of free entries in a ring.
Parameters
r A pointer to the ring structure.
Returns
The number of free entries in the ring.
3.41.3.20 void rte ring list dump ( void )
Dump the status of all rings on the console
3.41.3.21 struct rte_ring rte ring lookup ( const char name ) [read]
Search a ring from its name
Parameters
name The name of the ring.
Returns
The pointer to the ring matching the name, or NULL if not found, with rte_errno set appropriately. -
Possible rte_errno values include:
ENOENT - required entry not available to return.
3.41.3.22 static int rte ring mp enqueue burst ( struct rte_ring r, void const obj table, unsigned n )
[static]
Enqueue several objects on the ring (multi-producers safe).
This function uses a "compare and set" instruction to move the producer index atomically.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
327
Intel
DPDK)
API Reference
328
January 2014
Reference Number: 326004-006
rte_ring.h File Reference - Intel
DPDK
This function uses a "compare and set" instruction to move the consumer index atomically.
Parameters
r A pointer to the ring structure.
obj_table A pointer to a table of void pointers (objects) that will be lled.
n The number of objects to dequeue from the ring to the obj_table.
Returns
n: Actual number of objects dequeued, 0 if ring is empty
3.41.3.26 static int rte ring sc dequeue burst ( struct rte_ring r, void obj table, unsigned n ) [static]
Dequeue several objects from a ring (NOT multi-consumers safe).When the request objects are more than
the available objects, only dequeue the actual number of objects
Parameters
r A pointer to the ring structure.
obj_table A pointer to a table of void pointers (objects) that will be lled.
n The number of objects to dequeue from the ring to the obj_table.
Returns
n: Actual number of objects dequeued, 0 if ring is empty
3.41.3.27 static int rte ring dequeue burst ( struct rte_ring r, void obj table, unsigned n ) [static]
Dequeue multiple objects from a ring up to a maximum number.
This function calls the multi-consumers or the single-consumer version, depending on the default behaviour
that was specied at ring creation time (see ags).
Parameters
r A pointer to the ring structure.
obj_table A pointer to a table of void pointers (objects) that will be lled.
n The number of objects to dequeue from the ring to the obj_table.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
329
Intel
DPDK)
API Reference
330
January 2014
Reference Number: 326004-006
rte_sched.h File Reference - Intel
DPDK
Parameters
rwl A pointer to the rwlock structure.
3.42.3.2 static void rte rwlock read lock ( rte_rwlock_t rwl ) [static]
Take a read lock. Loop until the lock is held.
Parameters
rwl A pointer to a rwlock structure.
3.42.3.3 static void rte rwlock read unlock ( rte_rwlock_t rwl ) [static]
Release a read lock.
Parameters
rwl A pointer to the rwlock structure.
3.42.3.4 static void rte rwlock write lock ( rte_rwlock_t rwl ) [static]
Take a write lock. Loop until the lock is held.
Parameters
rwl A pointer to a rwlock structure.
3.42.3.5 static void rte rwlock write unlock ( rte_rwlock_t rwl ) [static]
Release a write lock.
Parameters
rwl A pointer to a rwlock structure.
3.43 rte sched.h File Reference
Data Structures
struct rte_sched_subport_params
struct rte_sched_subport_stats
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
331
Intel
DPDK)
API Reference
332
January 2014
Reference Number: 326004-006
rte_sched.h File Reference - Intel
DPDK
Trafc shaping using the token bucket algorithm (one bucket per subport);
Upper limit enforced per trafc class at subport level;
Lower priority trafc classes able to reuse subport bandwidth currently unused by higher priority trafc
classes of the same subport;
When any subport trafc class is oversubscribed (conguration time event), the usage of subport
member pipes with high demand for that trafc class pipes is truncated to a dynamically adjusted
value with no impact to low demand pipes; 3. Pipe:
Typical usage: individual user/subscriber;
Trafc shaping using the token bucket algorithm (one bucket per pipe); 4. Trafc class:
Trafc classes of the same pipe handled in strict priority order;
Upper limit enforced per trafc class at the pipe level;
Lower priority trafc classes able to reuse pipe bandwidth currently unused by higher priority trafc
classes of the same pipe; 5. Queue:
Typical usage: queue hosting packets from one or multiple connections of same trafc class belonging
to the same user;
Weighted Round Robin (WRR) is used to service the queues within same pipe trafc class.
3.43.2 Dene Documentation
3.43.2.1 #dene RTE SCHED TRAFFIC CLASSES PER PIPE
Random Early Detection (RED) Number of trafc classes per pipe (as well as subport). Cannot be changed.
3.43.2.2 #dene RTE SCHED QUEUES PER TRAFFIC CLASS
Number of queues per pipe trafc class. Cannot be changed.
3.43.2.3 #dene RTE SCHED QUEUES PER PIPE
Number of queues per pipe.
3.43.2.4 #dene RTE SCHED PIPE PROFILES PER PORT
Maximum number of pipe proles that can be dened per port. Compile-time congurable.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
333
Intel
DPDK)
API Reference
334
January 2014
Reference Number: 326004-006
rte_sched.h File Reference - Intel
DPDK
3.43.3.4 int rte sched pipe cong ( struct rte sched port port, uint32 t subport id, uint32 t pipe id, int32 t
pipe prole )
Hierarchical scheduler pipe conguration
Parameters
port Handle to port scheduler instance
subport_id Subport ID
pipe_id Pipe ID within subport
pipe_prole ID of port-level pre-congured pipe prole
Returns
0 upon success, error code otherwise
3.43.3.5 uint32 t rte sched port get memory footprint ( struct rte_sched_port_params params )
Hierarchical scheduler memory footprint size per port
Parameters
params Port scheduler conguration parameter structure
Returns
Memory footprint size in bytes upon success, 0 otherwise
3.43.3.6 int rte sched subport read stats ( struct rte sched port port, uint32 t subport id, struct
rte_sched_subport_stats stats, uint32 t tc ov )
Hierarchical scheduler subport statistics read
Parameters
port Handle to port scheduler instance
subport_id Subport ID
stats Pointer to pre-allocated subport statistics structure where the statistics counters should
be stored
tc_ov Pointer to pre-allocated 4-entry array where the oversubscription status for each of the
4 subport trafc classes should be stored.
Returns
0 upon success, error code otherwise
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
335
Intel
DPDK)
API Reference
336
January 2014
Reference Number: 326004-006
rte_sctp.h File Reference - Intel
DPDK
3.43.3.10 int rte sched port enqueue ( struct rte sched port port, struct rte_mbuf pkts, uint32 t n pkts )
Hierarchical scheduler port enqueue. Writes up to n_pkts to port scheduler and returns the number of
packets actually written. For each packet, the port scheduler queue to write the packet to is identied by
reading the hierarchy path from the packet descriptor; if the queue is full or congested and the packet is not
written to the queue, then the packet is automatically dropped without any action required from the caller.
Parameters
port Handle to port scheduler instance
pkts Array storing the packet descriptor handles
n_pkts Number of packets to enqueue from the pkts array into the port scheduler
Returns
Number of packets successfully enqueued
3.43.3.11 int rte sched port dequeue ( struct rte sched port port, struct rte_mbuf pkts, uint32 t n pkts )
Hierarchical scheduler port dequeue. Reads up to n_pkts from the port scheduler and stores them in the
pkts array and returns the number of packets actually read. The pkts array needs to be pre-allocated by the
caller with at least n_pkts entries.
Parameters
port Handle to port scheduler instance
pkts Pre-allocated packet descriptor array where the packets dequeued from the port
scheduler should be stored
n_pkts Number of packets to dequeue from the port scheduler
Returns
Number of packets successfully dequeued and placed in the pkts array
3.44 rte sctp.h File Reference
Data Structures
struct sctp_hdr
3.44.1 Detailed Description
SCTP-related denes
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
337
Intel
DPDK)
API Reference
338
January 2014
Reference Number: 326004-006
rte_spinlock.h File Reference - Intel
DPDK
3.45.3 Function Documentation
3.45.3.1 static void rte spinlock init ( rte_spinlock_t sl ) [static]
Initialize the spinlock to an unlocked state.
Parameters
sl A pointer to the spinlock.
3.45.3.2 static void rte spinlock lock ( rte_spinlock_t sl ) [static]
Take the spinlock.
Parameters
sl A pointer to the spinlock.
3.45.3.3 static void rte spinlock unlock ( rte_spinlock_t sl ) [static]
Release the spinlock.
Parameters
sl A pointer to the spinlock.
3.45.3.4 static int rte spinlock trylock ( rte_spinlock_t sl ) [static]
Try to take the lock.
Parameters
sl A pointer to the spinlock.
Returns
1 if the lock is successfully taken; 0 otherwise.
3.45.3.5 static int rte spinlock is locked ( rte_spinlock_t sl ) [static]
Test if the lock is taken.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
339
Intel
DPDK)
API Reference
340
January 2014
Reference Number: 326004-006
rte_string_fns.h File Reference - Intel
DPDK
3.46 rte string fns.h File Reference
Functions
static int rte_snprintf (char buffer, int buen, const char format,...)
static int rte_strsplit (char string, int stringlen, char tokens, int maxtokens, char delim)
3.46.1 Detailed Description
Denitions of warnings for use of various insecure functions
3.46.2 Function Documentation
3.46.2.1 static int rte snprintf ( char buffer, int buen, const char format, ... ) [static]
Safer version of snprintf that writes up to buen characters to the output buffer and ensures that the resultant
string is null-terminated, that is, it writes at most buen-1 actual string characters to buffer. The return value
is the number of characters which should be written to the buffer, so string truncation can be detected by
the caller by checking if the return value is greater than or equal to the buen.
Parameters
buffer The buffer into which the output is to be written
buen The size of the output buffer
format The format string to be printed to the buffer
Returns
The number of characters written to the buffer, or if the string has been truncated, the number of
characters which would have been written had the buffer been sufciently big.
3.46.2.2 static int rte strsplit ( char string, int stringlen, char tokens, int maxtokens, char delim ) [static]
Takes string "string" parameter and splits it at character "delim" up to maxtokens-1 times - to give
"maxtokens" resulting tokens. Like strtok or strsep functions, this modies its input string, by replacing
instances of "delim" with \0. All resultant tokens are returned in the "tokens" array which must have enough
entries to hold "maxtokens".
Parameters
string The input string to be split into tokens
stringlen The max length of the input buffer
tokens The array to hold the pointers to the tokens in the string
maxtokens The number of elements in the tokens array. At most, maxtokens-1 splits of the string
will be done.
delim The character on which the split of the data will be done
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
341
Intel
DPDK)
API Reference
342
January 2014
Reference Number: 326004-006
rte_tailq.h File Reference - Intel
DPDK
Returns
The return value from rte_eal_tailq_reserve, typecast to the appropriate structure pointer type. NULL
on error, since the tailq_head is the rst element in the rte_tailq_head structure.
3.47.2.2 #dene RTE TAILQ RESERVE BY IDX( idx, struct name )
Utility macro to make reserving a tailqueue for a particular struct easier.
Parameters
idx The tailq idx dened in rte_tail_t to be given to the tail queue.
used by lookup to nd it later
struct_name The name of the list type we are using. (Generally this is the same as the rst parameter
passed to TAILQ_HEAD macro)
Returns
The return value from rte_eal_tailq_reserve, typecast to the appropriate structure pointer type. NULL
on error, since the tailq_head is the rst element in the rte_tailq_head structure.
3.47.2.3 #dene RTE TAILQ LOOKUP( name, struct name )
Utility macro to make looking up a tailqueue for a particular struct easier.
Parameters
name The name of tailq
struct_name The name of the list type we are using. (Generally this is the same as the rst parameter
passed to TAILQ_HEAD macro)
Returns
The return value from rte_eal_tailq_lookup, typecast to the appropriate structure pointer type. NULL on
error, since the tailq_head is the rst element in the rte_tailq_head structure.
3.47.2.4 #dene RTE TAILQ LOOKUP BY IDX( idx, struct name )
Utility macro to make looking up a tailqueue for a particular struct easier.
Parameters
idx The tailq idx dened in rte_tail_t to be given to the tail queue.
struct_name The name of the list type we are using. (Generally this is the same as the rst parameter
passed to TAILQ_HEAD macro)
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
343
Intel
DPDK)
API Reference
344
January 2014
Reference Number: 326004-006
rte_tailq_elem.h File Reference - Intel
DPDK
Get a pointer to a tail queue header of an already reserved tail queue identied by the name given as an
argument. Note: this function, along with rte_tailq_reserve, is not multi-thread safe, and both these functions
should only be called from a single thread at a time
Parameters
name The name of the queue.
Returns
A pointer to the tail queue head structure.
3.47.3.6 struct rte_tailq_head rte eal tailq lookup by idx ( const unsigned idx ) [read]
Lookup for a tail queue.
Get a pointer to a tail queue header of an already reserved tail queue identied by the name given as an
argument. Note: this function, along with rte_tailq_reserve, is not multi-thread safe, and both these functions
should only be called from a single thread at a time
Parameters
idx The tailq idx dened in rte_tail_t to be given to the tail queue.
Returns
A pointer to the tail queue head structure.
3.48 rte tailq elem.h File Reference
3.48.1 Detailed Description
This le contains the type of the tailq elem recognised by DPDK, which can be used to ll out an array of
structures describing the tailq.
In order to populate an array, the user of this le must dene this macro: rte_tailq_elem(idx, name). For
example:
enum rte_tailq_t {
#define rte_tailq_elem(idx, name) idx,
#define rte_tailq_end(idx) idx
#include <rte_tailq_elem.h>
};
const char
*
rte_tailq_names[RTE_MAX_TAILQ] = {
#define rte_tailq_elem(idx, name) name,
#include <rte_tailq_elem.h>
};
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
345
Intel
DPDK)
API Reference
346
January 2014
Reference Number: 326004-006
rte_timer.h File Reference - Intel
DPDK
Functions
void rte_timer_subsystem_init (void)
void rte_timer_init (struct rte_timer tim)
int rte_timer_reset (struct rte_timer tim, uint64_t ticks, enum rte_timer_type type, unsigned tim_lcore,
rte_timer_cb_t fct, void arg)
void rte_timer_reset_sync (struct rte_timer tim, uint64_t ticks, enum rte_timer_type type, unsigned
tim_lcore, rte_timer_cb_t fct, void arg)
int rte_timer_stop (struct rte_timer tim)
void rte_timer_stop_sync (struct rte_timer tim)
int rte_timer_pending (struct rte_timer tim)
void rte_timer_manage (void)
void rte_timer_dump_stats (void)
3.50.1 Detailed Description
RTE Timer
This library provides a timer service to RTE Data Plane execution units that allows the execution of callback
functions asynchronously.
Timers can be periodic or single (one-shot).
The timers can be loaded from one core and executed on another. This has to be specied in the call
to rte_timer_reset().
High precision is possible. NOTE: this depends on the call frequency to rte_timer_manage() that check
the timer expiration for the local core.
If not used in an application, for improved performance, it can be disabled at compilation time by not
calling the rte_timer_manage() to improve performance.
The timer library uses the rte_get_hpet_cycles() function that uses the HPET, when available, to provide a
reliable time reference. [HPET routines are provided by EAL, which falls back to using the chip TSC (time-
stamp counter) as fallback when HPET is not available]
This library provides an interface to add, delete and restart a timer. The API is based on the BSD callout(9)
API with a few differences.
See the RTE architecture documentation for more information about the design of this library.
3.50.2 Dene Documentation
3.50.2.1 #dene RTE TIMER STOP
State: timer is stopped.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
347
Intel
DPDK)
API Reference
348
January 2014
Reference Number: 326004-006
rte_timer.h File Reference - Intel
DPDK
3.50.5.2 void rte timer init ( struct rte_timer tim )
Initialize a timer handle.
The rte_timer_init() function initializes the timer handle tim for use. No operations can be performed on a
timer before it is initialized.
Parameters
tim The timer to initialize.
3.50.5.3 int rte timer reset ( struct rte_timer tim, uint64 t ticks, enum rte_timer_type type, unsigned tim lcore,
rte_timer_cb_t fct, void arg )
Reset and start the timer associated with the timer handle.
The rte_timer_reset() function resets and starts the timer associated with the timer handle tim. When the
timer expires after ticks HPET cycles, the function specied by fct will be called with the argument arg
on core tim_lcore.
If the timer associated with the timer handle is already running (in the RUNNING state), the function will
fail. The user has to check the return value of the function to see if there is a chance that the timer is in the
RUNNING state.
If the timer is being congured on another core (the CONFIG state), it will also fail.
If the timer is pending or stopped, it will be rescheduled with the new parameters.
Parameters
tim The timer handle.
ticks The number of cycles (see rte_get_hpet_hz()) before the callback function is called.
type The type can be either:
PERIODICAL: The timer is automatically reloaded after execution (returns to the
PENDING state)
SINGLE: The timer is one-shot, that is, the timer goes to a STOPPED state after
execution.
tim_lcore The ID of the lcore where the timer callback function has to be executed. If tim_lcore is
LCORE_ID_ANY, the timer library will launch it on a different core for each call (round-
robin).
fct The callback function of the timer.
arg The user argument of the callback function.
Returns
0: Success; the timer is scheduled.
(-1): Timer is in the RUNNING or CONFIG state.
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
349
Intel
DPDK)
API Reference
350
January 2014
Reference Number: 326004-006
rte_udp.h File Reference - Intel
DPDK
3.50.5.6 void rte timer stop sync ( struct rte_timer tim )
Loop until rte_timer_stop() succeeds.
After a call to this function, the timer identied by tim is stopped. See rte_timer_stop() for details.
Parameters
tim The timer handle.
3.50.5.7 int rte timer pending ( struct rte_timer tim )
Test if a timer is pending.
The rte_timer_pending() function tests the PENDING status of the timer handle tim. A PENDING timer is
one that has been scheduled and whose function has not yet been called.
Parameters
tim The timer handle.
Returns
0: The timer is not pending.
1: The timer is pending.
3.50.5.8 void rte timer manage ( void )
Manage the timer list and execute callback functions.
This function must be called periodically from all cores main_loop(). It browses the list of pending timers
and runs all timers that are expired.
The precision of the timer depends on the call frequency of this function. However, the more often the
function is called, the more CPU resources it will use.
3.50.5.9 void rte timer dump stats ( void )
Dump statistics about timers.
3.51 rte udp.h File Reference
Data Structures
struct udp_hdr
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
351
Intel
DPDK)
API Reference
352
January 2014
Reference Number: 326004-006
rte_warnings.h File Reference - Intel
DPDK
3.52.2.5 #dene RTE VER SUFFIX
Extra string to be appended to version number, for example: pre1, EAR, nal etc.
3.52.3 Function Documentation
3.52.3.1 static const char rte version ( void ) [static]
Function returning string of version number: "RTE x.y.z"
Returns
string
3.53 rte warnings.h File Reference
3.53.1 Detailed Description
Denitions of warnings for use of various insecure functions
January 2014
Reference Number: 326004-006
Intel
DPDK)
API Reference
353