← Documents Documentation/networking/device_drivers/ethernet/freescale/dpaa2/dpio-driver.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

DPAA2 DPIO (Data Path I/O) Overview

DPAA2 DPIO가 fsl-mc 객체 관리, 다른 드라이버용 큐·알림·버퍼 API, QBman portal의 저수준 하드웨어 접근을 어떻게 분리하는지 설명합니다.

Source pathDocumentation/networking/device_drivers/ethernet/freescale/dpaa2/dpio-driver.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

dpio-driver.rst:1-161

DPIO는 DPAA2에서 프레임 큐와 버퍼 풀을 CPU가 이용하도록 연결하는 하드웨어 객체입니다. Linux 드라이버는 객체 수명 관리를 담당하는 `dpio-driver`, 다른 드라이버에 안정된 API를 제공하는 `dpio-service`, QBman portal을 직접 조작하는 `qbman-portal`의 세 층으로 책임을 나눕니다.

DPIO가 제공하는 세 서비스
서비스역할
큐 처리프레임 enqueue·dequeue
알림큐·채널 데이터 가용성 callback
버퍼 관리하드웨어 버퍼 풀 acquire·release

Ethernet을 비롯한 DPAA2 드라이버가 DPIO를 통해 사용하는 기능입니다.

DPIO 내부 계층
`fsl-mc` busDPIO object driverDPIO serviceQBman portal interfaceDPIO hardware
other driversDPIO serviceQBman portal interfaceDPIO hardware

원문의 첫 번째 ASCII 도식을 책임 경계 중심으로 다시 구성했습니다.

DPAA2 통합 구조
`/soc/fsl-mc`MC-bus driverDPRC driverAllocator `(DPMCP, DPBP)`
OS Network StackEthernet `(DPNI)`DPIO serviceQBman Portal
DPIO object driverDPIO serviceQBman portal interfaceDPIO hardware

원문의 두 번째 ASCII 도식에서 제어 경로와 프레임 경로를 분리했습니다.

객체 초기화 경로
`fsl-mc`에서 `dpio` 발견`probe()`QBman SW portal 매핑IRQ 초기화·handler 등록`dpio-service` 등록

`probe()`가 fsl-mc 객체를 사용할 수 있는 DPIO 서비스로 전환합니다.

CPU별 DPIO 배치
배치효과
CPU 0 → DPIO 0독립 portal에서 큐 연산
CPU 1 → DPIO 1다른 CPU와 동시 처리
CPU N → DPIO N전체 CPU로 처리량 확장

보통 CPU마다 DPIO 객체 하나를 배치해 큐 연산을 병렬화합니다.

DPIO service API 그룹
그룹대표 API
알림`register()` · `deregister()` · `rearm()`
dequeue`pull_fq()` · `pull_channel()` · `store_next()`
enqueue`enqueue_fq()` · `enqueue_qd()`
결과 저장소`store_create()` · `store_destroy()`
버퍼 풀`release()` · `acquire()`

공개 서비스 API는 알림, 큐, 버퍼 풀 세 범주로 나뉩니다.

QBman portal 책임
기능내용
초기화QMan software portal 준비
명령portal 명령 생성·전송과 응답
인터럽트portal IRQ 구성·처리
가시성다른 드라이버에는 비공개

저수준 API는 dpio-service 내부 구현으로만 사용됩니다.

공용 데이터 정의
헤더정의
`dpaa2-fd.h`frame descriptor·scatter-gather와 조작 API
`dpaa2-global.h`dequeue 결과 구조체와 parsing API

프레임과 dequeue 결과의 형식은 별도 헤더가 담당합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

DPAA2 DPIO 소개

1-26

이 문서는 `isonum.txt`를 포함해 저작권 기호를 사용하며, 저작권은 © 2016-2018 NXP에 있습니다.

DPAA2 DPIO(Data Path I/O) 개요

이 문서는 Freescale DPAA2 DPIO 드라이버의 전체 구조를 개괄합니다.

소개

DPAA2 DPIO(Data Path I/O)는 네트워크 인터페이스와 다른 가속기로 프레임을 enqueue하거나 그곳에서 dequeue하기 위한 인터페이스를 제공하는 하드웨어 객체입니다. DPIO는 네트워크 인터페이스용 하드웨어 버퍼 풀 관리 기능도 제공합니다.

여기서는 Linux DPIO 드라이버와 그 하위 구성 요소, 외부에 제공하는 API를 설명합니다.

DPAA2의 일반 개요와 Linux의 전체 DPAA2 드라이버 아키텍처는 `Documentation/networking/device_drivers/ethernet/freescale/dpaa2/overview.rst`를 참고하십시오.

.. 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

Introduction
============

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.

See
Documentation/networking/device_drivers/ethernet/freescale/dpaa2/overview.rst
for a general overview of DPAA2 and the general DPAA2 driver architecture
in Linux.

드라이버 역할과 세 구성 요소

27-62

드라이버 개요

DPIO 드라이버는 `fsl-mc` 버스에서 발견된 DPIO 객체에 바인딩되며 다음 서비스를 제공합니다.

  • A. Ethernet 드라이버 같은 다른 드라이버가 각자의 객체에 프레임을 enqueue하고 dequeue할 수 있게 합니다.
  • B. 큐 또는 채널에 데이터가 도착했을 때 데이터 가용성 알림을 받을 callback을 드라이버가 등록할 수 있게 합니다.
  • C. 드라이버가 하드웨어 버퍼 풀을 관리할 수 있게 합니다.

Linux DPIO 드라이버는 세 가지 주요 구성 요소로 이루어집니다.

구성 요소책임
DPIO object driverDPIO 객체를 관리하는 `fsl-mc` 드라이버
DPIO service다른 Linux 드라이버에 DPIO 서비스를 제공하는 API 계층
QBman portal interfaceportal 명령을 보내고 응답을 받는 저수준 인터페이스

세 구성 요소의 연결은 다음과 같습니다.

DPIO 내부 계층
`fsl-mc` busDPIO object driverDPIO serviceQBman portal interfacehardware
other driversDPIO serviceQBman portal interfacehardware

원문의 첫 번째 ASCII 도식을 객체 관리, 서비스 API, 하드웨어 portal 순서로 다시 구성했습니다.


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

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

   QBman portal interface-- sends portal commands, gets responses::

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

DPAA2 통합 구조와 DPIO 객체 드라이버

63-106

다음 구조는 DPIO 드라이버 구성 요소가 다른 DPAA2 Linux 드라이버와 어떻게 결합되는지를 보여 줍니다.

DPAA2 드라이버 통합
`/soc/fsl-mc`MC-bus driver`dev add/remove`DPRC driverAllocator `(DPMCP, DPBP)`
DPIO object driverDPIO serviceQBman portal interfaceDPIO·QBman Portal hardware
OS Network StackEthernet `(DPNI)``enqueue/dequeue`DPIO serviceQBman Portal
QBman PortalDPIO service`data available/tx confirmation`Ethernet `(DPNI)`OS Network Stack

원문의 두 번째 ASCII 도식을 제어 경로와 데이터 경로로 나누어 다시 구성했습니다.

DPIO 객체 드라이버(`dpio-driver.c`)

`dpio-driver` 구성 요소는 `fsl-mc` 버스에 등록되어 `dpio` 유형 객체를 처리합니다.

`probe()` 구현은 DPIO 영역, 즉 QBman software portal을 매핑하고 인터럽트를 초기화하며 IRQ handler를 등록하는 등 DPIO의 기본 초기화를 수행합니다.

초기화가 끝나면 `dpio-driver`는 probe한 DPIO를 `dpio-service`에 등록합니다.

The diagram below shows how the DPIO driver components fit with the other
DPAA2 Linux driver components::

                                                   +------------+
                                                   | 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 서비스 API, QBman portal과 공용 데이터 정의

107-161

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

DPIO service 구성 요소는 Ethernet 드라이버 같은 DPAA2 드라이버에 큐 처리, 알림, 버퍼 관리 서비스를 제공합니다. 모든 CPU에서 큐 연산을 동시에 수행할 수 있도록 시스템은 보통 CPU마다 DPIO 객체 하나를 할당합니다.

알림 처리

  • `dpaa2_io_service_register()`
  • `dpaa2_io_service_deregister()`
  • `dpaa2_io_service_rearm()`

큐 처리

  • `dpaa2_io_service_pull_fq()`
  • `dpaa2_io_service_pull_channel()`
  • `dpaa2_io_service_enqueue_fq()`
  • `dpaa2_io_service_enqueue_qd()`
  • `dpaa2_io_store_create()`
  • `dpaa2_io_store_destroy()`
  • `dpaa2_io_store_next()`

버퍼 풀 관리

  • `dpaa2_io_service_release()`
  • `dpaa2_io_service_acquire()`

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

`qbman-portal` 구성 요소는 다음 연산에 필요한 저수준 하드웨어 비트 조작 API를 제공합니다.

  • QMan software portal 초기화
  • portal 명령 생성과 전송
  • portal 인터럽트 구성과 처리

`qbman-portal` API는 다른 드라이버에 공개되지 않으며 `dpio-service`만 사용합니다.

기타 정의(`dpaa2-fd.h`, `dpaa2-global.h`)

frame descriptor와 scatter-gather 정의, 그리고 이를 조작하는 API는 `dpaa2-fd.h`에 정의되어 있습니다.

dequeue 결과 구조체와 parsing API는 `dpaa2-global.h`에 정의되어 있습니다.

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()

      dpaa2_io_service_deregister()

      dpaa2_io_service_rearm()

   Queuing
      dpaa2_io_service_pull_fq()

      dpaa2_io_service_pull_channel()

      dpaa2_io_service_enqueue_fq()

      dpaa2_io_service_enqueue_qd()

      dpaa2_io_store_create()

      dpaa2_io_store_destroy()

      dpaa2_io_store_next()

   Buffer pool management
      dpaa2_io_service_release()

      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
      - building and sending portal commands
      - 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.