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

net: Spurious driver errors due to feeding packets into IP stack when it's not fully initialized (assumed reason) #13991

Closed
pfalcon opened this issue Mar 1, 2019 · 4 comments
Assignees
Labels
area: Drivers area: Networking Enhancement Changes/Updates/Additions to existing features priority: low Low impact/importance bug

Comments

@pfalcon
Copy link
Contributor

pfalcon commented Mar 1, 2019

A typical situation:

***** Booting Zephyr OS zephyr-v1.13.0-5295-g5f2099fb63ba *****
[00:00:02.362,040] <err> eth_smsc911x: net_recv_data: -22
[00:00:02.364,062] <inf> net_config: Initializing network
[00:00:02.364,637] <inf> net_config: IPv4 address: 192.0.2.1

It's pretty clear (though not confirmed) that driver (on a typical busy network) receives and feeds a packet into stack when it's not yet fully initialized.

It's pretty easy to reproduce that with the default qemu_x86/SLIP setup, where I regularly get 2 screenfuls of errors like that.

We should do something about that. And the most obvious solution is to have proper initializing priorities, where drivers are initialized only after the core stack can accept packets from them.

@pfalcon pfalcon added bug The issue is a bug, or the PR is fixing a bug area: Drivers area: Networking labels Mar 1, 2019
@rljordan-zz rljordan-zz added the priority: low Low impact/importance bug label Mar 5, 2019
@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 7, 2019

It's pretty easy to reproduce that with the default qemu_x86/SLIP setup, where I regularly get 2 screenfuls of errors like that.

Here's a typical case:

SeaBIOS (version rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org)
Booting from ROM..***** Booting Zephyr OS zephyr-v1.13.0-5473-gae63b2411fe4 *****


--- 64 messages dropped ---
[00:00:00.350,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.360,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.360,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.360,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.370,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.370,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.370,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.370,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.380,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.380,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.390,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.390,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.400,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.400,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.410,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.410,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.420,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.420,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.420,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.430,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.430,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.440,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.440,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.440,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.450,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.460,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.500,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.500,000] <err> slip: [0x00400660] cannot allocate pkt
[00:00:00.540,000] <inf> net_config: Initializing network
[00:00:00.540,000] <inf> net_config: IPv4 address: 192.0.2.1
[00:00:00.640,000] <inf> net_config: IPv6 address: fe80::200:5eff:fe00:5306
[00:00:00.650,000] <inf> net_config: IPv6 address: fe80::200:5eff:fe00:5306
[00:00:03.660,000] <inf> net_echo_server_sample: Run echo server
[00:00:03.660,000] <inf> net_echo_server_sample: Waiting for TCP connection on port 4242 (IPv6)...
[00:00:03.660,000] <inf> net_echo_server_sample: Waiting for TCP connection on port 4242 (IPv4)...
[00:00:03.660,000] <inf> net_echo_server_sample: Waiting for UDP packets on port 4242 (IPv6)...
[00:00:03.660,000] <inf> net_echo_server_sample: Waiting for UDP packets on port 4242 (IPv4)...

@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 7, 2019

@jukkar, Any comments?

@jukkar
Copy link
Member

jukkar commented Mar 7, 2019

If the upper network stack is not able to receive any packets, then driver drops the packet as it is doing right now. What are you proposing we start to do at this point? Simple option is to just ignore the issue and not print the error as there is nothing wrong at this point.

Anyway, making this an enhancement and not a bug.

@jukkar
Copy link
Member

jukkar commented Jan 28, 2020

Going through old issues. This is a good candidate for closing. Can be re-opened if really needed.

@jukkar jukkar closed this as completed Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Drivers area: Networking Enhancement Changes/Updates/Additions to existing features priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants