Skip to content

feat(igc): enable tx checksum offload#694

Draft
ytakano wants to merge 2 commits into
tier4:mainfrom
ytakano:igc_tx_csum_offload
Draft

feat(igc): enable tx checksum offload#694
ytakano wants to merge 2 commits into
tier4:mainfrom
ytakano:igc_tx_csum_offload

Conversation

@ytakano

@ytakano ytakano commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Description

  • 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

Related links

How was this PR tested?

Notes for reviewers

ytakano and others added 2 commits June 8, 2026 18:30
- 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>
Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and CSUM_UDPv4 capabilities 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, &ether_frame, head)?;

let needed = ctx_count + 1;
if tx.igc_desc_unused() < needed {
return Ok(());
}
dropped_pkts: u64,
}

#[derive(Debug, PartialEq)]
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.

2 participants