Cadence Macb Linux Driver for Zynq
Introduction
This page gives an overview of the macb driver which is available as part of the Zynq Linux distribution and in the mainline.
Paths, files, links and documentation on this page are given relative to the Linux kernel source tree.
Kernel Configuration Options
The following config options should be enabled in order to build the macb driver
CONFIG_ETHERNET
CONFIG_NET_CADENCE
CONFIG_MACB
CONFIG_NETDEVICES
CONFIG_HAS_DMA
{macb_kconfig.png}
Mainline status
The macb driver is currently in sync with mainline and any further changes will be upstreamed.
Devicetree
For more details on phy bindings please refer "Documentation/devicetree/bindings/net/macb.txt"
gem0: ethernet@e000b000 {
compatible = "cdns,gem";
reg = <0xe000b000 0x1000>;
status = "disabled";
interrupt-parent = <&gic>;
interrupts = <0 22 4>;
clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <1>;
#size-cells = <0>;
phy-handle = <ðernet_phy>;
phy-mode = "rgmii-id";
ethernet_phy: ethernet-phy@7{
reg = <7>;
};
};
Features supported
Support for EthTool queries
NAPI support
Power management support
Known Issues and Limitations
Single MAC managing two PHYs: The current driver has no support for this use case.
No interrupt support for PHY events in driver. The current implementation relies on polling method for phy events
Testing Tools
Diagnostic and Protocol Tests
PING
This utility used to test the reachability of a host on an Internet Protocol(IP) network and to measure the round trip time for messages sent from the originating host to a destination computer
How to Run:
ping <Remote IP Address>
WebServer
Connect zynq board to a Linux x86 machine. Ensure that telnet server is running on the Zynq board. It tests for remote access for zynq board on host machine
Open a web browser on host machine and enter the static IP assigned to zynq board. Webpage is expected to be displayed properly.
Telnet
telnet <Server IP Address>
FTP & TFTP
How to run:
Open a ftp client on the host with the Zynq.
x86> ftp 192.168.1.10
Transfer a big enough file (in MBs) using mput command.
x86> mput <file_name>
File transfer should be completed without any error
Pkt Generator
Please refer the below link for how to run and various options
https://www.kernel.org/doc/Documentation/networking/pktgen.txt
Performance Tests
Netperf
How to Run
Server:
netserver
Client:
taskset 2 ./netperf -H <Server IP> -t TCP_STREAM
taskset 2 ./netperf -H <Server IP> -t UDP_STREAM
For more information please refer the below link:
http://www.netperf.org/netperf/
[[code]]
===Iperf===
How to Run
Server:
./iperf_arm -s -u
./iperf_arm -s
Client:
./iperf_arm -c <Server IP> -u -b <banwidth>
./iperf_arm -c <Server IP>
For more information please refer the below link:
http://en.wikipedia.org/wiki/Iperf
==Stress Test==
===Iperf with option -d===
Run iperf in dual testing mode. This will cause the server to connect back to the client on the port specified in the -L option (or defaults to the port the client connected to the server on). This is done immediately therefore running the tests simultaneously.
./iperf_arm -c <Server IP> -d
===Ping flood test===
Users can send hundred or more packets per second using -f option. It prints a ‘.’ when a packet is sent, and a backspace is printed when a packet is received
ping -f localhost
===gravecat===
gravecat is a tool which is shared by NI. It sends a lot of small sized UDP packets to overwhelm the Rx path.
How to run:
- Ensure gravecat binary is available in the SD card/ramdisk to be used after Linux boots up.
- Use the gravecat binary for x86 64 bit machine on the host.
- Run the following commands:
zynq> ./gravecat_armv7a -l 9999 &
x86> ./gravecat_x86_64 -s <zynq_gem_ip_address> 9999 4 1000 500
code
- Run it for 10 minutes. Stop the tool from host. Ping the Zynq board. Zynq board should respond properly.
- There should be no Rx lock up or hang. Zynq should respond to the ping requests.
Work to be done
IEEE 1588 support to be migrated from emacps driver to macb driver
Support for single mac managing two phys
Related Links