C H A P T E R  40

Ethernet Loopback Test (xnetlbtest)


xnetlbtest Description

The xnetlbtest provides functional test coverage of the network products based on Neptune Ethernet chip/core. nxge is the first driver xnetlbtest supports.

xnetlbtest uses DLPI to send and receive packets in loopback modes. A packet is defined as an Ethernet header followed by data payload. The test generates and sends a desired number of packets and receives the packets through the external or internal loopback interface. It also supports back-to-back (port-to-port) loopback tests between two ports. Loopback tests perform continuous transmit and receive asynchronously, and in case of the back-to-back loopback test, both ports perform transmit and receive concurrently. Due to asynchronous transmission, tests do not retry if a packet is not received. Instead, a tunable threshold is used to allow a number of packet drops in heavily loaded test systems. If an error occurs, an error message indicating the type of error, its probable causes, and recommended actions is displayed on the SunVTS console.

For internal and external loopback, xnetlbtest reads supported loopback types from the device driver and performs the tests sequentially for each type. In order to setup back-to-back loopback tests, the probe function registers the first of each two consecutive devices, and the last single device if there are an odd number of devices. For example, in a system with five nxge devices configured for xnetlbtest: nxge0, nxge2, nxge3, nxge4, nxge5, xnetlbtest is registered with nxge0, nxge3, and nxge5. Back-to-back loopback test is performed between (nxge0, nxge2) and between (nxge3, nxge4), nxge5 stands by itself and runs internal or external loopback only. With CLI, you can specify any two ports for back-to-back loopback tests.

The test stops when all packets are received or when there is a time out on the next incoming packet. At the completion of the test, the number of received packets are checked against the number sent. The test passes if (Number packets received) >= (Number packets sent - Threshold) where Threshold is the percentage of package drops allowed. An error is reported if there is an excessive packet drop or data is miscompared.



Note - Do not run xnetlbtest with netlbtest, or xnetlbtest with nettest, on the same device at the same time. The test will fail.



xnetlbtest Test Requirements

You must have the Ethernet card and the device driver installed, a loopback connector in place (external loopback only), and Intervention mode enabled before running xnetlbtest. xnetlbtest cannot run and does not appear in the GUI if the network interface is connected to a live network. xnetlbtest also requires that the Ethernet device be configured offline before running the test. Use the ifconfig(1M) command to bring the Ethernet device down before running xnetlbtest. Enter the following commands to bring the interface down:


# ifconfig interface down
# ifconfig interface unplumb

A loopback connector provides the network interface driver, the necessary link for testing, while maintaining isolation from a live network. A loopback connector is needed for external loopback and back-to-back loopback. It is not needed for internal loopback.


xnetlbtest Options


To reach the dialog box (FIGURE 40-1), right-click on test name in the System Map and select Test Parameter Options. If you do not see this test in the System Map, expand the collapsed groups, or your system might not include the device appropriate to this test. Refer to the SunVTS User's Guidefor more details.

Screenshot of the netlbtest Test Parameter Options dialog box

FIGURE 40-1 xnetlbtestTest Parameter Options

Refer to TABLE 40-1 for test parameter descriptions.


TABLE 40-1 xnetlbtest Options

xnetlbtest Options

Description

Loopback Mode

Specifies loopback mode to test: Internal, External, Back-to-back

Data Pattern

Specifies data pattern used in packet payload

Soft Error Threshold

Percentage of packet drop allowed.

Receive Timeout

Determines the amount of time (in seconds) that xnetlbtest can wait to receive a packet. If no packets are received within this time frame, xnetlbtest reports an error.

Delay Between Send

Value in micro-second to delay before sending next packet, used to control the send rate

Frame Size Test

Testing variable length packets. Back-to-back loopback mode only. Package length varies from 64 bytes to Jumbo frame in 48 bytes increment. Set jumbo enable in driver is required.

IP Fragmentation

Testing TCP and UDP fragmentations. Back_to_back mode only

Transmit/Receive (TXRX)

Testing a specified number of packets, a specified packet's type and length.

Packet Count

Number of packets send in TXRX test

Packet Type

Type of packets used in TXRX test

Packet Size

Size of Packet used in TXRX test: 68 to 1500 bytes.

Debug

Option to log transmit/receive packets and error information for debug purpose

Performance Log

Option to display and log kernel statistic of transmit/receive packets and DMA channel distributions



xnetlbtest Test Modes


TABLE 40-2 xnetlbtest Supported Test Modes

Test Mode

Description

Functional

Runs the full set of subtests. The host must not be connected to the network through the intended test device.


Since xnetlbtest requires a loopback connector for the external or back-to-back loopback test, it can only be selected when Intervention mode is enabled.


xnetlbtest Command-Line Syntax

The standard arguments for /opt/SUNWvts/bin/xnetlbtest are described in TABLE 40-3. The command-line syntax is below:

-o lb=<option>,pattern=<option>,thresh=<number>, timeout=<number>,delay=<number>, tpkts=<number>,pktype=<option>,pksz=<number>,debug=<option>,perform=<option>,dev=<device_name>


TABLE 40-3 xnetlbtest Command-Line Syntax

Argument

Description

lb=<option>

Back_to_back_#_# Back to back between 2 ports

Int_#_Int_# (default) Internal for both ports

Ext_#_Ext_# External for both ports

Int_#_only Internal for port # only (first port)

Int_#_only Internal for port # only (next port)

Ext_#_only External for port # only (first port)

Ext_#_only External for port # only (next port)

# is port number (that is: 0 for nxge0, 1 for nxge1, and so on.)

pattern=<option>

Increment (default)

0x5aa55aa5

0xdb6db6db

0x00000000

0xffffffff

thresh=<number>

0 - 3 (default = 2)

timeout=<numbe>

1 - 100 (default=10)

delay=<number>

1 - 100000 (default=20)

variable<Enabled/Disabled>

Default=Disabled

fragment<Enable/dDisabled>

Default=Disabled

txrx<Enabled/Disabled>

Default=Enabled

tpkts<number>

1 - 100000 (default=1000)

pktype=<option>

PKT_RAW Raw packet (default)

PKT_ARP ARP packet

PKT_UDP4_VL0 UDP over IPV4

PKT_TCP4_VL0 TCP over IPV4

PKT_TCP6_VL0 TCP over IPV6

PKT_UDP6_VL0 UDP over IPV6***

pksz=<number>

68 - 1514 (default=1000)

debug<Enabled/Disable>

Default=Disabled

perform<Enabled/Disabled>

Default=Disabled