11#include "port_l4virtio.h"
45 static constexpr unsigned Tx_burst = 128;
47 int lookup_free_slot();
58 template<
typename REQ>
59 void handle_tx_request(Port_iface *port, REQ
const &request);
61 template<
typename PORT>
62 void handle_tx_requests(PORT *port,
unsigned &num_reqs_handled);
65 void all_rx_notify_emit_and_enable()
67 for (
unsigned idx = 0; idx < _max_ports; ++idx)
69 _ports[idx]->rx_notify_emit_and_enable();
72 void all_rx_notify_disable_and_remember()
74 for (
unsigned idx = 0; idx < _max_ports; ++idx)
76 _ports[idx]->rx_notify_disable_and_remember();
137 bool handle_ixl_port_tx(Ixl_port *port);
151 return !_monitor ? 0 : -1;
153 return lookup_free_slot();
A Port on the Virtio Net Switch.
Mac_table manages a 1:n association between ports and MAC addresses.
The Virtio switch contains all ports and processes network requests.
void check_ports()
Check validity of ports.
bool add_monitor_port(Port_iface *port)
Add a monitor port to the switch.
bool handle_l4virtio_port_tx(L4virtio_port *port)
Handle TX queue of the given port.
int port_available(bool monitor)
Is there still a free port on this switch available?
bool add_port(Port_iface *port)
Add a port to the switch.