diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-12-07 15:55:46 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-12-13 16:18:39 +0100 |
| commit | ac74613b5a7be72acd8d5259055963f8b4aba7fd (patch) | |
| tree | bcc287e4edf65e0bb15cb5ff880aa0319ebf254f /embassy-net/src/lib.rs | |
| parent | 47747d3b73f392e53ead8ff49cd09fd017df3215 (diff) | |
net: remove packet pool.
The pool was prone to deadlocks, especially due to having a single pool
for rx+tx. If the pool got full with rx'd packets it would deadlock because
processing a rx packet requires doing another allocation on the pool, for
the possibly tx'd response, before deallocating the rx'd packet.
This also allows Device impls to allocate the packet memory in a particular
RAM kind, if needed for example to do DMA.
The `Device` trait is now token-based, like smoltcp's. In the end, this
is better because it allows callers to manage memory however they want (including
with a pool if they want to).
Diffstat (limited to 'embassy-net/src/lib.rs')
| -rw-r--r-- | embassy-net/src/lib.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index edb969842..e18e819cb 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -8,12 +8,9 @@ | |||
| 8 | // This mod MUST go first, so that the others see its macros. | 8 | // This mod MUST go first, so that the others see its macros. |
| 9 | pub(crate) mod fmt; | 9 | pub(crate) mod fmt; |
| 10 | 10 | ||
| 11 | mod device; | 11 | pub mod device; |
| 12 | mod packet_pool; | ||
| 13 | mod stack; | 12 | mod stack; |
| 14 | 13 | ||
| 15 | pub use device::{Device, LinkState}; | ||
| 16 | pub use packet_pool::{Packet, PacketBox, PacketBoxExt, PacketBuf, MTU}; | ||
| 17 | pub use stack::{Config, ConfigStrategy, Stack, StackResources}; | 14 | pub use stack::{Config, ConfigStrategy, Stack, StackResources}; |
| 18 | 15 | ||
| 19 | #[cfg(feature = "tcp")] | 16 | #[cfg(feature = "tcp")] |
| @@ -23,7 +20,6 @@ pub mod tcp; | |||
| 23 | pub mod udp; | 20 | pub mod udp; |
| 24 | 21 | ||
| 25 | // smoltcp reexports | 22 | // smoltcp reexports |
| 26 | pub use smoltcp::phy::{DeviceCapabilities, Medium}; | ||
| 27 | pub use smoltcp::time::{Duration as SmolDuration, Instant as SmolInstant}; | 23 | pub use smoltcp::time::{Duration as SmolDuration, Instant as SmolInstant}; |
| 28 | #[cfg(feature = "medium-ethernet")] | 24 | #[cfg(feature = "medium-ethernet")] |
| 29 | pub use smoltcp::wire::{EthernetAddress, HardwareAddress}; | 25 | pub use smoltcp::wire::{EthernetAddress, HardwareAddress}; |
