dpio-driver.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. .. include:: <isonum.txt>
  2. DPAA2 DPIO (Data Path I/O) Overview
  3. ===================================
  4. :Copyright: |copy| 2016-2018 NXP
  5. This document provides an overview of the Freescale DPAA2 DPIO
  6. drivers
  7. Introduction
  8. ============
  9. A DPAA2 DPIO (Data Path I/O) is a hardware object that provides
  10. interfaces to enqueue and dequeue frames to/from network interfaces
  11. and other accelerators. A DPIO also provides hardware buffer
  12. pool management for network interfaces.
  13. This document provides an overview the Linux DPIO driver, its
  14. subcomponents, and its APIs.
  15. See Documentation/networking/dpaa2/overview.rst for a general overview of DPAA2
  16. and the general DPAA2 driver architecture in Linux.
  17. Driver Overview
  18. ---------------
  19. The DPIO driver is bound to DPIO objects discovered on the fsl-mc bus and
  20. provides services that:
  21. A) allow other drivers, such as the Ethernet driver, to enqueue and dequeue
  22. frames for their respective objects
  23. B) allow drivers to register callbacks for data availability notifications
  24. when data becomes available on a queue or channel
  25. C) allow drivers to manage hardware buffer pools
  26. The Linux DPIO driver consists of 3 primary components--
  27. DPIO object driver-- fsl-mc driver that manages the DPIO object
  28. DPIO service-- provides APIs to other Linux drivers for services
  29. QBman portal interface-- sends portal commands, gets responses
  30. ::
  31. fsl-mc other
  32. bus drivers
  33. | |
  34. +---+----+ +------+-----+
  35. |DPIO obj| |DPIO service|
  36. | driver |---| (DPIO) |
  37. +--------+ +------+-----+
  38. |
  39. +------+-----+
  40. | QBman |
  41. | portal i/f |
  42. +------------+
  43. |
  44. hardware
  45. The diagram below shows how the DPIO driver components fit with the other
  46. DPAA2 Linux driver components::
  47. +------------+
  48. | OS Network |
  49. | Stack |
  50. +------------+ +------------+
  51. | Allocator |. . . . . . . | Ethernet |
  52. |(DPMCP,DPBP)| | (DPNI) |
  53. +-.----------+ +---+---+----+
  54. . . ^ |
  55. . . <data avail, | |<enqueue,
  56. . . tx confirm> | | dequeue>
  57. +-------------+ . | |
  58. | DPRC driver | . +--------+ +------------+
  59. | (DPRC) | . . |DPIO obj| |DPIO service|
  60. +----------+--+ | driver |-| (DPIO) |
  61. | +--------+ +------+-----+
  62. |<dev add/remove> +------|-----+
  63. | | QBman |
  64. +----+--------------+ | portal i/f |
  65. | MC-bus driver | +------------+
  66. | | |
  67. | /soc/fsl-mc | |
  68. +-------------------+ |
  69. |
  70. =========================================|=========|========================
  71. +-+--DPIO---|-----------+
  72. | | |
  73. | QBman Portal |
  74. +-----------------------+
  75. ============================================================================
  76. DPIO Object Driver (dpio-driver.c)
  77. ----------------------------------
  78. The dpio-driver component registers with the fsl-mc bus to handle objects of
  79. type "dpio". The implementation of probe() handles basic initialization
  80. of the DPIO including mapping of the DPIO regions (the QBman SW portal)
  81. and initializing interrupts and registering irq handlers. The dpio-driver
  82. registers the probed DPIO with dpio-service.
  83. DPIO service (dpio-service.c, dpaa2-io.h)
  84. ------------------------------------------
  85. The dpio service component provides queuing, notification, and buffers
  86. management services to DPAA2 drivers, such as the Ethernet driver. A system
  87. will typically allocate 1 DPIO object per CPU to allow queuing operations
  88. to happen simultaneously across all CPUs.
  89. Notification handling
  90. dpaa2_io_service_register()
  91. dpaa2_io_service_deregister()
  92. dpaa2_io_service_rearm()
  93. Queuing
  94. dpaa2_io_service_pull_fq()
  95. dpaa2_io_service_pull_channel()
  96. dpaa2_io_service_enqueue_fq()
  97. dpaa2_io_service_enqueue_qd()
  98. dpaa2_io_store_create()
  99. dpaa2_io_store_destroy()
  100. dpaa2_io_store_next()
  101. Buffer pool management
  102. dpaa2_io_service_release()
  103. dpaa2_io_service_acquire()
  104. QBman portal interface (qbman-portal.c)
  105. ---------------------------------------
  106. The qbman-portal component provides APIs to do the low level hardware
  107. bit twiddling for operations such as:
  108. -initializing Qman software portals
  109. -building and sending portal commands
  110. -portal interrupt configuration and processing
  111. The qbman-portal APIs are not public to other drivers, and are
  112. only used by dpio-service.
  113. Other (dpaa2-fd.h, dpaa2-global.h)
  114. ----------------------------------
  115. Frame descriptor and scatter-gather definitions and the APIs used to
  116. manipulate them are defined in dpaa2-fd.h.
  117. Dequeue result struct and parsing APIs are defined in dpaa2-global.h.