-
Notifications
You must be signed in to change notification settings - Fork 129
Memcached Client Project
memcached_client
contrib-projects/memcached_client
- NetFPGA-10G Specific cores
- [nf10_10g_interface](10G MAC Interface)
- nf10_mdio
- nf10_axis_memcached
- Xilinx AXI Peripheral
- Microblaze Subsystem
- Other
- [Linux Ethernet Driver](NetFPGA 10G Reference NIC Ethernet Driver)
host.py - control terminal and python library selftest.py - selftest and automation example script memcached_pcapgen - Memcached testcase generator memlib - memcached support libarary
The NetFPGA-10G Testclient can be used to test the performance, latency and correctness of an application server. It comes with an interactive configuration terminal for the host that can be fully automated using python. It allows to load test scenarios directly from packet capture files (.pcap). Finally, support scripts to use it as a memcached testclient right away are included in this project.
The testclient uses two of the 10Gb ethernet ports present on the NetFPGA board to connect to the servers to be tested. The RS232 port is used to configure the system. A microblaze is connected to the UART over AXI and manages the communication with the configuration host. It will then configure the testclient IP cores accordingly, connected over AXI. There are two testclient cores present that behave identical. Each of them is connected to one of the two ethernet ports to test one application server each.
There are three functional units in the testclient: Packet Generator, Packet Checker and Latency Measurement. The packet generator issues request packets to the application server over the ethernet port. It is connected to the send/TX buffer, a configurable buffer that contains the request to be sent. The delay between repeated requests is configurable, allowing for request rates from a few Mbps up to 10Gbps. The packet checker allows for basic performance evaluation and correctness validation of the application server. It is connected to the check/RX buffer. For correctness validation, this buffer can be loaded with the response expected from the server for the configured request packet in the send/TX buffer. Each packet the testclient receives on the ethernet port is compared against the check/RX buffer and a statistic is kept on how many received packets match the expected response. This statistic also serves as a basic performance indicator. The latency measurement unit sends a single request packet and measures the time for a response packet to be received. The maximum latency is 5sec.
The testclient can be configured and controlled over RS232. A user interface is presented when connecting to the client with a serial terminal. More convenient however is the use of the included python host library 'enter_name_here.py' that provides additional functionality. It can be used as a standalone control application or be important as a module in a customized python script for test automation.
When starting the python host standalone, it asks for the serial port to use, prints the available control commands and drops into an interactive shell. This is not just any shell, but a fully function python shell with the testclient configuration commands preloaded. This allows to benefit from the whole python ecosystem and can provide more high-level functionality than a simple serial connection. Two features are highlighted here. Most interesting, the packets for the send/TX and check/RX buffers can directly be loaded from a packet capture file (.pacp) and the library takes care of the conversion and transmission to the testclient. This includes recorded traffic traces from Wireshark. By default, the first two packets in the .pcap are used for the send and check buffer, respectively. Second, it has been taken care to present the testclient data neatly integrated into the programming environment. For instance, the traffic statistics of the client are returned as a HashMap where data fields can be indexed directly. Thus, results can easily be further processed as required by the testing infrastructure. This is most conveniently done by using the python library as a module in an automated testing script rather than using it standalone. Most functions will return an array of two maps corresponding to the data coming from the two testclients present on the board.
Further documentation can be found in the python files. The selftest also serves as an example script for automated testing.
The NetFPGA testclient can be tested without a server by letting the two ethernet ports talk to each other. Thus, the request sent from one port is interpreted as the response on the other port and vice versa.
Download the testclient bitfile from projects/memcached_client/bitfiles/testclient.bit. (Refer to Production Test Manual for instructions on how to download the bitfile or setup JTAG cable yet.) Connect client0 on nf0 (the port nearest to the PCI Express) to client1 on port nf3. Connect the NetFPGA-10G board to your controlling host computer over RS232. On your host, go to the software directory projects/memcached_client/sw/host and run the selftest.py. If successfull, the output should look similiar to the screenshot below.
If the script terminates with an error, you are most likely missing some python libraries. The error message should give you a hint which modules to install. If the script runs but the result is not correct, try connecting to the testclient directly with a serial terminal to verify the basic functionality.
- The hostcode requires Python 2.7 or higher.
- When the statistics counter exceeds 2 bil, they are reported as negative counts on the serial port. This breaks the python code.
- When tests are automated using python, a short sleep should be performed after each command before issuing the next one (especially buffer updates). Most PC's are to fast on the serial port for the microblaze to handle.