genode/repos/gems/src/server/http_block
Norman Feske bbe3ee8dc5 block_session: server-defined payload alignment
This patch replaces the formerly fixed 2 KiB data alignment within the
packet-stream buffer by a server-defined alignment. This has two
benefits.

First, when using block servers that provide small block sizes like 512
bytes, we avoid fragmenting the packet-stream buffer, which occurs when
aligning 512-byte requests at 2 KiB boundaries. This reduces meta data
costs for the packet-stream allocator and also allows fitting more
requests into the buffer.

Second, block drivers with alignment constraints dictated by the
hardware can now pass those constraints to the client, thereby easing
the use of zero-copy DMA directly into the packet stream.

The alignment is determined by the Block::Session_client at construction
time and applied by the Block::Session_client::alloc_packet method.
Block-session clients should always use this method, not the 'alloc_packet'
method of the packet stream (tx source) directly. The latter merely
applies a default alignment of 2 KiB.

At the server side, the alignment is automatically checked by
block/component.h (old API) and block/request_stream.h (new API).

Issue #3274
2019-05-03 13:53:12 +02:00
..
README Consistently name block components 2019-01-14 12:34:39 +01:00
http.cc gems: remove the use of deprecated APIs 2019-01-30 13:49:54 +01:00
http.h block session: remove Block::Session::Operations 2019-05-03 13:53:12 +02:00
main.cc block_session: server-defined payload alignment 2019-05-03 13:53:12 +02:00
target.mk Consistently name block components 2019-01-14 12:34:39 +01:00

README

This directory contains a HTTP client that implements Genode's block session
interface as a front-end. This way you can incorporate arbitrary files via.
HTTP requests and export them as a block device within Genode.


Usage
-----

Config file snippet:

!<start name="http_block">
!  <resource name="RAM" quantum="1M" />
!  <provides><service name="Block"/></provides> <!-- Mandatory -->
!  <config uri="http://kc86.genode.labs:80/file.iso" block_size=2048/>
!</start>