Skip to content

Conversation

@julianuziemblo
Copy link

@julianuziemblo julianuziemblo commented Jul 24, 2025

PHY loopback tests for Ethernet on iMX 6ULL/RT1064 evalkits and ia32-qemu

JIRA: RTOS-508

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: armv7m7-imxrt106x-evk, armv7a7-imx6ull-evk, ia32-generic-qemu.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @julianuziemblo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new test suite for Ethernet functionality, specifically targeting PHY loopback tests. The primary goal is to validate the network interface's ability to transmit and receive data reliably on various embedded platforms and QEMU, covering basic packet handling, performance under load, and error conditions.

Highlights

  • New Ethernet Tests: I've added a new set of Ethernet (enet) tests, specifically focusing on PHY loopback functionality. These tests are designed to verify the basic operation of the Ethernet driver and hardware by sending and receiving packets in a loopback configuration.
  • Comprehensive Test Cases: The new test suite includes several distinct test cases: a basic self-test using ETHTOOL_TEST, a single-packet send/receive verification, a load test to measure throughput by transferring 10MB of data, and a test to ensure proper error handling when attempting to send frames larger than the maximum transmission unit (MTU).
  • Multi-Platform Support: These tests are configured to run on multiple target platforms, including armv7m7-imxrt106x-evk, armv7a7-imx6ull-evk, and ia32-generic-qemu, ensuring broad coverage for the Ethernet stack across different hardware and emulation environments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from 1c01ec9 to 2441002 Compare July 24, 2025 08:02
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a suite of Ethernet PHY loopback tests using the Unity framework. The tests cover basic packet transmission, load testing, and error conditions like sending oversized packets. The implementation is mostly solid, but I've found a few critical issues related to resource management (socket handling) that could lead to bugs like double-closing file descriptors. I've also included some suggestions for improving code clarity and maintainability. Please review the comments for details.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from 2441002 to 5d3a0f5 Compare July 24, 2025 08:13
@julianuziemblo
Copy link
Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable set of Ethernet PHY loopback tests. The tests are comprehensive, covering basic functionality, load testing, and error handling. The code is generally well-structured.

I've identified a few issues, including a potential resource leak due to incorrect socket descriptor handling and the use of an invalid MAC address in one test case. I've provided suggestions to address these and to improve the overall clarity and robustness of the code. Once these points are addressed, the PR should be in great shape.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from 0ae0001 to 7a02889 Compare September 2, 2025 13:42
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from 7a02889 to 42742b8 Compare September 2, 2025 14:13
@julianuziemblo julianuziemblo changed the base branch from master to julianuziemblo/test-ioctl-special September 3, 2025 12:26
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from 42742b8 to 6f75444 Compare September 3, 2025 12:26
Special ioctls are those with that pass a struct
with subpointer(s) to arbitrary memory, as we have
to handle them differently to pass that memory.

JIRA: RTOS-1014
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-ioctl-special branch from da886e5 to da5d7b3 Compare September 3, 2025 12:31
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from 6f75444 to d81c0df Compare September 3, 2025 12:31
PHY loopback tests for Ethernet on iMX 6ULL/RT1064 evalkits
and ia32-generic-qemu

JIRA: RTOS-508
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-enet branch from d81c0df to ec10d1a Compare September 4, 2025 09:54
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-ioctl-special branch 3 times, most recently from 9939792 to 9b04cb4 Compare September 26, 2025 14:26
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/test-ioctl-special branch 2 times, most recently from 7e1475a to 8e4ee36 Compare September 26, 2025 15:17
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