Skip to content

Merge feature-emac branch into master #6847

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 61 commits into from
May 24, 2018
Merged

Merge feature-emac branch into master #6847

merged 61 commits into from
May 24, 2018

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented May 9, 2018

Description

Bring in the new EMAC network driver subsystem from the feature-emac branch. Primary PRs for work on that branch were #5558 and #5750.

Aside from EMAC-related work, also incorporates Non-blocking DNS (#6751) and default network interface support (#6855).

Full list of PRs on that branch: https://github.com/ARMmbed/mbed-os/pulls?q=is%3Apr+base%3Afeature-emac+is%3Aclosed

When this is merged, support for existing native lwIP and old-style emac drivers will be lost - only updated drivers will remain supported. Platforms losing existing drivers are:

  • ARM_CM3DS_MPS2
  • LPCTarget (LPC1768 family)
    * RZ_A1XX

Some test reconfiguration will be required to get this all green, both to adjust setup and in case any platforms losing Ethernet support due to lack of driver update.

Pull request type

[ ] Fix
[X] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@cmonr
Copy link
Contributor

cmonr commented May 14, 2018

@kjbracey-arm Is the goal to bring this in for 5.9?

@kjbracey
Copy link
Contributor Author

@cmonr - yes, the aim is to get this in this week for 5.9

@kjbracey
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 17, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented May 17, 2018

@mbed-ci
Copy link

mbed-ci commented May 17, 2018

@cmonr
Copy link
Contributor

cmonr commented May 17, 2018

Making a note here that this will need a PR for its example as well as a handbook PR for documentation, if not already available.

@geky
Copy link
Contributor

geky commented May 21, 2018

@kjbracey-arm, it looks like the mbed 2 compilation test in events is trying to compile the features/network folder without the tracing folder. Should this list be updated?
https://github.com/ARMmbed/mbed-os/blob/master/.travis.yml#L153

Can we just remove the entire features folder for the test?

@cmonr
Copy link
Contributor

cmonr commented May 21, 2018

@kjbracey-arm Also, take a look at the pr-head build. If you don't have access or need help navigating the Jenkins links, let us know.

The error(s):

[UBLOX_EVK_ODIN_W2_arm-none-eabi-gcc_wlan0] ./mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/TOOLCHAIN_GCC_ARM/libublox-odin-w2-driver.a(OdinWiFiInterface.o):(.rodata._ZTC17OdinWiFiInterface4_13EMACInterface+0x110): undefined reference to virtual thunk to EMACInterface::get_mac_address()

@kegilbert
Copy link
Contributor

Besides the current merge conflicts/CI errors was there anything in particular you'd like me to review? A (very) quick skim from a code perspective looks good to me.

SeppoTakalo
SeppoTakalo previously approved these changes May 22, 2018
kjbracey added 3 commits May 22, 2018 11:44
Initial work by Bartek Szatkowski in #4079,
reworked following review of #5202 to
transform the entire system into C++, retaining the basic functionality.

Bartek's summary:

* Porting ethernet to EMAC
* Updating EMAC to enable multiple interfaces
* Untangling networking classes, making the abstractions a bit clearer to follow, etc
* General refactoring
* Removal of DEVICE_EMAC flag and introducing DEVICE_ETH and DEVICE_WIFI

Revisions since initial branch:

* Remove lwip depencies
* Correct doxygen warnings
* Remove emac_api.h, replace with C++ EMAC abstract class.
* Create OnboardNetworkInterface, and LWIP implementation.
* Mappings since #4079
     lwip-interface/nsapi_stack_lwip.c -> LWIPStack.cpp
     lwip-interface/ipstack_lwip.c -> LWIPInterface.cpp
     netsocket/mbed_ipstack.h -> OnboardNetworkStack.h
     hal/emac_api.h -> EMAC.h
* Reinstate use of EthInterface abstraction
* Correct and clarify HW address EMAC ops
* Restore MBED_MAC_ADDR implementation
* Integrate PPP support with LWIP::Interface.
* Convert K64F lwIP driver to K64F_EMAC.

To do:

* Convert emac_stack_mem.h to follow this pattern.
* Figure out DEVICE_ETH/EMAC
* Update all drivers to use EMAC
Rather than let "EthernetInterface" be the base EMAC NetworkInterface,
insert an "EMACInterface" class.

EthernetInterface then derives from EMACInterface and EthInterface.

A Wi-Fi driver can derive from EMACInterface and WiFiInterface - this
will be more logical than deriving from EthernetInterface and
WiFiInterface.

This does mean adding a couple of virtual inheritances to avoid
duplicate NetworkInterfaces:

                   NetworkInterface
                     /           \
            virtual /             \ virtual
                   /               \
             EMACInterface     WiFiInterface
                   \               /
                    \             /
                     \           /
                  MyCustomWiFiInterface
This has been superceded by CellularBase. Name change occurred late
in review of #4119 and
original unused CellularInterface was left behind.
@kjbracey
Copy link
Contributor Author

GitHub display went weird - rebased feature-emac to clear it up. Shouldn't cause a problem, as no open PRs to it.

"present": 1
"present": 1,
"default-stack": "LWIP",
"default-interface-type": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be here. Seemingly, its added to targets.json already.

@cmonr
Copy link
Contributor

cmonr commented May 23, 2018

Restarting pr-head. License checkout issue.

@mbed-ci
Copy link

mbed-ci commented May 23, 2018

Build : FAILURE

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

@cmonr
Copy link
Contributor

cmonr commented May 23, 2018

@kjbracey-arm

"/tmp/d2gAAH", line 124 (column 3): Warning: L6312W: Empty Execution region description for region RW_IRAM1
Error: L6218E: Undefined symbol OnboardNetworkStack::get_default_instance() (referred from BUILD/K64F/ARM/mbed-os/features/netsocket/EthernetInterface.o).
Finished: 0 information, 3 warning and 1 error messages.

This is with the K64F nanostack-border-router example

@kjbracey
Copy link
Contributor Author

Okay, just going to have to kill the border router test again. Root cause here is that you can't have DEVICE_EMAC enabled on an ARMCC build if you don't have a default network stack.

Border router app is not touching the network stack setting, so it's LWIP, but it's removing FEATURE_LWIP, so left with no default stack. We can't fix this up until after the PR is merged, when it can switch the default network stack to Nanostack.

Remove check for LWIP - check target flagging for EMAC drivers.
Should still be DEVICE_EMAC, but tooling doesn't support that.
@kjbracey
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented May 23, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented May 23, 2018

@cmonr cmonr mentioned this pull request May 23, 2018
@mbed-ci
Copy link

mbed-ci commented May 23, 2018

@cmonr
Copy link
Contributor

cmonr commented May 24, 2018

@kjbracey-arm Good news and bad news.

The bad news is that this hit a test issue that is in the process of being resolved here: #6993

The good news is that after a rebase once that PR is in, it looks like CI should pass!

@0xc0170
Copy link
Contributor

0xc0170 commented May 24, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented May 24, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented May 24, 2018

@mbed-ci
Copy link

mbed-ci commented May 24, 2018

@kjbracey kjbracey merged commit 13dcef6 into master May 24, 2018
@kjbracey kjbracey deleted the feature-emac branch May 24, 2018 13:47
@mbed-ci
Copy link

mbed-ci commented May 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.