Skip to content

Conversation

iyzhang
Copy link
Contributor

@iyzhang iyzhang commented Sep 25, 2025

This PR fixes an issue where the inetstack was using the default implementation of max_buffer_size_bytes() rather than getting it from the underlying physical layer. For example, in Catnip, this meant that we were not using the configured DPDK max_body_size.

@iyzhang iyzhang self-assigned this Sep 25, 2025
@iyzhang iyzhang added the bug Something Isn't Working label Sep 25, 2025
Copy link

@Copilot Copilot AI left a comment

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 proper propagation of max buffer size configuration from the underlying physical layer (layer1) up through all network stack layers. The change ensures that configured buffer sizes (such as DPDK's max_body_size in Catnip) are properly used instead of relying on default implementations.

  • Implements max_buffer_size_bytes() method for DemiMemoryAllocator trait across all network layers
  • Creates a chain of delegation from layer4 down to layer1 to retrieve the actual configured buffer size
  • Fixes the issue where inetstack was not using the underlying physical layer's buffer size configuration

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/inetstack/mod.rs Implements max_buffer_size_bytes() for SharedInetStack, delegating to layer4
src/inetstack/protocols/layer4/mod.rs Implements max_buffer_size_bytes() for Peer, delegating to layer3
src/inetstack/protocols/layer3/mod.rs Implements max_buffer_size_bytes() for SharedLayer3Endpoint, delegating to layer2
src/inetstack/protocols/layer2/mod.rs Implements max_buffer_size_bytes() for SharedLayer2Endpoint, delegating to layer1

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@anandbonde anandbonde left a comment

Choose a reason for hiding this comment

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

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something Isn't Working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants