-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move SB route lookup (including insert method) to a module #928
Comments
Abstracting out MsgId/Route relation proposal - CFE_SB_GetRoutingTblPtr could use MsgId, with all the relation logic underneath the hood. CFE_SB_GetDestPtr could use route pointer. For the most part hide CFE_SB_GetRoutingTblIdx... shouldn't use direct access except when looping for reporting, and then could just loop the table. Also move all the related utility functions. Replace CFE_SB_RouteIdxPop_Unsync with a generic CFE_SB_AddRoute given MsgId, and CFE_SB_RouteIdxPush_Unsync is dead code for now (we no longer remove routes). CFE_SB_IsValidRouteIdx may actually go away (don't expose index directly). cfe_sb_task.c
cfe_sb_priv.c
cfe_sb_init.c
cfe_sb_api.c - straight forward using same methods above, use MsgId to get route pointer.. Move the message map internal to the module... may pull some of the configuration options into the module (don't allow configuration of the message map size, it's based on supported message IDs). EDIT - worth noting every one of these functions is internal to SB, but modularizing really makes them an interface... |
Not planning on fixing with this change - PipeId is used as an index in multiple places, whitespace/alignment is tragic, excessive comments (in my opinion). Likely spawn follow-on PRs to clean up. EDIT - also violates declare variables at the start of the function, fixing some where I see them but not a careful scrub |
Old issue #100 is for making Pipe IDs abstract/safe (which must include fixing use as index, etc). Might be worth considering for this cycle? Since I've converted so many other resources to use abstract IDs already, seems like a natural thing to include. Could be done after the current efforts are completed, if desired. |
Low priority but likely possible, and a desirable change for consistency. |
Two implementation options:
CCB votes for the structured API method (Option 1) |
I think the key to option 1 is to keep direct access to the resource (routing table in this case) on one side of the interface. Option 2 was allowing direct access on both sides in the short term, since that's how it's done currently since today routing is an internal capability of SB. Making routing a module with various possible implementations benefits from a more defined interface between routing and SB, which is option 1. Even doing it the right way shouldn't be that much more work, I'm just lazy enough to want confirmation that the harder option is worth it from the CCB/open source point of view. |
- Removed all index/pointer accesses of message map and routing table - All references now via IDs and APIs - Note SB still owns destination logic (unchanged linear linked list) - Limited whitespace fixes for readability - Resolved observed instances of variables not declared at the start of functions - Cleaned comments - Resolved potential double locks in CFE_SB_SendPrevSubs - Route and message write to file no longer guaranteed in msgid order to maintain performance for large msgid space implementations - Removed unused CFE_SB_FindGlobalMsgIdCnt - Clarified CFE_PLATFORM_SB_MAX_MSG_IDS config param description - Eliminated potential race in CFE_SB_PipeDeleteFull - Individual destination removal debug events no longer reported during a CFE_SB_PipeDeleteFull
- Implementation for direct map and unsorted routing table - Includes full coverage tests - Removed msg key and route stack concepts from direct map
- Linking SBR with SB unit test, not stubbed - Confirms matching functionality (with updates for intended changes)
- Implementation for direct map and unsorted routing table - Includes full coverage tests - Removed msg key and route stack concepts from direct map
- Linking SBR with SB unit test, not stubbed - Confirms matching functionality (with updates for intended changes)
Is your feature request related to a problem? Please describe.
Various implementations possible for message and route tables, all with associated advantages and issues.
Describe the solution you'd like
Provide the capability to replace the core implementation.
Describe alternatives you've considered
None.
Additional context
For implementations that support large MsgIds, or prefer smaller memory footprint at the cost of performance. Hashes, searches, etc.
Requester Info
Jacob Hageman - NASA/GSFC (per stakeholder request for alternate implementation)
The text was updated successfully, but these errors were encountered: