Commit 5ee0e8e
committed
udp gso/gro: move policy to client; send explicit params; server accepts and applies locally
Client remains the source of truth for UDP GSO/GRO policy (including --no-gsro). During parameter exchange, the client now sends GSO/GRO flags and sizes in JSON, and the server simply consumes those values without recomputing.
Kernel capability gating stays local and authoritative: each endpoint attempts to enable GSO/GRO on its own sockets via setsockopt, and if the kernel rejects it, we log and flip the local flag off. This handles the case where only one side supports the feature (GSO for the sender, GRO for the receiver).
Backward compatibility: if talking to an older client that doesn’t send GSO fields, the server derives gso_dg_size from blksize and adjusts gso_bf_size, falling back to DEFAULT_UDP_BLKSIZE if zero. This preserves previous behavior without overriding explicit client intent.
Behavior details:
- --no-gsro on the client sends gso=0 and gro=0, so the server won’t try to enable them.
- If -l/--length is provided, blksize (and therefore gso_dg_size when enabled) follows that value; otherwise default logic applies.
Files: src/iperf_api.c (send_parameters adds gso/gro fields; get_parameters reads them and removes server-side recompute unless needed for compatibility).1 parent d26a207 commit 5ee0e8e
1 file changed
+34
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2479 | 2479 | | |
2480 | 2480 | | |
2481 | 2481 | | |
| 2482 | + | |
| 2483 | + | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2482 | 2498 | | |
2483 | 2499 | | |
2484 | 2500 | | |
| |||
2602 | 2618 | | |
2603 | 2619 | | |
2604 | 2620 | | |
| 2621 | + | |
2605 | 2622 | | |
2606 | | - | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
2607 | 2633 | | |
2608 | | - | |
2609 | 2634 | | |
2610 | 2635 | | |
2611 | 2636 | | |
2612 | | - | |
2613 | 2637 | | |
2614 | 2638 | | |
2615 | 2639 | | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
2616 | 2647 | | |
2617 | 2648 | | |
2618 | 2649 | | |
| |||
0 commit comments