Skip to content

Traffic shaping - #14154

Merged
OhadMeir merged 5 commits into
realsenseai:developmentfrom
OhadMeir:traffic_shaping
Jul 27, 2025
Merged

Traffic shaping#14154
OhadMeir merged 5 commits into
realsenseai:developmentfrom
OhadMeir:traffic_shaping

Conversation

@OhadMeir

Copy link
Copy Markdown
Contributor

Tracked on [RSDEV-3644]

@OhadMeir
OhadMeir requested a review from Copilot July 22, 2025 11:11

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 implements traffic shaping functionality for Ethernet configuration by adding MTU and transmission delay parameters. The changes upgrade the Ethernet configuration from version 3 to version 4 with new configurable fields for network traffic control.

  • Adds MTU (Maximum Transmission Unit) and transmission delay parameters to Ethernet configuration
  • Upgrades configuration format from v3 to v4 with backward compatibility
  • Implements validation logic for the new parameters with appropriate constraints

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
rs-dds-config.cpp Adds command-line arguments for MTU and transmission delay with configuration handling
eth-config.h Updates structure to include transmission_delay field and adds v4 configuration support
eth-config.cpp Implements v4 configuration handling, validation logic, and operator equality updates
eth-config-v4.h Defines new v4 configuration structure with transmission_delay and reserved fields
dds-model.cpp Updates UI to include traffic shaping controls and improves error handling
Comments suppressed due to low confidence (1)

tools/dds/dds-config/rs-dds-config.cpp:191

  • [nitpick] The variable name 'trans_delay_arg' uses an abbreviation. Consider using the full name 'transmission_delay_arg' for consistency with the parameter name.
    cli::value< uint16_t > trans_delay_arg( "transmission-delay", "microseconds", 0, "Wait this much after each packet is sent before sending next one" );

Comment thread tools/dds/dds-config/rs-dds-config.cpp Outdated
Comment thread third-party/rsutils/include/rsutils/type/eth-config.cpp
Comment thread third-party/rsutils/include/rsutils/type/eth-config.cpp
Comment thread third-party/rsutils/include/rsutils/type/eth-config.cpp
Comment thread common/dds-model.cpp Outdated
Comment thread common/dds-model.cpp
@OhadMeir
OhadMeir requested a review from Nir-Az July 22, 2025 11:24
@OhadMeir
OhadMeir force-pushed the traffic_shaping branch 4 times, most recently from c8f37cb to b78914c Compare July 22, 2025 18:03
Comment thread common/dds-model.cpp Outdated
_changed_config.link.mtu = static_cast< uint32_t >( temp_mtu );
}

ImGui::Text( "Transmission Delay" );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add units

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread common/dds-model.cpp
, transmission_delay( 0 )
{
if( header.version != 3 )
throw std::runtime_error( "eth-config expecting version 3" );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lets add got header.version value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

, transmission_delay( v4.transmission_delay )
{
if( header.version != 4 )
throw std::runtime_error( "eth-config expecting version 4" );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread third-party/rsutils/include/rsutils/type/eth-config.cpp
Comment thread tools/dds/dds-config/rs-dds-config.cpp Outdated
cli::value< std::string > dhcp_arg( "dhcp", "on/off", "on", "DHCP dynamic IP discovery 'on' or 'off'" );
cli::value< uint32_t > dhcp_timeout_arg( "dhcp-timeout", "seconds", 30, "Seconds before DHCP times out and falls back to a static IP" );
cli::value< uint32_t > link_timeout_arg( "link-timeout", "milliseconds", 4000, "Milliseconds before --eth-first link times out and falls back to USB" );
cli::value< uint32_t > mtu_arg( "mtu", "bytes", 9000, "Size per Ethernet packet" );

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add value restrictions like jumps of 500 and divided by 3..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread tools/dds/dds-config/rs-dds-config.cpp
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.

3 participants