Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UDP GSO/GRO support. #1309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nathan565656
Copy link

  • Version of iperf3: master

  • Issues fixed (if any): N/A

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

@nathan565656
Copy link
Author

Some discussion related to this pull request is at #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!

@bprodoehl
Copy link

@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;
      |                                   ^~~~~~~~~~~~~~~

@davidBar-On
Copy link
Contributor

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.

@bprodoehl
Copy link

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.

@nathan565656
Copy link
Author

@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

@feiqin-corigine
Copy link

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?

@FirstLoveLife
Copy link

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
Copy link

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?

@gbhardwaja
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants