aboutsummaryrefslogtreecommitdiff
path: root/embassy-net/src/tcp.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-12-07 15:55:46 +0100
committerDario Nieuwenhuis <[email protected]>2022-12-13 16:18:39 +0100
commitac74613b5a7be72acd8d5259055963f8b4aba7fd (patch)
treebcc287e4edf65e0bb15cb5ff880aa0319ebf254f /embassy-net/src/tcp.rs
parent47747d3b73f392e53ead8ff49cd09fd017df3215 (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/tcp.rs')
-rw-r--r--embassy-net/src/tcp.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-net/src/tcp.rs b/embassy-net/src/tcp.rs
index 73cf2d4e4..0ed4b81e2 100644
--- a/embassy-net/src/tcp.rs
+++ b/embassy-net/src/tcp.rs
@@ -9,8 +9,8 @@ use smoltcp::time::Duration;
9use smoltcp::wire::{IpEndpoint, IpListenEndpoint}; 9use smoltcp::wire::{IpEndpoint, IpListenEndpoint};
10 10
11use super::stack::Stack; 11use super::stack::Stack;
12use crate::device::Device;
12use crate::stack::SocketStack; 13use crate::stack::SocketStack;
13use crate::Device;
14 14
15#[derive(PartialEq, Eq, Clone, Copy, Debug)] 15#[derive(PartialEq, Eq, Clone, Copy, Debug)]
16#[cfg_attr(feature = "defmt", derive(defmt::Format))] 16#[cfg_attr(feature = "defmt", derive(defmt::Format))]