Loading...
Searching...
No Matches
Virtio_net_request Class Referencefinal
Virtio Net Switch

Abstraction for a network request. More...

`#include <request_l4virtio.h>`

Collaboration diagram for Virtio_net_request:

## Public Member Functions

Mac_addr | dst_mac () const
| Get the Mac address of the destination port.
Mac_addr | src_mac () const
| Get the Mac address of the source port.

## Static Public Member Functions

static void | drop_requests (Virtio_net *dev, L4virtio::Svr::Virtqueue *queue)
| Drop all requests of a specific queue.
static std::optional< Virtio_net_request > | get_request (Virtio_net *dev, L4virtio::Svr::Virtqueue *queue)
| Construct a request from the next entry of a provided queue.

## Detailed Description

Abstraction for a network request.

A Virtio_net_request is constructed by the source port, using the static function get_request() as part of Port_iface::get_tx_request().

On destruction, finish() will be called, which, will trigger the client IRQ of the source client.

Definition at line 35 of file request_l4virtio.h.

## Member Function Documentation

## drop_requests()

void Virtio_net_request::drop_requests | ( | Virtio_net * | dev,
|  | L4virtio::Svr::Virtqueue * | queue )

inlinestatic

Drop all requests of a specific queue.

This function is used for example to drop all requests in the transmission queue of a monitor port, since monitor ports are not allowed to transmit data.

Parameters

  dev | Port of the provided virtqueue.
  queue | Virtqueue to drop all requests of.

Definition at line 172 of file request_l4virtio.h.

References L4virtio::Svr::Virtqueue::desc_avail(), L4virtio::Svr::Virtqueue::finish(), L4_UNLIKELY, L4virtio::Svr::Virtqueue::next_avail(), L4virtio::Virtqueue::ready(), and L4virtio::Svr::Request_processor::start().

Referenced by L4virtio_port::drop_requests().

Here is the call graph for this function:
Here is the caller graph for this function:

## get_request()

std::optional< Virtio_net_request > Virtio_net_request::get_request | ( | Virtio_net * | dev,
|  | L4virtio::Svr::Virtqueue * | queue )

inlinestatic

Construct a request from the next entry of a provided queue.

Parameters

  dev | Port of the provided virtqueue.
  queue | Virtqueue to extract next entry from.

Definition at line 199 of file request_l4virtio.h.

References L4_UNLIKELY, L4virtio::Svr::Virtqueue::next_avail(), and L4virtio::Virtqueue::ready().

Referenced by L4virtio_port::get_tx_request().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file:

- pkg/virtio-net-switch/server/switch/request_l4virtio.h