From 9e8366b47c86fcda6e01cc2d69be5ee83c977e65 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 17 Jan 2017 12:03:50 +0100 Subject: [PATCH] test/nic_raw: remove Ref #1987 --- repos/os/src/test/nic_raw/main.cc | 121 ---------------------------- repos/os/src/test/nic_raw/target.mk | 3 - 2 files changed, 124 deletions(-) delete mode 100644 repos/os/src/test/nic_raw/main.cc delete mode 100644 repos/os/src/test/nic_raw/target.mk diff --git a/repos/os/src/test/nic_raw/main.cc b/repos/os/src/test/nic_raw/main.cc deleted file mode 100644 index fcfa39e263..0000000000 --- a/repos/os/src/test/nic_raw/main.cc +++ /dev/null @@ -1,121 +0,0 @@ -/* - * \brief A simple nic session client using the performance measurement - * library. Purpose is to measure the overhead of a nic_session client - * using a ethernet driver versus solely using th ethernet driver. - * \author Alexander Boettcher - * \date 2013-03-26 - */ - -/* - * Copyright (C) 2013-2013 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU General Public License version 2. - */ - -/* Genode includes */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -enum { - STACK_SIZE = 4096, -}; - -class Nic_worker : public Genode::Thread_deprecated -{ - private: - - Nic::Connection *_nic; /* nic-session */ - Net::Mac_address _mac; - - struct stat { - Genode::uint64_t size; - Genode::uint64_t count; - } _stat, _drop; - - Genode::uint16_t _ntoh(Genode::uint16_t value) { - return ((value & 0xFFU) << 8) | ((value >> 8) & 0xFFU); } - - public: - - Nic_worker(Nic::Connection *nic) - : - Genode::Thread_deprecated("nic-worker"), _nic(nic) - { - using namespace Genode; - - memset(&_stat, 0, sizeof(_stat)); - memset(&_drop, 0, sizeof(_drop)); - - memcpy(_mac.addr, nic->mac_address().addr, 6); - log("MAC: ", _mac); - } - - void entry() - { - using namespace Genode; - - Timer::Connection timer; - - log("ready to receive packets"); - - Nic::Measurement stat(timer); - stat.set_mac(_mac.addr); - - while(true) - { - Packet_descriptor rx_packet = _nic->rx()->get_packet(); - - Net::Ethernet_frame *eth = - new (_nic->rx()->packet_content(rx_packet)) Net::Ethernet_frame(rx_packet.size()); - stat.data(eth, rx_packet.size()); - - _nic->rx()->acknowledge_packet(rx_packet); - } - } -}; - -static void net_init() -{ - using namespace Genode; - - /* Initialize nic-session */ - enum { - PACKET_SIZE = Nic::Packet_allocator::DEFAULT_PACKET_SIZE, - BUF_SIZE = Nic::Session::QUEUE_SIZE * PACKET_SIZE, - }; - - Nic::Packet_allocator *tx_block_alloc = new (env()->heap()) Nic::Packet_allocator(env()->heap()); - - Nic::Connection *nic = 0; - try { - nic = new (env()->heap()) Nic::Connection(tx_block_alloc, BUF_SIZE, BUF_SIZE); - } catch (Parent::Service_denied) { - destroy(env()->heap(), tx_block_alloc); - Genode::error("could not start Nic service"); - return; - } - - /* Setup receiver thread */ - Nic_worker *worker = new (env()->heap()) Nic_worker(nic); - worker->start(); - -} - -int main(int, char **) -{ - Genode::log("--- NIC performance measurements ---"); - - net_init(); - - Genode::sleep_forever(); - return 0; -} diff --git a/repos/os/src/test/nic_raw/target.mk b/repos/os/src/test/nic_raw/target.mk deleted file mode 100644 index 5527233ae3..0000000000 --- a/repos/os/src/test/nic_raw/target.mk +++ /dev/null @@ -1,3 +0,0 @@ -TARGET = test-nic_raw -SRC_CC = main.cc -LIBS = base net-stat