📜 ⬆️ ⬇️

Introduction to the Ethernet Fast Path software on the P1020RDB debug board



Despite the fact that ARM architecture processors are beginning to actively conquer the market for broadband communication systems and network technologies, PowerPC processors still occupy a significant market share due to manufacturers such as Freescale .

In this article, we will explore the technical capabilities of the Freescale P1020 processor in terms of handling Ethernet traffic. And also check the IP routing performance on the P1020RDB debug card (see above for an appearance).

The reference card (RDB) QorIQ P1020 is a multifunctional platform that can be used in a wide variety of device types. 1 GB of DDR3 SDRAM memory (unbuffered) is available, as well as 16 MB NOR flash and 32 MB NAND flash (with the ability to boot from NOR or NAND flash memory). The board supports six gigabit ports via SGMII PHY, RGMII PHY and a built-in 4-port switch, as well as 2-ports USB On-The-Go (OTG), four FXS-ports and one FXO-port (via a relay).
')

Block diagram of P1020RDB

Learn more about the P1020RDB at freescale.com .

To speed up the processing of network traffic, Freescale proposes to use ASF (Application Specific Fastpath) technology for the Linux kernel.

An ASF implementation is a dynamically loadable Linux kernel module that can be plugged into the Linux stack while it is running. Once connected to the Linux stack, packets are intercepted from a Linux (Ethernet) network device driver to the ASF data link module.

ASF is designed for the most common data transfer applications.

Key Applications

ASF is used to speed bandwidth:
  1. IPv4 Firewall + NAT / NAPT Forwarding
  2. IPv6 Firewall Forwarding
  3. IPv4 + IPv6 IPSec (ESP & AH) Forwarding
  4. QoS support

ASF implementation scheme

ASF integrates with various Linux network management modules to extract information for data processing. The figure below shows how the ASF module fits into the overall system on a typical network processor software architecture.


ASF software architecture

On the P1020RDB card, the software is installed on: QorIO-SDK-1.7-20141218-yocto

For ASF to work, you need to enable the appropriate option in the kernel from Freescale:
Application Specific FastPath ( Disabled by Default ) │ Location: │ -> Device Drivers │ -> Network device support (NETDEVICES [=y]) 

To test the bandwidth we will use a network analyzer:


Network analyzer

Test scenario tincture


We will test performance on a typical IP routing task according to RFC2544 - Benchmarking Methodology for Network Interconnect Devices.

The data flow from the first port of the analyzer is sent via the P1020RDB board to the second port. The received traffic is reflected and sent back through the P1020RDB to the first port of the analyzer. Thus, during the test, two multidirectional data streams (Full Duplex) flow through the P1020RDB. In order to perform full-duplex routing of 1 Gbps traffic, the processor must manage to process 2 Gbps of data per second.


On the scheme - the tested configuration

Configuration P1020RDB


Configuring IPv4 Addresses and Masks on eth0 and eth1 interfaces:
 ifconfig eth0 192.168.1.100 netmask 255.255.0.0 up ifconfig eth1 10.10.10.100 netmask 255.0.0.0 up 

Enable board routing:
 echo 1 > /proc/sys/net/ipv4/ip_forward 

Loading ASF kernel modules:
 insmod asf.ko insmod asfctrl.ko 

Increasing the number of possible threads:
 echo 140000 > /proc/sys/net/nf_conntrack_max 

Set UDP timeout to 9000 s (for performance test):
 echo 9000 > /sys/asfctrl/ffp/asfctrl_ffp_udp_tmout 

Setting the parameters for batch processing:
 ethtool -C eth0 rx-frames 12 rx-usecs 32 ethtool -C eth1 rx-frames 12 rx-usecs 32 

Setting Rx and Tx ring sizes:
 ethtool -G eth0 rx 32 tx 32 ethtool -G eth1 rx 32 tx 32 

The purpose of the kernel for interrupt handling:
 echo 2 > /proc/irq/30/smp_affinity echo 1 > /proc/irq/36/smp_affinity 

Turn off PTP:
 echo 0 > /sys/class/net/eth0/ptp_1588 echo 0 > /sys/class/net/eth1/ptp_1588 

Network analyzer setup:

Run a bandwidth test.

Throughput (payload) IP routing on P1020RDB with ASF


Findings:
Application Specific Fastpath on the P1020RDB works, i.e. when performing IP forwarding at a speed of 956.569 Mbit / s (frame 1500 bytes), the processor load was at the level of 2% (top).

It is worth noting that when processing traffic using ASF, it does not pass through the Linux stack, this can be seen from the lack of activity on the interface when tcpdump is started.

[!?] Thank you for your attention! Questions and comments are welcome. They will be answered by the programmer of the electronics center Promwad.

Source: https://habr.com/ru/post/257015/


All Articles