Skip to content

Commit 84d3ff7

Browse files
committed
Process the entire batch of packets in nullnet test
1 parent f57a4b9 commit 84d3ff7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

sys/driver/ixgbe/src/nullnet.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ impl NullNet {
1616
impl usr::net::Net for NullNet {
1717
fn submit_and_poll(&self, mut packets: &mut VecDeque<Vec<u8>
1818
>, mut collect: &mut VecDeque<Vec<u8>>, tx: bool) -> RpcResult<Result<usize>> {
19-
unimplemented!()
19+
20+
let ret = packets.len();
21+
while let Some(pkt) = packets.pop_front() {
22+
collect.push_back(pkt);
23+
}
24+
Ok(Ok(ret))
2025
}
2126

2227
fn submit_and_poll_rref(
@@ -30,11 +35,15 @@ impl usr::net::Net for NullNet {
3035
RRefDeque<[u8; 1514], 32>
3136
)>>
3237
{
33-
Ok(Ok((packets.len(), collect, packets)))
38+
while let Some(pkt) = packets.pop_front() {
39+
collect.push_back(pkt);
40+
}
41+
42+
Ok(Ok((collect.len(), packets, collect)))
3443
}
3544

3645
fn poll(&self, mut collect: &mut VecDeque<Vec<u8>>, tx: bool) -> RpcResult<Result<usize>> {
37-
unimplemented!()
46+
Ok(Ok(0))
3847
}
3948

4049
fn poll_rref(&self, collect: RRefDeque<[u8; 1514], 512>, tx: bool) -> RpcResult<Result<(usize, RRefDeque<[u8; 1514], 512>)>> {

0 commit comments

Comments
 (0)