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:
Sebastian Sumpf 2021-12-17 10:12:48 +01:00 committed by Christian Helmuth
parent 94a7c32fb4
commit 79e69a5549
2 changed files with 2 additions and 6 deletions

View File

@ -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; }

View File

@ -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++)