feat(igc): enable tx checksum offload#694
Draft
ytakano wants to merge 2 commits into
Draft
Conversation
- Add ActiveChecksumContext enum to Tx to track and reuse context descriptors - Add igc_tx_ctx_setup() to program the Advanced TX Context Descriptor for IPv4, TCP/IPv4, and UDP/IPv4 checksum offload - Update igc_send() to prepend a context descriptor when offload context changes - Advertise CSUM_IPv4, CSUM_TCPv4, and CSUM_UDPv4 capabilities - Enable TCP checksum offload in if_net and update the capability comment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds IPv4/TCPv4/UDPv4 TX checksum offload support for the Intel IGC (I225/I226) driver by introducing advanced TX context descriptors and advertising the corresponding network capabilities so the stack can request hardware checksum insertion.
Changes:
- Add tracking for the “active” TX checksum context and emit an Advanced TX Context Descriptor when the offload context changes.
- Advertise
CSUM_IPv4,CSUM_TCPv4, andCSUM_UDPv4capabilities in the IGC driver and enable TCP checksum offload in the network interface capabilities mapping. - Extend IGC descriptor definitions/structures to support Advanced Context Descriptors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| awkernel_lib/src/net/if_net.rs | Enables TCP checksum offload reporting to smoltcp when the device advertises CSUM_TCPv4. |
| awkernel_drivers/src/pcie/intel/igc/igc_defines.rs | Adds constants needed to build Advanced TX Context Descriptors for checksum offload. |
| awkernel_drivers/src/pcie/intel/igc/igc_base.rs | Extends the advanced TX descriptor union to include the context descriptor view. |
| awkernel_drivers/src/pcie/intel/igc.rs | Implements context descriptor setup, context reuse tracking, capability advertisement, and send-path changes to prepend context descriptors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1008
to
+1010
| type_tucmd_mlhl |= IGC_ADVTXD_TUCMD_IPV4; | ||
| ip.header_len() as u32 | ||
| } |
Comment on lines
+1061
to
+1064
| let desc = &mut tx.tx_desc_ring.as_mut()[head]; | ||
| desc.adv_ctx.vlan_macip_lens = u32::to_le(vlan_macip_lens); | ||
| desc.adv_ctx.ts.launch_time = u32::to_le(0); | ||
| desc.adv_ctx.type_tucmd_mlhl = u32::to_le(type_tucmd_mlhl); |
Comment on lines
+1097
to
1105
| let head = tx.next_avail_desc; | ||
| let ring_len = tx.tx_desc_ring.as_ref().len(); | ||
|
|
||
| let (ctx_count, data_olinfo_status) = self.igc_tx_ctx_setup(&mut tx, ðer_frame, head)?; | ||
|
|
||
| let needed = ctx_count + 1; | ||
| if tx.igc_desc_unused() < needed { | ||
| return Ok(()); | ||
| } |
| dropped_pkts: u64, | ||
| } | ||
|
|
||
| #[derive(Debug, PartialEq)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related links
How was this PR tested?
Notes for reviewers