iperf icon indicating copy to clipboard operation
iperf copied to clipboard

Add UDP GSO/GRO support.

Open nathan565656 opened this issue 2 years ago • 9 comments

  • Version of iperf3: master

  • Issues fixed (if any): N/A

  • Brief description of code changes: Add UDP GSO/GRO support.

nathan565656 avatar Apr 05 '22 18:04 nathan565656

Some discussion related to this pull request is at https://github.com/esnet/iperf/discussions/1281 in case someone is interested in the details.

Please kindly let me know if anything is missing or it's better to add something more, ex. implementation details or any explanation. Please also feel free to let me know if any question. I will update and get back soon. Thanks!

nathan565656 avatar Jun 13 '22 18:06 nathan565656

@nathan565656 I'm seeing these compilation errors. Am I missing a step?

iperf_api.c: In function 'iperf_defaults':
iperf_api.c:2805:28: error: 'GSO_DEF' undeclared (first use in this function)
 2805 |     testp->settings->gso = GSO_DEF;
      |                            ^~~~~~~
iperf_api.c:2805:28: note: each undeclared identifier is reported only once for each function it appears in
iperf_api.c:2807:36: error: 'GSO_BF_MAX_SIZE' undeclared (first use in this function)
 2807 |     testp->settings->gso_bf_size = GSO_BF_MAX_SIZE;
      |                                    ^~~~~~~~~~~~~~~
iperf_api.c:2810:28: error: 'GRO_DEF' undeclared (first use in this function)
 2810 |     testp->settings->gro = GRO_DEF;
      |                            ^~~~~~~
iperf_api.c:2811:36: error: 'GRO_BF_MAX_SIZE' undeclared (first use in this function)
 2811 |     testp->settings->gro_bf_size = GRO_BF_MAX_SIZE;
      |                                    ^~~~~~~~~~~~~~~
iperf_api.c: In function 'iperf_reset_test':
iperf_api.c:3108:35: error: 'GSO_BF_MAX_SIZE' undeclared (first use in this function)
 3108 |     test->settings->gso_bf_size = GSO_BF_MAX_SIZE;
      |                                   ^~~~~~~~~~~~~~~
iperf_api.c:3111:35: error: 'GRO_BF_MAX_SIZE' undeclared (first use in this function)
 3111 |     test->settings->gro_bf_size = GRO_BF_MAX_SIZE;
      |                                   ^~~~~~~~~~~~~~~

bprodoehl avatar Oct 03 '23 16:10 bprodoehl

I'm seeing these compilation errors. Am I missing a step?

@bprodoehl,, did you re-run configure (and maybe bootstrap.sh)? This should be done as these are probably new declarations in configure.ac.

davidBar-On avatar Oct 04 '23 08:10 davidBar-On

I'm seeing these compilation errors. Am I missing a step?

@bprodoehl,, did you re-run configure (and maybe bootstrap.sh)? This should be done as these are probably new declarations in configure.ac.

I did run bootstrap.sh and configure before posting. I don't see them defined anywhere in the PR, so my guess is they were meant to be added to iperf_api.h but forgotten. I added them locally, defaulting GSO and GRO to 0 and defaulting the max buffer sizes to 128K, and it seems ok.

bprodoehl avatar Oct 04 '23 10:10 bprodoehl

@bprodoehl Sorry that somehow that part was missing. Please add the following in "iperf.h". Please feel free to let me know if there is any other question. Thanks.

#define GSO_BF_MAX_SIZE 64000 #define GSO_DEF 0 #ifndef UDP_SEGMENT #define UDP_SEGMENT 103 #endif #define GRO_DEF 0 #define GRO_BF_MAX_SIZE 65535 #ifndef UDP_GRO #define UDP_GRO 104 #endif

nathan565656 avatar Oct 05 '23 00:10 nathan565656

Hi, @bprodoehl @nathan565656. Hope you have a nice day. We are also interested in the UDP GSO which looks highly benefit improving UDP performance.
May i ask if there's any plan to merge the support for UDP GSO?

feiqin-corigine avatar Nov 23 '23 08:11 feiqin-corigine

Hi, @bprodoehl @nathan565656. Hope you have a nice day. We are also interested in the UDP GSO which looks highly benefit improving UDP performance. May i ask if there's any plan to merge the support for UDP GSO?

Maybe @nathan565656 can rebase his commit to fix the compile issue first.

FirstLoveLife avatar Nov 30 '23 03:11 FirstLoveLife

Hi @nathan565656 ,

I hit SIGFPE when run with your patch:

(gdb) r
Starting program: /usr/local/bin/iperf3 -c 10.4.8.129 -u --gsro -b 0
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGFPE, Arithmetic exception.
iperf_parse_arguments (test=test@entry=0x5555555592a0, argc=argc@entry=7, argv=argv@entry=0x7fffffffdc68) at iperf_api.c:1673
1673            test->settings->gso_bf_size = (test->settings->gso_bf_size / test->settings->gso_dg_size) * test->settings->gso_dg_size;

Could you kindly please take a look?

FirstLoveLife avatar Nov 30 '23 07:11 FirstLoveLife

Hi, when this feature will be merged and avilable on iperf3 ?

gbhardwaja avatar Sep 27 '24 04:09 gbhardwaja