66339 Commits

Author SHA1 Message Date
Augustin Cavalier
1981214cd7 TCP: Initiate a send if the new window is larger than 3 default segments.
If the send maximum segment size is very large (as it is on loopback)
and we have receive scaling enabled, we can wind up in situations where
the advertised window will basically always be smaller than the maximum
segment size. In order to avoid stalling until timeouts occur in
this case, check the advertised window against the default segment
size times 3 (which is around the size of ethernet MTU.)
2024-08-01 22:31:07 -04:00
Augustin Cavalier
de6a7a3edf TCP: Do not start the TIME_WAIT timer in Free() if we are about to delete.
The TIME_WAIT timer, when it fires, either sets FLAG_DELETE_ON_CLOSE
(if FLAG_CLOSED is not set), or releases the socket reference directly
(if it is set.) As we set FLAG_CLOSED in Free(), we only want to start
the TIME_WAIT timer if FLAG_DELETE_ON_CLOSE is not set yet.

Probably harmless since the timer was cancelled on deletion anyway,
but it doesn't hurt to be clearer here.
2024-08-01 22:31:07 -04:00
Augustin Cavalier
cb98c7928c TCP: Send immediate ACKs for every out-of-order packet, plus...
...in-order packets following out-of-order ones.

This more or less undoes 04468d614b2a9568d7f05c09c7d8bc48670989d9.
A closer reading of the specs indicates we should send duplicate ACKs
for every out-of-order packet even when SACK is enabled (and of course
send up-to-date SACK information with each duplicate ACK in that case.)
2024-08-01 22:31:07 -04:00
Máximo Castañeda
5c9ff09463 AboutSystem: terminate copyright list
Fixes: #18963
Change-Id: I525627ce9008aef43d3b99d231865fe5598e1994
hrev57904
2024-08-01 18:26:00 +02:00
Jérôme Duval
6aab5c47c2 XHCI: define the SuperSpeedPlus ID for 10Gbps connection speed
can be found on USB 3.1 xhci controllers in the PORTSC register

Change-Id: I11df7e22ca1ab71b42325f8c3db1e4745287feeb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7923
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev57903
2024-08-01 04:24:54 +00:00
Augustin Cavalier
0f73d13bda virtio_net: Fix logic inversion in VIRTIO_NET_CTRL_RX.
The onoff value should be set to 1 for "on" and 0 for "off",
based on the FreeBSD code.

Change-Id: I8da7c905bc4af815f51563b6d9696692b29771db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7919
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev57902
2024-08-01 04:23:26 +00:00
Augustin Cavalier
173fb65a91 virtio_net: Implement receive checksum offloading.
virtio can pass us packets with some of the checksums incomplete.
For now we just pass these to the stack without completing their
checksums; the stack will check only the CHECKSUM_VALID flags.

Tested with QEMU on Linux (IPv4, UDP, TCP, ICMP), seems to work.

Change-Id: Ifc13d931278849b6c4eec550444344e7f1bf53d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7918
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-08-01 04:23:26 +00:00
Máximo Castañeda
13e1bd391b app_server: lock font manager in PicturePlayers accesses
Change-Id: I0a5e59d7141167d8fb22d9cf23baeddd2ea8a8df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7922
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev57901
2024-08-01 04:21:50 +00:00
Máximo Castañeda
78d164f7ee app_server: update font manager revision on font addition and removal
The revision number is used to know if the font list has changed, and
that's where it happens.

Fixes the revision going back when a font directory is removed.

Change-Id: Ib9bb0f463177aff11665c0083604f4a7e35395eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7921
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-08-01 04:21:50 +00:00
Máximo Castañeda
e03d9e134c BFont: reset to plain font on font unload
It may not be ID 0 if it has been changed from the default.

Change-Id: I9aef328ee243d85c2cd37b47666440e0e54e66c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7920
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-08-01 04:21:50 +00:00
Augustin Cavalier
9888c3ce83 TCP: Skip updating round-trip time if it's <= 0.
Taken from https://review.haiku-os.org/c/haiku/+/6364.
hrev57900
2024-07-31 16:20:17 -04:00
Augustin Cavalier
04468d614b TCP: Don't send extra duplicate ACKs with SACK enabled.
If SACK is enabled, then we do not need to send a duplicate ACK
for every out-of-sequence packet, just the first one; following
ones will get delayed-acknowledge'd with SACK information.

Under those conditions, this reduces duplicate ACKs significantly.
2024-07-31 16:19:14 -04:00
Augustin Cavalier
e86e0ee4fd TCP: Fix operator precedence in SACK in _PrepareSendSegment().
?: is lower precedence than -.
Spotted by Clang.
2024-07-31 16:17:07 -04:00
Jim906
ffd9482847 FAT: Extend volume size limit
* Extend the volume size limit in bsd_device_init() from 32 GB to 256
  GB.
* Permit read-only access above this threshold.
* I would like to do more testing before allowing write access above
  256 GB.
* See #11119.

Change-Id: Ica7872d5f4c06415c1501f7a8ffb955785f91a29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7911
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev57899
2024-07-31 16:25:42 +00:00
Augustin Cavalier
587c5ecdac kernel/fs: Check for missing vnode fields in get_vnode.
And issue a panic if they're unset on KDEBUG kernels.
This would've made the cause of #18838 much more apparent.
hrev57898
2024-07-30 20:57:31 -04:00
Augustin Cavalier
61f7048ea3 RAMFS: Properly set node->ops in ramfs_get_vnode.
Fixes #18838.
2024-07-30 20:54:33 -04:00
Augustin Cavalier
ff890d04b3 app_server: Acquire the lock in GlobalFontManager::GetStyle().
On debug builds, the assertion failed on picture playback.
So just use a BAutolock to acquire the lock (again) for
this method.
hrev57897
2024-07-30 20:54:00 -04:00
Augustin Cavalier
4448758b3e app_server & Interface Kit: Rework cursor reference management.
We can't allow applications to reference/unreference cursors,
this is a safety/security violation, and it being done improperly
lead to the reference counts becoming incorrect on the app_server
side.

Change AS_REFERENCE_CURSOR to AS_CLONE_CURSOR and adjust the Cursor
code appropriately. (In the future, copying BCursor without Clone'ing
the data in the case of custom cursors could be accomplished with
client-side reference counting.)

Then rework CursorManager to remove cursors at once on team deletion,
and otherwise clean up cursor reference management to let the
reference counting handle things.
2024-07-30 20:51:53 -04:00
Augustin Cavalier
917dcdfe75 app_server: Fix reference counting for cursors in Desktop class.
We need to acquire our own references to these Cursors.
Fixes assert failures after the addition of more Referenceable asserts,
and may help with #13464 and #18275.
hrev57896
2024-07-30 19:40:58 -04:00
Augustin Cavalier
ae302bcf80 launch_daemon: Change permissions of tmp and shared_memory to 0777.
This matches Linux. New files created in these folders will still
have rwxr-xr-x by default, of course, but the directories themselves
should be usable by all users.
hrev57895
2024-07-30 17:04:48 -04:00
Augustin Cavalier
5ab32f699d BReferenceable: Add checks that the reference count is not <= 0.
If it is, that could indicate a use-after-free (0xdeadbeef has the
sign bit set), or at least that something else strange is happening.

May help with catching/diagnosing KDLs in the network stack.
hrev57894
2024-07-30 17:03:30 -04:00
Augustin Cavalier
9addf8749c kernel/slab: Add slab_object KDL command.
This takes an address and tells you what object_cache it's inside.
2024-07-30 16:50:50 -04:00
Augustin Cavalier
bdd2bf295f freebsd_network: Implement receive checksum offloading.
The drivers enable it by default, so just pass the flags up
the stack if set.

Part of #18744.
hrev57893
2024-07-30 13:23:05 -04:00
Augustin Cavalier
63ea85a225 virtio_net: Update virtio_net.h from FreeBSD.
No functional change intended.
2024-07-30 13:16:27 -04:00
Augustin Cavalier
e49b2154fe ethernet: Get rid of the read/write buffers for scattered I/O.
This (mostly) reverts commit 3ea7c99119a6ae7305a1579d7294e9b1b46810e5.

We no longer need this code after introducing the calls to send
net_buffers to drivers directly.

Change-Id: I31a2fdbbbe8203c53dbcc1e3b1fab2492c8651bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7914
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev57892
2024-07-30 17:03:36 +00:00
Augustin Cavalier
b07cf30aee freebsd_network: Implement the new send/receive ioctls.
It would be nice to reuse the data_nodes as ext_bufs directly
and save another copy. However, we can't do that at the moment,
because while data_nodes and MCLBYTES are the same size (2048),
the data_nodes contain a header structure at the beginning of
that data.

(Perhaps we should consider reworking net_buffer to store data
differently to make that possible. It would also have the advantage
that data_nodes would start on a page boundary or a half-page boundary,
which would make doing direct DMA with them much easier in this
and other drivers as well.)

Change-Id: I8cd3b82a90f328c7a5d2437e3e95413bd74537ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7913
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-30 17:03:36 +00:00
Augustin Cavalier
1485e71d8c ethernet: Make it possible for ethernet drivers to send/receive net_buffers.
This paves the way for a variety of more interesting interactions
between drivers and the stack which are currently not possible
(e.g. checksum offload, #18744). The main advantage for the moment
is that we will save a memcpy of the buffer on each send/receive.

Adapt the virtio_net driver so that at least one driver is using
the new interface. Network still seems to work OK with it.

Change-Id: Ic5832e4865e3e1bed7462583ca1ffd16418d7cab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7912
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-30 17:03:36 +00:00
Augustin Cavalier
60e949faf8 fs_shell: Add ASSERT_ALWAYS definition. hrev57891 2024-07-30 13:02:54 -04:00
Augustin Cavalier
be4e927eed FAT: Just use braces in lockmgr_assert.
Otherwise we encounter a different problem under KDEBUG_LEVEL=2.
2024-07-30 13:02:44 -04:00
Augustin Cavalier
f99ca9a5a2 FAT: Fix build under KDEBUG_LEVEL < 2.
For now, use ASSERT_ALWAYS in a few places.
hrev57890
2024-07-30 10:56:37 -04:00
Augustin Cavalier
a05359e4dd USB: Change some ASSERT to ASSERT_ALWAYS.
Otherwise we get Werrors when trying to build with KDEBUG_LEVEL < 2.
We might as well check these statuses always and panic even on release
builds.
2024-07-30 10:56:10 -04:00
Augustin Cavalier
2a2f213fde network/protocols: Set and check L3/L4_CHECKSUM_VALID flags.
iperf3 TCP on loopback, 1 core (in VMware) goes from ~7.2 Gbits/sec
to ~9.4 Gbits/sec.

Change-Id: I0c93254fab9ee1b5040ef5f71000982bac1a5d15
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7917
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev57889
2024-07-30 14:54:49 +00:00
Augustin Cavalier
258ae0c892 network: Add net_buffer::buffer_flags field.
Does not actually break ABI since net_buffer had 3 bytes of padding
remaining unused.

Add the first two constants for this field: L3/L4_CHECKSUM_VALID.
These will indicate when the checksum of the packet is known to be
valid (good/correct).

Change-Id: I155b3ea51d1093e229677cb788a007560ddbd428
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7916
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-30 14:54:49 +00:00
Augustin Cavalier
e864e93949 network: Rename net_buffer::flags to msg_flags.
It contains only the MSG_* flags, not any other kind of flags.

Change-Id: Ia4590d87a1638fcdb848ef2b816b047b72ca2836
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7915
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-07-30 14:54:49 +00:00
Alexander von Gluck
4c62171e88 usb_serial: Add missing FTDI uarts USBID's
* Witnessed at linux drivers/usb/serial/ftdi_sio_ids.h
* I have a 0403:6010 in hand, validated functional
* Looking at the linux code, there aren't any special
  cases for these alternate FTDI devices.
* There are a bunch of clones we could add per the above
  reference, but lets just support the "official" ones for now.

Change-Id: I4c1aa162b94753431d7497a65f646faec5cccfad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7902
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alexander von Gluck <alex@terarocket.io>
hrev57888
2024-07-30 13:41:47 +00:00
Ilmari "ilzu" Siiteri
78d0ecbbf5 Tracker: Allow organizing of Tracker's New templates to sub-menus
* Fixes #18595
* Organizes templates to the menu in following order: sub-menus,
  directories and files

* Sub-menus are directories with boolean attribute _trk/_template_submenu
  set to true

* For now it doesn't change the behaviour of template folders to allow
  folders to have content to be copied as I suggested in the ticket, I'll
  add that as a separate submission. I also intend to change the behaviour
  of copying the templates to happen asynchronously, as if one uses a large
  template with current implementation it will cause tracker to be
  unresponsive while copying.

Change-Id: I20ea5e3ede0c32df0eacb12df93ae6051654c050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7832
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
hrev57887
2024-07-30 13:35:22 +00:00
Fabio Tomat
4cff206204 Friulian keymap: Add missing character.
"Ç" was missing.

Fixes #18961.

Change-Id: I2ca18d0fa337c2566dbc092d8415f9796c587343
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7910
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev57886
2024-07-30 13:23:21 +00:00
Augustin Cavalier
a57635112e openbsd_network: If dmamem allocation fails, don't leak the local tag. hrev57885 2024-07-29 18:04:12 -04:00
Augustin Cavalier
b390890110 freebsd_network: Allocate only as large a bounce buffer as is actually needed.
Otherwise we will waste a lot of pages.
May help with #18957.
2024-07-29 18:03:50 -04:00
Augustin Cavalier
3c1f9a126b kernel/heap: Increase the guarded heap 'initial' & 'grow' sizes.
With the standard defaults it wastes too much memory and didn't boot.
With these it successfully boots to desktop, for me at least.
hrev57884
2024-07-29 17:52:54 -04:00
Máximo Castañeda
caed67a8cb Input server: add mouse-specific API for button map and click speed
Convert users of those and other parameters to the new API.
Fix mouse preferences "Default" button not changing button map.

Change-Id: I9184011fd3067fd0b229e1db6376c1b41f06dab9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7878
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev57883
2024-07-29 17:30:39 +00:00
Máximo Castañeda
df803c0f3f input_server: handle empty-named mouse settings requests
When reading data, return it from one of the connected devices, or from
defaults if there's none. When changing data, do it for all connected
devices.

Fixes: #16617
Change-Id: I36e0f9929c833905d146d19b02be136a3588026a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7837
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-29 17:30:39 +00:00
Máximo Castañeda
85e84ddefb Input server and preferences: clean up
Remove compatibility with legacy settings format.
The preferences app doesn't need to read and save the settings file:
devices are enumerated and their properties retrieved from the
input_server. When something changes, the input_server updates the data.

Change-Id: Id1ea6f2532a1c8a173e9ba9818dd911fd6f4aa10
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7877
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-07-29 17:30:39 +00:00
Jérôme Duval
f00e314e57 kernel: Vector: fix warning
template-id not allowed for constructor in C++20

Change-Id: I562856908ab2deb9fdbf6bf24eedb58e5ebf6c9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7908
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
hrev57882
2024-07-29 08:11:40 +00:00
Jérôme Duval
7ffd2c9e59 kernel: LegacyDevice: SetHooks() needs a non-null fDeviceModule
fix gcc analyzer warning

Change-Id: Ic2aaeebb516f680ba40c343c01d5be1a9232d46d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7907
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-07-29 08:11:40 +00:00
Augustin Cavalier
b017b23b34 Package Kit: Add another include path to appease GCC2. hrev57881 2024-07-27 23:58:45 -04:00
Augustin Cavalier
bc2428853f Switch to using the vendored libsolv.
Package dependency resolution seems to still be working OK.
hrev57880
2024-07-27 16:57:40 -04:00
Augustin Cavalier
f491972ca9 libsolv: Import 0.3.0_haiku_2014_12_22.
As discussed in #18339, it seems to make sense to vendor libsolv,
given how closely tied it is to the package kit, the difficulties
of upgrading it without breaking anything (even when using SOVERSION
to avoid conflicts), and other concerns.

We already vendor libraries much larger than this (e.g. Zydis),
so vendoring libsolv seems fine.
2024-07-27 16:54:41 -04:00
Augustin Cavalier
ef7e9ceb69 kernel/fs: Create a macro to fetch the net_socket from file_descriptor.
As discussed on the mailing list. Makes the code a bit easier to read.
hrev57879
2024-07-27 15:47:12 -04:00
Augustin Cavalier
3114a405f5 kernel/arch: Apply same fix to stack trace printing as on x86.
At least to the architectures that have stack trace printing code
clearly based on the current x86 one.

Change-Id: I6f28a10234a80ecd464fc640ac1ac26199aa2912
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7906
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: X512 X512 <danger_mail@list.ru>
hrev57878
2024-07-27 19:28:09 +00:00