Commit graph

3041 commits

Author SHA1 Message Date
bunnie
3664331b2f update release notes 2022-05-13 14:53:23 +08:00
bunnie
4ec84bf4dc implement deferred close on drop for TcpStream
streams are not closed until the txbuffer is empty
2022-05-13 14:51:07 +08:00
bunnie
6f1597b1e7 make "fountain" test optionally terminate
any characters typed as an argument after "fountain" will cause
it to terminate in 10 iterations
2022-05-13 14:50:29 +08:00
bunnie
b470588285 oops, fix a compile error. also try adding a flush()...this only made things worse?? 2022-05-13 02:25:35 +08:00
bunnie
56f9c654c0 debugging of TcpStream Drop dropping too fast
so far only able to confirm the problem happens, no effective
fixes yet.
2022-05-13 02:19:10 +08:00
bunnie
17e9a210ef add maintenanence notes referring to relevant smoltcp issues 2022-05-13 01:21:41 +08:00
bunnie
77e56a5a6e add notes about smoltcp integration 2022-05-13 01:17:25 +08:00
bunnie
c17219b6fe add icmpv4 fixes
a lot of debug spew is also enabled in this commit, intentionally,
because the next thing to chase out is the failure of TcpStream
on Drop.
2022-05-13 00:30:12 +08:00
bunnie
bac650808d force all UDP packets to respond on the local IP address
smoltcp is written to allow multiple adapters, so 0.0.0.0 as
the binding for UDP is illegal. However, in Rust, it seems that
0.0.0.0 is "totally fine" and most OSes will resolve this to
a "default" adapter.

this patch introduces the behavior of taking 0.0.0.0 and mapping
it to a default adapter. In fact, we only allow binding to the
default adapter. The reasoning behind this is that if our IP
address changes, we would expect that 0.0.0.0 resolves to that.

Where this scheme fails is if someone binds to 127.0.0.1 expecting
it to not respond to packets coming in from the outside, e.g.
they are using UDP as a loopback interface. I think this isn't
a common use case for Xous, but if it does become one I suppose
we could add a code path to also check for the 127.0.0.1 case
and try to handle it...
2022-05-12 22:26:38 +08:00
bunnie
94cbbddaa6 refactor follow-up scheduling vs smoltcp stack
smoltcp requires some polling to be done in the future for it
to work with low latency. It returns a time in the future for
the next poll.

This refactors the polling algorithm to:

1. use a fixed thread pool. This burns a little extra memory in
exchange for not having to allocate/de-allocate threads every
time a follow-up is needed.

2. use a short/long scheduler, where short delays (shorter than
the scheduler quantum) are grouped together, and only a single
follow-up is fired off within that time range if needed. Longer
delays have a larger window (roughly +/- 100ms) of grouping,
so fewer such events are also required in the distant future.

Empirically the delays seem to fall into two groups, either "short"
(less than 20ms) or "long" (around 700ms).

This improved scheduler uses fewer threads and generates less
messages, so instead of 16 threads and encountering exhaustion
we have 9 and have yet to see more than 7 used even under the
most strenuous tests (multiple while-true curl loops + fountain
test + ping simultaneously).

Some helpful debug is also printed now when scheduler runs out
of slots, so we can see the distribution of pending delays.
2022-05-12 17:49:27 +08:00
bunnie
0aa2f21f0b make scheduler quantum a visible parameter, and adjust to 10ms down from 20ms 2022-05-12 17:49:03 +08:00
bunnie
caf91e18ca fix net reset
we no longer create a new interface on net reset, which means that
the socket handles don't blow up if we change IP addresses.
However, the ARP cache is still stale and there seems to be on way
to force it to flush....but I guess in theory, eventually it
should fix itself, if smoltcp is working correctly?
2022-05-12 10:34:19 +08:00
bunnie
cc7e7f97c7 update smoltcp to 0.8.0
the refactor changes the way sockets are handled, so now, when
the interface is rebound we are certain to get panics.

working on resolving this detail now, but at least the interface
is working now and it seems more stable than before.
2022-05-12 09:27:51 +08:00
bunnie
fd500927d3 quit fountain generator if error is encountered 2022-05-11 22:20:15 +08:00
bunnie
ce116c2c0d add "fountain" test to net suite 2022-05-11 21:24:04 +08:00
bunnie
867b0efdf2 hosted mode breaks under windows due to missing .exe on some configs
I don't know why it doesn't break under a default config, but if
xous-core is cloned to a directory that doesn't match the repo
name this breaks. This patch tries to fix it for that case.
2022-05-10 17:37:41 +08:00
bunnie
8af8926ad1 make disk sizing errors non-fatal in hosted mode
it can be innocuous in the case that you're changing sizes
for debugging
2022-05-10 17:37:08 +08:00
bunnie
9419ed6078 update release, fix warning 2022-05-10 17:36:52 +08:00
bunnie
b9262dc390
Merge pull request #153 from nworbnhoj/qrcode
refine qrcode handling
2022-05-10 02:06:33 -07:00
bunnie
9e350e739a
Update i18n.json
add translations
2022-05-10 17:05:59 +08:00
nworbnhoj
dd1ce051d1 refine qrcode handling
- expand max text.len to 4096
- throw error on overrun
- simplify qrcode rendering (reduced memory & math)
- correct module size by 1px
2022-05-08 10:00:41 +10:00
bunnie
ea6cf27ed9 fix PDDB length field -- somehow this got flipped from the debug branch 2022-05-06 14:43:29 +08:00
bunnie
ee0f443883 hoist net thread exhaustion check to before we check the poll interval 2022-05-06 14:17:29 +08:00
bunnie
e2c07bd4d7 fix warning 2022-05-06 14:16:54 +08:00
bunnie
ccb3e495e1 hoist net thread exhaustion check to before we check the poll interval 2022-05-06 14:15:53 +08:00
bunnie
9893e70759 fix warning 2022-05-06 13:45:22 +08:00
bunnie
71e41d4b0a fix buffer length check computation 2022-05-06 13:45:22 +08:00
bunnie
413b7153ac refactor wait timer for net pump 2022-05-06 13:44:03 +08:00
bunnie
99a7d2b6e3 add forwarding to release notes 2022-04-25 22:45:09 +08:00
bunnie
f6b39158db
Merge pull request #151 from betrusted-io/regifting-fixes
Regifting fixes
2022-04-25 18:43:41 +08:00
bunnie
33a3cfa7c2 fix typo 2022-04-25 18:34:31 +08:00
bunnie
a9b2dd535a add a note to remind about the purpose of the unsub test command 2022-04-25 18:32:09 +08:00
bunnie
d23dbd1db8 add an explicit test of the unsub path
normally you would never use this, this would cause the
connection manager to muck up.
2022-04-25 18:30:43 +08:00
bunnie
969b4ec868 refactor net firewall to use .forward() method 2022-04-25 18:30:24 +08:00
Sean Cross
617e075c08 xous: handle forwarding of BlockingScalar messages
These are not automatically returned on their own, so handle the return
manually.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:52:09 +08:00
Sean Cross
fa98b865df xtask: add --no-timestamp option
Add a --no-timestamp build option to skip rebuilding `ticktimer`.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:41:35 +08:00
Sean Cross
7d8ff07caf xous: use the alloc API for allocating memory
Don't rely on the trick where we use a `Vec<u8>`. Call the `alloc` API
directly for all packet types.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
c956cb7da5 xous: add Envelope.forward() to forward messages
Messages should be able to be forwarded from one Server to another. This
is a wrapper around the machinery that would do that.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
d8a413b7c2 xous: add take_message() and send() calls to the envelope
Add a function to enable "regifting" a message that was sent to you.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
04e91b8c44 xous: messages: add set_id() to set Message ID
Allow setting a message's ID by adding a `set_id(&mut self, ...)`
function. This can be used when regifting a message.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
ddd7c6715a xous: hosted: use Vec as a memory backing
Use a `Vec<u8>` as a backing for memory across the entire project.

Previously we used `Vec<u8>` as a backing for MemoryMessages and used
`alloc` for all other messages. This unifies that to always use
`Vec<u8>`.

I'd prefer if we used `alloc` instead, however that has not been working
and I'm not sure why. Standardize on this for now and look into why
later.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
Sean Cross
2084a9cda4 xous: split messages into a sub-module
The `Messages` types were getting hairy, and `definitions.rs` was really
long. Trim it down by moving types into their own files.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-25 17:31:27 +08:00
bunnie
f531955c44 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-04-24 21:53:36 +08:00
bunnie
8d28f130ea fix a missing case for hardware not caught by hosted mode 2022-04-24 21:53:18 +08:00
Sean Cross
88a0be5e4b
CONTRIBUTRING: Update license link
Correct the link to the licenses directory to address #148
2022-04-24 21:48:43 +08:00
bunnie
ed8e73764a add Cargo.lock 2022-04-24 21:41:18 +08:00
bunnie
f8246b14f5 run rustfmt on the modals crate 2022-04-24 21:40:42 +08:00
bunnie
26e98ec255 add PR #150 to release notes 2022-04-24 21:37:56 +08:00
bunnie
547783d195
Merge pull request #150 from nworbnhoj/qrcode
enable notification modal text + qrcode
2022-04-24 21:36:38 +08:00
bunnie
5b32fac3cc add PR #149 to release notes 2022-04-24 21:33:27 +08:00