dpio-driver.rst 5.7 KB
Newer Older
1 2 3 4 5 6 7 8 9
.. include:: <isonum.txt>

DPAA2 DPIO (Data Path I/O) Overview
===================================

:Copyright: |copy| 2016-2018 NXP

This document provides an overview of the Freescale DPAA2 DPIO
drivers
10 11

Introduction
12
============
13 14 15 16 17 18 19 20 21

A DPAA2 DPIO (Data Path I/O) is a hardware object that provides
interfaces to enqueue and dequeue frames to/from network interfaces
and other accelerators.  A DPIO also provides hardware buffer
pool management for network interfaces.

This document provides an overview the Linux DPIO driver, its
subcomponents, and its APIs.

22
See Documentation/networking/dpaa2/overview.rst for a general overview of DPAA2
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
and the general DPAA2 driver architecture in Linux.

Driver Overview
---------------

The DPIO driver is bound to DPIO objects discovered on the fsl-mc bus and
provides services that:
  A) allow other drivers, such as the Ethernet driver, to enqueue and dequeue
     frames for their respective objects
  B) allow drivers to register callbacks for data availability notifications
     when data becomes available on a queue or channel
  C) allow drivers to manage hardware buffer pools

The Linux DPIO driver consists of 3 primary components--
   DPIO object driver-- fsl-mc driver that manages the DPIO object
38

39
   DPIO service-- provides APIs to other Linux drivers for services
40

41
   QBman portal interface-- sends portal commands, gets responses
42
::
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

          fsl-mc          other
           bus           drivers
            |               |
        +---+----+   +------+-----+
        |DPIO obj|   |DPIO service|
        | driver |---|  (DPIO)    |
        +--------+   +------+-----+
                            |
                     +------+-----+
                     |    QBman   |
                     | portal i/f |
                     +------------+
                            |
                         hardware

59

60
The diagram below shows how the DPIO driver components fit with the other
61
DPAA2 Linux driver components::
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
                                                   +------------+
                                                   | OS Network |
                                                   |   Stack    |
                 +------------+                    +------------+
                 | Allocator  |. . . . . . .       |  Ethernet  |
                 |(DPMCP,DPBP)|                    |   (DPNI)   |
                 +-.----------+                    +---+---+----+
                  .          .                         ^   |
                 .            .           <data avail, |   |<enqueue,
                .              .           tx confirm> |   | dequeue>
    +-------------+             .                      |   |
    | DPRC driver |              .    +--------+ +------------+
    |   (DPRC)    |               . . |DPIO obj| |DPIO service|
    +----------+--+                   | driver |-|  (DPIO)    |
               |                      +--------+ +------+-----+
               |<dev add/remove>                 +------|-----+
               |                                 |   QBman    |
          +----+--------------+                  | portal i/f |
          |   MC-bus driver   |                  +------------+
          |                   |                     |
          | /soc/fsl-mc       |                     |
          +-------------------+                     |
                                                    |
 =========================================|=========|========================
                                        +-+--DPIO---|-----------+
                                        |           |           |
                                        |        QBman Portal   |
                                        +-----------------------+

 ============================================================================


DPIO Object Driver (dpio-driver.c)
----------------------------------

   The dpio-driver component registers with the fsl-mc bus to handle objects of
   type "dpio".  The implementation of probe() handles basic initialization
   of the DPIO including mapping of the DPIO regions (the QBman SW portal)
   and initializing interrupts and registering irq handlers.  The dpio-driver
   registers the probed DPIO with dpio-service.

DPIO service  (dpio-service.c, dpaa2-io.h)
------------------------------------------

   The dpio service component provides queuing, notification, and buffers
   management services to DPAA2 drivers, such as the Ethernet driver.  A system
   will typically allocate 1 DPIO object per CPU to allow queuing operations
   to happen simultaneously across all CPUs.

   Notification handling
      dpaa2_io_service_register()
113

114
      dpaa2_io_service_deregister()
115

116 117 118 119
      dpaa2_io_service_rearm()

   Queuing
      dpaa2_io_service_pull_fq()
120

121
      dpaa2_io_service_pull_channel()
122

123
      dpaa2_io_service_enqueue_fq()
124

125
      dpaa2_io_service_enqueue_qd()
126

127
      dpaa2_io_store_create()
128

129
      dpaa2_io_store_destroy()
130

131 132 133 134
      dpaa2_io_store_next()

   Buffer pool management
      dpaa2_io_service_release()
135

136 137 138 139 140 141 142 143
      dpaa2_io_service_acquire()

QBman portal interface (qbman-portal.c)
---------------------------------------

   The qbman-portal component provides APIs to do the low level hardware
   bit twiddling for operations such as:
      -initializing Qman software portals
144

145
      -building and sending portal commands
146

147 148 149 150 151 152 153 154 155 156 157 158
      -portal interrupt configuration and processing

   The qbman-portal APIs are not public to other drivers, and are
   only used by dpio-service.

Other (dpaa2-fd.h, dpaa2-global.h)
----------------------------------

   Frame descriptor and scatter-gather definitions and the APIs used to
   manipulate them are defined in dpaa2-fd.h.

   Dequeue result struct and parsing APIs are defined in dpaa2-global.h.