package mirage-net-xen

  1. Overview
  2. Docs
Network device for reading and writing Ethernet frames via then Xen netfront/netback protocol

Install

Dune Dependency

Authors

Maintainers

Sources

mirage-net-xen-2.1.5.tbz
sha256=1399dfa90e79a485efdf61b480ef801d202bb10cf2d63b0c9b7b12631586d1f9
sha512=ecc85ea1cbdd17750198ed7b3ccb1d3f3d3cde5fb949d01099a8838660ffa997ab848bfd622ee323c6635246c9643b945792a60fbcee717bdc66eba4c403acf5

doc/mirage-net-xen/Shared_page_pool/index.html

Module Shared_page_poolSource

Pool and reuse shared memory blocks. This saves having to reallocate and reshare pages of memory, which is slow. A block is half the size of a page, since network packets usually don't require more than this.

Sourcetype t
Sourceval make : (Xen_os.Xen.Gntref.t -> Io_page.t -> unit) -> t

make grant_access is a shared pool of blocks. When a new page is first allocated, grant_access is called to share it.

Sourceval use : t -> (id:Cstruct.uint16 -> Xen_os.Xen.Gntref.t -> Cstruct.t -> ('a * unit Lwt.t) Lwt.t) -> ('a * unit Lwt.t) Lwt.t

use t fn calls fn ~id gref block with a free shared block of memory and that block's unique ID (note: the gref is NOT unique). The function should return a thread that indicates when the request has been added to the queue, by returning a result value and a second thread indicating when the block can be returned to the pool.

Sourceval blocks_needed : int -> int

Rounds a size in bytes up to the number of blocks needed for it.

Sourceval shutdown : t -> unit

Unshare and free all the pages of the pool once all outstanding requests have completed. Calling use after shutdown will return an error.

OCaml

Innovation. Community. Security.