Commit graph

3130 commits

Author SHA1 Message Date
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
Nicolas Dorier
7d540ddbd4
Fix link in repl demo
The link was relative but the README probably moved since then, I believe it's better to have absolute link.
2022-05-11 13:20:09 +09: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
bunnie
d7ad8d6356 this device image is responding to USB setup packets, at least. 2022-05-10 13:24:27 +08:00
bunnie
adf8eb6519 some progress .. seeing setup packets now 2022-05-10 13:24:08 +08:00
bunnie
6b04f0e73c fix missing pullup bit, required for core to operate correctly
even though it's not hooked up externally, it affects the internal
logic somehow?
2022-05-09 21:10:34 +08:00
bunnie
047b9e539d refactor of usb hardware drivers
- write only u32s to registers
- make everything volatile
2022-05-09 10:04: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
8310d64de9 layer in the HID keyboard drivers 2022-05-07 13:21:23 +08: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
aede037e09 update Cargo.lock 2022-05-06 13:41:09 +08:00
bunnie
15d16ab490 add warnings to remind about moving USB disable to the usbdev server once it's possible 2022-05-06 13:40:32 +08:00
bunnie
bee8334b3b flesh out usb driver 2022-05-06 13:40:12 +08:00
bunnie
e3cd5de0ea this version of precursors actually seems to be doing something usb-like 2022-05-06 13:39:39 +08:00
bunnie
7720b61451 update renode to latest soc 2022-05-06 13:39:28 +08:00
bunnie
22c9867a9a fix Atomic version of instructions to be non-mut
better compatibility with usb libraries
2022-05-06 13:36:11 +08:00
bunnie
709c087337 refactor wait timer for net pump 2022-05-06 13:35:33 +08:00
bunnie
9354932483 fix buffer length check computation 2022-05-06 13:34:59 +08:00
bunnie
382f2ae306 fix warning 2022-05-06 04:00:55 +08:00
bunnie
2a4dd67564 hoist net thread exhaustion check to before we check the poll interval 2022-05-06 04:00:20 +08:00
bunnie
fd2aa438c0 still struggling a bit to get basic USB connectivity test to pass 2022-05-05 20:51:48 +08:00
bunnie
1c21482796 move USB signals into the usbdev block (out of GPIO) 2022-05-03 10:47:40 +08:00
bunnie
b5bbdd87dc absorb missing commit info 2022-05-03 01:51:23 +08:00
bunnie
3133d386c4 cleanup type problems incurred while fixing +Send trait on core types 2022-05-03 01:13:24 +08:00
bunnie
796b7292a6 build for hardware by default 2022-05-03 01:13:11 +08:00
bunnie
5b29fce651 add AtomicCsr type for hw blocks that have to implement Send trait 2022-05-03 01:12:48 +08:00
bunnie
2c2e15ac67 hopefully this time i got all the CSRs compiled in for the USB device 2022-05-03 00:11:16 +08:00
bunnie
322de782d7 ensure all allocs meet the 16-byte alignment criteria 2022-05-02 23:15:52 +08:00
bunnie
c12d9cbe8f working through the usb endpoint descriptor allocator 2022-05-02 22:59:33 +08:00
bunnie
66892e15d2 upgrade the netlist to include the interrupt line 2022-04-28 22:43:16 +08:00
bunnie
8ef37c0526 commit Cargo.lock's reflection of usb-test's addtional dependencie 2022-04-27 02:42:12 +08:00
bunnie
74dafa4788 augment the xtask to deal with more usb-dev scenarios 2022-04-27 02:41:38 +08:00
bunnie
467254fa81 lay down some initial data structures to talk to the UDC 2022-04-27 02:41:07 +08:00
bunnie
a7684343f2 add first commands to toggle core connectivity 2022-04-27 01:22:53 +08:00
bunnie
17cc92eadd ignore changes to Renode filesystem template 2022-04-27 01:22:28 +08:00