요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=================================
Megaraid Common Management Module
=================================
Overview
--------
Different classes of controllers from LSI Logic accept and respond to the
user applications in a similar way. They understand the same firmware control
commands. Furthermore, the applications also can treat different classes of
the controllers uniformly. Hence it is logical to have a single module that
interfaces with the applications on one side and all the low level drivers
on the other.
The advantages, though obvious, are listed for completeness:
i. Avoid duplicate code from the low level drivers.
ii. Unburden the low level drivers from having to export the
character node device and related handling.
iii. Implement any policy mechanisms in one place.
iv. Applications have to interface with only module instead of
multiple low level drivers.
Currently this module (called Common Management Module) is used only to issue
ioctl commands. But this module is envisioned to handle all user space level
interactions. So any 'proc', 'sysfs' implementations will be localized in this
common module.
Credits
-------
::
"Shared code in a third module, a "library module", is an acceptable
solution. modprobe automatically loads dependent modules, so users
running "modprobe driver1" or "modprobe driver2" would automatically
load the shared library module."
- Jeff Garzik ([email protected]), 02.25.2004 LKML
::
"As Jeff hinted, if your userspace<->driver API is consistent between
your new MPT-based RAID controllers and your existing megaraid driver,
then perhaps you need a single small helper module (lsiioctl or some
better name), loaded by both mptraid and megaraid automatically, which
handles registering the /dev/megaraid node dynamically. In this case,
both mptraid and megaraid would register with lsiioctl for each
adapter discovered, and lsiioctl would essentially be a switch,
redirecting userspace tool ioctls to the appropriate driver."
- Matt Domsch, ([email protected]), 02.25.2004 LKML
Design
------
The Common Management Module is implemented in megaraid_mm.[ch] files. This
module acts as a registry for low level hba drivers. The low level drivers
(currently only megaraid) register each controller with the common module.
The applications interface with the common module via the character device
node exported by the module.
The lower level drivers now understand only a new improved ioctl packet called
uioc_t. The management module converts the older ioctl packets from the older
applications into uioc_t. After driver handles the uioc_t, the common module
will convert that back into the old format before returning to applications.
As new applications evolve and replace the old ones, the old packet format
will be retired.
Common module dedicates one uioc_t packet to each controller registered. This
can easily be more than one. But since megaraid is the only low level driver
today, and it can handle only one ioctl, there is no reason to have more. But
as new controller classes get added, this will be tuned appropriately.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
공통 management module의 목적
1-30서로 다른 LSI Logic controller class는 같은 firmware control command를 이해하고 user application에 비슷하게 응답한다. Application도 controller class를 동일하게 다룰 수 있으므로 application과 여러 low-level driver 사이에 하나의 공통 module을 두는 것이 합리적이다.
Common Management Module은 low-level driver의 중복 code를 없애고, character device node export와 관련 처리를 driver에서 분리하며, policy를 한곳에서 구현하고, application이 여러 driver 대신 한 module에만 연결하게 한다.
현재 module은 ioctl command 발행에만 사용하지만 장차 모든 user-space interaction을 처리하도록 설계됐다. 따라서 `proc`와 `sysfs` 구현도 이 공통 module에 모은다.
Application과 controller driver 사이의 공통 경계입니다.
.. SPDX-License-Identifier: GPL-2.0
=================================
Megaraid Common Management Module
=================================
Overview
--------
Different classes of controllers from LSI Logic accept and respond to the
user applications in a similar way. They understand the same firmware control
commands. Furthermore, the applications also can treat different classes of
the controllers uniformly. Hence it is logical to have a single module that
interfaces with the applications on one side and all the low level drivers
on the other.
The advantages, though obvious, are listed for completeness:
i. Avoid duplicate code from the low level drivers.
ii. Unburden the low level drivers from having to export the
character node device and related handling.
iii. Implement any policy mechanisms in one place.
iv. Applications have to interface with only module instead of
multiple low level drivers.
Currently this module (called Common Management Module) is used only to issue
ioctl commands. But this module is envisioned to handle all user space level
interactions. So any 'proc', 'sysfs' implementations will be localized in this
common module.
공통 helper module 제안의 배경
31-55Jeff Garzik은 2004-02-25 LKML에서 공유 code를 세 번째 library module에 두는 방식을 받아들일 수 있다고 설명했다. `modprobe`가 dependency를 자동 load하므로 사용자가 `modprobe driver1` 또는 `modprobe driver2`를 실행하면 shared module도 자동으로 load된다.
Matt Domsch는 같은 날 MPT 기반 RAID controller와 기존 megaraid의 user space-driver API가 일관된다면 `lsiioctl` 같은 작은 helper module이 적합하다고 제안했다. `mptraid`와 `megaraid`가 발견한 adapter를 helper에 등록하고, helper가 `/dev/megaraid`를 동적으로 등록한 뒤 user-space ioctl을 해당 driver로 전환하는 구조다.
제안된 library module 구조입니다.
Credits
-------
::
"Shared code in a third module, a "library module", is an acceptable
solution. modprobe automatically loads dependent modules, so users
running "modprobe driver1" or "modprobe driver2" would automatically
load the shared library module."
- Jeff Garzik ([email protected]), 02.25.2004 LKML
::
"As Jeff hinted, if your userspace<->driver API is consistent between
your new MPT-based RAID controllers and your existing megaraid driver,
then perhaps you need a single small helper module (lsiioctl or some
better name), loaded by both mptraid and megaraid automatically, which
handles registering the /dev/megaraid node dynamically. In this case,
both mptraid and megaraid would register with lsiioctl for each
adapter discovered, and lsiioctl would essentially be a switch,
redirecting userspace tool ioctls to the appropriate driver."
- Matt Domsch, ([email protected]), 02.25.2004 LKML
megaraid_mm registry와 uioc_t 변환
56-77Common Management Module은 `megaraid_mm.[ch]`에 구현되며 low-level HBA driver registry로 동작한다. 현재는 megaraid만 각 controller를 공통 module에 등록한다. Application은 module이 export한 character device node를 통해 접근한다.
Low-level driver는 개선된 ioctl packet `uioc_t`만 이해한다. Management module은 기존 application의 old ioctl packet을 `uioc_t`로 바꾸고 driver 처리 후 다시 old format으로 변환해 반환한다. 새 application이 기존 application을 대체하면 old packet format은 폐기될 예정이다.
Common module은 등록된 controller마다 `uioc_t` packet 하나를 전용으로 둔다. 여러 개로 늘릴 수 있지만 현재 유일한 low-level driver인 megaraid가 ioctl 하나만 처리하므로 더 둘 이유가 없다. 새 controller class가 추가되면 수를 조정할 수 있다.
기존 application과 새 driver packet 사이의 변환입니다.
Design
------
The Common Management Module is implemented in megaraid_mm.[ch] files. This
module acts as a registry for low level hba drivers. The low level drivers
(currently only megaraid) register each controller with the common module.
The applications interface with the common module via the character device
node exported by the module.
The lower level drivers now understand only a new improved ioctl packet called
uioc_t. The management module converts the older ioctl packets from the older
applications into uioc_t. After driver handles the uioc_t, the common module
will convert that back into the old format before returning to applications.
As new applications evolve and replace the old ones, the old packet format
will be retired.
Common module dedicates one uioc_t packet to each controller registered. This
can easily be more than one. But since megaraid is the only low level driver
today, and it can handle only one ioctl, there is no reason to have more. But
as new controller classes get added, this will be tuned appropriately.
요약·해설
megaraid.rst:1-77megaraid 공통 ioctl registry와 uioc_t compatibility 변환 설계를 설명합니다.