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

61. 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 build -Db_lto=true
Next Previous

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