mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
nic_dump: synchronize down/uplink creation
Previously, the uplink session was created on component startup while the creation of the downlink session is timed by the client component. This created a time span in which packets from the uplink were dropped at the nic_dump. Now the uplink session-request is done by the session component of the downlink. Ref #2490
This commit is contained in:
parent
570b5a6920
commit
84ad50b527
@ -56,29 +56,28 @@ Session_component_base(Allocator &guarded_alloc_backing,
|
||||
|
||||
Net::Session_component::Session_component(Allocator &alloc,
|
||||
size_t const amount,
|
||||
Ram_session &buf_ram,
|
||||
size_t const tx_buf_size,
|
||||
size_t const rx_buf_size,
|
||||
Region_map ®ion_map,
|
||||
Uplink &uplink,
|
||||
Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Entrypoint &ep)
|
||||
Env &env)
|
||||
:
|
||||
Session_component_base(alloc, amount, buf_ram, tx_buf_size, rx_buf_size),
|
||||
Session_rpc_object(region_map, _tx_buf, _rx_buf, &_range_alloc, ep.rpc_ep()),
|
||||
Interface(ep, config.attribute_value("downlink", Interface_label()),
|
||||
Session_component_base(alloc, amount, env.ram(), tx_buf_size, rx_buf_size),
|
||||
Session_rpc_object(env.rm(), _tx_buf, _rx_buf, &_range_alloc,
|
||||
env.ep().rpc_ep()),
|
||||
Interface(env.ep(), config.attribute_value("downlink", Interface_label()),
|
||||
timer, curr_time, config.attribute_value("time", false),
|
||||
_guarded_alloc),
|
||||
_mac(uplink.mac_address())
|
||||
_uplink(env, config, timer, curr_time, alloc),
|
||||
_mac(_uplink.mac_address())
|
||||
{
|
||||
_tx.sigh_ready_to_ack(_sink_ack);
|
||||
_tx.sigh_packet_avail(_sink_submit);
|
||||
_rx.sigh_ack_avail(_source_ack);
|
||||
_rx.sigh_ready_to_submit(_source_submit);
|
||||
Interface::remote(uplink);
|
||||
uplink.Interface::remote(*this);
|
||||
Interface::remote(_uplink);
|
||||
_uplink.Interface::remote(*this);
|
||||
}
|
||||
|
||||
|
||||
@ -99,20 +98,15 @@ void Session_component::link_state_sigh(Signal_context_capability sigh)
|
||||
** Root **
|
||||
**********/
|
||||
|
||||
Net::Root::Root(Entrypoint &ep,
|
||||
Net::Root::Root(Env &env,
|
||||
Allocator &alloc,
|
||||
Uplink &uplink,
|
||||
Ram_session &buf_ram,
|
||||
Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Region_map ®ion_map)
|
||||
unsigned &curr_time)
|
||||
:
|
||||
Root_component<Session_component, Genode::Single_client>(&ep.rpc_ep(),
|
||||
Root_component<Session_component, Genode::Single_client>(&env.ep().rpc_ep(),
|
||||
&alloc),
|
||||
_ep(ep), _uplink(uplink), _buf_ram(buf_ram),
|
||||
_region_map(region_map), _config(config), _timer(timer),
|
||||
_curr_time(curr_time)
|
||||
_env(env), _config(config), _timer(timer), _curr_time(curr_time)
|
||||
{ }
|
||||
|
||||
|
||||
@ -143,8 +137,8 @@ Session_component *Net::Root::_create_session(char const *args)
|
||||
}
|
||||
return new (md_alloc())
|
||||
Session_component(*md_alloc(), ram_quota - session_size,
|
||||
_buf_ram, tx_buf_size, rx_buf_size, _region_map,
|
||||
_uplink, _config, _timer, _curr_time, _ep);
|
||||
tx_buf_size, rx_buf_size, _config, _timer,
|
||||
_curr_time, _env);
|
||||
}
|
||||
catch (...) { throw Service_denied(); }
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
/* local includes */
|
||||
#include <interface.h>
|
||||
#include <uplink.h>
|
||||
|
||||
namespace Net {
|
||||
|
||||
@ -29,7 +30,6 @@ namespace Net {
|
||||
class Session_component_base;
|
||||
class Session_component;
|
||||
class Root;
|
||||
class Uplink;
|
||||
}
|
||||
|
||||
|
||||
@ -73,6 +73,7 @@ class Net::Session_component : public Session_component_base,
|
||||
{
|
||||
private:
|
||||
|
||||
Uplink _uplink;
|
||||
Mac_address _mac;
|
||||
|
||||
|
||||
@ -87,15 +88,12 @@ class Net::Session_component : public Session_component_base,
|
||||
|
||||
Session_component(Genode::Allocator &alloc,
|
||||
Genode::size_t const amount,
|
||||
Genode::Ram_session &buf_ram,
|
||||
Genode::size_t const tx_buf_size,
|
||||
Genode::size_t const rx_buf_size,
|
||||
Genode::Region_map ®ion_map,
|
||||
Uplink &uplink,
|
||||
Genode::Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Genode::Entrypoint &ep);
|
||||
Genode::Env &env);
|
||||
|
||||
|
||||
/******************
|
||||
@ -113,13 +111,10 @@ class Net::Root : public Genode::Root_component<Session_component,
|
||||
{
|
||||
private:
|
||||
|
||||
Genode::Entrypoint &_ep;
|
||||
Uplink &_uplink;
|
||||
Genode::Ram_session &_buf_ram;
|
||||
Genode::Region_map &_region_map;
|
||||
Genode::Xml_node _config;
|
||||
Timer::Connection &_timer;
|
||||
unsigned &_curr_time;
|
||||
Genode::Env &_env;
|
||||
Genode::Xml_node _config;
|
||||
Timer::Connection &_timer;
|
||||
unsigned &_curr_time;
|
||||
|
||||
|
||||
/********************
|
||||
@ -130,14 +125,11 @@ class Net::Root : public Genode::Root_component<Session_component,
|
||||
|
||||
public:
|
||||
|
||||
Root(Genode::Entrypoint &ep,
|
||||
Genode::Allocator &alloc,
|
||||
Uplink &uplink,
|
||||
Genode::Ram_session &buf_ram,
|
||||
Genode::Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time,
|
||||
Genode::Region_map ®ion_map);
|
||||
Root(Genode::Env &env,
|
||||
Genode::Allocator &alloc,
|
||||
Genode::Xml_node config,
|
||||
Timer::Connection &timer,
|
||||
unsigned &curr_time);
|
||||
};
|
||||
|
||||
#endif /* _COMPONENT_H_ */
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
/* local includes */
|
||||
#include <component.h>
|
||||
#include <uplink.h>
|
||||
|
||||
using namespace Net;
|
||||
using namespace Genode;
|
||||
@ -33,7 +32,6 @@ class Main
|
||||
Timer::Connection _timer;
|
||||
unsigned _curr_time { 0 };
|
||||
Genode::Heap _heap;
|
||||
Uplink _uplink;
|
||||
Net::Root _root;
|
||||
|
||||
public:
|
||||
@ -45,9 +43,7 @@ class Main
|
||||
Main::Main(Env &env)
|
||||
:
|
||||
_config(env, "config"), _timer(env), _heap(&env.ram(), &env.rm()),
|
||||
_uplink(env, _config.xml(), _timer, _curr_time, _heap),
|
||||
_root(env.ep(), _heap, _uplink, env.ram(), _config.xml(), _timer,
|
||||
_curr_time, env.rm())
|
||||
_root(env, _heap, _config.xml(), _timer, _curr_time)
|
||||
{
|
||||
env.parent().announce(env.ep().manage(_root));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user