-
Notifications
You must be signed in to change notification settings - Fork 168
issue: 4656811 Removing TSO #1144
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR removes TCP Segmentation Offload (TSO) support from libvma, eliminating an obsolete feature compilation flavor. The change removes approximately 1,782 lines across 41 files.
Major changes:
- Removed
--enable-tsoconfiguration option andDEFINED_TSOcompile-time flag - Eliminated TSO-specific WQE handling in MLX5 queue pair manager (295 lines)
- Removed TSO segment joining, splitting, and retransmission logic from lwip TCP stack (415 lines)
- Deleted TSO-specific send paths in destination entry handling (174 lines)
- Removed TSO capability detection and initialization from device and ring layers
- Cleaned up TSO-related environment variables (
VMA_TSO,VMA_TX_BUF_SIZE) and documentation
Code quality:
The removal is systematic and complete. All TSO-specific code paths are properly removed, including:
- Build system configuration
- Runtime configuration variables
- Device capability detection
- Data path implementations
- Documentation
The PR maintains clean fallback to standard non-TSO code paths that were already present. No TSO references remain in the codebase after this change.
Confidence Score: 5/5
- This PR is safe to merge with minimal risk - it's a clean feature removal with no functional regressions expected
- Score of 5 reflects that this is a straightforward feature removal where all TSO code paths are properly eliminated and the codebase falls back to existing non-TSO implementations that were already tested. The changes are systematic, complete, and self-contained with no remaining TSO references.
- No files require special attention - all changes are consistent deletions of TSO-specific code
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| configure.ac | 5/5 | Removed --enable-tso configuration option and associated autoconf macro |
| src/vma/ib/base/verbs_extra.h | 5/5 | Removed TSO-related macros and type definitions for both verbs v2 and v3 |
| src/vma/dev/qp_mgr_eth_mlx5.cpp | 5/5 | Removed TSO WQE handling, LSO fill functions, and TSO-specific doorbell ringing (295 lines removed) |
| src/vma/lwip/tcp.h | 5/5 | Removed TSO structure from tcp_pcb and TSO-related macros |
| src/vma/lwip/tcp_out.c | 5/5 | Removed TSO segment joining, splitting, and retransmission logic (415 lines removed) |
| src/vma/proto/dst_entry_tcp.cpp | 5/5 | Removed TSO-specific fast_send and slow_send implementations (174 lines removed) |
| src/vma/sock/sockinfo_tcp.cpp | 5/5 | Removed TSO PCB initialization and TSO-specific ip_output implementations (99 lines removed) |
Sequence Diagram
sequenceDiagram
participant App as Application
participant TCP as TCP Stack (lwip)
participant Dst as dst_entry_tcp
participant Ring as ring_simple
participant QP as qp_mgr_eth_mlx5
participant HW as Hardware NIC
Note over App,HW: Before TSO Removal
App->>TCP: tcp_write(data)
TCP->>TCP: Check TSO capability
alt TSO Enabled
TCP->>TCP: tcp_tso_segment() - join segments
TCP->>Dst: fast_send() with VMA_TX_PACKET_TSO
Dst->>Ring: Check TSO caps (max_payload_sz, max_header_sz)
Ring->>QP: send() with TSO WQE
QP->>QP: fill_wqe_lso() - prepare TSO WQE
QP->>HW: Post TSO WQE with large payload
else TSO Disabled
TCP->>Dst: fast_send() standard
Dst->>Ring: send()
Ring->>QP: send()
QP->>QP: fill_wqe() - standard WQE
QP->>HW: Post standard WQE
end
Note over App,HW: After TSO Removal
App->>TCP: tcp_write(data)
TCP->>Dst: fast_send() standard
Dst->>Ring: send()
Ring->>QP: send()
QP->>QP: fill_wqe() - standard WQE
QP->>HW: Post standard WQE
41 files reviewed, no comments
|
bot:retest |
f8afc12 to
00676bb
Compare
Greptile OverviewGreptile SummaryThis PR comprehensively removes TSO (TCP Segmentation Offload) support from libvma, eliminating the compilation flavor that allowed hardware-accelerated large TCP segment transmission. Key Changes
Architecture ImpactThe removal simplifies the codebase by consolidating dual code paths (TSO vs non-TSO) into a single standard path. TCP segmentation now occurs entirely in software at the MSS boundary, rather than being offloaded to hardware. This affects throughput characteristics for large data transfers but simplifies maintenance and reduces code complexity by ~1,771 lines. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User as User Application
participant Config as Build System
participant SysVars as System Variables
participant Socket as Socket Layer
participant TCP as TCP/lwIP Layer
participant DST as Destination Entry
participant Ring as Ring (QP)
participant QP as QP Manager (MLX5)
participant HW as Hardware/Verbs
Note over Config,HW: Before: TSO Enabled Path
User->>Config: Configure with --enable-tso
Config->>SysVars: Set DEFINED_TSO flag
SysVars->>Socket: enable_tso=true, tx_buf_size set
Socket->>TCP: Initialize TSO caps (max_payload_sz, max_header_sz)
TCP->>TCP: tcp_tso_segment() - join segments
TCP->>DST: Send large buffer (>MSS)
DST->>Ring: fast_send with TSO flag
Ring->>QP: fill_wqe_lso() - TSO work queue
QP->>HW: MLX5_OPCODE_TSO with large payload
Note over Config,HW: After: TSO Removed Path
User->>Config: Configure (no TSO option)
Config->>SysVars: No DEFINED_TSO flag
SysVars->>Socket: Standard configuration only
Socket->>TCP: Standard TCP segmentation
TCP->>TCP: Standard MSS-sized segments
TCP->>DST: Send standard buffer (<=MSS)
DST->>Ring: fast_send standard path
Ring->>QP: fill_wqe() - standard WQE
QP->>HW: MLX5_OPCODE_SEND with normal payload
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
42 files reviewed, no comments
00676bb to
e5f6aaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
42 files reviewed, no comments
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
src/vma/lwip/tcp_out.c
Outdated
| } | ||
|
|
||
| LWIP_DEBUGF(TCP_TSO_DEBUG | LWIP_DBG_TRACE, | ||
| LWIP_DEBUGF(LWIP_DBG_TRACE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can combine to 1 line, it does not cross the chars count per line limit
| m_sge = new (nothrow) struct ibv_sge [m_p_ring->get_max_send_sge()]; | ||
| #else | ||
|
|
||
| m_sge = new (nothrow) struct ibv_sge [2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 will be used for ZC yea? 1 for headers and 1 for data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not related to ZC just general WQE posting with ibv_sge
|
Removing TSO code, introduced DEAD code, this struct is only used in TSO deleted logic. "typedef struct { |
|
@dpressle Please review changes in CI files and approvde |
BasharRadya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove dead code
Removing TSO (TCP Segmentation offload) compilation flavor. Signed-off-by: Alexander Grissik <[email protected]>
e5f6aaa to
3af7c13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
42 files reviewed, no comments
Description
Removing TSO (TCP Segmentation offload) compilation flavor.
Why ?
Removing obsolete features
Change type
What kind of change does this PR introduce?
Check list