Fix a gcc warning: "to be safe all intermediate pointers in cast from
'...' to '...' must be 'const' qualified [-Wcast-qual]".
Doing what is essentially a __DECONST() adding the uintptr_t gets
rid of the massive amount of warnings we get in LinuxKPI and lets
us see the actual problems a lot better.
This is a follow-up to 74e908b3c6 which
fixed READ_ONCE().
ACCESS_ONCE() seems to be an obsolete KPI these days in Linux and
FreeBSD does not use it either directly so we can entirely remove
it now.
Sponsored by: The FreeBSD Foundation
Suggested by: jhb
Reviewed by: hselasky
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D40084
Move static mutex declaration outside function body, to avoid global
variables being declared on the stack, when using SYSINITs.
MFC after: 1 week
Sponsored by: NVIDIA Networking
The ext2fs does not support disks with sectorsize more 512 bytes.
The main issue is in reading/writing superblock, which is not aligned
with 4k value. Reimplement the superblock reading logic to make it
indifferent to disk logical sector size. The logical sector size
more then page size is not supported, like it is doing on Linux side.
PR: 271105
Reported by: k(at)vodka.home.kg
Reviewed by: pfg
MFC after: 2 week
Differential Revision: https://reviews.freebsd.org/D40047
Try to implement pci_rescan_bus(). pci_rescan_method() is already
doing most of the job. We only have to do the count for the return
value again ourselves.
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D40122
Moving the APIs from OpenSSL 1.1 supporting APIs to 3.x supporting APIs
is a non-trivial effort. Require 1.1 API compatibility to unblock
updating OpenSSL in base to 3.x.
This mirrors what upstream has done in their configure.ac file.
Submitted by: Pierre Pronchery <pierre@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40082
After adding addpkg() in 10aa369afd
the redirects are no longer needed. We can now log directly so
simplify the code.
Reported by: manu
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D40077
Add support for Realtek, QCA, and Mediatek WiFi NIC cards.
We group the matching entries by driver in sub-functions in order
to semi-automatically create the lists for now.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D40073
When matching "class" only match the class byte and not subclass and
programming interface.
Extend the list of supported classes by network, old, and misc (for no
better names on the latter two).
Extend the list of known vendors for various WiFi NICs.
Add a "pci_fixup_class" as some wireless cards have unexpected PCI
classes set. In case we cannot find a matching file for the original
try to see if a "fixed up" version exists. This allows us to avoid
duplicate matching files for the same vendor/driver but different
chipsets.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D40072
Rather than using echo to return the firmware package name, call a
new function (addpkg) which will also deal with (i) no leading space
and (ii) remove duplicates (as some devices have dual-wifi-cards).
In addition we won't have a line break when having multiple packages.
While here also do not call pkg(8) anymore if there is no package to
install and use the correct variable to install all and not just the
last found package.
Reviewed by: manu, bapt
Differential Revision: https://reviews.freebsd.org/D40071
Add the two new functions needed by wireless drivers by the same
implementation pattern we did for different sizes.
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40174
Currently carp implementation peeks into the opaque 'afp->af_addreq'
buffer, assumes it knows the af-specific layout and assigns vhid
directly.
Simplify the code and remove abstraction leak by introducing per-afp
callback for setting vhid.
This change is a pre-requisite to set addresses via Netlink,
as Netlink implementiation uses different structure layout.
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40160
MFC after: 2 weeks
Add a dummy implementation of skb_get_hash() until we'll hit and
implement it. It'll help to keep an upcoming wireless driver to
compile.
MFC after: 10 days
Add dev_set_threaded() to the dummy functions of netdevice.h in order
to keep an upcoming wireless driver compiling.
While here also update the name of a function argument for consistency.
MFC after: 10 days
ath1xk drivers require further HE defines. Some of those we had
already predicted as comments in the past.
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Inpired by OpenBSD date(1), this option allows to do timezone conversion
via the date(1) command.
For example, to determine when the BSDCan livestream begins for me:
$ env -i TZ=EST5EDT date -z Europe/Paris -j 0900
MFC After: 1 week
Reviewed by: kib, bcr (manpage)
Differential Revision: https://reviews.freebsd.org/D40159
When using rack, cubic and htcp will grab the srtt, but they think it is in ticks. For rack
it is in micro-seconds (which we should probably move all stacks to actually). This causes
issues so instead lets make a new interface so that any CC module can pull the srtt in
whatever granularity they want.
Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D40146
This reduces CI cycle time (a small amount).
Suggested by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40136
The bubblesort of SYSINITs is currently responsible for 7% of the
kernel boot time when booting a 1 CPU / 128 MB VM under Firecracker.
It needs to be replaced with a faster sort, but until that happens
at least instrumenting it with TSLOG makes it show up in flamecharts.
When a new bridge_rtnode is added it is added with a NULL brt_dst. The
brt_dst is set after the entry is added. This means there's a small
window where another core could also attempt to add this node, leading
to the code attempting to log that the MAC addresses moved to a new
interface.
Aside from that being a spurious log entry it also panics, because
obif is NULL (and we attempt to dereference it).
Avoid this by settings brt_dst before we insert the bridge_rtnode.
Assert that obif is non-NULL, as an extra precaution.
Reported by: olivier@
Reviewed by: zlei@
Differential Revision: https://reviews.freebsd.org/D40147
Rename the jails used in the unicast_ll_v6 test, to ensure the jail
names are unique to this test.
That is one of the requirements for running these tests in parallel.
When checking if the state synced over we should look for
198.51.100.254, not 198.51.100.2. The test worked because the incorrect
address is a substring of the correct one, but we should fix it anyway.
Reported by: Naman Sood <naman@freebsdfoundation.org>
MFC after: 1 week
short is small enough that it can overflow in practice for certain cases
and then trigger wrong asserts.
One known example is vfs namecache resize which grabs all locks at once.
Reported by: gallatin
Sponsored by: Rubicon Communications, LLC ("Netgate")
Summary:
This brings some benefit of a tcp flow identification for some kernel
modules, such as siftr.
Reviewers: rrs, rscheff, tuexen, #transport!
Approved by: tuexen (mentor), rrs
Subscribers: imp, melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D40061
If the peer6 address is a link-local address we have to embed the
scopeid, much like we have to for IPv6 multicast as well.
Sponsored by: Rubicon Communications, LLC ("Netgate")
getaddrinfo() returns 0 if it succeeded, but it's not guaranteed to
return 1 on error. Check for success rather than for one specific error.
Without this fix commands such as `ifconfig bnxt1 inet6 add vhid 1 peer6
2001:db8::1/64` would segfault ifconfig.
Sponsored by: Rubicon Communications, LLC ("Netgate")
When trying to auto-load a module, we trim the interface number off
the end. Currently we stop at the first digit. For interfaces which
have numbers in the driver name this does not work well.
In the current example ifconfig ath10k0 would load ath(4) instead of
ath10k(4). For module/interface names like rtw88[0] we never guess
correctly.
To improve for the case we can, start trimming off digits from the
end rather than the front.
Sponsored by: The FreeBSD Foundation
Reported by: thierry
MFC after: 20 days
Reviewed by: melifaro, thierry
Differential Revision: https://reviews.freebsd.org/D40137
The code in rc.d/netif waiting for IPv6 Duplicate Address Detection if
any network interfaces support IPv6. Unfortunately, since lo0 *always*
has IPv6 enabled, this means unconditionally sleeping, even on systems
which have no external IPv6 interfaces.
Since we presume that there is little risk of a duplicate address being
assigned on lo0, amend the test to wait only if there is an interface
*other than lo0* which supports IPv6.
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D40141
In our implementation, grantpt() and unlockpt() don't actually have
any use, because PTY's are created on the fly and already have proper
permissions upon creation.
Atleast check that a proper fd passed to unlockpt(). For grantpt()
Glibc calls TIOCGPTN ioctl which would fail if fd is not a master.
Differential Revision: https://reviews.freebsd.org/D40100
MFC after: 1 week