emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.03k stars 234 forks source link

How to configure the link speed for DPDK NIC? #298

Closed yyu4 closed 3 years ago

yyu4 commented 3 years ago

Hi,

I am using x540 NIC to test a 100Mbps network latency. Firstly I need to measure the x540 NIC self latency, i.e. to test the latency of back-to-back connection between two ports of x540. And the 100Mbps link speed is required. My question is how to configure x540 link speed, instead of auto-negotiation?

thanks, -Yi

vipinpv85 commented 3 years ago

can you share the following details like

  1. OS version
  2. Nic firmware
  3. driver being - igb_uio or vfio-pci or uio_pci_generic
  4. DPDK version
  5. shared or static library
  6. sample application in use (testpmd, skeleton, l2fwd) etc?

Reason for asking a sample DPDK application is because I assume you have already tried go into moon gen code search for ### rte_eth_dev_configure. Edit the last argument ### eth_conf to disable ### AUTONEG and enable ### FIXED with the required speed. Recompile and the test is failing for you.

yyu4 commented 3 years ago

Thank you @vipinpv85 . Your suggestion of "rte_eth_dev_configure" is the right answer for me. I was running "./build/MoonGen" bash with scripts like "l3-load-latency" etc. After configuring line 131 of MoonGen/libmoon/src/device.c to "./link_speeds = ETH_LINK_SPEED_100M," the NIC works at 100Mbps for me now. Best, -Yi