요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
===============================
Marvell(Aquantia) AQtion Driver
===============================
For the aQuantia Multi-Gigabit PCI Express Family of Ethernet Adapters
.. Contents
- Identifying Your Adapter
- Configuration
- Supported ethtool options
- Command Line Parameters
- Config file parameters
- Support
- License
Identifying Your Adapter
========================
The driver in this release is compatible with AQC-100, AQC-107, AQC-108
based ethernet adapters.
SFP+ Devices (for AQC-100 based adapters)
-----------------------------------------
This release tested with passive Direct Attach Cables (DAC) and SFP+/LC
Optical Transceiver.
Configuration
=============
Viewing Link Messages
---------------------
Link messages will not be displayed to the console if the distribution is
restricting system messages. In order to see network driver link messages on
your console, set dmesg to eight by entering the following::
dmesg -n 8
.. note::
This setting is not saved across reboots.
Jumbo Frames
------------
The driver supports Jumbo Frames for all adapters. Jumbo Frames support is
enabled by changing the MTU to a value larger than the default of 1500.
The maximum value for the MTU is 16000. Use the `ip` command to
increase the MTU size. For example::
ip link set mtu 16000 dev enp1s0
ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. The latest
ethtool version is required for this functionality.
NAPI
----
NAPI (Rx polling mode) is supported in the atlantic driver.
Supported ethtool options
=========================
Viewing adapter settings
------------------------
::
ethtool <ethX>
Output example::
Settings for enp1s0:
Supported ports: [ TP ]
Supported link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
2500baseT/Full
5000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
2500baseT/Full
5000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 10000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yes
.. note::
AQrate speeds (2.5/5 Gb/s) will be displayed only with linux kernels > 4.10.
But you can still use these speeds::
ethtool -s eth0 autoneg off speed 2500
Viewing adapter information
---------------------------
::
ethtool -i <ethX>
Output example::
driver: atlantic
version: 5.2.0-050200rc5-generic-kern
firmware-version: 3.1.78
expansion-rom-version:
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no
Viewing Ethernet adapter statistics
-----------------------------------
::
ethtool -S <ethX>
Output example::
NIC statistics:
InPackets: 13238607
InUCast: 13293852
InMCast: 52
InBCast: 3
InErrors: 0
OutPackets: 23703019
OutUCast: 23704941
OutMCast: 67
OutBCast: 11
InUCastOctects: 213182760
OutUCastOctects: 22698443
InMCastOctects: 6600
OutMCastOctects: 8776
InBCastOctects: 192
OutBCastOctects: 704
InOctects: 2131839552
OutOctects: 226938073
InPacketsDma: 95532300
OutPacketsDma: 59503397
InOctetsDma: 1137102462
OutOctetsDma: 2394339518
InDroppedDma: 0
Queue[0] InPackets: 23567131
Queue[0] OutPackets: 20070028
Queue[0] InJumboPackets: 0
Queue[0] InLroPackets: 0
Queue[0] InErrors: 0
Queue[1] InPackets: 45428967
Queue[1] OutPackets: 11306178
Queue[1] InJumboPackets: 0
Queue[1] InLroPackets: 0
Queue[1] InErrors: 0
Queue[2] InPackets: 3187011
Queue[2] OutPackets: 13080381
Queue[2] InJumboPackets: 0
Queue[2] InLroPackets: 0
Queue[2] InErrors: 0
Queue[3] InPackets: 23349136
Queue[3] OutPackets: 15046810
Queue[3] InJumboPackets: 0
Queue[3] InLroPackets: 0
Queue[3] InErrors: 0
Interrupt coalescing support
----------------------------
ITR mode, TX/RX coalescing timings could be viewed with::
ethtool -c <ethX>
and changed with::
ethtool -C <ethX> tx-usecs <usecs> rx-usecs <usecs>
To disable coalescing::
ethtool -C <ethX> tx-usecs 0 rx-usecs 0 tx-max-frames 1 tx-max-frames 1
Wake on LAN support
-------------------
WOL support by magic packet::
ethtool -s <ethX> wol g
To disable WOL::
ethtool -s <ethX> wol d
Set and check the driver message level
--------------------------------------
Set message level
::
ethtool -s <ethX> msglvl <level>
Level values:
====== =============================
0x0001 general driver status.
0x0002 hardware probing.
0x0004 link state.
0x0008 periodic status check.
0x0010 interface being brought down.
0x0020 interface being brought up.
0x0040 receive error.
0x0080 transmit error.
0x0200 interrupt handling.
0x0400 transmit completion.
0x0800 receive completion.
0x1000 packet contents.
0x2000 hardware status.
0x4000 Wake-on-LAN status.
====== =============================
By default, the level of debugging messages is set 0x0001(general driver status).
Check message level
::
ethtool <ethX> | grep "Current message level"
If you want to disable the output of messages::
ethtool -s <ethX> msglvl 0
RX flow rules (ntuple filters)
------------------------------
There are separate rules supported, that applies in that order:
1. 16 VLAN ID rules
2. 16 L2 EtherType rules
3. 8 L3/L4 5-Tuple rules
The driver utilizes the ethtool interface for configuring ntuple filters,
via ``ethtool -N <device> <filter>``.
To enable or disable the RX flow rules::
ethtool -K ethX ntuple <on|off>
When disabling ntuple filters, all the user programmed filters are
flushed from the driver cache and hardware. All needed filters must
be re-added when ntuple is re-enabled.
Because of the fixed order of the rules, the location of filters is also fixed:
- Locations 0 - 15 for VLAN ID filters
- Locations 16 - 31 for L2 EtherType filters
- Locations 32 - 39 for L3/L4 5-tuple filters (locations 32, 36 for IPv6)
The L3/L4 5-tuple (protocol, source and destination IP address, source and
destination TCP/UDP/SCTP port) is compared against 8 filters. For IPv4, up to
8 source and destination addresses can be matched. For IPv6, up to 2 pairs of
addresses can be supported. Source and destination ports are only compared for
TCP/UDP/SCTP packets.
To add a filter that directs packet to queue 5, use
``<-N|-U|--config-nfc|--config-ntuple>`` switch::
ethtool -N <ethX> flow-type udp4 src-ip 10.0.0.1 dst-ip 10.0.0.2 src-port 2000 dst-port 2001 action 5 <loc 32>
- action is the queue number.
- loc is the rule number.
For ``flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6`` you must set the loc
number within 32 - 39.
For ``flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6`` you can set 8 rules
for traffic IPv4 or you can set 2 rules for traffic IPv6. Loc number traffic
IPv6 is 32 and 36.
At the moment you can not use IPv4 and IPv6 filters at the same time.
Example filter for IPv6 filter traffic::
sudo ethtool -N <ethX> flow-type tcp6 src-ip 2001:db8:0:f101::1 dst-ip 2001:db8:0:f101::2 action 1 loc 32
sudo ethtool -N <ethX> flow-type ip6 src-ip 2001:db8:0:f101::2 dst-ip 2001:db8:0:f101::5 action -1 loc 36
Example filter for IPv4 filter traffic::
sudo ethtool -N <ethX> flow-type udp4 src-ip 10.0.0.4 dst-ip 10.0.0.7 src-port 2000 dst-port 2001 loc 32
sudo ethtool -N <ethX> flow-type tcp4 src-ip 10.0.0.3 dst-ip 10.0.0.9 src-port 2000 dst-port 2001 loc 33
sudo ethtool -N <ethX> flow-type ip4 src-ip 10.0.0.6 dst-ip 10.0.0.4 loc 34
If you set action -1, then all traffic corresponding to the filter will be discarded.
The maximum value action is 31.
The VLAN filter (VLAN id) is compared against 16 filters.
VLAN id must be accompanied by mask 0xF000. That is to distinguish VLAN filter
from L2 Ethertype filter with UserPriority since both User Priority and VLAN ID
are passed in the same 'vlan' parameter.
To add a filter that directs packets from VLAN 2001 to queue 5::
ethtool -N <ethX> flow-type ip4 vlan 2001 m 0xF000 action 1 loc 0
L2 EtherType filters allows filter packet by EtherType field or both EtherType
and User Priority (PCP) field of 802.1Q.
UserPriority (vlan) parameter must be accompanied by mask 0x1FFF. That is to
distinguish VLAN filter from L2 Ethertype filter with UserPriority since both
User Priority and VLAN ID are passed in the same 'vlan' parameter.
To add a filter that directs IP4 packess of priority 3 to queue 3::
ethtool -N <ethX> flow-type ether proto 0x800 vlan 0x600 m 0x1FFF action 3 loc 16
To see the list of filters currently present::
ethtool <-u|-n|--show-nfc|--show-ntuple> <ethX>
Rules may be deleted from the table itself. This is done using::
sudo ethtool <-N|-U|--config-nfc|--config-ntuple> <ethX> delete <loc>
- loc is the rule number to be deleted.
Rx filters is an interface to load the filter table that funnels all flow
into queue 0 unless an alternative queue is specified using "action". In that
case, any flow that matches the filter criteria will be directed to the
appropriate queue. RX filters is supported on all kernels 2.6.30 and later.
RSS for UDP
-----------
Currently, NIC does not support RSS for fragmented IP packets, which leads to
incorrect working of RSS for fragmented UDP traffic. To disable RSS for UDP the
RX Flow L3/L4 rule may be used.
Example::
ethtool -N eth0 flow-type udp4 action 0 loc 32
UDP GSO hardware offload
------------------------
UDP GSO allows to boost UDP tx rates by offloading UDP headers allocation
into hardware. A special userspace socket option is required for this,
could be validated with /kernel/tools/testing/selftests/net/::
udpgso_bench_tx -u -4 -D 10.0.1.1 -s 6300 -S 100
Will cause sending out of 100 byte sized UDP packets formed from single
6300 bytes user buffer.
UDP GSO is configured by::
ethtool -K eth0 tx-udp-segmentation on
Private flags (testing)
-----------------------
Atlantic driver supports private flags for hardware custom features::
$ ethtool --show-priv-flags ethX
Private flags for ethX:
DMASystemLoopback : off
PKTSystemLoopback : off
DMANetworkLoopback : off
PHYInternalLoopback: off
PHYExternalLoopback: off
Example::
$ ethtool --set-priv-flags ethX DMASystemLoopback on
DMASystemLoopback: DMA Host loopback.
PKTSystemLoopback: Packet buffer host loopback.
DMANetworkLoopback: Network side loopback on DMA block.
PHYInternalLoopback: Internal loopback on Phy.
PHYExternalLoopback: External loopback on Phy (with loopback ethernet cable).
Command Line Parameters
=======================
The following command line parameters are available on atlantic driver:
aq_itr -Interrupt throttling mode
---------------------------------
Accepted values: 0, 1, 0xFFFF
Default value: 0xFFFF
====== ==============================================================
0 Disable interrupt throttling.
1 Enable interrupt throttling and use specified tx and rx rates.
0xFFFF Auto throttling mode. Driver will choose the best RX and TX
interrupt throttling settings based on link speed.
====== ==============================================================
aq_itr_tx - TX interrupt throttle rate
--------------------------------------
Accepted values: 0 - 0x1FF
Default value: 0
TX side throttling in microseconds. Adapter will setup maximum interrupt delay
to this value. Minimum interrupt delay will be a half of this value
aq_itr_rx - RX interrupt throttle rate
--------------------------------------
Accepted values: 0 - 0x1FF
Default value: 0
RX side throttling in microseconds. Adapter will setup maximum interrupt delay
to this value. Minimum interrupt delay will be a half of this value
.. note::
ITR settings could be changed in runtime by ethtool -c means (see below)
Config file parameters
======================
For some fine tuning and performance optimizations,
some parameters can be changed in the {source_dir}/aq_cfg.h file.
AQ_CFG_RX_PAGEORDER
-------------------
Default value: 0
RX page order override. That's a power of 2 number of RX pages allocated for
each descriptor. Received descriptor size is still limited by
AQ_CFG_RX_FRAME_MAX.
Increasing pageorder makes page reuse better (actual on iommu enabled systems).
AQ_CFG_RX_REFILL_THRES
----------------------
Default value: 32
RX refill threshold. RX path will not refill freed descriptors until the
specified number of free descriptors is observed. Larger values may help
better page reuse but may lead to packet drops as well.
AQ_CFG_VECS_DEF
---------------
Number of queues
Valid Range: 0 - 8 (up to AQ_CFG_VECS_MAX)
Default value: 8
Notice this value will be capped by the number of cores available on the system.
AQ_CFG_IS_RSS_DEF
-----------------
Enable/disable Receive Side Scaling
This feature allows the adapter to distribute receive processing
across multiple CPU-cores and to prevent from overloading a single CPU core.
Valid values
== ========
0 disabled
1 enabled
== ========
Default value: 1
AQ_CFG_NUM_RSS_QUEUES_DEF
-------------------------
Number of queues for Receive Side Scaling
Valid Range: 0 - 8 (up to AQ_CFG_VECS_DEF)
Default value: AQ_CFG_VECS_DEF
AQ_CFG_IS_LRO_DEF
-----------------
Enable/disable Large Receive Offload
This offload enables the adapter to coalesce multiple TCP segments and indicate
them as a single coalesced unit to the OS networking subsystem.
The system consumes less energy but it also introduces more latency in packets
processing.
Valid values
== ========
0 disabled
1 enabled
== ========
Default value: 1
AQ_CFG_TX_CLEAN_BUDGET
----------------------
Maximum descriptors to cleanup on TX at once.
Default value: 256
After the aq_cfg.h file changed the driver must be rebuilt to take effect.
Support
=======
If an issue is identified with the released source code on the supported
kernel with a supported adapter, email the specific information related
to the issue to [email protected]
License
=======
aQuantia Corporation Network Driver
Copyright |copy| 2014 - 2019 aQuantia Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Adapter 식별과 기본 configuration
1-66Marvell(Aquantia) AQtion Driver
aQuantia Multi-Gigabit PCI Express Ethernet Adapter family용 driver입니다.
이 문서는 adapter 식별, configuration, 지원 ethtool option, command line parameter, config file parameter, 지원 및 license를 설명합니다.
Adapter 식별
이 release의 driver는 AQC-100, AQC-107, AQC-108 기반 Ethernet adapter와 호환됩니다.
SFP+ device(AQC-100 기반 adapter)
이 release는 passive Direct Attach Cable(`DAC`) 및 SFP+/LC optical transceiver로 시험했습니다.
Configuration
Link message 보기
Distribution이 system message를 제한하면 link message가 console에 표시되지 않습니다. Network driver link message를 console에서 보려면 다음과 같이 dmesg level을 8로 설정합니다.
dmesg -n 8
이 설정은 reboot 후 유지되지 않습니다.
Jumbo frame
Driver는 모든 adapter에서 Jumbo Frame을 지원합니다. 기본값 1500보다 큰 MTU로 변경하면 활성화됩니다. 최대 MTU는 16000이며 `ip` command로 늘립니다.
ip link set mtu 16000 dev enp1s0
ethtool
Driver는 configuration, 진단, 통계 표시를 위해 ethtool interface를 사용합니다. 이 기능을 사용하려면 최신 ethtool version이 필요합니다.
NAPI
Atlantic driver는 NAPI, 즉 Rx polling mode를 지원합니다.
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
===============================
Marvell(Aquantia) AQtion Driver
===============================
For the aQuantia Multi-Gigabit PCI Express Family of Ethernet Adapters
.. Contents
- Identifying Your Adapter
- Configuration
- Supported ethtool options
- Command Line Parameters
- Config file parameters
- Support
- License
Identifying Your Adapter
========================
The driver in this release is compatible with AQC-100, AQC-107, AQC-108
based ethernet adapters.
SFP+ Devices (for AQC-100 based adapters)
-----------------------------------------
This release tested with passive Direct Attach Cables (DAC) and SFP+/LC
Optical Transceiver.
Configuration
=============
Viewing Link Messages
---------------------
Link messages will not be displayed to the console if the distribution is
restricting system messages. In order to see network driver link messages on
your console, set dmesg to eight by entering the following::
dmesg -n 8
.. note::
This setting is not saved across reboots.
Jumbo Frames
------------
The driver supports Jumbo Frames for all adapters. Jumbo Frames support is
enabled by changing the MTU to a value larger than the default of 1500.
The maximum value for the MTU is 16000. Use the `ip` command to
increase the MTU size. For example::
ip link set mtu 16000 dev enp1s0
ethtool
-------
The driver utilizes the ethtool interface for driver configuration and
diagnostics, as well as displaying statistical information. The latest
ethtool version is required for this functionality.
NAPI
----
NAPI (Rx polling mode) is supported in the atlantic driver.
Adapter setting과 driver 정보
67-135지원 ethtool option
Adapter setting 보기
ethtool <ethX>
출력에는 지원 port, 100M/1G/2.5G/5G/10G full-duplex link mode, pause frame, auto-negotiation, FEC, 광고 link mode, 현재 speed와 duplex, port, PHY address, transceiver, MDI-X, Wake-on-LAN, link 감지 상태가 포함됩니다.
예시에서는 `enp1s0`이 twisted pair port에서 10000Mb/s full-duplex로 연결되어 있고 auto-negotiation은 켜져 있으며 Wake-on-LAN capability는 magic packet(`g`)이지만 현재는 비활성(`d`)입니다.
AQrate 속도인 2.5Gb/s와 5Gb/s는 Linux kernel 4.10보다 새로운 version에서만 표시됩니다. 표시되지 않아도 다음과 같이 사용할 수 있습니다.
ethtool -s eth0 autoneg off speed 2500
Adapter 정보 보기
ethtool -i <ethX>
출력 예시는 driver `atlantic`, kernel driver version, firmware version `3.1.78`, PCI bus `0000:01:00.0`을 보여줍니다. Statistics와 register dump는 지원하고 test, EEPROM access, private flag는 이 예시에서 지원하지 않습니다.
Supported ethtool options
=========================
Viewing adapter settings
------------------------
::
ethtool <ethX>
Output example::
Settings for enp1s0:
Supported ports: [ TP ]
Supported link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
2500baseT/Full
5000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 100baseT/Full
1000baseT/Full
10000baseT/Full
2500baseT/Full
5000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 10000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yes
.. note::
AQrate speeds (2.5/5 Gb/s) will be displayed only with linux kernels > 4.10.
But you can still use these speeds::
ethtool -s eth0 autoneg off speed 2500
Viewing adapter information
---------------------------
::
ethtool -i <ethX>
Output example::
driver: atlantic
version: 5.2.0-050200rc5-generic-kern
firmware-version: 3.1.78
expansion-rom-version:
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no
통계, coalescing, WOL과 message level
136-255Ethernet adapter 통계 보기
ethtool -S <ethX>
출력은 NIC 전체 packet, unicast, multicast, broadcast, error, octet counter와 DMA packet·octet·drop counter를 포함합니다. 또한 각 queue의 input/output packet, jumbo packet, LRO packet, error counter를 제공합니다.
- `InPackets`, `OutPackets`: 전체 입출력 packet 수
- `InUCast`, `InMCast`, `InBCast` 및 송신 대응 counter: traffic 유형별 packet 수
- `InErrors`: 수신 error
- `InOctects`, `OutOctects`: MAC octet 수
- `InPacketsDma`, `OutPacketsDma`, `InOctetsDma`, `OutOctetsDma`: DMA 기준 counter
- `InDroppedDma`: DMA drop
- `Queue[n] InPackets`, `OutPackets`, `InJumboPackets`, `InLroPackets`, `InErrors`: queue별 통계
Interrupt coalescing 지원
ITR mode와 TX/RX coalescing timing은 다음 command로 봅니다.
ethtool -c <ethX>
다음 command로 변경합니다.
ethtool -C <ethX> tx-usecs <usecs> rx-usecs <usecs>
Coalescing을 비활성화하려면 다음과 같이 설정합니다.
ethtool -C <ethX> tx-usecs 0 rx-usecs 0 tx-max-frames 1 tx-max-frames 1
Wake on LAN 지원
Magic packet WOL을 활성화합니다.
ethtool -s <ethX> wol g
WOL을 비활성화합니다.
ethtool -s <ethX> wol d
Driver message level 설정과 확인
ethtool -s <ethX> msglvl <level>
- `0x0001`: 일반 driver 상태
- `0x0002`: hardware probing
- `0x0004`: link 상태
- `0x0008`: 주기적 상태 확인
- `0x0010`: interface down
- `0x0020`: interface up
- `0x0040`: receive error
- `0x0080`: transmit error
- `0x0200`: interrupt 처리
- `0x0400`: transmit completion
- `0x0800`: receive completion
- `0x1000`: packet 내용
- `0x2000`: hardware 상태
- `0x4000`: Wake-on-LAN 상태
기본 debug message level은 일반 driver 상태인 `0x0001`입니다.
현재 message level은 다음과 같이 확인합니다.
ethtool <ethX> | grep "Current message level"
Message 출력을 끄려면 다음과 같이 설정합니다.
ethtool -s <ethX> msglvl 0
Viewing Ethernet adapter statistics
-----------------------------------
::
ethtool -S <ethX>
Output example::
NIC statistics:
InPackets: 13238607
InUCast: 13293852
InMCast: 52
InBCast: 3
InErrors: 0
OutPackets: 23703019
OutUCast: 23704941
OutMCast: 67
OutBCast: 11
InUCastOctects: 213182760
OutUCastOctects: 22698443
InMCastOctects: 6600
OutMCastOctects: 8776
InBCastOctects: 192
OutBCastOctects: 704
InOctects: 2131839552
OutOctects: 226938073
InPacketsDma: 95532300
OutPacketsDma: 59503397
InOctetsDma: 1137102462
OutOctetsDma: 2394339518
InDroppedDma: 0
Queue[0] InPackets: 23567131
Queue[0] OutPackets: 20070028
Queue[0] InJumboPackets: 0
Queue[0] InLroPackets: 0
Queue[0] InErrors: 0
Queue[1] InPackets: 45428967
Queue[1] OutPackets: 11306178
Queue[1] InJumboPackets: 0
Queue[1] InLroPackets: 0
Queue[1] InErrors: 0
Queue[2] InPackets: 3187011
Queue[2] OutPackets: 13080381
Queue[2] InJumboPackets: 0
Queue[2] InLroPackets: 0
Queue[2] InErrors: 0
Queue[3] InPackets: 23349136
Queue[3] OutPackets: 15046810
Queue[3] InJumboPackets: 0
Queue[3] InLroPackets: 0
Queue[3] InErrors: 0
Interrupt coalescing support
----------------------------
ITR mode, TX/RX coalescing timings could be viewed with::
ethtool -c <ethX>
and changed with::
ethtool -C <ethX> tx-usecs <usecs> rx-usecs <usecs>
To disable coalescing::
ethtool -C <ethX> tx-usecs 0 rx-usecs 0 tx-max-frames 1 tx-max-frames 1
Wake on LAN support
-------------------
WOL support by magic packet::
ethtool -s <ethX> wol g
To disable WOL::
ethtool -s <ethX> wol d
Set and check the driver message level
--------------------------------------
Set message level
::
ethtool -s <ethX> msglvl <level>
Level values:
====== =============================
0x0001 general driver status.
0x0002 hardware probing.
0x0004 link state.
0x0008 periodic status check.
0x0010 interface being brought down.
0x0020 interface being brought up.
0x0040 receive error.
0x0080 transmit error.
0x0200 interrupt handling.
0x0400 transmit completion.
0x0800 receive completion.
0x1000 packet contents.
0x2000 hardware status.
0x4000 Wake-on-LAN status.
====== =============================
By default, the level of debugging messages is set 0x0001(general driver status).
Check message level
::
ethtool <ethX> | grep "Current message level"
If you want to disable the output of messages::
ethtool -s <ethX> msglvl 0
RX flow rule과 ntuple filter
256-354RX flow rule(ntuple filter)
다음과 같은 별도 rule이 이 순서로 적용됩니다.
- VLAN ID rule 16개
- L2 EtherType rule 16개
- L3/L4 5-tuple rule 8개
Driver는 `ethtool -N <device> <filter>`로 ntuple filter를 설정합니다.
RX flow rule을 켜거나 끕니다.
ethtool -K ethX ntuple <on|off>
Ntuple filter를 끄면 사용자가 설정한 모든 filter가 driver cache와 hardware에서 제거됩니다. 다시 켤 때 필요한 filter를 모두 재등록해야 합니다.
Rule 순서가 고정되어 있으므로 filter location도 고정됩니다.
- Location 0~15: VLAN ID filter
- Location 16~31: L2 EtherType filter
- Location 32~39: L3/L4 5-tuple filter, IPv6는 32와 36
L3/L4 5-tuple은 protocol, source·destination IP address, source·destination TCP/UDP/SCTP port를 8개 filter와 비교합니다. IPv4는 source와 destination address를 최대 8쌍, IPv6는 최대 2쌍 지원합니다. Port는 TCP/UDP/SCTP packet에서만 비교합니다.
Packet을 queue 5로 보내는 filter 예시는 다음과 같습니다.
ethtool -N <ethX> flow-type udp4 src-ip 10.0.0.1 dst-ip 10.0.0.2 src-port 2000 dst-port 2001 action 5 <loc 32>
`action`은 queue 번호이고 `loc`은 rule 번호입니다.
`flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6`에서는 `loc`을 32~39로 지정해야 합니다. IPv4 traffic rule은 8개, IPv6는 2개를 설정할 수 있으며 IPv6 location은 32와 36입니다. 현재 IPv4와 IPv6 filter를 동시에 사용할 수 없습니다.
IPv6 traffic filter 예시입니다.
sudo ethtool -N <ethX> flow-type tcp6 src-ip 2001:db8:0:f101::1 dst-ip 2001:db8:0:f101::2 action 1 loc 32
sudo ethtool -N <ethX> flow-type ip6 src-ip 2001:db8:0:f101::2 dst-ip 2001:db8:0:f101::5 action -1 loc 36
IPv4 traffic filter 예시입니다.
sudo ethtool -N <ethX> flow-type udp4 src-ip 10.0.0.4 dst-ip 10.0.0.7 src-port 2000 dst-port 2001 loc 32
sudo ethtool -N <ethX> flow-type tcp4 src-ip 10.0.0.3 dst-ip 10.0.0.9 src-port 2000 dst-port 2001 loc 33
sudo ethtool -N <ethX> flow-type ip4 src-ip 10.0.0.6 dst-ip 10.0.0.4 loc 34
`action -1`을 설정하면 filter와 일치하는 모든 traffic을 폐기합니다. `action`의 최대값은 31입니다.
VLAN filter는 VLAN ID를 16개 filter와 비교합니다. VLAN ID에는 mask `0xF000`을 함께 지정해야 합니다. User Priority와 VLAN ID가 같은 `vlan` parameter로 전달되므로 이를 UserPriority가 있는 L2 EtherType filter와 구분하기 위해서입니다.
VLAN 2001 packet을 queue 5로 보내는 예시입니다.
ethtool -N <ethX> flow-type ip4 vlan 2001 m 0xF000 action 1 loc 0
L2 EtherType filter는 EtherType field 또는 EtherType과 802.1Q User Priority(`PCP`) field를 함께 사용해 packet을 filter합니다. UserPriority(`vlan`) parameter에는 mask `0x1FFF`를 함께 지정해야 VLAN filter와 구분할 수 있습니다.
Priority 3의 IPv4 packet을 queue 3으로 보내는 예시입니다.
ethtool -N <ethX> flow-type ether proto 0x800 vlan 0x600 m 0x1FFF action 3 loc 16
현재 filter 목록을 봅니다.
ethtool <-u|-n|--show-nfc|--show-ntuple> <ethX>
Table에서 rule을 삭제합니다.
sudo ethtool <-N|-U|--config-nfc|--config-ntuple> <ethX> delete <loc>
`loc`은 삭제할 rule 번호입니다. Rx filter는 기본적으로 모든 flow를 queue 0으로 보내며 `action`으로 대체 queue를 지정할 수 있습니다. Filter 조건과 일치하는 flow는 해당 queue로 전달됩니다. RX filter는 kernel 2.6.30 이상에서 지원됩니다.
RX flow rules (ntuple filters)
------------------------------
There are separate rules supported, that applies in that order:
1. 16 VLAN ID rules
2. 16 L2 EtherType rules
3. 8 L3/L4 5-Tuple rules
The driver utilizes the ethtool interface for configuring ntuple filters,
via ``ethtool -N <device> <filter>``.
To enable or disable the RX flow rules::
ethtool -K ethX ntuple <on|off>
When disabling ntuple filters, all the user programmed filters are
flushed from the driver cache and hardware. All needed filters must
be re-added when ntuple is re-enabled.
Because of the fixed order of the rules, the location of filters is also fixed:
- Locations 0 - 15 for VLAN ID filters
- Locations 16 - 31 for L2 EtherType filters
- Locations 32 - 39 for L3/L4 5-tuple filters (locations 32, 36 for IPv6)
The L3/L4 5-tuple (protocol, source and destination IP address, source and
destination TCP/UDP/SCTP port) is compared against 8 filters. For IPv4, up to
8 source and destination addresses can be matched. For IPv6, up to 2 pairs of
addresses can be supported. Source and destination ports are only compared for
TCP/UDP/SCTP packets.
To add a filter that directs packet to queue 5, use
``<-N|-U|--config-nfc|--config-ntuple>`` switch::
ethtool -N <ethX> flow-type udp4 src-ip 10.0.0.1 dst-ip 10.0.0.2 src-port 2000 dst-port 2001 action 5 <loc 32>
- action is the queue number.
- loc is the rule number.
For ``flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6`` you must set the loc
number within 32 - 39.
For ``flow-type ip4|udp4|tcp4|sctp4|ip6|udp6|tcp6|sctp6`` you can set 8 rules
for traffic IPv4 or you can set 2 rules for traffic IPv6. Loc number traffic
IPv6 is 32 and 36.
At the moment you can not use IPv4 and IPv6 filters at the same time.
Example filter for IPv6 filter traffic::
sudo ethtool -N <ethX> flow-type tcp6 src-ip 2001:db8:0:f101::1 dst-ip 2001:db8:0:f101::2 action 1 loc 32
sudo ethtool -N <ethX> flow-type ip6 src-ip 2001:db8:0:f101::2 dst-ip 2001:db8:0:f101::5 action -1 loc 36
Example filter for IPv4 filter traffic::
sudo ethtool -N <ethX> flow-type udp4 src-ip 10.0.0.4 dst-ip 10.0.0.7 src-port 2000 dst-port 2001 loc 32
sudo ethtool -N <ethX> flow-type tcp4 src-ip 10.0.0.3 dst-ip 10.0.0.9 src-port 2000 dst-port 2001 loc 33
sudo ethtool -N <ethX> flow-type ip4 src-ip 10.0.0.6 dst-ip 10.0.0.4 loc 34
If you set action -1, then all traffic corresponding to the filter will be discarded.
The maximum value action is 31.
The VLAN filter (VLAN id) is compared against 16 filters.
VLAN id must be accompanied by mask 0xF000. That is to distinguish VLAN filter
from L2 Ethertype filter with UserPriority since both User Priority and VLAN ID
are passed in the same 'vlan' parameter.
To add a filter that directs packets from VLAN 2001 to queue 5::
ethtool -N <ethX> flow-type ip4 vlan 2001 m 0xF000 action 1 loc 0
L2 EtherType filters allows filter packet by EtherType field or both EtherType
and User Priority (PCP) field of 802.1Q.
UserPriority (vlan) parameter must be accompanied by mask 0x1FFF. That is to
distinguish VLAN filter from L2 Ethertype filter with UserPriority since both
User Priority and VLAN ID are passed in the same 'vlan' parameter.
To add a filter that directs IP4 packess of priority 3 to queue 3::
ethtool -N <ethX> flow-type ether proto 0x800 vlan 0x600 m 0x1FFF action 3 loc 16
To see the list of filters currently present::
ethtool <-u|-n|--show-nfc|--show-ntuple> <ethX>
Rules may be deleted from the table itself. This is done using::
sudo ethtool <-N|-U|--config-nfc|--config-ntuple> <ethX> delete <loc>
- loc is the rule number to be deleted.
Rx filters is an interface to load the filter table that funnels all flow
into queue 0 unless an alternative queue is specified using "action". In that
case, any flow that matches the filter criteria will be directed to the
appropriate queue. RX filters is supported on all kernels 2.6.30 and later.
UDP RSS·GSO와 private test flag
355-406UDP용 RSS
현재 NIC는 fragmented IP packet의 RSS를 지원하지 않아 fragmented UDP traffic에서 RSS가 올바르게 동작하지 않습니다. UDP RSS를 끄려면 RX Flow L3/L4 rule을 사용할 수 있습니다.
ethtool -N eth0 flow-type udp4 action 0 loc 32
UDP GSO hardware offload
UDP GSO는 UDP header 할당을 hardware로 offload하여 UDP 송신 속도를 높입니다. 이를 사용하려면 특별한 userspace socket option이 필요하며 `/kernel/tools/testing/selftests/net/`의 다음 command로 검증할 수 있습니다.
udpgso_bench_tx -u -4 -D 10.0.1.1 -s 6300 -S 100
이 command는 하나의 6300-byte user buffer에서 만든 100-byte UDP packet을 송신합니다.
UDP GSO는 다음과 같이 설정합니다.
ethtool -K eth0 tx-udp-segmentation on
Private flag(testing)
Atlantic driver는 hardware custom feature용 private flag를 지원합니다.
$ ethtool --show-priv-flags ethX
Private flags for ethX:
DMASystemLoopback : off
PKTSystemLoopback : off
DMANetworkLoopback : off
PHYInternalLoopback: off
PHYExternalLoopback: off
설정 예시는 다음과 같습니다.
ethtool --set-priv-flags ethX DMASystemLoopback on
- `DMASystemLoopback`: DMA host loopback
- `PKTSystemLoopback`: packet buffer host loopback
- `DMANetworkLoopback`: DMA block의 network side loopback
- `PHYInternalLoopback`: PHY 내부 loopback
- `PHYExternalLoopback`: loopback Ethernet cable을 사용하는 PHY 외부 loopback
RSS for UDP
-----------
Currently, NIC does not support RSS for fragmented IP packets, which leads to
incorrect working of RSS for fragmented UDP traffic. To disable RSS for UDP the
RX Flow L3/L4 rule may be used.
Example::
ethtool -N eth0 flow-type udp4 action 0 loc 32
UDP GSO hardware offload
------------------------
UDP GSO allows to boost UDP tx rates by offloading UDP headers allocation
into hardware. A special userspace socket option is required for this,
could be validated with /kernel/tools/testing/selftests/net/::
udpgso_bench_tx -u -4 -D 10.0.1.1 -s 6300 -S 100
Will cause sending out of 100 byte sized UDP packets formed from single
6300 bytes user buffer.
UDP GSO is configured by::
ethtool -K eth0 tx-udp-segmentation on
Private flags (testing)
-----------------------
Atlantic driver supports private flags for hardware custom features::
$ ethtool --show-priv-flags ethX
Private flags for ethX:
DMASystemLoopback : off
PKTSystemLoopback : off
DMANetworkLoopback : off
PHYInternalLoopback: off
PHYExternalLoopback: off
Example::
$ ethtool --set-priv-flags ethX DMASystemLoopback on
DMASystemLoopback: DMA Host loopback.
PKTSystemLoopback: Packet buffer host loopback.
DMANetworkLoopback: Network side loopback on DMA block.
PHYInternalLoopback: Internal loopback on Phy.
PHYExternalLoopback: External loopback on Phy (with loopback ethernet cable).
Interrupt throttling command line parameter
407-447Command line parameter
Atlantic driver는 다음 command line parameter를 제공합니다.
`aq_itr`: interrupt throttling mode
허용값은 `0`, `1`, `0xFFFF`이고 기본값은 `0xFFFF`입니다.
- `0`: interrupt throttling을 비활성화합니다.
- `1`: interrupt throttling을 활성화하고 지정된 TX/RX rate를 사용합니다.
- `0xFFFF`: auto throttling mode입니다. Driver가 link speed에 따라 최적의 RX/TX interrupt throttling setting을 선택합니다.
`aq_itr_tx`: TX interrupt throttle rate
허용 범위는 `0`~`0x1FF`, 기본값은 `0`입니다. TX throttling을 microsecond 단위로 지정합니다. Adapter의 최대 interrupt delay가 이 값이고 최소 delay는 절반입니다.
`aq_itr_rx`: RX interrupt throttle rate
허용 범위는 `0`~`0x1FF`, 기본값은 `0`입니다. RX throttling을 microsecond 단위로 지정합니다. Adapter의 최대 interrupt delay가 이 값이고 최소 delay는 절반입니다.
ITR setting은 runtime에 `ethtool -c` 계열 command로 변경할 수 있습니다.
Command Line Parameters
=======================
The following command line parameters are available on atlantic driver:
aq_itr -Interrupt throttling mode
---------------------------------
Accepted values: 0, 1, 0xFFFF
Default value: 0xFFFF
====== ==============================================================
0 Disable interrupt throttling.
1 Enable interrupt throttling and use specified tx and rx rates.
0xFFFF Auto throttling mode. Driver will choose the best RX and TX
interrupt throttling settings based on link speed.
====== ==============================================================
aq_itr_tx - TX interrupt throttle rate
--------------------------------------
Accepted values: 0 - 0x1FF
Default value: 0
TX side throttling in microseconds. Adapter will setup maximum interrupt delay
to this value. Minimum interrupt delay will be a half of this value
aq_itr_rx - RX interrupt throttle rate
--------------------------------------
Accepted values: 0 - 0x1FF
Default value: 0
RX side throttling in microseconds. Adapter will setup maximum interrupt delay
to this value. Minimum interrupt delay will be a half of this value
.. note::
ITR settings could be changed in runtime by ethtool -c means (see below)
RX page, refill과 queue config
448-483Config file parameter
세밀한 tuning과 성능 최적화를 위해 `{source_dir}/aq_cfg.h`의 일부 parameter를 변경할 수 있습니다.
`AQ_CFG_RX_PAGEORDER`
기본값은 `0`입니다. Descriptor마다 할당할 RX page 수의 2의 거듭제곱 order를 override합니다. 수신 descriptor 크기는 계속 `AQ_CFG_RX_FRAME_MAX`로 제한됩니다. Page order를 늘리면 특히 IOMMU가 활성화된 system에서 page 재사용이 좋아집니다.
`AQ_CFG_RX_REFILL_THRES`
기본값은 `32`입니다. RX refill threshold로, 지정한 수의 free descriptor가 관찰될 때까지 RX path가 해제된 descriptor를 refill하지 않습니다. 큰 값은 page 재사용을 개선할 수 있지만 packet drop을 유발할 수도 있습니다.
`AQ_CFG_VECS_DEF`
Queue 수를 지정하며 유효 범위는 `0`~`8`, 즉 `AQ_CFG_VECS_MAX`까지입니다. 기본값은 `8`입니다. 실제 값은 system에서 사용할 수 있는 core 수로 제한됩니다.
Config file parameters
======================
For some fine tuning and performance optimizations,
some parameters can be changed in the {source_dir}/aq_cfg.h file.
AQ_CFG_RX_PAGEORDER
-------------------
Default value: 0
RX page order override. That's a power of 2 number of RX pages allocated for
each descriptor. Received descriptor size is still limited by
AQ_CFG_RX_FRAME_MAX.
Increasing pageorder makes page reuse better (actual on iommu enabled systems).
AQ_CFG_RX_REFILL_THRES
----------------------
Default value: 32
RX refill threshold. RX path will not refill freed descriptors until the
specified number of free descriptors is observed. Larger values may help
better page reuse but may lead to packet drops as well.
AQ_CFG_VECS_DEF
---------------
Number of queues
Valid Range: 0 - 8 (up to AQ_CFG_VECS_MAX)
Default value: 8
Notice this value will be capped by the number of cores available on the system.
RSS, LRO와 cleanup config
484-538`AQ_CFG_IS_RSS_DEF`
Receive Side Scaling을 활성화하거나 비활성화합니다. Adapter가 receive processing을 여러 CPU core에 분산하여 단일 core overload를 방지합니다. `0`은 비활성, `1`은 활성이고 기본값은 `1`입니다.
`AQ_CFG_NUM_RSS_QUEUES_DEF`
Receive Side Scaling용 queue 수입니다. 유효 범위는 `0`~`8`, 즉 `AQ_CFG_VECS_DEF`까지이며 기본값은 `AQ_CFG_VECS_DEF`입니다.
`AQ_CFG_IS_LRO_DEF`
Large Receive Offload를 활성화하거나 비활성화합니다. Adapter가 여러 TCP segment를 하나의 병합 unit으로 합쳐 OS networking subsystem에 전달합니다. System energy 소비는 줄지만 packet processing latency는 늘어납니다. `0`은 비활성, `1`은 활성이고 기본값은 `1`입니다.
`AQ_CFG_TX_CLEAN_BUDGET`
한 번에 TX에서 cleanup할 최대 descriptor 수이며 기본값은 `256`입니다.
`aq_cfg.h`를 변경한 뒤에는 효과를 적용하려면 driver를 다시 build해야 합니다.
AQ_CFG_IS_RSS_DEF
-----------------
Enable/disable Receive Side Scaling
This feature allows the adapter to distribute receive processing
across multiple CPU-cores and to prevent from overloading a single CPU core.
Valid values
== ========
0 disabled
1 enabled
== ========
Default value: 1
AQ_CFG_NUM_RSS_QUEUES_DEF
-------------------------
Number of queues for Receive Side Scaling
Valid Range: 0 - 8 (up to AQ_CFG_VECS_DEF)
Default value: AQ_CFG_VECS_DEF
AQ_CFG_IS_LRO_DEF
-----------------
Enable/disable Large Receive Offload
This offload enables the adapter to coalesce multiple TCP segments and indicate
them as a single coalesced unit to the OS networking subsystem.
The system consumes less energy but it also introduces more latency in packets
processing.
Valid values
== ========
0 disabled
1 enabled
== ========
Default value: 1
AQ_CFG_TX_CLEAN_BUDGET
----------------------
Maximum descriptors to cleanup on TX at once.
Default value: 256
After the aq_cfg.h file changed the driver must be rebuilt to take effect.
지원과 license
539-556지원
지원되는 kernel과 adapter에서 release source code 문제가 확인되면 문제 관련 구체적인 정보를 `[email protected]`으로 보내십시오.
License
aQuantia Corporation Network Driver
Copyright © 2014-2019 aQuantia Corporation.
이 program은 Free Software Foundation이 공개한 GNU General Public License version 2의 조건에 따라 재배포하거나 수정할 수 있는 free software입니다.
Support
=======
If an issue is identified with the released source code on the supported
kernel with a supported adapter, email the specific information related
to the issue to [email protected]
License
=======
aQuantia Corporation Network Driver
Copyright |copy| 2014 - 2019 aQuantia Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
요약·해설
atlantic.rst:1-556Atlantic driver는 100M부터 10G까지의 AQtion adapter를 ethtool 중심으로 운영합니다. 특히 ntuple filter location이 rule type별로 고정되어 있고, command line ITR와 compile-time `aq_cfg.h` tuning이 함께 존재한다는 점이 중요합니다.
문서가 명시한 device family와 시험 media입니다.
기본 운영 command와 persistence 특성을 정리했습니다.
Adapter 상태부터 queue별 통계까지 조회합니다.
필요한 debug category를 bitwise 조합할 수 있습니다.
Hardware rule order 때문에 location 범위가 고정됩니다.
일치하지 않는 flow는 queue 0, 일치하는 flow는 action queue로 갑니다.
같은 vlan parameter를 rule 성격에 따라 mask로 구분합니다.
Fragment와 segmentation 상황에 따라 설정이 다릅니다.
Hardware block별 test loopback을 제공합니다.
Command line parameter가 throttling strategy를 결정합니다.
Page 재사용과 packet drop 사이의 trade-off가 있습니다.
Compile-time default와 기능 효과입니다.
aq_cfg.h parameter는 runtime setting이 아니므로 rebuild가 필요합니다.
설정 변경 시 놓치기 쉬운 상태를 모았습니다.