Make NIC RX/TX buffer sizes configureable in libc

* Remove far too low default values from Nic::Connection constructor
* Extend lwip initialization function with desired TX/RX buffer sizes
* Add configuration possibility to libc_lwip_dhcp plugin to define
  buffer sizes, like the following:

  '<libc tx_buf_size="1M" tx_buf_size="1M"/>'

Fixes #892
This commit is contained in:
Stefan Kalkowski
2013-09-23 15:58:45 +02:00
committed by Christian Helmuth
parent c56927b76e
commit 8f0c789ed4
15 changed files with 81 additions and 26 deletions

View File

@ -15,6 +15,7 @@
#include <base/printf.h>
#include <base/sleep.h>
#include <lwip/genode.h>
#include <nic/packet_allocator.h>
extern "C" {
#include <lwip/netdb.h>
@ -295,9 +296,11 @@ void Http::cmd_get(size_t file_offset, size_t size, off_t offset)
void __attribute__((constructor)) init()
{
enum { BUF_SIZE = Nic::Packet_allocator::DEFAULT_PACKET_SIZE * 128 };
lwip_tcpip_init();
if (lwip_nic_init(0, 0, 0)) {
if (lwip_nic_init(0, 0, 0, BUF_SIZE, BUF_SIZE)) {
PERR("DHCP failed");
throw -1;
}