Skip to content
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

Fix #1155, clean up zero copy API #1257

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Mar 23, 2021

Describe the contribution
This removes the now-unnecessary CFE_SB_ZeroCopyHandle_t type and all APIs that refer/require this extra handle.

Adds two new simplified functions CFE_SB_AllocateMessageBuffer() and CFE_SB_ReleaseMessageBuffer() to replace CFE_SB_ZeroCopyGetPtr() and CFE_SB_ZeroCopyReleasePtr(), respectively. These new functions do not use a separate handle.

Updates the CFE_SB_TransmitBuffer() API to also remove the handle.

Fixes #1155

Testing performed
Build and run CFE, sanity check, run all tests.
Also Updated CI_LAB to use this zero copy API pattern, and confirm that all is working correctly.

Expected behavior changes
Removes redundant handle type and simplifies API.
Note - This does affect public APIs.

System(s) tested on
Ubuntu 20.04

Additional context
See also nasa/ci_lab#73

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

The separate zero copy handle type is removed.

Adds two new simplified functions CFE_SB_AllocateMessageBuffer
and CFE_SB_ReleaseMessageBuffer to replace CFE_SB_ZeroCopyGetPtr
and CFE_SB_ZeroCopyGetPtr.  These new functions do not use
a separate Handle.

Updates the CFE_SB_TransmitBuffer() API to also remove the handle.
@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Mar 23, 2021
@astrogeco
Copy link
Contributor

astrogeco commented Mar 24, 2021

CCB:2021-03-24 APPROVED

  • The pattern remains that passing a buffer to "transmit" then the buffer is owned by software bus
  • "release message buffer" is for discarding unsent messages
  • cleans up wording
  • "transmit buffer" does not need a handle anymore
  • had to remove all deprecated APIs because there wasn't a way to maintain them
  • update the user's guide zero copy section

@astrogeco astrogeco changed the base branch from main to integration-candidate March 29, 2021 13:47
@astrogeco astrogeco added conflicts IC:2021-03-30 and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Mar 29, 2021
@astrogeco astrogeco merged commit 7db7c72 into nasa:integration-candidate Mar 29, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Mar 29, 2021
nasa/osal#923 - Fix #831, Finish os-impl-bsd-socket.c coverage testing

nasa/cFE#1237 - Fix #1180, Removes impossible conditions
nasa/cFE#1240 - Fix #1002, Remove deprecated elements
nasa/cFE#1253 - Fix #1252, Squash potentially uninitialized variable warnings
nasa/cFE#1241 - Fix #1185, Squash possible uninitialized variable false alarms
nasa/cFE#1247 - Fix #1246, Typo in CFE_TBL_Validate AppName
nasa/cFE#1234 - Fix #1192, Initialize TotalMsgSize in CFE_SB_GetUserDataLength
nasa/cFE#1245 - Fix #1187, Increment CreatePipeErrorCounter for all create pipe errors
nasa/cFE#1236 - Fix #1186, Remove useless assignments/checks
nasa/cFE#1262 - Fix #1239, scrub include header guards
nasa/cFE#1256 - Fix #1194, check for NULL in SlotUsed helpers
nasa/cFE#1263 - Fix #1261, removed redundant checks for CFE_SUCCESS
nasa/cFE#1250 - Fix #1215, remove task registration calls
nasa/cFE#1242 - Fix #1223, shorten TestRunner function name
nasa/cFE#1242 - Fix #1264, Convert functional test startup script example to use "simple" filenames
nasa/cFE#1229 - Fix #1164, use FS file name parser for commands
nasa/cFE#1257 - Fix #1155, clean up zero copy API
nasa/cFE#1254 - Fix #1181, global variable cleanup
nasa/cFE#1255 - Fix #1206, report PSP version in ES HK TLM
astrogeco added a commit to astrogeco/cFE that referenced this pull request Mar 30, 2021
Updates documentation for ZeroCopy Ptr APIs updated in nasa#1257
astrogeco added a commit to astrogeco/cFE that referenced this pull request Mar 30, 2021
Updates documentation for ZeroCopy Ptr APIs updated in nasa#1257
astrogeco added a commit to astrogeco/cFE that referenced this pull request Mar 30, 2021
Updates documentation for ZeroCopy Ptr APIs updated in nasa#1257

Add "c" to code blocks in users guide markdown syntax
astrogeco added a commit to astrogeco/cFE that referenced this pull request Mar 30, 2021
Updates documentation for ZeroCopy Ptr APIs updated in nasa#1257

Add "c" to code blocks in users guide markdown syntax
astrogeco added a commit that referenced this pull request Mar 30, 2021
Updates documentation for ZeroCopy Ptr APIs updated in #1257

Add "c" to code blocks in users guide markdown syntax
astrogeco added a commit to nasa/cFS that referenced this pull request Apr 1, 2021
nasa/cFE#1237 - Fix #1180, Removes impossible conditions
nasa/cFE#1240 - Fix #1002, Remove deprecated elements
nasa/cFE#1253 - Fix #1252, Squash potentially uninitialized variable warnings
nasa/cFE#1241 - Fix #1185, Squash possible uninitialized variable false alarms
nasa/cFE#1247 - Fix #1246, Typo in CFE_TBL_Validate AppName
nasa/cFE#1234 - Fix #1192, Initialize TotalMsgSize in CFE_SB_GetUserDataLength
nasa/cFE#1245 - Fix #1187, Increment CreatePipeErrorCounter for all create pipe errors
nasa/cFE#1236 - Fix #1186, Remove useless assignments/checks
nasa/cFE#1237 - Fix #1180, Removes impossible conditions
nasa/cFE#1240 - Fix #1002, Remove deprecated elements
nasa/cFE#1253 - Fix #1252, Squash potentially uninitialized variable warnings
nasa/cFE#1241 - Fix #1185, Squash possible uninitialized variable false alarms
nasa/cFE#1247 - Fix #1246, Typo in CFE_TBL_Validate AppName
nasa/cFE#1234 - Fix #1192, Initialize TotalMsgSize in CFE_SB_GetUserDataLength
nasa/cFE#1245 - Fix #1187, Increment CreatePipeErrorCounter for all create pipe errors
nasa/cFE#1236 - Fix #1186, Remove useless assignments/checks
nasa/cFE#1262 - Fix #1239, scrub include header guards
nasa/cFE#1256 - Fix #1194, check for NULL in SlotUsed helpers
nasa/cFE#1263 - Fix #1261, removed redundant checks for CFE_SUCCESS
nasa/cFE#1250 - Fix #1215, remove task registration calls
nasa/cFE#1242 - Fix #1223, shorten TestRunner function name
nasa/cFE#1242 - Fix #1264, Convert functional test startup script example to use "simple" filenames
nasa/cFE#1229 - Fix #1164, use FS file name parser for commands
nasa/cFE#1257 - Fix #1155, clean up zero copy API
nasa/cFE#1254 - Fix #1181, global variable cleanup
nasa/cFE#1255 - Fix #1206, report PSP version in ES HK TLM
nasa/cFE#1271 - Fix #1270, limit check in pool validation
nasa/cFE#1268 - Fix #1267, add null pointer check
nasa/cFE#1268 - Fix #1269, replace CFE_ES_ERR_BUFFER return for invalid null pointer arguments
nasa/cFE#1260 - Fix #1259, adds --branch-coverage option to genhtml line in lcov Makefile rule

nasa/osal#878 - Fix #843, remove BIG/LITTLE bit order macros
nasa/osal#918 - Fix #846, Minor clean up and clarification in comments/namin
nasa/osal#923 - Fix #831, Finish os-impl-bsd-socket.c coverage testing
nasa/osal#915 - Fix #888, better return codes from OS_SymbolTableDump_Impl
nasa/osal#926 - Fix #853, remove OS_TaskRegister
nasa/osal#935 - Fix #934, Remove unused SCRIPT_MODE flag
nasa/osal#930 - Fix #929, use test function for osal_id_t

nasa/PSP#276 - Fix #275, Adds a UT stub for CFE_PSP_GetKernelTextSegmentInfo
nasa/PSP#278 - Fix #277, add version file

nasa/ci_lab#83 - Fix #82, remove app registration
nasa/ci_lab#84 - Fix #73, use zero copy API

nasa/sample_app#139 - Fix #138, remove app registration
nasa/sample_app#143 - Fix #142, scrub header guards

nasa/sch_lab#75 - Fix #74, remove app registration

nasa/to_lab#96 - Fix #95, remove app registration
@jphickey jphickey deleted the fix-1155-zerocopy-api branch April 9, 2021 18:01
@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider simplifying the zero-copy SB API
3 participants