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

iface: make poll() process all packets, add fine-grained poll functions. #991

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Sep 16, 2024

This makes .poll() behave the same as before #954. Users affected by DoS
concerns can use the finer-grained egress-only and single-packet-ingress-only fns.

Fixes #990

  • wtf
  • tests: use two queues for TestingDevice.
  • iface: make poll() process all packets, add fine-grained poll functions.

Currently TestingDevice is a loopback device, which causes problems if the iface transmits a packet then receives.
The packet gets looped back to the interface instead of being handled by the test code.

This commit changes TestingDevice to behave more like a "virtual wire" that communicates the
interface with the testing code, with one queue for each direction.
This makes `.poll()` behave the same as before #954. Users affected by DoS
concerns can use the finer-grained egress-only and single-packet-ingress-only fns.
@Dirbaio
Copy link
Member Author

Dirbaio commented Sep 16, 2024

running the benchmark example, two attempts each:

smoltcp 0.11.0
    reader: 3.726 Gbps 3.676 Gbps
    writer: 11.102 Gbps 11.187 Gbps
smoltcp git main 469dccdba
    reader: 3.731 Gbps 3.788 Gbps
    writer: 4.260 Gbps 4.246 Gbps
smoltcp this PR:
    reader: 3.522 Gbps 3.558 Gbps
    writer: 11.524 Gbps 11.484 Gbps

@Dirbaio
Copy link
Member Author

Dirbaio commented Sep 16, 2024

embassy-net stm32 eth perf test, stm32h755zi, 64k tcp buffer:

smoltcp 0.11.0:
    download:        6273 kB/s  6264 kB/s
    upload:          9619 kB/s  9619 kB/s
    upload+download: 1297 kB/s  1575 kB/s

smoltcp git main 469dccd
    download:        5357 kB/s  5354 kB/s
    upload:          9678 kB/s  9588 kB/s
    upload+download: 1098 kB/s  1122 kB/s

smoltcp this PR
    download:        5826 kB/s  5822 kB/s
    upload:          9142 kB/s  9145 kB/s
    upload+download: 3043 kB/s  2729 kB/s

@Dirbaio Dirbaio added this pull request to the merge queue Sep 17, 2024
Merged via the queue into main with commit 4a9ebe7 Sep 17, 2024
9 checks passed
@Dirbaio Dirbaio deleted the ll-poll branch September 17, 2024 14:05
@lrh2000 lrh2000 mentioned this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Throughput has decreased drastically after polling updates
2 participants