Skip to content

Conversation

@julianuziemblo
Copy link

@julianuziemblo julianuziemblo commented Jan 28, 2026

Description

Special-case ioctls are those which pass a structure with pointers or flexible array members to the syscall. For now this is only: SIOCGIFCONF, SIOCADDRT and SIOCDELRT.

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: (list targets here).

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

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
@gemini-code-assist
Copy link

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 significantly expands the test coverage for ioctl system calls and network routing functionality. It introduces new tests for complex ioctl operations that handle data structures with embedded pointers, ensuring their correct behavior. Additionally, a new test suite for the route command has been added, improving the robustness of network configuration management.

Highlights

  • New Special-Case ioctl Tests: Added comprehensive Unity tests for "special-case" ioctl calls, specifically SIOCGIFCONF, which involve structures with pointers requiring flattening in userspace. These tests ensure correct handling of interface configuration retrieval and buffer management.
  • New Route Command Test: Introduced a new Python-based harness test (test-route.py) to validate the functionality of the route command, including adding and deleting routes and verifying output format.
  • Test Infrastructure Updates: Updated the build system (ioctl/Makefile) and test configuration (ioctl/test.yaml) to integrate and enable these new tests on relevant targets, particularly those with network stack support (lwIP).
  • Minor ioctl Test Cleanup: Performed a minor cleanup in an existing ioctl test (ioctl/test-ioctl.c) by removing a redundant NULL argument from an ioctl call, simplifying the test case.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

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

The pull request introduces new tests for special ioctl calls, specifically SIOCGIFCONF, and a Python test for route management. The changes include adding the new test files to the Makefile and the test configuration YAML. Overall, the new tests are a valuable addition, but there are a few areas for improvement regarding error handling in the GET_IFADDRS macro, clarity in a test case name and assertion, and consistency in ioctl call arguments.

@github-actions
Copy link

Unit Test Results

9 474 tests  +12   8 879 ✅ +6   54m 15s ⏱️ + 3m 2s
  569 suites + 8     589 💤 ±0 
    1 files   ± 0       6 ❌ +6 

For more details on these failures, see this check.

Results for commit d8ef89f. ± Comparison against base commit bb76df5.

This pull request removes 99 and adds 111 tests. Note that renamed tests count towards both.
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_in
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_in_big
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_out
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_out_big
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.in_val
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.invalid_req
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.no_data
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.not_valid_fd
…
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_in
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_in_big
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_inout
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_out
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_out_big
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.in_val
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.invalid_req
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.no_data
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.not_valid_fd
…

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