aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-27 19:58:42 +0000
committerGitHub <[email protected]>2022-04-27 19:58:42 +0000
commitba46df6825f35e0c3beb90f28b61f3dbe46e005e (patch)
tree022452e7c8cf9e96824b757031d78fe1d13985be
parent5b3aaaaa9c1ff3b35f28f7babc628950192ef850 (diff)
parent3a3ed27c303055c6770784f86b996b4721786576 (diff)
Merge #739
739: net: Add support for packet pools with size 64 and 128 r=Dirbaio a=matoushybl Co-authored-by: Matous Hybl <[email protected]>
-rw-r--r--embassy-net/Cargo.toml2
-rw-r--r--embassy-net/src/packet_pool.rs6
2 files changed, 8 insertions, 0 deletions
diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml
index 90e84d828..2d0116bd5 100644
--- a/embassy-net/Cargo.toml
+++ b/embassy-net/Cargo.toml
@@ -28,6 +28,8 @@ pool-4 = []
28pool-8 = [] 28pool-8 = []
29pool-16 = [] 29pool-16 = []
30pool-32 = [] 30pool-32 = []
31pool-64 = []
32pool-128 = []
31 33
32[dependencies] 34[dependencies]
33 35
diff --git a/embassy-net/src/packet_pool.rs b/embassy-net/src/packet_pool.rs
index b43ae2eb2..99311ae74 100644
--- a/embassy-net/src/packet_pool.rs
+++ b/embassy-net/src/packet_pool.rs
@@ -17,6 +17,12 @@ pub const PACKET_POOL_SIZE: usize = 16;
17#[cfg(feature = "pool-32")] 17#[cfg(feature = "pool-32")]
18pub const PACKET_POOL_SIZE: usize = 32; 18pub const PACKET_POOL_SIZE: usize = 32;
19 19
20#[cfg(feature = "pool-64")]
21pub const PACKET_POOL_SIZE: usize = 64;
22
23#[cfg(feature = "pool-128")]
24pub const PACKET_POOL_SIZE: usize = 128;
25
20pool!(pub PacketPool: [Packet; PACKET_POOL_SIZE]); 26pool!(pub PacketPool: [Packet; PACKET_POOL_SIZE]);
21pub type PacketBox = Box<PacketPool>; 27pub type PacketBox = Box<PacketPool>;
22 28