iperf icon indicating copy to clipboard operation
iperf copied to clipboard

Add sendmmsg support for UDP

Open davidBar-On opened this issue 5 years ago • 2 comments

  • Version of iperf3 (or development branch, such as master or 3.1-STABLE) to which this pull request applies: 3.10.1 latest master

  • Issues fixed (if any): #873

  • Brief description of code changes (suitable for use as a commit message):

Add sendmmsg support for sending UDP messages for enhanced throughput. sendmmsg is used by setting the -Z option (which is currently used only for TCP), as it is regarded as the UDP's alternative to TCP's zero copy. The number of packets that are send by each call to sendmmsg is the burst size set by the -b option.

Note:

  1. configure.ac was changed so running bootstrap.sh; configure is required for the changes to take effect. (New defines are HAVE_SENDMMSG, HAVE_RECVMMSG and HAVE-SEND_RECVMMSG.)
  2. recvmmsg is not used because tests showed does not help the throughput and event may hart it. However, the changes for testing recvmmsg are commented out in iperf_udp_recv() and not removed in case further evaluation is desired. If this is not the case, then all changes tp iperf_udp_recv can be removed.

davidBar-On avatar Aug 09 '20 16:08 davidBar-On

@bmah888 I have change the PR to use -Z option for using sendmmsg for UDP, instead of adding a new option (I also rewrote the PR description). I also enhanced implementation, so if -Z is not used for UDP, practically there should not be any change to the current iperf3 behavior. Therefore the risk of adding these changes is low.

The UDP throughput enhancement achieved for high throughput interfaces is quite substantial, especially when the UDP messages are not large (witch is usually the case).

davidBar-On avatar Sep 18 '21 11:09 davidBar-On

@bmah888 Any plan to have this PR reviewed and merged?

database64128 avatar Apr 13 '22 14:04 database64128