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,
|
Net::Session_component::Session_component(Allocator &alloc,
|
||||||
size_t const amount,
|
size_t const amount,
|
||||||
Ram_session &buf_ram,
|
|
||||||
size_t const tx_buf_size,
|
size_t const tx_buf_size,
|
||||||
size_t const rx_buf_size,
|
size_t const rx_buf_size,
|
||||||
Region_map ®ion_map,
|
|
||||||
Uplink &uplink,
|
|
||||||
Xml_node config,
|
Xml_node config,
|
||||||
Timer::Connection &timer,
|
Timer::Connection &timer,
|
||||||
unsigned &curr_time,
|
unsigned &curr_time,
|
||||||
Entrypoint &ep)
|
Env &env)
|
||||||
:
|
:
|
||||||
Session_component_base(alloc, amount, buf_ram, tx_buf_size, rx_buf_size),
|
Session_component_base(alloc, amount, env.ram(), tx_buf_size, rx_buf_size),
|
||||||
Session_rpc_object(region_map, _tx_buf, _rx_buf, &_range_alloc, ep.rpc_ep()),
|
Session_rpc_object(env.rm(), _tx_buf, _rx_buf, &_range_alloc,
|
||||||
Interface(ep, config.attribute_value("downlink", Interface_label()),
|
env.ep().rpc_ep()),
|
||||||
|
Interface(env.ep(), config.attribute_value("downlink", Interface_label()),
|
||||||
timer, curr_time, config.attribute_value("time", false),
|
timer, curr_time, config.attribute_value("time", false),
|
||||||
_guarded_alloc),
|
_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_ready_to_ack(_sink_ack);
|
||||||
_tx.sigh_packet_avail(_sink_submit);
|
_tx.sigh_packet_avail(_sink_submit);
|
||||||
_rx.sigh_ack_avail(_source_ack);
|
_rx.sigh_ack_avail(_source_ack);
|
||||||
_rx.sigh_ready_to_submit(_source_submit);
|
_rx.sigh_ready_to_submit(_source_submit);
|
||||||
Interface::remote(uplink);
|
Interface::remote(_uplink);
|
||||||
uplink.Interface::remote(*this);
|
_uplink.Interface::remote(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,20 +98,15 @@ void Session_component::link_state_sigh(Signal_context_capability sigh)
|
||||||
** Root **
|
** Root **
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
Net::Root::Root(Entrypoint &ep,
|
Net::Root::Root(Env &env,
|
||||||
Allocator &alloc,
|
Allocator &alloc,
|
||||||
Uplink &uplink,
|
|
||||||
Ram_session &buf_ram,
|
|
||||||
Xml_node config,
|
Xml_node config,
|
||||||
Timer::Connection &timer,
|
Timer::Connection &timer,
|
||||||
unsigned &curr_time,
|
unsigned &curr_time)
|
||||||
Region_map ®ion_map)
|
|
||||||
:
|
:
|
||||||
Root_component<Session_component, Genode::Single_client>(&ep.rpc_ep(),
|
Root_component<Session_component, Genode::Single_client>(&env.ep().rpc_ep(),
|
||||||
&alloc),
|
&alloc),
|
||||||
_ep(ep), _uplink(uplink), _buf_ram(buf_ram),
|
_env(env), _config(config), _timer(timer), _curr_time(curr_time)
|
||||||
_region_map(region_map), _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())
|
return new (md_alloc())
|
||||||
Session_component(*md_alloc(), ram_quota - session_size,
|
Session_component(*md_alloc(), ram_quota - session_size,
|
||||||
_buf_ram, tx_buf_size, rx_buf_size, _region_map,
|
tx_buf_size, rx_buf_size, _config, _timer,
|
||||||
_uplink, _config, _timer, _curr_time, _ep);
|
_curr_time, _env);
|
||||||
}
|
}
|
||||||
catch (...) { throw Service_denied(); }
|
catch (...) { throw Service_denied(); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
/* local includes */
|
/* local includes */
|
||||||
#include <interface.h>
|
#include <interface.h>
|
||||||
|
#include <uplink.h>
|
||||||
|
|
||||||
namespace Net {
|
namespace Net {
|
||||||
|
|
||||||
|
@ -29,7 +30,6 @@ namespace Net {
|
||||||
class Session_component_base;
|
class Session_component_base;
|
||||||
class Session_component;
|
class Session_component;
|
||||||
class Root;
|
class Root;
|
||||||
class Uplink;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ class Net::Session_component : public Session_component_base,
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Uplink _uplink;
|
||||||
Mac_address _mac;
|
Mac_address _mac;
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,15 +88,12 @@ class Net::Session_component : public Session_component_base,
|
||||||
|
|
||||||
Session_component(Genode::Allocator &alloc,
|
Session_component(Genode::Allocator &alloc,
|
||||||
Genode::size_t const amount,
|
Genode::size_t const amount,
|
||||||
Genode::Ram_session &buf_ram,
|
|
||||||
Genode::size_t const tx_buf_size,
|
Genode::size_t const tx_buf_size,
|
||||||
Genode::size_t const rx_buf_size,
|
Genode::size_t const rx_buf_size,
|
||||||
Genode::Region_map ®ion_map,
|
|
||||||
Uplink &uplink,
|
|
||||||
Genode::Xml_node config,
|
Genode::Xml_node config,
|
||||||
Timer::Connection &timer,
|
Timer::Connection &timer,
|
||||||
unsigned &curr_time,
|
unsigned &curr_time,
|
||||||
Genode::Entrypoint &ep);
|
Genode::Env &env);
|
||||||
|
|
||||||
|
|
||||||
/******************
|
/******************
|
||||||
|
@ -113,10 +111,7 @@ class Net::Root : public Genode::Root_component<Session_component,
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Genode::Entrypoint &_ep;
|
Genode::Env &_env;
|
||||||
Uplink &_uplink;
|
|
||||||
Genode::Ram_session &_buf_ram;
|
|
||||||
Genode::Region_map &_region_map;
|
|
||||||
Genode::Xml_node _config;
|
Genode::Xml_node _config;
|
||||||
Timer::Connection &_timer;
|
Timer::Connection &_timer;
|
||||||
unsigned &_curr_time;
|
unsigned &_curr_time;
|
||||||
|
@ -130,14 +125,11 @@ class Net::Root : public Genode::Root_component<Session_component,
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Root(Genode::Entrypoint &ep,
|
Root(Genode::Env &env,
|
||||||
Genode::Allocator &alloc,
|
Genode::Allocator &alloc,
|
||||||
Uplink &uplink,
|
|
||||||
Genode::Ram_session &buf_ram,
|
|
||||||
Genode::Xml_node config,
|
Genode::Xml_node config,
|
||||||
Timer::Connection &timer,
|
Timer::Connection &timer,
|
||||||
unsigned &curr_time,
|
unsigned &curr_time);
|
||||||
Genode::Region_map ®ion_map);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _COMPONENT_H_ */
|
#endif /* _COMPONENT_H_ */
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
/* local includes */
|
/* local includes */
|
||||||
#include <component.h>
|
#include <component.h>
|
||||||
#include <uplink.h>
|
|
||||||
|
|
||||||
using namespace Net;
|
using namespace Net;
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
@ -33,7 +32,6 @@ class Main
|
||||||
Timer::Connection _timer;
|
Timer::Connection _timer;
|
||||||
unsigned _curr_time { 0 };
|
unsigned _curr_time { 0 };
|
||||||
Genode::Heap _heap;
|
Genode::Heap _heap;
|
||||||
Uplink _uplink;
|
|
||||||
Net::Root _root;
|
Net::Root _root;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -45,9 +43,7 @@ class Main
|
||||||
Main::Main(Env &env)
|
Main::Main(Env &env)
|
||||||
:
|
:
|
||||||
_config(env, "config"), _timer(env), _heap(&env.ram(), &env.rm()),
|
_config(env, "config"), _timer(env), _heap(&env.ram(), &env.rm()),
|
||||||
_uplink(env, _config.xml(), _timer, _curr_time, _heap),
|
_root(env, _heap, _config.xml(), _timer, _curr_time)
|
||||||
_root(env.ep(), _heap, _uplink, env.ram(), _config.xml(), _timer,
|
|
||||||
_curr_time, env.rm())
|
|
||||||
{
|
{
|
||||||
env.parent().announce(env.ep().manage(_root));
|
env.parent().announce(env.ep().manage(_root));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user