mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 21:57:55 +00:00
nic_loopback: Adjust to packet allocator changes
Remove '_expected_offset' check on round trip test from RX packet, because allocators between RX/TX can have different allocation strategies. Rely on 'pattern' check for RX packets only. In loopback server alloc size must match actual packet size. issue #4312
This commit is contained in:
parent
94a7c32fb4
commit
79e69a5549
@ -70,8 +70,6 @@ class Nic_loopback::Session_component : public Nic::Session_component
|
||||
|
||||
void Nic_loopback::Session_component::_handle_packet_stream()
|
||||
{
|
||||
size_t const alloc_size = Nic::Packet_allocator::DEFAULT_PACKET_SIZE;
|
||||
|
||||
/* loop while we can make progress */
|
||||
for (;;) {
|
||||
|
||||
@ -111,7 +109,8 @@ void Nic_loopback::Session_component::_handle_packet_stream()
|
||||
|
||||
Packet_descriptor packet_to_client;
|
||||
try {
|
||||
packet_to_client = _rx.source()->alloc_packet(alloc_size); }
|
||||
packet_to_client = _rx.source()->alloc_packet(
|
||||
_tx.sink()->peek_packet().size()); }
|
||||
catch (Session::Rx::Source::Packet_alloc_failed) {
|
||||
continue; }
|
||||
|
||||
|
@ -195,9 +195,6 @@ struct Test::Roundtrip : Base
|
||||
if (rx_packet.size() != PACKET_SIZE)
|
||||
abort("sent and echoed packets differ in size");
|
||||
|
||||
if (rx_packet.offset() != _expected_packet_offset)
|
||||
abort(__func__, ": unexpected offset of received packet");
|
||||
|
||||
/* compare original and echoed packets */
|
||||
char const * const rx_content = nic.rx()->packet_content(rx_packet);
|
||||
for (unsigned i = 0; i < PACKET_SIZE; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user