← Documents Documentation/PCI/endpoint/pci-vntb-function.rst GitHub 원문 ↗

Linux 6.18.37 · PCI

PCI vNTB 기능

한 host와 endpoint 사이에 virtual NTB peer를 만들기 위한 계층, scratchpad·doorbell·memory window와 BAR 배치를 설명합니다.

Source pathDocumentation/PCI/endpoint/pci-vntb-function.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

pci-vntb-function.rst:1-129

vNTB는 한 개의 물리 endpoint 안에 virtual PCI bus와 NTB peer를 구성합니다. Doorbell은 interrupt, memory window는 data, scratchpad는 peer 상태 교환을 담당합니다.

32-bit BAR 모델은 최대 네 memory window를 분리하고, 64-bit 모델은 BAR 쌍으로 config·doorbell·첫 memory window를 배치합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =================
4 PCI vNTB Function
5 =================
6
7 :Author: Frank Li <[email protected]>
8
9 The difference between PCI NTB function and PCI vNTB function is
10
11 PCI NTB function need at two endpoint instances and connect HOST1
12 and HOST2.
13
14 PCI vNTB function only use one host and one endpoint(EP), use NTB
15 connect EP and PCI host
16
17 .. code-block:: text
18
19
20 +------------+ +---------------------------------------+
21 | | | |
22 +------------+ | +--------------+
23 | NTB | | | NTB |
24 | NetDev | | | NetDev |
25 +------------+ | +--------------+
26 | NTB | | | NTB |
27 | Transfer | | | Transfer |
28 +------------+ | +--------------+
29 | | | | |
30 | PCI NTB | | | |
31 | EPF | | | |
32 | Driver | | | PCI Virtual |
33 | | +---------------+ | NTB Driver |
34 | | | PCI EP NTB |<------>| |
35 | | | FN Driver | | |
36 +------------+ +---------------+ +--------------+
37 | | | | | |
38 | PCI BUS | <-----> | PCI EP BUS | | Virtual PCI |
39 | | PCI | | | BUS |
40 +------------+ +---------------+--------+--------------+
41 PCI RC PCI EP
42
43 Constructs used for Implementing vNTB
44 =====================================
45
46 1) Config Region
47 2) Self Scratchpad Registers
48 3) Peer Scratchpad Registers
49 4) Doorbell (DB) Registers
50 5) Memory Window (MW)
51
52
53 Config Region:
54 --------------
55
56 It is same as PCI NTB Function driver
57
58 Scratchpad Registers:
59 ---------------------
60
61 It is appended after Config region.
62
63 .. code-block:: text
64
65
66 +--------------------------------------------------+ Base
67 | |
68 | |
69 | |
70 | Common Config Register |
71 | |
72 | |
73 | |
74 +-----------------------+--------------------------+ Base + span_offset
75 | | |
76 | Peer Span Space | Span Space |
77 | | |
78 | | |
79 +-----------------------+--------------------------+ Base + span_offset
80 | | | + span_count * 4
81 | | |
82 | Span Space | Peer Span Space |
83 | | |
84 +-----------------------+--------------------------+
85 Virtual PCI Pcie Endpoint
86 NTB Driver NTB Driver
87
88
89 Doorbell Registers:
90 -------------------
91
92 Doorbell Registers are used by the hosts to interrupt each other.
93
94 Memory Window:
95 --------------
96
97 Actual transfer of data between the two hosts will happen using the
98 memory window.
99
100 Modeling Constructs:
101 ====================
102
103 32-bit BARs.
104
105 ====== ===============
106 BAR NO CONSTRUCTS USED
107 ====== ===============
108 BAR0 Config Region
109 BAR1 Doorbell
110 BAR2 Memory Window 1
111 BAR3 Memory Window 2
112 BAR4 Memory Window 3
113 BAR5 Memory Window 4
114 ====== ===============
115
116 64-bit BARs.
117
118 ====== ===============================
119 BAR NO CONSTRUCTS USED
120 ====== ===============================
121 BAR0 Config Region + Scratchpad
122 BAR1
123 BAR2 Doorbell
124 BAR3
125 BAR4 Memory Window 1
126 BAR5
127 ====== ===============================
128
129
130

3. 한국어 전문 번역

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

PCI NTB와 vNTB의 차이

1-16

저자는 Frank Li입니다. PCI NTB 기능과 PCI vNTB 기능의 차이는 endpoint와 host를 배치하는 방식에 있습니다.

PCI NTB 기능에는 endpoint 인스턴스 두 개가 필요하며 HOST1과 HOST2를 연결합니다.

PCI vNTB 기능은 host 하나와 endpoint(EP) 하나만 사용하고, NTB를 이용해 EP와 PCI host를 연결합니다.

.. SPDX-License-Identifier: GPL-2.0

=================
PCI vNTB Function
=================

:Author: Frank Li <[email protected]>

The difference between PCI NTB function and PCI vNTB function is

PCI NTB function need at two endpoint instances and connect HOST1
and HOST2.

PCI vNTB function only use one host and one endpoint(EP), use NTB
connect EP and PCI host

RC·EP·virtual PCI bus 구조

17-42

PCI RC의 일반 PCI bus는 PCI link로 EP의 PCI EP bus와 연결됩니다. RC 쪽 `PCI NTB EPF Driver`와 EP 쪽 `PCI EP NTB FN Driver`가 물리 endpoint 경계를 이루고, EP 내부의 `PCI Virtual NTB Driver`가 virtual PCI bus를 제공합니다.

양쪽 상위 계층에는 동일하게 `NTB Transfer`와 `NTB NetDev`가 놓입니다. 따라서 표준 NTB client는 RC와 EP의 virtual PCI 측을 서로 다른 NTB peer처럼 다룰 수 있습니다.

PCI vNTB 계층
PCI RC: PCI BUSPCI linkPCI EP: PCI EP BUSPCI EP NTB FN DriverPCI Virtual NTB DriverVirtual PCI BUS
PCI RC: PCI NTB EPF DriverNTB TransferNTB NetDev
PCI EP: PCI Virtual NTB DriverNTB TransferNTB NetDev

원문의 ASCII 그림을 계층과 연결 관계가 같은 흐름으로 재구성했습니다.

.. code-block:: text


  +------------+         +---------------------------------------+
  |            |         |                                       |
  +------------+         |                        +--------------+
  | NTB        |         |                        | NTB          |
  | NetDev     |         |                        | NetDev       |
  +------------+         |                        +--------------+
  | NTB        |         |                        | NTB          |
  | Transfer   |         |                        | Transfer     |
  +------------+         |                        +--------------+
  |            |         |                        |              |
  |  PCI NTB   |         |                        |              |
  |    EPF     |         |                        |              |
  |   Driver   |         |                        | PCI Virtual  |
  |            |         +---------------+        | NTB Driver   |
  |            |         | PCI EP NTB    |<------>|              |
  |            |         |  FN Driver    |        |              |
  +------------+         +---------------+        +--------------+
  |            |         |               |        |              |
  |  PCI BUS   | <-----> |  PCI EP BUS   |        |  Virtual PCI |
  |            |  PCI    |               |        |     BUS      |
  +------------+         +---------------+--------+--------------+
      PCI RC                        PCI EP

vNTB 구현 구성 요소

43-56

vNTB 구현에는 1) Config Region, 2) Self Scratchpad Registers, 3) Peer Scratchpad Registers, 4) Doorbell(DB) Registers, 5) Memory Window(MW)를 사용합니다.

Config Region은 PCI NTB Function driver의 구성 영역과 같습니다.

vNTB 구성 요소
구성 요소역할
Config Region공통 NTB 구성 정보
Self Scratchpad Registers로컬 측 scratchpad
Peer Scratchpad Registerspeer 측에서 보이는 scratchpad
Doorbell (DB) Registerspeer interrupt 알림
Memory Window (MW)양쪽 사이의 실제 데이터 전송

제어·알림·데이터 전달에 쓰이는 다섯 영역입니다.

Constructs used for Implementing vNTB
=====================================

        1) Config Region
        2) Self Scratchpad Registers
        3) Peer Scratchpad Registers
        4) Doorbell (DB) Registers
        5) Memory Window (MW)


Config Region:
--------------

It is same as PCI NTB Function driver

Scratchpad register 배치

57-88

Scratchpad register는 Config Region 뒤에 덧붙입니다. `Base`부터 `Base + span_offset`까지는 `Common Config Register`이고, 그 뒤 공간을 local span과 peer span이 서로 반대 방향으로 해석합니다.

Virtual PCI NTB Driver가 첫 scratchpad 구간을 `Peer Span Space`로 볼 때 PCIe Endpoint NTB Driver는 같은 구간을 `Span Space`로 봅니다. 다음 구간에서는 이 관계가 뒤바뀌며 경계는 `Base + span_offset + span_count * 4`입니다.

Scratchpad address view
주소 구간Virtual PCI NTB DriverPCIe Endpoint NTB Driver
Base .. Base + span_offsetCommon Config RegisterCommon Config Register
첫 span 구간Peer Span SpaceSpan Space
다음 span 구간Span SpacePeer Span Space
경계Base + span_offset + span_count * 4Base + span_offset + span_count * 4

원문의 좌우 ASCII 배치를 주소 경계별 표로 재구성했습니다.


Scratchpad Registers:
---------------------

It is appended after Config region.

.. code-block:: text


  +--------------------------------------------------+ Base
  |                                                  |
  |                                                  |
  |                                                  |
  |          Common Config Register                  |
  |                                                  |
  |                                                  |
  |                                                  |
  +-----------------------+--------------------------+ Base + span_offset
  |                       |                          |
  |    Peer Span Space    |    Span Space            |
  |                       |                          |
  |                       |                          |
  +-----------------------+--------------------------+ Base + span_offset
  |                       |                          |      + span_count * 4
  |                       |                          |
  |     Span Space        |   Peer Span Space        |
  |                       |                          |
  +-----------------------+--------------------------+
        Virtual PCI             Pcie Endpoint
        NTB Driver               NTB Driver

Doorbell과 Memory Window

89-99

Doorbell register는 host들이 서로에게 interrupt를 발생시키는 데 사용합니다.

두 host 사이의 실제 데이터 전송은 memory window를 통해 이루어집니다.

vNTB 제어와 데이터 경로
Host/RCDoorbell interruptEP virtual peer
Host/RC memoryMemory WindowEP memory

Doorbell은 알림을, memory window는 payload를 전달합니다.

Doorbell Registers:
-------------------

  Doorbell Registers are used by the hosts to interrupt each other.

Memory Window:
--------------

  Actual transfer of data between the two hosts will happen using the
  memory window.

32-bit BAR 모델

100-115

32-bit BAR 모델에서는 여섯 BAR를 각각 하나의 구성 요소에 배정합니다. BAR0은 Config Region, BAR1은 Doorbell이고 BAR2부터 BAR5까지는 Memory Window 1부터 4입니다.

32-bit BAR 배치
BAR 번호사용 구성 요소
BAR0Config Region
BAR1Doorbell
BAR2Memory Window 1
BAR3Memory Window 2
BAR4Memory Window 3
BAR5Memory Window 4

각 BAR가 독립 구성 영역을 가리킵니다.

Modeling Constructs:
====================

32-bit BARs.

======  ===============
BAR NO  CONSTRUCTS USED
======  ===============
BAR0    Config Region
BAR1    Doorbell
BAR2    Memory Window 1
BAR3    Memory Window 2
BAR4    Memory Window 3
BAR5    Memory Window 4
======  ===============

64-bit BAR 모델

116-129

64-bit BAR 모델에서는 BAR 쌍을 사용합니다. BAR0/BAR1 쌍은 Config Region과 Scratchpad, BAR2/BAR3 쌍은 Doorbell, BAR4/BAR5 쌍은 Memory Window 1에 배정됩니다.

64-bit BAR 배치
BAR 쌍사용 구성 요소
BAR0 + BAR1Config Region + Scratchpad
BAR2 + BAR3Doorbell
BAR4 + BAR5Memory Window 1

빈 BAR 행은 바로 앞 64-bit BAR의 상위 절반을 뜻합니다.

64-bit BARs.

======  ===============================
BAR NO  CONSTRUCTS USED
======  ===============================
BAR0    Config Region + Scratchpad
BAR1
BAR2    Doorbell
BAR3
BAR4    Memory Window 1
BAR5
======  ===============================