Skip to content

floonoc: bug fixes and add support for multiple address rules on the same target#56

Open
liyinrong wants to merge 4 commits intogvsoc:masterfrom
liyinrong:yinrong/floonoc_fix
Open

floonoc: bug fixes and add support for multiple address rules on the same target#56
liyinrong wants to merge 4 commits intogvsoc:masterfrom
liyinrong:yinrong/floonoc_fix

Conversation

@liyinrong
Copy link
Contributor

No description provided.

@liyinrong liyinrong marked this pull request as ready for review November 13, 2025 16:07
Copilot AI review requested due to automatic review settings November 17, 2025 19:31
Copy link

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 pull request addresses bug fixes in the FlooNoc network interface implementation and adds support for multiple address rules on the same target. The main changes include:

  • Refactored request/response handling to differentiate between requests and responses using a new is_req parameter
  • Fixed storage location for the wide flag by moving it to a dedicated argument slot (IO_REQ_NB_ARGS-1) to avoid conflicts with reused request arguments
  • Added support for naming multiple address mappings to the same target

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pulp/floonoc/floonoc_network_interface.hpp Added is_req parameter to enqueue_router_req method signature
pulp/floonoc/floonoc_network_interface.cpp Updated request/response handling logic, moved wide flag storage, fixed response handling to use correct NI reference
pulp/floonoc/floonoc.py Added optional name parameter to o_MAP method for supporting multiple mappings to same target

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (*(NetworkInterface **)req->arg_get(FlooNoc::REQ_SRC_NI))
if (is_req)
{
bool wide = *(bool *)req->arg_get(IO_REQ_NB_ARGS-1);
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

The magic number IO_REQ_NB_ARGS-1 is used multiple times throughout the file for accessing the wide flag. Consider defining a named constant like FlooNoc::REQ_WIDE_FLAG to improve code clarity and maintainability.

Copilot uses AI. Check for mistakes.
else
{
ni->handle_response(req);
this->handle_response(req);
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

The response is now being sent to this->handle_response(req) instead of the source NI. This appears correct given the removed line that retrieved the source NI, but verify that responses should be handled by the destination NI rather than being routed back to the source NI that initiated the request.

Suggested change
this->handle_response(req);
// Retrieve the source NI from the request and send the response back to it
NetworkInterface *source_ni = (NetworkInterface *)req->arg_get(FlooNoc::REQ_SOURCE_NI);
if (source_ni != nullptr)
{
source_ni->handle_response(req);
}
else
{
// Fallback: handle locally if source NI is not set
this->handle_response(req);
}

Copilot uses AI. Check for mistakes.
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