Commit Graph

24 Commits

Author SHA1 Message Date
Christian Prochaska 31d7b3eb97 vfs_lwip: guard 'blocked_handles' Fifo
Fixes #3738
2020-04-28 11:37:56 +02:00
Christian Helmuth 504539ad1e vfs/lwip: notify I/O progress on sent packets
Incoming ACK packets for sent data packets may be the only unblocker for
suspended write/send loops. This patch informs VFS users about I/O of
VFS handle on successfully sent packets.
2019-12-19 17:01:42 +01:00
Sebastian Sumpf 9767c4db0e vfs_lwip/lwip: Lwip::lock for concurrent access
This is required in case the send and receive of IP packets is
performed by multiple thread because lwip is not thread safe.

issue #3568
2019-12-19 17:01:42 +01:00
Christian Helmuth e70c04ef86 lwip: shut down TCP sockets return WRITE_ERR_IO on write 2019-11-19 14:54:13 +01:00
Norman Feske 5ab1505d43 file system: enhanced file status info
This patch extends the 'File_system::Status',
'File_system::Directory_entry', and the related 'Vfs' types with
the following additional information:

- Distinction between continuous and transactional files (Node_type)
  (issue #3507)
- Readable, writeable, and executable attributes (Node_rwx),
  replacing the former 'mode' bits
  (issue #3030)

The types 'Node_rwx', 'Node_type' are defined twice,
once for the VFS (vfs/types.h) and once for the 'File_system'
session (file_system_session/file_system_session.h).
Similarly, there is a direct correspondance between
'Vfs::Directory_service::Dirent' and 'File_system::Directory_entry'.

This duplication of types follows the existing pattern of keeping the
VFS and file-system session independent from each other.
2019-11-19 14:23:56 +01:00
Norman Feske e0ee56275e vfs_lwip: fix switch fall-through
Pointed out by a compiler warning.
2019-11-19 14:10:55 +01:00
Ehmry - 36111a2edf Libc: implement getifaddrs
Implement getifaddrs and freeifaddrs within the libc using socket
control files at the VFS. Add an "address" and "netmask" file to the
lwIP plugin.

Only a single IPv4 address is initially supported, and the broadcast
address returned will never be valid.

Fixes #3439
2019-09-02 16:36:07 +02:00
Ehmry - 66f49e6c42 VFS lwIP: support opening a handle on the root directory
The "nameserver" file cannot be opened through a VFS File_system client
if the plugin does not support opening the parent directory of
"/nameserver", which would be "/".

Ref #3269
2019-04-09 12:30:34 +02:00
Ehmry - a635873568 VFS: Replace global response handlers with local handlers
Replace the I/O response handler that is passed to the VFS at
construction with an object that is dynamically attached to handles.
This object shall also accept read-ready notifications, and plugins are
encouraged to keep handles awaiting ready-ready notifications separate
from handles that await I/O progress.

Replace the use of handle lists in plugins with handle queues, this
makes the code easier to understand and the ordering of notifications to
the application more explicit.

These changes replace the use of the Post_signal_hook from all VFS
plugins, applications must assume that read-ready and I/O notifications
occur during I/O signal dispatch and use an Io_progress_handler at its
entrypoints to defer response until after signal dispatching.

Fix #3257
2019-04-09 12:30:34 +02:00
Ehmry - 800b4e44b1 Reduce Vfs::Vfs_handle::Context to empty struct type
The "Vfs::Vfs_handle" type should not contain any public members that
can be initialized by the VFS internally and by the application, so
remove inheritance from the "Genode::list::Element" class. The VFS
plugins must instead use lists of "Vfs::Vfs_handle" sub-classes, the
lifetime of which are always managed by the plugin.

Ref #3036
2019-04-01 19:33:47 +02:00
Ehmry - 2fa7964a39 VFS lwIP: fix TCP pbuf unchaining
The lwIP VFS plugin uses lwIP pbuf chains to queue recieved TCP data and
must rechain them when the application dequeues data. Remove an
"pbuf_realloc" call which is not needed for updating pbuf metadata when
dequeuing the head of the chain.

Fix #3169
2019-02-26 14:44:31 +01:00
Norman Feske b3727a9b46 Add missing override annotations
Issue #3159
2019-02-19 11:12:11 +01:00
Ehmry - 38ab456c78 Remove pointers from Genode::Fifo interface
Replace methods of Genode::Fifo returning pointers with methods which
call lambdas with references.

Ref #3135
2019-02-19 11:08:17 +01:00
Christian Prochaska e8ea28d897 socket fs: support non-blocking 'connect()'
Fixes #3113
2019-01-30 13:35:28 +01:00
Ehmry - bd53e5b496 VFS lwIP: send application data immediately
Call 'tcp_output' if application data has been successfully queued. This
sends data immediately that may otherwise remain queued until the next
periodic TCP timer event.

This reverts a change made in 3e31e2ba53.

Fix #3067
2019-01-07 12:25:46 +01:00
Ehmry - 3e31e2ba53 VFS LwIP: blocking TCP write
Block and loop until application writes are sent or buffered in their
entirety. Do not call "tcp_output" directly, LwIP calls this procedure
internally and calling it again appears to disrupt the LwIP TCP state
machine.

Fix #3017
2018-10-29 09:36:22 +01:00
Ehmry - 98380cebda VFS LwIP: do not free TCP PCBs on error
The VFS LwIP plugin is page-faulting on connect error because the LwIP
library frees a failed TCP protocol control block before calling the
error callback, and then the VFS plugin dereferences the PCB to free it
a second time. This problem was caused by a failure to follow
documentation during a transition from a C callback to a C++ method.

Fix #2972
2018-09-13 15:21:11 +02:00
Ehmry - 6f8e8a6ea4 LwIP: clamp reads to a value that can be expressed in 16 bits
There is a bug in the LwIP VFS plugin, the chained buffers used by Lwip
use sizes expressed in sixteen bits, and under conditions such as a read
of 1<<16 the higher bits are lost and the plugin performs a zero length
read, and the application interprets this as a closed connection.

Fix #2947
2018-08-30 09:24:47 +02:00
Ehmry - 26611db95b LwIP VFS: remove link status messages
Remove warnings from the plugin that were used to check behavior of
applications waiting for link and IP status changes.

Ref #2335
2018-08-28 17:10:57 +02:00
Ehmry - ffd688642a VFS LwIP: state tracking fixes
Better track the state of TCP connections and PCB pointers. Allow
received data that has queued to be read under any conditions.

Ref #2335
2018-08-28 16:45:27 +02:00
Ehmry - 67d88526b9 VFS LwIP: delay accepted connections
Ref #2335
2018-08-28 16:45:27 +02:00
Ehmry - 4678f27802 Propagate LwIP connect errors with sync
Ref #2335
Ref #2920
2018-08-08 11:34:21 +02:00
Ehmry - e208fbb1b3 VFS LwIP: notify peek handles on recv
Ref #2335
2018-08-08 10:59:02 +02:00
Emery Hemingway d9a4773194 LwIP VFS plugin
This patch reintroduces the LwIP stack to libc as a VFS plugin
implementing the socket_fs interface. Rather than use LwIP's socket
emulation layer this plugin interfaces directly to LwIP raw API and is
single threaded.

The internal TCP parameters of the stack are untuned.

Fix #2050
Fix #2335
2018-08-02 14:36:48 +02:00