Skip to content

Memory manager for unified EMAC #5750

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

Merged
merged 7 commits into from
Feb 13, 2018
Merged

Memory manager for unified EMAC #5750

merged 7 commits into from
Feb 13, 2018

Conversation

mikaleppanen
Copy link

@mikaleppanen mikaleppanen commented Dec 21, 2017

Description

READY FOR REVIEW

EMAC memory manager changes.

Status

READY FOR REVIEW

Migrations

YES

#5558

Related PRs

List related PRs against other branches:

branch PR
feature-emac #5558

Todos

  • Tests
  • Documentation

Deploy notes

Steps to test or reproduce

@mikaleppanen
Copy link
Author

@kjbracey-arm here's the memory manager and K64F/STM driver changes.

@kjbracey
Copy link
Contributor

To maybe slightly reduce confusion, this PR should be against feature-emac rather than master. Not sure if you can change that after creation?

@mikaleppanen mikaleppanen changed the base branch from master to feature-emac December 21, 2017 10:56
@mikaleppanen
Copy link
Author

Changed the base..... since this branch is based on current master it is ahead of the feature-emac.

* @param mem Memory buffer
* @return Total length in bytes
*/
virtual uint32_t get_total_len(emac_mem_buf_t *buf);
Copy link
Contributor

@kjbracey kjbracey Dec 21, 2017

Choose a reason for hiding this comment

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

Let's have some const-correctness - this should be a const buf pointer, and the method should be const.

Should all the methods be const apart from free and alloc - if they only touch the buffer, they can't be changing the memory manager's overall state right? I suppose anything that modifies a buffer could be changing housekeeping info. So maybe const methods if they take const buf pointers.

* @param mem Memory buffer
* @return The next memory buffer, or NULL if last
*/
virtual emac_mem_buf_t *next(emac_mem_buf_t *buf);
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, const, and same for the others. Should this be get_next to match the below?

pbuf->len -= offset;
}

return (emac_mem_buf_t*)pbuf;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make all the casting here C++ static_cast? Would help enforce the const-correctness I'm calling for elsewhere.

* Chaining of the buffers is made using singly linked list.
*
* Memory buffers can be allocated either from heap or from memory pools. Heap buffers are always contiguous.
* Memory pool buffers may be either contiguous or chained depending on allocation size.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to distinguish what you call "buffer" here from the "emac_mem_buf_t". I would suggest you use "buffer" and "buffer chain", and say whether calls work on a buffer or an entire chain. Then the EMAC API passes a chain up or down.

@mikaleppanen
Copy link
Author

Updated commits based on comments.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 21, 2017

@mikaleppanen destination branch updated, not certain why commits are still shown here that are already there

@mikaleppanen mikaleppanen changed the base branch from feature-emac to master December 22, 2017 06:54
@mikaleppanen mikaleppanen changed the base branch from master to feature-emac December 22, 2017 06:54
@mikaleppanen
Copy link
Author

Thanks, I changed base branch to master and back to feature-emac and the github updated the commit list.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 22, 2017

Please review CI (travis and jenkins) both report failures (travis docs and jenkins compiler error)

@mikaleppanen
Copy link
Author

Updated lwip memory manager to support pool allocation alignment. Updated K64F and STM ethernet drivers.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 5, 2018

@mikaleppanen Can you rebase this PR, I rebased the branch to resolve some issues that were affecting this PR

@mikaleppanen
Copy link
Author

@0xc0170 I rebased the PR

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 5, 2018

Travis - docs failure (doxygen needs fixes), and jenkins CI - can't find a header file

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 8, 2018

Please review the jenkins failure (one device fails to connect, the other 2 are regarding missing declarations)

@mikaleppanen
Copy link
Author

Updated commits. Looks like only cellular MTS_DRAGONFLY_F411RE is failing. @kjbracey-arm is it expected that with the current changes the cellular fails, and it will be updated later?

@mikaleppanen
Copy link
Author

Updated also cellular for MTS_DRAGONFLY_F411RE . Now that is also building. Rest of the build errors are from drivers that are not ported yet to new emac interface.

@mikaleppanen
Copy link
Author

Added a commit that adds set preferred alignment, copy to buffer and copy from buffer methods to memory manager.

@cmonr
Copy link
Contributor

cmonr commented Jan 11, 2018

@mikaleppanen Let us know when this is ready for review by modifying the initial comment. Thanks!

@kjbracey
Copy link
Contributor

Mika and I suggest we fold these changes into #5558 for combined review. (The first 4 commits visible here are from #5558). Any objections?

@mikaleppanen
Copy link
Author

@0xc0170 @kjbracey-arm @SeppoTakalo This pull request is ready for review.

@mikaleppanen
Copy link
Author

.mbedignore with named files seems not to work gnuarmeclipse exporter, so changed the ublox wifi sdk directory .mbedignore to just contain asterisk. Now it should generate the eclipse project correctly.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 9, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 9, 2018

Build : SUCCESS

Build number : 1099
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5750/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Feb 9, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 9, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 9, 2018

/morph uvisor-test

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 9, 2018

We might need to rebase (uvisor json CI file was recently updated to resolve the errors we are seeing here). Please review after another CI run (I've retriggered it just now)

@cmonr
Copy link
Contributor

cmonr commented Feb 9, 2018

@0xc0170 Correct, rebase is needed for uVisor CI update.

@mikaleppanen
Copy link
Author

Rebased the branch.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 12, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 12, 2018

Build : SUCCESS

Build number : 1114
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5750/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Feb 12, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 13, 2018

@0xc0170 0xc0170 merged commit ed4bf78 into ARMmbed:feature-emac Feb 13, 2018
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.

5 participants