Data Plane Development Kit Logo
22.11.8
  • Getting Started Guide for Linux
  • Getting Started Guide for FreeBSD
  • Getting Started Guide for Windows
  • Sample Applications User Guides
  • Programmer’s Guide
    • 1. Introduction
    • 2. Overview
    • 3. Source Organization
    • 4. Environment Abstraction Layer
    • 5. Service Cores
    • 6. Trace Library
    • 7. RCU Library
    • 8. Ring Library
    • 9. Stack Library
    • 10. Mempool Library
    • 11. Mbuf Library
    • 12. Poll Mode Driver
    • 13. Generic flow API (rte_flow)
    • 14. Switch Representation within DPDK Applications
    • 15. Traffic Metering and Policing API
    • 16. Traffic Management API
    • 17. Wireless Baseband Device Library
    • 18. Cryptography Device Library
    • 19. Compression Device Library
    • 20. RegEx Device Library
    • 21. DMA Device Library
    • 22. General-Purpose Graphics Processing Unit Library
    • 23. Security Library
    • 24. Rawdevice Library
    • 25. Link Bonding Poll Mode Driver Library
    • 26. Timer Library
    • 27. Hash Library
    • 28. Toeplitz Hash Library
    • 29. Elastic Flow Distributor Library
    • 30. Membership Library
    • 31. LPM Library
    • 32. LPM6 Library
    • 33. FIB Library
    • 34. RIB Library
    • 35. Flow Classification Library
    • 36. Packet Distributor Library
    • 37. Reorder Library
    • 38. IP Fragmentation and Reassembly Library
    • 39. Generic Receive Offload Library
    • 40. Generic Segmentation Offload Library
    • 41. Packet Capture Next Generation Library
    • 42. Packet Capture Library
    • 43. Multi-process Support
    • 44. Kernel NIC Interface
    • 45. Thread Safety of DPDK Functions
    • 46. Event Device Library
    • 47. Event Ethernet Rx Adapter Library
    • 48. Event Ethernet Tx Adapter Library
    • 49. Event Timer Adapter Library
    • 50. Event Crypto Adapter Library
    • 51. Quality of Service (QoS) Framework
    • 52. Power Management
    • 53. Packet Classification and Access Control
    • 54. Packet Framework
    • 55. Vhost Library
    • 56. Metrics Library
    • 57. Telemetry Library
    • 58. Berkeley Packet Filter Library
    • 59. IPsec Packet Processing Library
    • 60. Graph Library and Inbuilt Nodes
    • 61. Installing DPDK Using the meson build system
    • 62. Running DPDK Unit Tests with Meson
    • 63. Building Your Own Application
    • 64. Performance Optimization Guidelines
    • 65. Writing Efficient Code
    • 66. Link Time Optimization
    • 67. Profile Your Application
    • 68. Running AddressSanitizer
    • 69. Glossary
  • HowTo Guides
  • DPDK Tools User Guides
  • Testpmd Application User Guide
  • Network Interface Controller Drivers
  • Baseband Device Drivers
  • Crypto Device Drivers
  • Compression Device Drivers
  • vDPA Device Drivers
  • REGEX Device Drivers
  • DMA Device Drivers
  • General-Purpose Graphics Processing Unit Drivers
  • Event Device Drivers
  • Rawdev Drivers
  • Mempool Device Driver
  • Platform Specific Guides
  • Contributor’s Guidelines
  • Release Notes
  • FAQ
Data Plane Development Kit
  • Programmer’s Guide
  • 66. Link Time Optimization
  • View page source

66. Link Time Optimization

The DPDK supports compilation with link time optimization turned on. This depends obviously on the ability of the compiler to do “whole program” optimization at link time and is available only for compilers that support that feature. To be more specific, compiler (in addition to performing LTO) have to support creation of ELF objects containing both normal code and internal representation (called fat-lto-objects in gcc and icc). This is required since during build some code is generated by parsing produced ELF objects (pmdinfogen).

The amount of performance gain that one can get from LTO depends on the compiler and the code that is being compiled. However LTO is also useful for additional code analysis done by the compiler. In particular due to interprocedural analysis compiler can produce additional warnings about variables that might be used uninitialized. Some of these warnings might be “false positives” though and you might need to explicitly initialize variable in order to silence the compiler.

Please note that turning LTO on causes considerable extension of build time.

Link time optimization can be enabled by setting meson built-in ‘b_lto’ option:

meson setup build -Db_lto=true
Previous Next

Built with Sphinx using a theme provided by Read the Docs.