요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
=======================================
Altera Triple-Speed Ethernet MAC driver
=======================================
Copyright |copy| 2008-2014 Altera Corporation
This is the driver for the Altera Triple-Speed Ethernet (TSE) controllers
using the SGDMA and MSGDMA soft DMA IP components. The driver uses the
platform bus to obtain component resources. The designs used to test this
driver were built for a Cyclone(R) V SOC FPGA board, a Cyclone(R) V FPGA board,
and tested with ARM and NIOS processor hosts separately. The anticipated use
cases are simple communications between an embedded system and an external peer
for status and simple configuration of the embedded system.
For more information visit www.altera.com and www.rocketboards.org. Support
forums for the driver may be found on www.rocketboards.org, and a design used
to test this driver may be found there as well. Support is also available from
the maintainer of this driver, found in MAINTAINERS.
The Triple-Speed Ethernet, SGDMA, and MSGDMA components are all soft IP
components that can be assembled and built into an FPGA using the Altera
Quartus toolchain. Quartus 13.1 and 14.0 were used to build the design that
this driver was tested against. The sopc2dts tool is used to create the
device tree for the driver, and may be found at rocketboards.org.
The driver probe function examines the device tree and determines if the
Triple-Speed Ethernet instance is using an SGDMA or MSGDMA component. The
probe function then installs the appropriate set of DMA routines to
initialize, setup transmits, receives, and interrupt handling primitives for
the respective configurations.
The SGDMA component is to be deprecated in the near future (over the next 1-2
years as of this writing in early 2014) in favor of the MSGDMA component.
SGDMA support is included for existing designs and reference in case a
developer wishes to support their own soft DMA logic and driver support. Any
new designs should not use the SGDMA.
The SGDMA supports only a single transmit or receive operation at a time, and
therefore will not perform as well compared to the MSGDMA soft IP. Please
visit www.altera.com for known, documented SGDMA errata.
Scatter-gather DMA is not supported by the SGDMA or MSGDMA at this time.
Scatter-gather DMA will be added to a future maintenance update to this
driver.
Jumbo frames are not supported at this time.
The driver limits PHY operations to 10/100Mbps, and has not yet been fully
tested for 1Gbps. This support will be added in a future maintenance update.
1. Kernel Configuration
=======================
The kernel configuration option is ALTERA_TSE:
Device Drivers ---> Network device support ---> Ethernet driver support --->
Altera Triple-Speed Ethernet MAC support (ALTERA_TSE)
2. Driver parameters list
=========================
- debug: message level (0: no output, 16: all);
- dma_rx_num: Number of descriptors in the RX list (default is 64);
- dma_tx_num: Number of descriptors in the TX list (default is 64).
3. Command line options
=======================
Driver parameters can be also passed in command line by using::
altera_tse=dma_rx_num:128,dma_tx_num:512
4. Driver information and notes
===============================
4.1. Transmit process
---------------------
When the driver's transmit routine is called by the kernel, it sets up a
transmit descriptor by calling the underlying DMA transmit routine (SGDMA or
MSGDMA), and initiates a transmit operation. Once the transmit is complete, an
interrupt is driven by the transmit DMA logic. The driver handles the transmit
completion in the context of the interrupt handling chain by recycling
resource required to send and track the requested transmit operation.
4.2. Receive process
--------------------
The driver will post receive buffers to the receive DMA logic during driver
initialization. Receive buffers may or may not be queued depending upon the
underlying DMA logic (MSGDMA is able queue receive buffers, SGDMA is not able
to queue receive buffers to the SGDMA receive logic). When a packet is
received, the DMA logic generates an interrupt. The driver handles a receive
interrupt by obtaining the DMA receive logic status, reaping receive
completions until no more receive completions are available.
4.3. Interrupt Mitigation
-------------------------
The driver is able to mitigate the number of its DMA interrupts
using NAPI for receive operations. Interrupt mitigation is not yet supported
for transmit operations, but will be added in a future maintenance release.
4.4) Ethtool support
--------------------
Ethtool is supported. Driver statistics and internal errors can be taken using:
ethtool -S ethX command. It is possible to dump registers etc.
4.5) PHY Support
----------------
The driver is compatible with PAL to work with PHY and GPHY devices.
4.7) List of source files:
--------------------------
- Kconfig
- Makefile
- altera_tse_main.c: main network device driver
- altera_tse_ethtool.c: ethtool support
- altera_tse.h: private driver structure and common definitions
- altera_msgdma.h: MSGDMA implementation function definitions
- altera_sgdma.h: SGDMA implementation function definitions
- altera_msgdma.c: MSGDMA implementation
- altera_sgdma.c: SGDMA implementation
- altera_sgdmahw.h: SGDMA register and descriptor definitions
- altera_msgdmahw.h: MSGDMA register and descriptor definitions
- altera_utils.c: Driver utility functions
- altera_utils.h: Driver utility function definitions
5. Debug Information
====================
The driver exports debug information such as internal statistics,
debug information, MAC and DMA registers etc.
A user may use the ethtool support to get statistics:
e.g. using: ethtool -S ethX (that shows the statistics counters)
or sees the MAC registers: e.g. using: ethtool -d ethX
The developer can also use the "debug" module parameter to get
further debug information.
6. Statistics Support
=====================
The controller and driver support a mix of IEEE standard defined statistics,
RFC defined statistics, and driver or Altera defined statistics. The four
specifications containing the standard definitions for these statistics are
as follows:
- IEEE 802.3-2012 - IEEE Standard for Ethernet.
- RFC 2863 found at http://www.rfc-editor.org/rfc/rfc2863.txt.
- RFC 2819 found at http://www.rfc-editor.org/rfc/rfc2819.txt.
- Altera Triple Speed Ethernet User Guide, found at http://www.altera.com
The statistics supported by the TSE and the device driver are as follows:
"tx_packets" is equivalent to aFramesTransmittedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.2. This statistics is the count of frames that are successfully
transmitted.
"rx_packets" is equivalent to aFramesReceivedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.5. This statistic is the count of frames that are successfully
received. This count does not include any error packets such as CRC errors,
length errors, or alignment errors.
"rx_crc_errors" is equivalent to aFrameCheckSequenceErrors defined in IEEE
802.3-2012, Section 5.2.2.1.6. This statistic is the count of frames that are
an integral number of bytes in length and do not pass the CRC test as the frame
is received.
"rx_align_errors" is equivalent to aAlignmentErrors defined in IEEE 802.3-2012,
Section 5.2.2.1.7. This statistic is the count of frames that are not an
integral number of bytes in length and do not pass the CRC test as the frame is
received.
"tx_bytes" is equivalent to aOctetsTransmittedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.8. This statistic is the count of data and pad bytes
successfully transmitted from the interface.
"rx_bytes" is equivalent to aOctetsReceivedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.14. This statistic is the count of data and pad bytes
successfully received by the controller.
"tx_pause" is equivalent to aPAUSEMACCtrlFramesTransmitted defined in IEEE
802.3-2012, Section 30.3.4.2. This statistic is a count of PAUSE frames
transmitted from the network controller.
"rx_pause" is equivalent to aPAUSEMACCtrlFramesReceived defined in IEEE
802.3-2012, Section 30.3.4.3. This statistic is a count of PAUSE frames
received by the network controller.
"rx_errors" is equivalent to ifInErrors defined in RFC 2863. This statistic is
a count of the number of packets received containing errors that prevented the
packet from being delivered to a higher level protocol.
"tx_errors" is equivalent to ifOutErrors defined in RFC 2863. This statistic
is a count of the number of packets that could not be transmitted due to errors.
"rx_unicast" is equivalent to ifInUcastPkts defined in RFC 2863. This
statistic is a count of the number of packets received that were not addressed
to the broadcast address or a multicast group.
"rx_multicast" is equivalent to ifInMulticastPkts defined in RFC 2863. This
statistic is a count of the number of packets received that were addressed to
a multicast address group.
"rx_broadcast" is equivalent to ifInBroadcastPkts defined in RFC 2863. This
statistic is a count of the number of packets received that were addressed to
the broadcast address.
"tx_discards" is equivalent to ifOutDiscards defined in RFC 2863. This
statistic is the number of outbound packets not transmitted even though an
error was not detected. An example of a reason this might occur is to free up
internal buffer space.
"tx_unicast" is equivalent to ifOutUcastPkts defined in RFC 2863. This
statistic counts the number of packets transmitted that were not addressed to
a multicast group or broadcast address.
"tx_multicast" is equivalent to ifOutMulticastPkts defined in RFC 2863. This
statistic counts the number of packets transmitted that were addressed to a
multicast group.
"tx_broadcast" is equivalent to ifOutBroadcastPkts defined in RFC 2863. This
statistic counts the number of packets transmitted that were addressed to a
broadcast address.
"ether_drops" is equivalent to etherStatsDropEvents defined in RFC 2819.
This statistic counts the number of packets dropped due to lack of internal
controller resources.
"rx_total_bytes" is equivalent to etherStatsOctets defined in RFC 2819.
This statistic counts the total number of bytes received by the controller,
including error and discarded packets.
"rx_total_packets" is equivalent to etherStatsPkts defined in RFC 2819.
This statistic counts the total number of packets received by the controller,
including error, discarded, unicast, multicast, and broadcast packets.
"rx_undersize" is equivalent to etherStatsUndersizePkts defined in RFC 2819.
This statistic counts the number of correctly formed packets received less
than 64 bytes long.
"rx_oversize" is equivalent to etherStatsOversizePkts defined in RFC 2819.
This statistic counts the number of correctly formed packets greater than 1518
bytes long.
"rx_64_bytes" is equivalent to etherStatsPkts64Octets defined in RFC 2819.
This statistic counts the total number of packets received that were 64 octets
in length.
"rx_65_127_bytes" is equivalent to etherStatsPkts65to127Octets defined in RFC
2819. This statistic counts the total number of packets received that were
between 65 and 127 octets in length inclusive.
"rx_128_255_bytes" is equivalent to etherStatsPkts128to255Octets defined in
RFC 2819. This statistic is the total number of packets received that were
between 128 and 255 octets in length inclusive.
"rx_256_511_bytes" is equivalent to etherStatsPkts256to511Octets defined in
RFC 2819. This statistic is the total number of packets received that were
between 256 and 511 octets in length inclusive.
"rx_512_1023_bytes" is equivalent to etherStatsPkts512to1023Octets defined in
RFC 2819. This statistic is the total number of packets received that were
between 512 and 1023 octets in length inclusive.
"rx_1024_1518_bytes" is equivalent to etherStatsPkts1024to1518Octets define
in RFC 2819. This statistic is the total number of packets received that were
between 1024 and 1518 octets in length inclusive.
"rx_gte_1519_bytes" is a statistic defined specific to the behavior of the
Altera TSE. This statistics counts the number of received good and errored
frames between the length of 1519 and the maximum frame length configured
in the frm_length register. See the Altera TSE User Guide for More details.
"rx_jabbers" is equivalent to etherStatsJabbers defined in RFC 2819. This
statistic is the total number of packets received that were longer than 1518
octets, and had either a bad CRC with an integral number of octets (CRC Error)
or a bad CRC with a non-integral number of octets (Alignment Error).
"rx_runts" is equivalent to etherStatsFragments defined in RFC 2819. This
statistic is the total number of packets received that were less than 64 octets
in length and had either a bad CRC with an integral number of octets (CRC
error) or a bad CRC with a non-integral number of octets (Alignment Error).
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Altera TSE driver 개요와 DMA 구성
1-54Altera Triple-Speed Ethernet MAC driver
Copyright © 2008-2014 Altera Corporation
이 driver는 `SGDMA` 및 `MSGDMA` soft DMA IP component를 사용하는 Altera Triple-Speed Ethernet(`TSE`) controller용입니다. Driver는 component resource를 얻기 위해 platform bus를 사용합니다. 시험에 사용한 설계는 Cyclone(R) V SoC FPGA board와 Cyclone(R) V FPGA board를 대상으로 만들었으며, ARM host와 NIOS processor host에서 각각 시험했습니다. 예상 용도는 embedded system과 외부 peer 사이에서 상태 확인과 간단한 embedded system 설정을 주고받는 통신입니다.
자세한 정보는 `www.altera.com`과 `www.rocketboards.org`에서 확인할 수 있습니다. Driver 지원 forum과 시험에 사용한 설계도 `www.rocketboards.org`에서 찾을 수 있습니다. `MAINTAINERS`에 기재된 driver maintainer에게도 지원을 요청할 수 있습니다.
Triple-Speed Ethernet, SGDMA, MSGDMA는 모두 Altera Quartus toolchain으로 FPGA 안에 조립하고 build할 수 있는 soft IP component입니다. 이 driver를 시험한 설계는 Quartus 13.1과 14.0으로 만들었습니다. Driver용 device tree는 `sopc2dts` tool로 생성하며, 이 tool은 `rocketboards.org`에서 구할 수 있습니다.
Driver의 probe function은 device tree를 조사하여 Triple-Speed Ethernet instance가 SGDMA와 MSGDMA 중 무엇을 사용하는지 판단합니다. 이어서 해당 구성에 맞는 DMA routine set을 설치해 초기화, 송신 설정, 수신 설정, interrupt handling primitive를 준비합니다.
문서 작성 시점인 2014년 초 기준으로 SGDMA component는 향후 1~2년 안에 MSGDMA로 대체되어 폐기될 예정이었습니다. 기존 설계와, 개발자가 자체 soft DMA logic 및 driver 지원을 구현할 때 참고할 수 있도록 SGDMA 지원을 포함합니다. 새 설계에서는 SGDMA를 사용하지 않아야 합니다.
SGDMA는 한 번에 송신 또는 수신 작업 하나만 지원하므로 MSGDMA soft IP보다 성능이 낮습니다. 알려진 SGDMA errata는 `www.altera.com`의 문서를 확인하십시오.
현재 SGDMA와 MSGDMA 모두 scatter-gather DMA를 지원하지 않습니다. 향후 driver maintenance update에서 추가될 예정입니다.
현재 jumbo frame도 지원하지 않습니다.
Driver는 PHY 동작을 10/100Mbps로 제한하며 1Gbps 시험은 아직 완전하지 않습니다. 1Gbps 지원 역시 향후 maintenance update에서 추가될 예정입니다.
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
=======================================
Altera Triple-Speed Ethernet MAC driver
=======================================
Copyright |copy| 2008-2014 Altera Corporation
This is the driver for the Altera Triple-Speed Ethernet (TSE) controllers
using the SGDMA and MSGDMA soft DMA IP components. The driver uses the
platform bus to obtain component resources. The designs used to test this
driver were built for a Cyclone(R) V SOC FPGA board, a Cyclone(R) V FPGA board,
and tested with ARM and NIOS processor hosts separately. The anticipated use
cases are simple communications between an embedded system and an external peer
for status and simple configuration of the embedded system.
For more information visit www.altera.com and www.rocketboards.org. Support
forums for the driver may be found on www.rocketboards.org, and a design used
to test this driver may be found there as well. Support is also available from
the maintainer of this driver, found in MAINTAINERS.
The Triple-Speed Ethernet, SGDMA, and MSGDMA components are all soft IP
components that can be assembled and built into an FPGA using the Altera
Quartus toolchain. Quartus 13.1 and 14.0 were used to build the design that
this driver was tested against. The sopc2dts tool is used to create the
device tree for the driver, and may be found at rocketboards.org.
The driver probe function examines the device tree and determines if the
Triple-Speed Ethernet instance is using an SGDMA or MSGDMA component. The
probe function then installs the appropriate set of DMA routines to
initialize, setup transmits, receives, and interrupt handling primitives for
the respective configurations.
The SGDMA component is to be deprecated in the near future (over the next 1-2
years as of this writing in early 2014) in favor of the MSGDMA component.
SGDMA support is included for existing designs and reference in case a
developer wishes to support their own soft DMA logic and driver support. Any
new designs should not use the SGDMA.
The SGDMA supports only a single transmit or receive operation at a time, and
therefore will not perform as well compared to the MSGDMA soft IP. Please
visit www.altera.com for known, documented SGDMA errata.
Scatter-gather DMA is not supported by the SGDMA or MSGDMA at this time.
Scatter-gather DMA will be added to a future maintenance update to this
driver.
Jumbo frames are not supported at this time.
The driver limits PHY operations to 10/100Mbps, and has not yet been fully
tested for 1Gbps. This support will be added in a future maintenance update.
Kernel 설정, parameter와 command line
55-781. Kernel 설정
Kernel configuration option은 `ALTERA_TSE`입니다.
Device Drivers ---> Network device support ---> Ethernet driver support --->
Altera Triple-Speed Ethernet MAC support (ALTERA_TSE)
2. Driver parameter 목록
- `debug`: message level입니다. `0`은 출력 없음, `16`은 모든 message 출력입니다.
- `dma_rx_num`: RX list의 descriptor 수이며 기본값은 `64`입니다.
- `dma_tx_num`: TX list의 descriptor 수이며 기본값은 `64`입니다.
3. Command line option
Driver parameter는 다음과 같이 command line으로도 전달할 수 있습니다.
altera_tse=dma_rx_num:128,dma_tx_num:512
4. Driver 정보와 참고 사항
1. Kernel Configuration
=======================
The kernel configuration option is ALTERA_TSE:
Device Drivers ---> Network device support ---> Ethernet driver support --->
Altera Triple-Speed Ethernet MAC support (ALTERA_TSE)
2. Driver parameters list
=========================
- debug: message level (0: no output, 16: all);
- dma_rx_num: Number of descriptors in the RX list (default is 64);
- dma_tx_num: Number of descriptors in the TX list (default is 64).
3. Command line options
=======================
Driver parameters can be also passed in command line by using::
altera_tse=dma_rx_num:128,dma_tx_num:512
4. Driver information and notes
===============================
송수신, interrupt 완화, ethtool, PHY와 source file
79-1294.1. 송신 과정
Kernel이 driver의 transmit routine을 호출하면, driver는 하부 DMA transmit routine인 SGDMA 또는 MSGDMA routine을 호출해 transmit descriptor를 설정하고 송신 작업을 시작합니다. 송신이 완료되면 transmit DMA logic이 interrupt를 발생시킵니다. Driver는 interrupt handling chain의 context에서 요청된 송신 작업을 보내고 추적하는 데 사용한 resource를 재활용하여 송신 완료를 처리합니다.
4.2. 수신 과정
Driver는 초기화 중 receive buffer를 receive DMA logic에 게시합니다. Receive buffer를 queue할 수 있는지는 하부 DMA logic에 따라 달라집니다. MSGDMA는 receive buffer를 queue할 수 있지만 SGDMA는 SGDMA receive logic에 receive buffer를 queue할 수 없습니다. Packet이 수신되면 DMA logic이 interrupt를 발생시킵니다. Driver는 DMA receive logic의 상태를 얻고 더 이상 receive completion이 없을 때까지 완료 항목을 회수하여 receive interrupt를 처리합니다.
4.3. Interrupt 완화
Driver는 receive operation에 NAPI를 사용하여 DMA interrupt 수를 줄일 수 있습니다. Transmit operation의 interrupt 완화는 아직 지원하지 않으며 향후 maintenance release에서 추가될 예정입니다.
4.4. Ethtool 지원
Ethtool을 지원합니다. `ethtool -S ethX` command로 driver 통계와 내부 error를 확인할 수 있으며 register 등도 dump할 수 있습니다.
4.5. PHY 지원
Driver는 PHY 및 GPHY device와 함께 동작하도록 PAL과 호환됩니다.
4.7. Source file 목록
- `Kconfig`
- `Makefile`
- `altera_tse_main.c`: 주 network device driver
- `altera_tse_ethtool.c`: ethtool 지원
- `altera_tse.h`: private driver structure와 공통 정의
- `altera_msgdma.h`: MSGDMA 구현 function 정의
- `altera_sgdma.h`: SGDMA 구현 function 정의
- `altera_msgdma.c`: MSGDMA 구현
- `altera_sgdma.c`: SGDMA 구현
- `altera_sgdmahw.h`: SGDMA register와 descriptor 정의
- `altera_msgdmahw.h`: MSGDMA register와 descriptor 정의
- `altera_utils.c`: driver utility function
- `altera_utils.h`: driver utility function 정의
4.1. Transmit process
---------------------
When the driver's transmit routine is called by the kernel, it sets up a
transmit descriptor by calling the underlying DMA transmit routine (SGDMA or
MSGDMA), and initiates a transmit operation. Once the transmit is complete, an
interrupt is driven by the transmit DMA logic. The driver handles the transmit
completion in the context of the interrupt handling chain by recycling
resource required to send and track the requested transmit operation.
4.2. Receive process
--------------------
The driver will post receive buffers to the receive DMA logic during driver
initialization. Receive buffers may or may not be queued depending upon the
underlying DMA logic (MSGDMA is able queue receive buffers, SGDMA is not able
to queue receive buffers to the SGDMA receive logic). When a packet is
received, the DMA logic generates an interrupt. The driver handles a receive
interrupt by obtaining the DMA receive logic status, reaping receive
completions until no more receive completions are available.
4.3. Interrupt Mitigation
-------------------------
The driver is able to mitigate the number of its DMA interrupts
using NAPI for receive operations. Interrupt mitigation is not yet supported
for transmit operations, but will be added in a future maintenance release.
4.4) Ethtool support
--------------------
Ethtool is supported. Driver statistics and internal errors can be taken using:
ethtool -S ethX command. It is possible to dump registers etc.
4.5) PHY Support
----------------
The driver is compatible with PAL to work with PHY and GPHY devices.
4.7) List of source files:
--------------------------
- Kconfig
- Makefile
- altera_tse_main.c: main network device driver
- altera_tse_ethtool.c: ethtool support
- altera_tse.h: private driver structure and common definitions
- altera_msgdma.h: MSGDMA implementation function definitions
- altera_sgdma.h: SGDMA implementation function definitions
- altera_msgdma.c: MSGDMA implementation
- altera_sgdma.c: SGDMA implementation
- altera_sgdmahw.h: SGDMA register and descriptor definitions
- altera_msgdmahw.h: MSGDMA register and descriptor definitions
- altera_utils.c: Driver utility functions
- altera_utils.h: Driver utility function definitions
Debug 정보와 통계 표준
130-1565. Debug 정보
Driver는 내부 통계, debug 정보, MAC 및 DMA register 등의 debug 정보를 외부에 제공합니다.
사용자는 ethtool 지원을 이용해 통계를 얻을 수 있습니다. 예를 들어 `ethtool -S ethX`는 통계 counter를 표시하고, `ethtool -d ethX`는 MAC register를 표시합니다.
개발자는 `debug` module parameter를 사용하여 추가 debug 정보를 얻을 수도 있습니다.
6. 통계 지원
Controller와 driver는 IEEE 표준 통계, RFC 정의 통계, driver 또는 Altera 정의 통계를 함께 지원합니다. 이 통계의 표준 정의를 담은 네 specification은 다음과 같습니다.
- `IEEE 802.3-2012` - Ethernet용 IEEE 표준
- `RFC 2863` - `http://www.rfc-editor.org/rfc/rfc2863.txt`
- `RFC 2819` - `http://www.rfc-editor.org/rfc/rfc2819.txt`
- Altera Triple Speed Ethernet User Guide - `http://www.altera.com`
TSE와 device driver가 지원하는 통계는 다음과 같습니다.
5. Debug Information
====================
The driver exports debug information such as internal statistics,
debug information, MAC and DMA registers etc.
A user may use the ethtool support to get statistics:
e.g. using: ethtool -S ethX (that shows the statistics counters)
or sees the MAC registers: e.g. using: ethtool -d ethX
The developer can also use the "debug" module parameter to get
further debug information.
6. Statistics Support
=====================
The controller and driver support a mix of IEEE standard defined statistics,
RFC defined statistics, and driver or Altera defined statistics. The four
specifications containing the standard definitions for these statistics are
as follows:
- IEEE 802.3-2012 - IEEE Standard for Ethernet.
- RFC 2863 found at http://www.rfc-editor.org/rfc/rfc2863.txt.
- RFC 2819 found at http://www.rfc-editor.org/rfc/rfc2819.txt.
- Altera Triple Speed Ethernet User Guide, found at http://www.altera.com
The statistics supported by the TSE and the device driver are as follows:
IEEE 및 RFC interface 통계
157-216`tx_packets`는 IEEE 802.3-2012 5.2.2.1.2절의 `aFramesTransmittedOK`와 같습니다. 성공적으로 송신한 frame 수입니다.
`rx_packets`는 IEEE 802.3-2012 5.2.2.1.5절의 `aFramesReceivedOK`와 같습니다. 성공적으로 수신한 frame 수이며 CRC error, length error, alignment error 같은 error packet은 포함하지 않습니다.
`rx_crc_errors`는 IEEE 802.3-2012 5.2.2.1.6절의 `aFrameCheckSequenceErrors`와 같습니다. 길이가 byte의 정수 배이지만 수신 시 CRC test를 통과하지 못한 frame 수입니다.
`rx_align_errors`는 IEEE 802.3-2012 5.2.2.1.7절의 `aAlignmentErrors`와 같습니다. 길이가 byte의 정수 배가 아니면서 수신 시 CRC test를 통과하지 못한 frame 수입니다.
`tx_bytes`는 IEEE 802.3-2012 5.2.2.1.8절의 `aOctetsTransmittedOK`와 같습니다. Interface에서 성공적으로 송신한 data byte와 padding byte 수입니다.
`rx_bytes`는 IEEE 802.3-2012 5.2.2.1.14절의 `aOctetsReceivedOK`와 같습니다. Controller가 성공적으로 수신한 data byte와 padding byte 수입니다.
`tx_pause`는 IEEE 802.3-2012 30.3.4.2절의 `aPAUSEMACCtrlFramesTransmitted`와 같습니다. Network controller가 송신한 PAUSE frame 수입니다.
`rx_pause`는 IEEE 802.3-2012 30.3.4.3절의 `aPAUSEMACCtrlFramesReceived`와 같습니다. Network controller가 수신한 PAUSE frame 수입니다.
`rx_errors`는 RFC 2863의 `ifInErrors`와 같습니다. Error 때문에 상위 protocol에 전달할 수 없었던 수신 packet 수입니다.
`tx_errors`는 RFC 2863의 `ifOutErrors`와 같습니다. Error 때문에 송신하지 못한 packet 수입니다.
`rx_unicast`는 RFC 2863의 `ifInUcastPkts`와 같습니다. Broadcast address나 multicast group으로 향하지 않은 수신 packet 수입니다.
`rx_multicast`는 RFC 2863의 `ifInMulticastPkts`와 같습니다. Multicast address group으로 향한 수신 packet 수입니다.
`rx_broadcast`는 RFC 2863의 `ifInBroadcastPkts`와 같습니다. Broadcast address로 향한 수신 packet 수입니다.
`tx_discards`는 RFC 2863의 `ifOutDiscards`와 같습니다. Error가 검출되지 않았지만 송신하지 않은 outbound packet 수입니다. 내부 buffer 공간을 확보하기 위해 packet을 버리는 경우가 한 예입니다.
"tx_packets" is equivalent to aFramesTransmittedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.2. This statistics is the count of frames that are successfully
transmitted.
"rx_packets" is equivalent to aFramesReceivedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.5. This statistic is the count of frames that are successfully
received. This count does not include any error packets such as CRC errors,
length errors, or alignment errors.
"rx_crc_errors" is equivalent to aFrameCheckSequenceErrors defined in IEEE
802.3-2012, Section 5.2.2.1.6. This statistic is the count of frames that are
an integral number of bytes in length and do not pass the CRC test as the frame
is received.
"rx_align_errors" is equivalent to aAlignmentErrors defined in IEEE 802.3-2012,
Section 5.2.2.1.7. This statistic is the count of frames that are not an
integral number of bytes in length and do not pass the CRC test as the frame is
received.
"tx_bytes" is equivalent to aOctetsTransmittedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.8. This statistic is the count of data and pad bytes
successfully transmitted from the interface.
"rx_bytes" is equivalent to aOctetsReceivedOK defined in IEEE 802.3-2012,
Section 5.2.2.1.14. This statistic is the count of data and pad bytes
successfully received by the controller.
"tx_pause" is equivalent to aPAUSEMACCtrlFramesTransmitted defined in IEEE
802.3-2012, Section 30.3.4.2. This statistic is a count of PAUSE frames
transmitted from the network controller.
"rx_pause" is equivalent to aPAUSEMACCtrlFramesReceived defined in IEEE
802.3-2012, Section 30.3.4.3. This statistic is a count of PAUSE frames
received by the network controller.
"rx_errors" is equivalent to ifInErrors defined in RFC 2863. This statistic is
a count of the number of packets received containing errors that prevented the
packet from being delivered to a higher level protocol.
"tx_errors" is equivalent to ifOutErrors defined in RFC 2863. This statistic
is a count of the number of packets that could not be transmitted due to errors.
"rx_unicast" is equivalent to ifInUcastPkts defined in RFC 2863. This
statistic is a count of the number of packets received that were not addressed
to the broadcast address or a multicast group.
"rx_multicast" is equivalent to ifInMulticastPkts defined in RFC 2863. This
statistic is a count of the number of packets received that were addressed to
a multicast address group.
"rx_broadcast" is equivalent to ifInBroadcastPkts defined in RFC 2863. This
statistic is a count of the number of packets received that were addressed to
the broadcast address.
"tx_discards" is equivalent to ifOutDiscards defined in RFC 2863. This
statistic is the number of outbound packets not transmitted even though an
error was not detected. An example of a reason this might occur is to free up
internal buffer space.
송신 분류와 RMON 크기 통계
217-256`tx_unicast`는 RFC 2863의 `ifOutUcastPkts`와 같습니다. Multicast group이나 broadcast address로 향하지 않은 송신 packet 수입니다.
`tx_multicast`는 RFC 2863의 `ifOutMulticastPkts`와 같습니다. Multicast group으로 향한 송신 packet 수입니다.
`tx_broadcast`는 RFC 2863의 `ifOutBroadcastPkts`와 같습니다. Broadcast address로 향한 송신 packet 수입니다.
`ether_drops`는 RFC 2819의 `etherStatsDropEvents`와 같습니다. 내부 controller resource 부족으로 drop한 packet 수입니다.
`rx_total_bytes`는 RFC 2819의 `etherStatsOctets`와 같습니다. Error packet과 폐기 packet을 포함해 controller가 받은 전체 byte 수입니다.
`rx_total_packets`는 RFC 2819의 `etherStatsPkts`와 같습니다. Error, 폐기, unicast, multicast, broadcast packet을 모두 포함한 전체 수신 packet 수입니다.
`rx_undersize`는 RFC 2819의 `etherStatsUndersizePkts`와 같습니다. 올바르게 형성되었지만 길이가 64 byte보다 짧은 수신 packet 수입니다.
`rx_oversize`는 RFC 2819의 `etherStatsOversizePkts`와 같습니다. 올바르게 형성되었지만 길이가 1518 byte보다 긴 수신 packet 수입니다.
`rx_64_bytes`는 RFC 2819의 `etherStatsPkts64Octets`와 같습니다. 길이가 정확히 64 octet인 전체 수신 packet 수입니다.
`rx_65_127_bytes`는 RFC 2819의 `etherStatsPkts65to127Octets`와 같습니다. 길이가 65~127 octet인 전체 수신 packet 수이며 양 끝값을 포함합니다.
"tx_unicast" is equivalent to ifOutUcastPkts defined in RFC 2863. This
statistic counts the number of packets transmitted that were not addressed to
a multicast group or broadcast address.
"tx_multicast" is equivalent to ifOutMulticastPkts defined in RFC 2863. This
statistic counts the number of packets transmitted that were addressed to a
multicast group.
"tx_broadcast" is equivalent to ifOutBroadcastPkts defined in RFC 2863. This
statistic counts the number of packets transmitted that were addressed to a
broadcast address.
"ether_drops" is equivalent to etherStatsDropEvents defined in RFC 2819.
This statistic counts the number of packets dropped due to lack of internal
controller resources.
"rx_total_bytes" is equivalent to etherStatsOctets defined in RFC 2819.
This statistic counts the total number of bytes received by the controller,
including error and discarded packets.
"rx_total_packets" is equivalent to etherStatsPkts defined in RFC 2819.
This statistic counts the total number of packets received by the controller,
including error, discarded, unicast, multicast, and broadcast packets.
"rx_undersize" is equivalent to etherStatsUndersizePkts defined in RFC 2819.
This statistic counts the number of correctly formed packets received less
than 64 bytes long.
"rx_oversize" is equivalent to etherStatsOversizePkts defined in RFC 2819.
This statistic counts the number of correctly formed packets greater than 1518
bytes long.
"rx_64_bytes" is equivalent to etherStatsPkts64Octets defined in RFC 2819.
This statistic counts the total number of packets received that were 64 octets
in length.
"rx_65_127_bytes" is equivalent to etherStatsPkts65to127Octets defined in RFC
2819. This statistic counts the total number of packets received that were
between 65 and 127 octets in length inclusive.
나머지 packet 크기와 error 통계
257-286`rx_128_255_bytes`는 RFC 2819의 `etherStatsPkts128to255Octets`와 같습니다. 길이가 128~255 octet인 전체 수신 packet 수이며 양 끝값을 포함합니다.
`rx_256_511_bytes`는 RFC 2819의 `etherStatsPkts256to511Octets`와 같습니다. 길이가 256~511 octet인 전체 수신 packet 수이며 양 끝값을 포함합니다.
`rx_512_1023_bytes`는 RFC 2819의 `etherStatsPkts512to1023Octets`와 같습니다. 길이가 512~1023 octet인 전체 수신 packet 수이며 양 끝값을 포함합니다.
`rx_1024_1518_bytes`는 RFC 2819의 `etherStatsPkts1024to1518Octets`와 같습니다. 길이가 1024~1518 octet인 전체 수신 packet 수이며 양 끝값을 포함합니다.
`rx_gte_1519_bytes`는 Altera TSE 동작에 특화하여 정의한 통계입니다. 길이가 1519 byte부터 `frm_length` register에 설정된 최대 frame 길이까지인 정상 frame과 error frame의 수를 셉니다. 자세한 내용은 Altera TSE User Guide를 참조하십시오.
`rx_jabbers`는 RFC 2819의 `etherStatsJabbers`와 같습니다. 길이가 1518 octet보다 길면서, octet 수가 정수이고 CRC가 잘못된 CRC Error 또는 octet 수가 정수가 아니고 CRC가 잘못된 Alignment Error가 있는 전체 수신 packet 수입니다.
`rx_runts`는 RFC 2819의 `etherStatsFragments`와 같습니다. 길이가 64 octet보다 짧으면서, octet 수가 정수이고 CRC가 잘못된 CRC error 또는 octet 수가 정수가 아니고 CRC가 잘못된 Alignment Error가 있는 전체 수신 packet 수입니다.
"rx_128_255_bytes" is equivalent to etherStatsPkts128to255Octets defined in
RFC 2819. This statistic is the total number of packets received that were
between 128 and 255 octets in length inclusive.
"rx_256_511_bytes" is equivalent to etherStatsPkts256to511Octets defined in
RFC 2819. This statistic is the total number of packets received that were
between 256 and 511 octets in length inclusive.
"rx_512_1023_bytes" is equivalent to etherStatsPkts512to1023Octets defined in
RFC 2819. This statistic is the total number of packets received that were
between 512 and 1023 octets in length inclusive.
"rx_1024_1518_bytes" is equivalent to etherStatsPkts1024to1518Octets define
in RFC 2819. This statistic is the total number of packets received that were
between 1024 and 1518 octets in length inclusive.
"rx_gte_1519_bytes" is a statistic defined specific to the behavior of the
Altera TSE. This statistics counts the number of received good and errored
frames between the length of 1519 and the maximum frame length configured
in the frm_length register. See the Altera TSE User Guide for More details.
"rx_jabbers" is equivalent to etherStatsJabbers defined in RFC 2819. This
statistic is the total number of packets received that were longer than 1518
octets, and had either a bad CRC with an integral number of octets (CRC Error)
or a bad CRC with a non-integral number of octets (Alignment Error).
"rx_runts" is equivalent to etherStatsFragments defined in RFC 2819. This
statistic is the total number of packets received that were less than 64 octets
in length and had either a bad CRC with an integral number of octets (CRC
error) or a bad CRC with a non-integral number of octets (Alignment Error).
요약·해설
altera_tse.rst:1-286이 문서는 FPGA soft IP인 Altera Triple-Speed Ethernet MAC과 SGDMA·MSGDMA를 Linux network driver가 어떻게 결합하는지 설명합니다. 새 설계에서는 MSGDMA를 선택하고, 실제 동작은 `ethtool` 통계와 register dump로 확인하는 것이 핵심입니다.
Driver가 device tree와 platform resource를 바탕으로 적합한 DMA backend를 선택합니다.
Probe 결과에 따라 동일한 MAC driver가 서로 다른 DMA routine set을 설치합니다.
Device tree 정보가 DMA backend와 data path primitive를 결정합니다.
문서가 명시한 driver의 당시 기능 범위입니다.
Descriptor 수는 workload와 memory 사용량을 함께 고려해 조절합니다.
완료 interrupt에서 송신 resource를 회수하고 재활용합니다.
MSGDMA는 여러 receive buffer를 queue할 수 있지만 SGDMA는 그렇지 않습니다.
운영 중 driver 상태와 MAC register를 확인하는 기본 command입니다.
Counter 이름은 IEEE interface 통계와 RFC RMON 통계를 함께 반영합니다.
길이와 CRC·alignment 조건을 함께 보아 counter를 해석합니다.