seoul: adjust Intel network model to recent VM

Issue #2715
This commit is contained in:
Alexander Boettcher 2018-03-14 13:37:27 +01:00 committed by Christian Helmuth
parent 3bcb45b4e7
commit bb768c2cab
3 changed files with 11 additions and 13 deletions

View File

@ -1 +1 @@
17edd2a944f378c3d7243eca9e7ed3da80d14e77
49c315a92108ed1c7e0f356b2e6c72ad6a9422bb

View File

@ -4,7 +4,7 @@ DOWNLOADS := seoul.git
URL(seoul) := https://github.com/alex-ab/seoul.git
# branch genode_18_05
REV(seoul) := c1f9575c30c66abffc9b7db86cf52ecb12a45ca7
REV(seoul) := 01482004511abec65704ff9c32355f0e79ecf84a
DIR(seoul) := src/app/seoul
#

View File

@ -48,6 +48,9 @@ void Seoul::Network::_handle_packets()
_forward_pkt = 0;
/* acknowledge received packet */
if (!_nic.rx()->ready_to_ack())
Logging::printf("not ready for acks");
_nic.rx()->acknowledge_packet(rx_packet);
}
}
@ -59,6 +62,12 @@ bool Seoul::Network::transmit(void const * const packet, Genode::size_t len)
/* don't end in an endless forwarding loop */
return false;
/* check for acknowledgements */
while (_nic.tx()->ack_avail()) {
Nic::Packet_descriptor const ack = _nic.tx()->get_acked_packet();
_nic.tx()->release_packet(ack);
}
/* allocate transmit packet */
Nic::Packet_descriptor tx_packet;
try {
@ -70,20 +79,9 @@ bool Seoul::Network::transmit(void const * const packet, Genode::size_t len)
/* fill packet with content */
char * const tx_content = _nic.tx()->packet_content(tx_packet);
_forward_pkt = tx_content;
memcpy(tx_content, packet, len);
_nic.tx()->submit_packet(tx_packet);
/* wait for acknowledgement */
Nic::Packet_descriptor ack_tx_packet = _nic.tx()->get_acked_packet();
if (ack_tx_packet.size() != tx_packet.size() ||
ack_tx_packet.offset() != tx_packet.offset())
Logging::printf("error: unexpected acked packet\n");
/* release sent packet to free the space in the tx communication buffer */
_nic.tx()->release_packet(tx_packet);
return true;
}