This topic describes how to diagnose and locate Shared Memory Communication (SMC) faults.
Prerequisites
smc-tools, which is a user-mode SMC maintenance toolset provided by Alibaba Cloud Linux 3, is installed.
If the smc-tools toolset is not installed, run the following command to install the toolset:
sudo yum install -y smc-toolsFallback diagnostics
The SMC stack automatically negotiates with the peer about whether to use SMC during connection establishment. If the conditions for using SMC are not met, the stack securely falls back to TCP. You can run the smcss command to query the fallback reason for each SMC connection. For more information, see Monitor connections.
Packet capture diagnostics
The SMC stack uses Remote Direct Memory Access (RDMA) and other Direct Memory Access (DMA) technologies for data transmission to bypass the traditional network protocol stack. In this case, traditional sniffing points cannot be directly used to capture data packets and control packets.
Starting from version ANCK 5.10.134-18, the Alibaba Cloud Linux 3 kernel provides a solution for capturing data packets and control packets on the SMC stack:
When receiving or sending connection control messages and data blocks in shared memory, the SMC kernel stack constructs a UDP socket buffer (skb) that points to the target data memory and sends the skb to a specific virtual network device (dummy device). The skb is silently consumed by the virtual network device and does not enter the network. During this process, the skb passes through the existing kernel sniffing points, as shown in the following diagram with
dev_queue_xmit_nit(). This allowstcpdumpandlibpcapto capture the data packets and control packets sent or received by the SMC stack on the virtual network device.The TCP packets in the SMC handshake process are still captured on the original Ethernet network interface controller (NIC).
The following table describes the methods for capturing packets during the stages shown in the preceding diagram.
Packet type | Traffic-bearing device | Capture device | Captured packet format |
SMC handshake negotiation TCP packets or packets after fallback to TCP stack | Ethernet NIC, such as | Ethernet NIC, such as | TCP |
SMC data packets or control packets | RDMA NIC, such as | Virtual NIC, such as | UDP |
smc-tools provides the packet capture tool smcdump-ex based on this solution, which is a re-encapsulation script of the tcpdump tool for conveniently capturing the entire SMC communication process. smcdump-ex creates a virtual network device named smc-dummy{4-letter random character} in the current net namespace and enables the feature of capturing SMC data packets and control packets. smcdump-ex uses tcpdump to capture SMC handshake negotiation packets, data packets, and control packets on Ethernet devices or virtual network devices as required. Upon receiving a SIGINT (Ctrl+C) signal, smcdump-ex ends the capture, disables the capture feature, and destroys the virtual network device.
Tool usage
Run the following command to query the usage of
smcdump-ex.Warningsmcdump-ex is an experimental tool, and its usage may change in the future.
smcdump-ex -h usage: smcdump-ex [-h] [-m {all,smc,smcd,smcr}] [-t {all,raw,cdc}] [--param PARAM] [--filter FILTER] [--legacy] SMC Dump - SMC Traffic Capture (Experimental) optional arguments: -h, --help show this help message and exit -m {all,smc,smcd,smcr}, --mode {all,smc,smcd,smcr} Select the mode (default: smc) -t {all,raw,cdc}, --type {all,raw,cdc} Select the packet type (default: all) --param PARAM Additional parameters for tcpdump. e.g. --param '-w packets.pcap' --filter FILTER Additional filter expressions for tcpdump. e.g. --filter 'host xxx.xxx.x.x and port 8080' --legacy Use the legacy SMC dump header formatUse
-mto set the data capture modeOptional capture modes:
all: Capture packets on all network interfaces, which is equivalent to invokingtcpdump -i any. If you specifyall, SMC handshake negotiation packets on Ethernet interfaces and capture SMC data packets and control packets on newly created virtual network interfaces are captured. In this mode, we recommend that you use--filterto configure additionaltcpdumpfilter expressions to narrow the scope of network packet capture for accurately capturing SMC negotiation packets. For more information, see--filter.smc,smcr, andsmcd: Capture only SMC, SMC-R, and SMC-D data packets and control packets on the newly created virtual network interfaces, respectively, which is equivalent to invokingtcpdump -i smc-dummy{4-letter random character}.
Use
-tto set the type of network packets to captureOptional types of network packets to capture:
all: SMC data packets and control packets.raw: only SMC data packets.cdc: only SMC control packets.
Use
--paramto specify additionaltcpdumpparametersFor example, specify
--param '-w smcdata.pcap'to dump the captured content to a file.Use
--filterto configure additionaltcpdumpfilter rulesFor example, specify
--filter 'host <ip> and port <port>'to configure the IP address and port of the packets to be captured. This ensures that SMC negotiation packets are accurately captured and prevents interference from other TCP network packets in the result analysis.Use
--legacyto parse the oldsmc dump headerformatThis parameter is only for compatibility with the
ANCK 5.10.134-17.3kernel version. For kernel versionsANCK 5.10.134-18and later, this parameter is not required.
Examples
For example, run the following smcdump-ex command to capture all data packets that include the IP address 192.168.2.5 and port number 5201 during the SMC connection communication and dump the captured packets to the
smc.pcapfile:smcdump-ex -m all -t all --param '-w smc.pcap' --filter 'host 192.168.2.5 and port 5201'You can use Wireshark with the Lua plug-in to further analyze the captured packets that you dump to the
.pcapfile by using the--param '-w <pcap file>'parameter.Download and install Wireshark.
Use Wireshark with the Lua plug-in to further analyze the captured packets stored in the
.pcapfile.Download the Lua plug-in: https://os-smc-new.oss-cn-hangzhou.aliyuncs.com/smc_dump.lua.
NoteTo use the Lua plug-in, ensure that the Lua interpreter version in Wireshark is 5.3 or later.
Check the installation path of the
Wireshark Lua scriptand place the Lua script in the path.Check the installation path of the
Wireshark Lua scripton macOS.Run Wireshark.
In the menu bar, choose


Check the installation path of the
Wireshark Lua scripton Windows.Run Wireshark.
In the main interface of Wireshark, choose .

Restart Wireshark or reload the Lua plug-in for the script to take effect. Then, all UDP packets that include the SMC dump header in the payload are parsed as SMC packets.
Performance diagnostics
If you encounter issues, such as SMC performance fallback, during performance comparison tests, you can use basic performance testing tools to identify the issues.
For SMC, you can use basic network performance testing tools, such as
sockperf,qperf,iperf3, andnetperf, for bandwidth and latency benchmarking.For elastic RDMA (eRDMA), you can use the
perftestbasic performance testing tool for bandwidth and latency benchmarking. For more information, see Test eRDMA network performance.
If SMC or eRDMA experiences performance fallback during benchmarking, submit a ticket for further processing. If the benchmarking is normal, refer to Enable and configure SMC to check the SMC configuration.