Commit Graph

142479 Commits

Author SHA1 Message Date
John Baldwin
551feba18c sc vga: Remove unused variables.
Cast the return value of intentional dummy reads to void.
2022-04-06 16:45:28 -07:00
John Baldwin
c0a1391aa6 ixl: Remove unused variables. 2022-04-06 16:45:28 -07:00
John Baldwin
ee28ad11b7 iavf: Quite set but not used warnings.
Move declaration of dev in iavf_if_attach_post under #ifdef IXL_DEBUG.

Remove unused ifp in iavf_stop.
2022-04-06 16:45:28 -07:00
John Baldwin
46adc7fad3 axgbe: Remove unused variable in axgbe_msix_que.
Keep the register read just in case though it seems possible it is not
needed as the function later clears specific interrupts via a write to
the same register.
2022-04-06 16:45:28 -07:00
John Baldwin
354ef278e9 powernow(4): Fix unused variable warnings by using the variables. 2022-04-06 16:45:28 -07:00
John Baldwin
d68cc5a839 isci: Disable set but unused warnings. 2022-04-06 16:45:28 -07:00
John Baldwin
bbfec32d15 isci: Propagate error from bus_dma_tag_create.
Return error from isci_controller_allocate_memory if bus_dma_tag_create
fails instead of ignoring the error.
2022-04-06 16:45:28 -07:00
John Baldwin
b024faffa0 hyperv storvsc: Remove unused variables. 2022-04-06 16:45:28 -07:00
John Baldwin
583df2db5c bxe: Quiet set but not used warnings.
Comment out other references to more_tx since the only use is commented out.

Remove unused is_parity variable.
2022-04-06 16:45:28 -07:00
John Baldwin
9b0eb55048 psm: Remove write-only variables. 2022-04-06 16:45:28 -07:00
John Baldwin
6301649e0e mlx5: Remove write-only variables. 2022-04-06 16:45:28 -07:00
John Baldwin
8b6ccfb6c7 multicast code: Quiet unused warnings for variables used for KTR traces.
For nallow and nblock, move the variables under #ifdef KTR.

For return values from functions logged in KTR traces, mark the
variables as __unused rather than having to #ifdef the assignment of
the function return value.
2022-04-06 16:45:28 -07:00
John Baldwin
f7236dd068 change_mpath_route: Remove write-only nh variable.
While here, cleanup the style of the function prologue by moving an
assignment out of the middle of two variable declaration blocks.
2022-04-06 16:45:28 -07:00
John Baldwin
371c917b0b unlink_nhgrp: Remove write-only variable.
Possibly one could assert that ret should always be 0 here (that is,
that there was always an index found in the bitmask).  That should be
true since a bitmask index is allocated before the nhgrp is inserted
in the ctl->gr_head list in link_nhgrp.
2022-04-06 16:45:27 -07:00
John Baldwin
7650d4b67e xen netback: Remove write-only variables. 2022-04-06 16:45:27 -07:00
John Baldwin
92ca0e81b8 pvscsi_adapter_reset: Mark val as unused.
This variable is unsed in a debug trace conditional on a private
debugging macro (so not eligible for __diagused).
2022-04-06 16:45:27 -07:00
John Baldwin
8c3923ae2f uhci: Remove write-only variable. 2022-04-06 16:45:27 -07:00
John Baldwin
4afc92cd6e ac97_initmixer: Remove write-only variables. 2022-04-06 16:45:27 -07:00
John Baldwin
546629073d cmi: Mark rsp as unused.
If the DEB macro is manually enabled to enable tracing then this
variable is used.  This doesn't use __diagused since it is dependent
on a non-standard debugging macro.
2022-04-06 16:45:27 -07:00
John Baldwin
30cac8e3bb ppc: Fix set but not used warnings on !i386.
Move fetch of SYS_RES_IOPORT resource and associated variables under
existing #ifdef __i386__.
2022-04-06 16:45:27 -07:00
John Baldwin
d31850654e iwn: Remove write-only extra variable.
extra is used in a commented-out expression to compute
scan_service_time.  Use #if 0 instead of a comment for the disabled
scan_service_time expression and move the unused computation of extra
under the same #if.
2022-04-06 16:45:27 -07:00
John Baldwin
99f65e9198 iwi: Remove write-only status variable.
Skip over unused field from asresp frame header.
2022-04-06 16:45:27 -07:00
John Baldwin
89abc0fbbd x86 bounce_bus_dma_tag_destroy: Silence set but unused warning. 2022-04-06 16:45:27 -07:00
Alan Somers
3227325366 fusefs: fix two bugs regarding VOP_RECLAIM of the root inode
* We never send FUSE_LOOKUP for the root inode, since its inode number
  is hard-coded to 1.  Therefore, we should not send FUSE_FORGET for it,
  lest the server see its lookup count fall below 0.

* During VOP_RECLAIM, if we are reclaiming the root inode, we must clear
  the file system's vroot pointer.  Otherwise it will be left pointing
  at a reclaimed vnode, which will cause future VOP_LOOKUP operations to
  fail.  Previously we only cleared that pointer during VFS_UMOUNT.  I
  don't know of any real-world way to trigger this bug.

MFC after:	2 weeks
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D34753
2022-04-06 16:16:52 -06:00
Kirk McKusick
4710aa248b Avoid dereferencing a possibly null pointer.
Reported by: Coverity
CID:         1475868
2022-04-06 14:25:55 -07:00
Navdeep Parhar
c5a7885c80 cxgbe(4): Display the number of free PM pages and p-structs in meminfo.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-04-06 13:15:26 -07:00
Navdeep Parhar
f88b31885c cxgbe(4): meminfo should get the TLS region's limits from the hardware.
meminfo is meant for debugging and it should read hardware configuration
directly when possible instead of relying on values queried from the
firmware.  Rename the region to "TLSKey region" to match other drivers
while here.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-04-06 13:15:25 -07:00
Navdeep Parhar
9983e5cce6 cxgbe(4): Fix the sorting order of the regions listed in meminfo.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-04-06 13:15:25 -07:00
Kristof Provost
bef7104571 pf: use ERROUT_IOCTL()
Use ERROUT_IOCTL() rather than hand-rolling the macro. This adds DTrace
SDTs in the error path, making debugging ioctl errors easier.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-06 16:51:31 +02:00
Gordon Bergling
f64919bbd9 ng_btsocket(4): Fix a typo in an error message
- s/mulitplexor/multiplexor/

MFC after:	5 days
2022-04-06 18:27:29 +02:00
Dmitry Chagin
0938d04a2c linux(4): Fix a typo in itimerspec conversion routine.
MFC after:	3 days
2022-04-06 17:40:00 +03:00
Andrew Turner
d8bff5b67c Handle non-page aligned/sized memory in physmem
In some configurations the firmware may pass memory regions that are
not page sized or aligned, e.g. when using 16k pages on arm64. If this
is the case we will calculate many small regions because the alignment
is applied before being inserted. As we round the start up and end down
this will leave a 1 page hole between what should have been a single
region.

Fix by keeping the original alignment until we are just about to insert
the region into the avail array.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34694
2022-04-06 14:13:29 +01:00
Andrew Turner
8c99dfed54 Port subr_physmem to userspace and add tests
These give us some confidience we haven't broken anything in early
boot code that may be running before the console.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34691
2022-04-06 14:13:05 +01:00
Andrew Turner
3532bcd282 Fix a coherent bus check in the arm64 busdma
In the arm64 busdma we have an internal flag to signal when a tag is
for a cache-coherent device. In this case we don't need to adjust the
size and alignment of allocated buffers to be within a cache line.

The cache line adjustment was incorrectly using the coherent flag
passed in to bus_dma_tag_create and not the internal flag. Fix it to
use the latter to reduce the memory usage slightly.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34763
2022-04-06 14:11:12 +01:00
Andrew Turner
bcd763b642 Move the arm64 DMAP creation to C
To simplify the creation of the direct map (DMAP) region on arm64 move
it from the pre-C code into pmap. This simplifies the DMAP creation
as we can use the notmal index macros, and should reduce the number
of pages needed to hold the level 1 tables to just those needed.

Reviewed by:	alc, dch
Tested by:	dch, kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34568
2022-04-06 14:09:49 +01:00
Warner Losh
28ea3785d9 neta: remove write only variable
Sponsored by:		Netflix
2022-04-05 21:42:06 -06:00
Warner Losh
37466424b2 mxge: Remove write only variables, mark ifp __unused
Sponsored by:		Netflix
2022-04-05 21:42:06 -06:00
Warner Losh
7e5c042cce msk: Remove write only variables, but leave hardware reads in place
Sponsored by:		Netflix
2022-04-05 21:42:06 -06:00
Warner Losh
85ecba9b20 mwl: Remove write only variables, but leave hardware reads in place
Sponsored by:		Netflix
2022-04-05 21:42:06 -06:00
Warner Losh
fba6f8efb6 malo: Remove write only variables, but leave hardware reads in place
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
d483782ecf intpm: Remove write only variables, tag slvcnt unused since it's used for debugging
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
8707108f33 ipmi: Remove write only variables used to read form hardware
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
1545c66789 hwpmc_arm64: remove write only variables and the computations they do
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
20669405d2 flexspi: In flex_spi_task remove dev, it's write only
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
094b2a2379 ena: Remove write only variables
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
5f5986656c cas: Mark work3 as unused: we apparently need to read it from hardware, but ignore its value
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
2f3b67560a zstd: Supress set but unused warnings for zstd_compress_superblock.c
Sponsored by:		Netflix
2022-04-05 21:42:05 -06:00
Warner Losh
4c30b9ecd4 fix integer overflow bugs in *stosbt
68f57679d6 Fixed another class of integer overflows, but introduced a
boundary condition for 2-4s in ns conversion, 2-~4000s in us conversions
and 2-~4,000,000s in ms conversions. This was because we bogusly used
SBT_1S for the notion of 1 second, instead of the appropriate power of
10. To fix, just use the appropriate power of 10, which avoids these
overflows.

This caused some sleeps in ZFS to be on the order of an hour.

MFC:			1 day
PR:			263073
Sponsored by:		Netflix
Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D34790
2022-04-05 21:36:59 -06:00
Bjoern A. Zeeb
fb8c87b4f3 net80211: validate Mesh ID length in ieee80211_parse_beacon
Reported by:	m00nbsd working with Trend Micro Zero Day Initiative
2022-04-05 22:58:28 +00:00
Robert Wing
e8e691983b suppress set but not used warnings for kernel builds
Use -Wno-unused-but-set-variable for kernel builds with clang13.

To turn this warning back on, set the following in src.conf:
    WITH_SET_BUT_NOTUSED_KERNEL_WARNINGS=

Reviewed by:	mjg, imp
Differential Revision:	https://reviews.freebsd.org/D34784
2022-04-05 13:34:34 -08:00
Warner Losh
56cc89585d bcm5874: Add opt_usb.h for module dependency
Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Warner Losh
a66a3994aa cc: Add opt_kern_tls.h to all congestion modules
All congestion controll modules need opt_kern_tls.h, make sure it's
listed everywhere.

Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Warner Losh
b111430e54 mii: Add opt_platform.h to all miibus drivers
miivar.h includes opt_platform.h. Make sure all the drivers that use the
miibus_if.h interface file have opt_platform.h as well. While some of
these may not, strictly speaking, need it, it's easier to include it
universally for miibus.

Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Warner Losh
ff8d9d9c56 config.mk: Add opt_platform.h support
opt_platform.h is now included from miivar.h, so add support for
generating it in the standalone build case.

Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Warner Losh
5035b5f5b0 bwi: Mark write-only variable as __unused
We read TX_STATUS1 to acknowledge a TX interrupt. We don't use this
value for anything, so mark it as unused. We may be able to eliminate
this read, but since this hardware is poorly documented and difficult to
test, I'm leaving the read in place.

Sponsored by:		Netflix
2022-04-05 13:52:55 -06:00
Warner Losh
6e5056a903 bwi: Remove write-only variable
bbp_atten is write-only: we don't use it later in
bwi_rf_calc_nrssi_slope_11b. However, we may also be able to eliminate
the read of this value from the device. However, The documationation for
this hardware is thing and I can't test this card so I've left the read
of this register in case it's required.

Sponsored by:		Netflix
2022-04-05 13:52:54 -06:00
Warner Losh
cbf7b9e6ee bce: Mark a few debugging variables as unused.
Sponsored by:		Netflix
2022-04-05 13:52:54 -06:00
Mitchell Horne
eb9d205fa6 livedump: add event handler hooks
Add three hooks to the livedump process: before, after, and for each
block of dumped data. This allows, for example, quiescing the system
before the dump begins or protecting data of interest to ensure its
consistency in the final output.

Reviewed by:	markj, kib (previous version)
Reviewed by:	debdrup (manpages)
Reviewed by:	Pau Amma <pauamma@gundo.com> (manpages)
MFC after:	3 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34067
2022-04-05 15:35:05 -03:00
Mitchell Horne
c9114f9f86 Add new vnode dumper to support live minidumps
This dumper can instantiate and write the dump's contents to a
file-backed vnode.

Unlike existing disk or network dumpers, the vnode dumper should not be
invoked during a system panic, and therefore is not added to the global
dumper_configs list. Instead, the vnode dumper is constructed ad-hoc
when a live dump is requested using the new ioctl on /dev/mem. This is
similar in spirit to a kgdb session against the live system via
/dev/mem.

As described briefly in the mem(4) man page, live dumps are not
guaranteed to result in a usuable output file, but offer some debugging
value where forcefully panicing a system to dump its memory is not
desirable/feasible.

A future change to savecore(8) will add an option to save a live dump.

Reviewed by:	markj, Pau Amma <pauamma@gundo.com> (manpages)
Discussed with:	kib
MFC after:	3 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D33813
2022-04-05 15:35:05 -03:00
Mitchell Horne
59c27ea18c Split out dumper allocation from list insertion
Add a new function, dumper_create(), to allocate a dumper.
dumper_insert() will call this function and retains the existing
behaviour.

This is desirable for performing live dumps of the system. Here, there
is a need to allocate and configure a dumper structure that is invoked
outside of the typical debugger context. Therefore, it should be
excluded from the list of panic-time dumpers.

free_single_dumper() is made public and renamed to dumper_destroy().

Reviewed by:	kib, markj
MFC after:	1 week
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34068
2022-04-05 15:35:05 -03:00
Warner Losh
393b7606f9 Unbreak the build: Also define NFSV42_OLDNPROCS here.
If nfsproto.h is included before nfsport.h, then NFSV42_OLDNPROCS would
be undefined when it is used in struct nfsstatsov1.

Sponsored by:		Netflix
2022-04-05 11:54:20 -06:00
Rick Macklem
330aa8acde nfscl: Add support for a NFSv4 AppendWrite RPC
For IO_APPEND VOP_WRITE()s, the code first does a
Getattr RPC to acquire the file's size, before it
can do the Write RPC.

Although NFS does not have an append write operation,
an NFSv4 compound can use a Verify operation to check
that the client's notion of the file's size is
correct before doing the Write operation.

This patch prepares the NFSv4 client for such an
RPC, which will be added in a future commit.

This patch does not cause any semantics change.
2022-04-05 08:11:37 -07:00
Chandrakanth Patil
79c4c4be96 mrsas: if controller reset is in progress, refrain from firing DCMDs to
firmware in shutdown

If controller reset is in progress, at same time if system shutdown is
issued then corresponding shutdown function in driver will be invoked
where driver is waiting 15 seconds to complete the controller reset.

If the reset is not complteted within that time frame driver will go
ahead and fire cache flush and shutdown DCMDs which will end up
accessing the the queues which are not initialized due to undergoing
reset leads to FMU error in firmware.

Fix:
In shutdown function, if controller reset is not finished within 15
seconds than driver will return to the OS without firing any DCMDs.

Reviewed by: imp
PR: 261375
2022-04-05 08:38:15 -06:00
Chandrakanth Patil
241bb95552 mrsas: remove additional MPT command allocation for R1 FP command
There is an additional MPT command allocation for R1 fp command which
will lead to MPT command unavailablity in case of rigorous R1 FP IOs.

Remove additional MPT command allocation for R1 FP.

Reviewed by: imp
PR: 261377
2022-04-05 08:38:14 -06:00
Michael Tuexen
ccdfd621d0 tcp cc: don't recurse on non recursive mutex
This issue was found by syzkaller.

Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34743
2022-04-05 13:52:36 +02:00
Warner Losh
132b00f906 linuxkpi: move io_mapping_create_wc to .c
Move io_mapping_create_wc to .c because it encodes the size of struct
io_mapping so we move this from the client module to the linuxkpi
module.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34776
2022-04-04 23:06:37 -06:00
Warner Losh
2bf3361d56 linuxkpi: Move lkpi_pcim_iomap_devres_find to .c file
lkpi_pcim_iomap_devres_find encodes the size of struct pcim_iomap_devres
in the code, so move from .h to .c to move from client driver to
linuxkpi module.

Sponsored by:		Netflix
Reviewed by:		hselasky
Differential Revision:	https://reviews.freebsd.org/D34775
2022-04-04 23:06:29 -06:00
Warner Losh
36b5c44002 linuxkpi: Move pci_alloc_irq_vectors to .c file
pci_alloc_irq_vectors encodes the size of struct msix_entry
into its code. Move from .h to .c to move this knowledge from
client modules to linuxkpi module.

Sponsored by:		Netflix
Reviewed by:		hselasky
Differential Revision:	https://reviews.freebsd.org/D34774
2022-04-04 23:06:21 -06:00
Warner Losh
1cdb25340f linuxkpi: Move pci_request_region and _lkpi_pci_iomap into .c
Both pci_request_region and _lkpi_pci_iomap encode the size of struct
pci_mmio_region into their code. Move from .h to .c files to move that
knowledge from the client drivers into the linuxkpi module.

Sponsored by:		Netflix
Reviewed by:		hselasky
Differential Revision:	https://reviews.freebsd.org/D34773
2022-04-04 23:06:14 -06:00
Warner Losh
3ea682e21e linuxkpi: Move lkpi_pci_devres_get_alloc into .c file
lkpi_pci_devres_get_alloc encodes the struct pci_devres into its
code. Move from .h file to .c file to move this knowledge into linuxkpi
module.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34772
2022-04-04 23:06:06 -06:00
Warner Losh
aca0bcbca3 linuxkpi: Move cdev_alloc into .c file
Move cdev_alloc into linux_compat.c since it encodes the size of struct
linux_cdev into the client modules otherwise.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34771
2022-04-04 23:05:59 -06:00
Warner Losh
58e6719ca0 linuxkpi: Remove write only variable from lkpi_iicbb_reset
Sponsored by:		Netflix
Reviewed by:		hselasky
Differential Revision:	https://reviews.freebsd.org/D34770
2022-04-04 23:05:52 -06:00
Warner Losh
1341ac9f9c linuxkpi: Move class_create to .c file
class_create encodes the size of struct class into the generated
code. Move from .h file to .c file to move this knowledge from the
client modules that call this into the linuxkpi module.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34769
2022-04-04 23:05:43 -06:00
Warner Losh
702b687503 linuxkpi: Move device_create_groups_vargs to linux_compat.c
device_create_groups_vargs encodes the size of struct device. Move
definition from .h to .c to move this size into the linuxkpi module
rather than encoding it in all client driver modules.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34768
2022-04-04 23:05:36 -06:00
Warner Losh
36929b5584 linuxkpi: move kobject_create to .c file
kobject_create knows the size of struct kobject. Move it to
linux_compat.c so this knowledge is confined to the loadable module and
not the clients.

Sponsored by:		Netflix
Reviewed by:		hselasky, emaste
Differential Revision:	https://reviews.freebsd.org/D34767
2022-04-04 23:05:26 -06:00
Warner Losh
6e671ec1e6 svc_vc_rendezvous_stat: eliminiate write only variable stat
Sponsored by:		Netflix
2022-04-04 22:31:04 -06:00
Warner Losh
77bc5890ad clnt_vc_destroy: eliminiate write only variable stat
Sponsored by:		Netflix
2022-04-04 22:31:02 -06:00
Warner Losh
5c2aad7e89 krpc_call: eliminiate write only variable nam
Sponsored by:		Netflix
2022-04-04 22:31:00 -06:00
Warner Losh
b64a484592 bootpc_decode_reply: eliminiate write only variable ip
Sponsored by:		Netflix
2022-04-04 22:30:59 -06:00
Warner Losh
d6f6985494 smb_smb_treedisconnect: eliminate write only variable mbp
Sponsored by:		Netflix
2022-04-04 22:30:57 -06:00
Warner Losh
65ee334d11 smb_iod_main: eliminate write only variable error
Sponsored by:		Netflix
2022-04-04 22:30:54 -06:00
Warner Losh
c7761ca93e pim6_input: eliminate write only variable rc
Sponsored by:		Netflix
2022-04-04 22:30:52 -06:00
Warner Losh
e606e5d157 sysctl_dumpentry: move error to inner scope
Sponsored by:		Netflix
2022-04-04 22:30:50 -06:00
Warner Losh
5de5b5a34d route_ctl: eliminate write only variables ifa and nh
Sponsored by:		Netflix
2022-04-04 22:30:48 -06:00
Warner Losh
7f9c3339a4 get_nhop: eliminate write only variable gateway
Sponsored by:		Netflix
2022-04-04 22:30:47 -06:00
Warner Losh
c972f2c065 xl_attach: eliminate write only variable unit
Sponsored by:		Netflix
2022-04-04 22:30:45 -06:00
Warner Losh
76e9675663 vtpci_legacy_register_msix: eliminate write only variable dev
Sponsored by:		Netflix
2022-04-04 22:30:42 -06:00
Warner Losh
7a1bef40f1 ustorage_fs_verify: eliminate write only variables file_offset and file_offset
Sponsored by:		Netflix
2022-04-04 22:30:40 -06:00
Warner Losh
f7097359c8 mgue: eliminate write only variables ret, err and error
Sponsored by:		Netflix
2022-04-04 22:30:38 -06:00
Warner Losh
11110685fc cp2112iic_intr_write_callback: eliminate write only variable psc
Sponsored by:		Netflix
2022-04-04 22:30:36 -06:00
Warner Losh
53c1f1fc60 wsp_intr_callback: eliminate write only variable h
Sponsored by:		Netflix
2022-04-04 22:30:33 -06:00
Warner Losh
12312f7583 uss820dci: eliminate unused variables sc, ep_no
Sponsored by:		Netflix
2022-04-04 22:30:31 -06:00
Warner Losh
6ccdcae1b9 uhci_xfer_setup: eliminate write only variable sc
Sponsored by:		Netflix
2022-04-04 22:30:29 -06:00
Warner Losh
ab59cd6a0b musb: eliminate write only variable sc
Sponsored by:		Netflix
2022-04-04 22:30:26 -06:00
Warner Losh
e73b02f66b atmegadci: eliminate unused variables sc, ep_no
Sponsored by:		Netflix
2022-04-04 22:30:23 -06:00
Warner Losh
ad1b7fd714 hdspe_dmapsetmap: eliminate write only variable sc
Sponsored by:		Netflix
2022-04-04 22:30:22 -06:00
Warner Losh
c8fe3923d8 quicc_bus_setsig: eliminate write only variable bas
Sponsored by:		Netflix
2022-04-04 22:30:20 -06:00
Warner Losh
557627dda9 hdaa_eld_dump: eliminate write only variable len
Sponsored by:		Netflix
2022-04-04 22:30:17 -06:00
Warner Losh
8717135d37 emu10kx: eliminate write only variables val, r and move i to loop
Sponsored by:		Netflix
2022-04-04 22:30:13 -06:00
Warner Losh
451f54707a emu10kx-pci: eliminate write only variable r
Sponsored by:		Netflix
2022-04-04 22:30:11 -06:00
Warner Losh
7387abd342 emu_midi_probe: eliminate write only variable r
Sponsored by:		Netflix
2022-04-04 22:30:09 -06:00
Warner Losh
33985865b2 pcmcsa_attach: eliminate write only variable unit
Sponsored by:		Netflix
2022-04-04 22:30:07 -06:00
Warner Losh
3e423419cf midicsa_attach: eliminate write only variable func
Sponsored by:		Netflix
2022-04-04 22:30:06 -06:00
Warner Losh
0c64fe0068 cs4281: eliminate write only variable codecno
Sponsored by:		Netflix
2022-04-04 22:30:04 -06:00
Warner Losh
635a4068d2 sb_probe: eliminate write only variable r
Sponsored by:		Netflix
2022-04-04 22:30:02 -06:00
Warner Losh
668986eae9 sb16_probe: eliminate write only variable r
Sponsored by:		Netflix
2022-04-04 22:30:01 -06:00
Warner Losh
3a7365acc8 ess_probe: eliminate write only variable r
Sponsored by:		Netflix
2022-04-04 22:29:59 -06:00
Warner Losh
c9439e23ce sis_attach: Move waittime definition into for loop
Sponsored by:		Netflix
2022-04-04 22:29:57 -06:00
Warner Losh
94885fbd04 ppc_detect_fifo: eliminate write only variable cc
Sponsored by:		Netflix
2022-04-04 22:29:55 -06:00
Warner Losh
de80fb0ace ppi_probe: eliminate unused variable ppi
Sponsored by:		Netflix
2022-04-04 22:29:53 -06:00
Warner Losh
09b966ee7c Mark cfg as __unused to avoid ifdef soup
Sponsored by:		Netflix
2022-04-04 22:29:51 -06:00
Warner Losh
273676a44c mxge_rss_ethp_z8e_fw_modevent: eliminate write only variable parent
Sponsored by:		Netflix
2022-04-04 22:29:49 -06:00
Warner Losh
5f136a4c01 mxge_rss_eth_z8e_fw_modevent: eliminate write only variable parent
Sponsored by:		Netflix
2022-04-04 22:29:47 -06:00
Warner Losh
886bc93da8 mxge_ethp_z8e_fw_modevent: eliminate write only variable parent
Sponsored by:		Netflix
2022-04-04 22:29:45 -06:00
Warner Losh
498276b4b4 mxge_eth_z8e_fw_modevent: eliminate write only variable parent
Sponsored by:		Netflix
2022-04-04 22:29:43 -06:00
Warner Losh
f8967810f5 mge: eliminate write only variables ifp, sc and error
Sponsored by:		Netflix
2022-04-04 22:29:41 -06:00
Warner Losh
2d4ae2ed36 tmp461_signed_extend32 is unused, remove it
Sponsored by:		Netflix
2022-04-04 22:29:39 -06:00
Warner Losh
875145ffd4 rx8803_settime: remove write only variable bus
Sponsored by:		Netflix
2022-04-04 22:29:38 -06:00
Warner Losh
22127c7c1b tca6416: remove write only sc
Sponsored by:		Netflix
2022-04-04 22:29:36 -06:00
Warner Losh
8a46fc9a9b armv7_allocate_pmc: remove write only variable pac
Sponsored by:		Netflix
2022-04-04 22:29:34 -06:00
Warner Losh
6ca6b8ea52 pmc_save_user_callchain: eliminate write only td variable
Sponsored by:		Netflix
2022-04-04 22:29:33 -06:00
Warner Losh
92ec9782ac hpen_battery_strenght_cb: eliminate write only data variable
Sponsored by:		Netflix
2022-04-04 22:29:31 -06:00
Warner Losh
edcced8ab7 mx25l_task: eliminate dev write only variable
Sponsored by:		Netflix
2022-04-04 22:29:29 -06:00
Warner Losh
05d3c5fd18 fd_probe: only define unit on x86, other platforms don't use this code
Sponsored by:		Netflix
2022-04-04 22:29:28 -06:00
Warner Losh
9a2e6ca6ef e6000sw_set_atustat: eliminate write only ret variable
Sponsored by:		Netflix
2022-04-04 22:29:26 -06:00
Warner Losh
3ca3bb576b cyapa_raw_input: elimmminate write only k variable
Sponsored by:		Netflix
2022-04-04 22:29:25 -06:00
Warner Losh
a9e022d3d7 bwn_lo_measure_gain_values: eliminate write only trsw_rx variable
Sponsored by:		Netflix
2022-04-04 22:29:23 -06:00
Warner Losh
87a4328651 bhnd_nvram_store_export_child: eliminate num_props write only variable
Sponsored by:		Netflix
2022-04-04 22:29:21 -06:00
Warner Losh
5466363900 bhnd_pmu_sdiod_drive_strength_init: eliminate write only intr_val variable
Sponsored by:		Netflix
2022-04-04 22:29:20 -06:00
Warner Losh
9af048a0b1 bhnd_pwrctl_attach: eliminate write only bus variable
Sponsored by:		Netflix
2022-04-04 22:29:18 -06:00
Warner Losh
e10ac1ed2c fdt_win_process_child: eliminate write only size variable
Sponsored by:		Netflix
2022-04-04 22:29:16 -06:00
Warner Losh
624f60ca03 platform_mpp_init: eliminate write only tuples variable
Sponsored by:		Netflix
2022-04-04 22:29:15 -06:00
Warner Losh
b20f0f7247 mv_rtc_attach: eliminate write only unit variable
Sponsored by:		Netflix
2022-04-04 22:29:13 -06:00
Warner Losh
feb08ab0cf vfp_init: eliminate fpexc write only variable
Sponsored by:		Netflix
2022-04-04 22:29:12 -06:00
Warner Losh
80f33a69a8 sendsig: eliminate write only code variable
Sponsored by:		Netflix
2022-04-04 22:29:10 -06:00
Warner Losh
97663c8d9e get_cachetype_cp15: eliminate write only multilier
Sponsored by:		Netflix
2022-04-04 22:29:06 -06:00
Warner Losh
04bb568fdc ARMADAXP: Add extres pseudo devices to some kernel
Add extres and related pseudo devices to allow this to compile.

Sponsored by:		Netflix
PR:			262417
2022-04-04 22:29:02 -06:00
Robert Wing
f3f6e0ebe9 geom_vinum: fix set but not used warnings 2022-04-04 13:23:47 -08:00
Robert Wing
8f7878e3e1 geom_eli: fix set but not used warning 2022-04-04 13:20:27 -08:00
Navdeep Parhar
08c7f1b6d4 Fix typo (interrups -> interrupts) in a sysctl description in tcp_lro.c.
MFC after:	3 days
2022-04-04 13:48:32 -07:00
Ed Maste
ab5c7dff95 zlib: replace CRLF line endings in zlib.map
MFC after:	3 days
2022-04-04 15:10:03 -04:00
Bjoern A. Zeeb
e86707418c LinuxKPI: PCI: add counter for linux_dma_map_phys_common() errors
LinuxKPI is asking for single-segment mappings.  Some (wireless) drivers
are using this to map multi-pages and our busdma framework is not very
friendly to that as single-segments [D31823].  Add a counter so we can
track when this happens to gather more information.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	hselasky
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D34715
2022-04-03 23:05:47 +00:00
Xin LI
0a21252adf sys/contrib/zlib: Always define Z_U8 and Z_U4
This is a temporary hack for zlib to make sure that the library
still builds when building with Z_SOLO (used in kernel and loader),
as zlib is depending on limits.h which is only available in STDC
case.

PR:		kern/262977
MFC after:	3 days
2022-04-03 14:38:31 -07:00
Mitchell Horne
823b5cfbab mii_fdt: fix a set-but-not-used warning 2022-04-03 12:28:37 -03:00
Milan Obuch
517ea731d4 mii: include missing sources in loadable module
As of today, using 'kldload miibus' is not equivalent to using 'device
miibus' in a kernel config. Newly introduced PHY drivers (DP83822,
DP83867, VSCPHY) and source files/PHY driver for FDT-enabled kernels
are missing. Without including them, kernel modules using any function
from dev/mii/mii_fdt.c refuse to load. Additionally, miivar.h directly
includes opt_platform.h.

Add the missing sources to the module build, with the FDT-only files
gated behind an OPT_FDT check. Maintain the alphabetical listing of
SRCS, but move the required header files to a separate line to improve
readability.

Reviewed by:	mhorne, mindal@semihalf.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34256
2022-04-03 12:28:37 -03:00
Milan Obuch
242cd60a0a cgem: Support building as a loadable kernel module
For development, building a driver as kernel module is both convenient
and a time saver (no need for reboot on some change, testing it requires
just kldunload and kldload, a matter of seconds). For some special
cases, it may be even desirable to postpone initializing the network
interface after some action is done (loading a FPGA bitstream may be
required for Zynq/ZynqMP based hardware as an example).

Building is limited to ARM, ARM64 and RISC-V architectures (for Zynq,
ZynqMP, PolarFire Soc based boards, and HiFive based boards are known to
use CGEM at the moment).

Reviewed by:	mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34687
2022-04-03 12:28:37 -03:00
Gordon Bergling
756220b515 isci(4): Remove a double word in an error message
- s/is is/is/

MFC after:	1 week
2022-04-03 16:07:20 +02:00
Michael Tuexen
52106f072f sctp: don't refer to a potentially outdated stream
Reported by:	syzbot+1593381019112e5bb35c@syzkaller.appspotmail.com
MFC after:	3 days
2022-04-02 23:26:27 +02:00
Michael Tuexen
b30b7a140c sctp: cleanup, no functional change
MFC after:	3 days
2022-04-02 23:02:16 +02:00
Mateusz Guzik
b7262756e2 vfs: fixup WANTIOCTLCAPS on open
In some cases vn_open_cred overwrites cn_flags, effectively nullifying
initialisation done in NDINIT. This will have to be fixed.

In the meantime make sure the flag is passed.

Reported by:	jenkins
Noted by:	Mathieu <sigsys@gmail.com>
2022-04-02 20:49:01 +02:00
Michael Tuexen
0f31631620 sctp: remove a test, which isn't safe
We can't ensure the stcb is still around. This issue was found
 by syzkaller.

MFC after:	3 days
2022-04-02 15:09:50 +02:00
Gordon Bergling
882d3b24fe smartpqi(4): Fix a typo in a source code comment
- s/commmand/command/

MFC after:	3 days
2022-04-02 15:21:45 +02:00
Gordon Bergling
01d74e5c7a iscsi(4): Fix a typo in a source code comment
- s/commmand/command/

MFC after:	3 days
2022-04-02 15:20:59 +02:00
Gordon Bergling
5ee87525a8 cxgbe(4): Fix a typo in a source code comment
- s/commmand/command/

MFC after:	3 days
2022-04-02 15:19:59 +02:00
Gordon Bergling
d792dc7ebb net(4): Fix a typo in a source code comment
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:57:06 +02:00
Gordon Bergling
ef1534cad8 fusefs(5): Fix a typo in a source code comment
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:56:21 +02:00
Gordon Bergling
c9b04ee4f8 kern: Fix two typos in source code comments
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:52:49 +02:00
Gordon Bergling
9097d2f5d1 etherswitch(4): Fix a few common typos in source code comments
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:51:57 +02:00
Gordon Bergling
b34f7568d1 NOTES: Fix a typo in a comments
- s/accomodate/accommodate/

MFC after:	3 days
2022-04-02 14:50:04 +02:00
Michael Tuexen
d4290f7e62 Revert "sctp: remove a test, which isn't safe"
It included unrelated changes still under review.
This reverts commit b1fe92b28b.
2022-04-02 14:49:14 +02:00
Michael Tuexen
b1fe92b28b sctp: remove a test, which isn't safe
We can't ensure the stcb is still around. This issue was found
by syzkaller.

MFC after:	3 days
2022-04-02 14:44:06 +02:00
Gordon Bergling
24926c487b bce(4): Fix a typo in a source code comment
- s/exisitng/existing/

MFC after:	3 days
2022-04-02 14:40:34 +02:00
Gordon Bergling
0ce9617620 sound(4): Fix a typo in a source code comment
- s/exisitng/existing/

MFC after:	3 days
2022-04-02 14:40:10 +02:00
Gordon Bergling
942e8cab8c netinet: Fix a typo in a source code comment
- s/exisitng/existing/

MFC after:	3 days
2022-04-02 14:39:32 +02:00
Gordon Bergling
b61c7c2dfb isci(4): Fix a typo in a source code comment
- s/initialzied/initialized/

MFC after:	3 days
2022-04-02 14:29:34 +02:00
Gordon Bergling
cededdff9b ocs_fc(4): Fix a typo in a source code comment
- s/initialzied/initialized/

MFC after:	3 days
2022-04-02 14:28:30 +02:00
Gordon Bergling
f70fc4377f netpfil: Fix two typo in source code comments
- s/measurment/measurement/

While here, also fix some whitespace issues.

MFC after:	3 days
2022-04-02 14:18:11 +02:00
Gordon Bergling
7181887e82 kern: Fix two typos in source code comments
- s/measurment/measurement/

MFC after:	3 days
2022-04-02 14:15:27 +02:00
Luiz Amaral
654c1b8ef3 pfsync: Add CTLFLAG_VNET to carp_demotion_factor sysctl
When trying to avoid a CARP demotion during a pfsync service restart, I
noticed that a non-default value for the net.pfsync.carp_demotion_factor
sysctl was not being applied during the demotion. The CARP was always
demoted by 240.

After investigating, I realized that the sysctl was using VNET_NAME()
without the CTLFLAG_VNET.

PR:		262983
Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34737
2022-04-02 12:11:32 +02:00
Gordon Bergling
8d30ef92d5 khelp(9): Fix a typo in a source code comment
- s/measurment/measurement/

MFC after:	3 days
2022-04-02 14:10:59 +02:00
Mateusz Guzik
0c805718cb vfs: fix memory leak on lookup with fds with ioctl caps
Reviewed by:	markj
PR:		262515
Noted by:	firk@cantconnect.ru
Differential Revision:	https://reviews.freebsd.org/D34667
2022-04-02 12:09:07 +00:00
Gordon Bergling
17628f1b79 cc_vegas(4): Fix a typo in a source code comment
- s/measurment/measurement/

MFC after:	3 days
2022-04-02 14:07:44 +02:00
Gordon Bergling
81d4309f9b safe(4): Fix a typo in a source code comment
- s/multple/multiple/

MFC after:	3 days
2022-04-02 14:03:17 +02:00
Gordon Bergling
f9254cc6ca enetc(4): Fix a typo in a source code comment
- s/multple/multiple/

MFC after:	3 days
2022-04-02 14:02:46 +02:00
Gordon Bergling
32c601b6cf mrsas(4): Fix a typo in a source code comment
- s/alloction/allocation/

MFC after:	3 days
2022-04-02 13:59:11 +02:00
Gordon Bergling
7fc0ffda35 ng_pppoe(4): Fix a typo in a source code comment
- s/asychronous/asynchronous/

MFC after:	3 days
2022-04-02 13:54:36 +02:00
Gordon Bergling
f167c46e79 memguard(9): Fix two typos in source code comments
- s/comparsion/comparison/

MFC after:	3 days
2022-04-02 13:51:27 +02:00
Gordon Bergling
011e6016d0 isci(4): Fix a typo in a source code comment
- s/differnt/different/

MFC after:	3 days
2022-04-02 13:35:30 +02:00
Gordon Bergling
6039e38f93 mlx4en(4): Fix two in source code comments
- s/differnt/different/
- s/differntly/differently/

MFC after:	3 days
2022-04-02 13:33:57 +02:00
Gordon Bergling
2543276943 iwm(4): Remove a whitespace
In 9f4dc7fd97 I accidentally added a whitespace at the
end of the line. Remove it.

Reported by:	Jose Luis Duran (via github)
MFC with:	9f4dc7fd97
2022-04-02 13:09:26 +02:00
Peter Jeremy
9a89977bf6
kern: Fix typo in kassert message.
- s/unepxected/unexpected/
MFC after:	3 days
2022-04-02 21:36:17 +11:00
Gordon Bergling
9f4dc7fd97 iwm(4): Fix a typo in a source code comment
- s/coresponding/corresponding/

Obtained from:	NetBSD
MFC after:	3 days
2022-04-02 11:50:38 +02:00
Gordon Bergling
13bf578c25 jme(4): Fix a typo in a source code comment
- s/verion/version/

MFC after:	3 days
2022-04-02 10:54:43 +02:00
Gordon Bergling
cba46da538 net(3): Fix a typo in a source code comment
- s/verion/version/

MFC after:	3 days
2022-04-02 10:53:40 +02:00
Gordon Bergling
24498b53ef sound(4): Fix a typo in a source code comment
- s/immediatly/immediately/

MFC after:	3 days
2022-04-02 10:50:03 +02:00
Gordon Bergling
5c0b62dcfc tsec: Fix a typo in a source code comment
- s/immediatly/immediately/

MFC after:	3 days
2022-04-02 10:48:37 +02:00
Gordon Bergling
592fcf6c45 neta: Fix a typo in a source code comment
- s/immediatly/immediately/

MFC after:	3 days
2022-04-02 10:46:13 +02:00
Gordon Bergling
dc8d33b368 snd_csa(4): Fix a few common typos in source code comments
- s/hander/handler/

MFC after:	3 days
2022-04-02 10:30:52 +02:00
Gordon Bergling
6efd2e3e51 neta: Fix a few common typos in a source code comment
- s/hander/handler/

MFC after:	3 days
2022-04-02 10:29:23 +02:00
Gordon Bergling
be83eecf5a jme(4): Fix a typo in a source code comment
- s/watchog/watchdog

MFC after:	3 days
2022-04-02 10:22:28 +02:00
Gordon Bergling
1cba6077be viawd(4): Fix a typo in a kernel message
- s/watchog/watchdog

MFC after:	5 days
2022-04-02 10:21:37 +02:00
Gordon Bergling
669d5ea4e3 kern: Fix a typo in a source code comment
- s/paniced/panicked/

MFC after:	3 days
2022-04-02 10:15:02 +02:00
Gordon Bergling
9094c3a71b usb(3): Fix a few typos in source code comments
- s/paniced/panicked/

MFC after:	3 days
2022-04-02 10:14:32 +02:00
Gordon Bergling
49dace1d46 cam: Fix typos in source code comments
- s/paniced/panicked/

MFC after:	3 days
2022-04-02 10:13:35 +02:00
Gordon Bergling
f8d292b665 net(3): Fix a typo in a source code comment
- s/Multilik/Multilink/

Obtained from:	NetBSD
MFC after:	3 days
2022-04-02 09:41:10 +02:00
Gordon Bergling
5c49e1cbea rpc(3): Fix two typos in source code comments
- s/alloctaed/allocated/

Obtained from:	NetBSD
MFC after:	3 days
2022-04-02 09:33:24 +02:00
Gordon Bergling
23677398ca net(3): Fix a typo in a source code comment
- s/paramenters/parameters/

MFC after:	3 days
2022-04-02 09:24:48 +02:00
Gordon Bergling
c748efcd94 risc-v: Fix two typos in a source code comment
- s/interger/integer/
- s/manupilate/manipulate/

MFC after:	3 days
2022-04-02 08:58:45 +02:00
Gordon Bergling
e443f2102e bxe(4): Fix a typo in an error message
- s/intergers/integers/

MFC after:	3 days
2022-04-02 08:56:06 +02:00
Hans Petter Selasky
88162f7abd ulpt(4): Add support for Epson TM-U220B.
Submitted by:		Archimedes Gaviola <archimedes.gaviola@gmail.com>
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-04-02 02:29:05 +02:00
Michael Tuexen
39a22011bb sctp: clear pointer to stack when returning from function.
Reported by:    syzbot+04cee5d8805dfbb63c06@syzkaller.appspotmail.com
Reported by:    syzbot+71e7e33dfc3cc39a6bd0@syzkaller.appspotmail.com
Reported by:    syzbot+6c36fc3c1bd03ed96107@syzkaller.appspotmail.com
Reported by:    syzbot+198b3751c158181c47de@syzkaller.appspotmail.com
2022-04-02 00:54:49 +02:00
Bjoern A. Zeeb
60970a328e LinuxKPI: 802.11: fix RSSI (and NF)
As in 4a22cd6c4e nf and rss should be
signed and not unsigned.  Change the types in the header and while
here change a magic number to a define as done elsewhere (value does
not change).

When calculating c_rssi we need to make it relative so subtract nf.
And while here improve the debug output.

This will hopefully fix ifconfig wlanN list scan S:N output which
tools use to chose a BSSID and help net80211 internal calculations.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-04-01 22:31:23 +00:00
Bjoern A. Zeeb
4a22cd6c4e net80211: correct types for nf and rssi
NF and RSSI should be signed and not unsigned to avoid problems.
Change the type accordingly.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-04-01 22:30:02 +00:00
Navdeep Parhar
d6226d6adb cxgbe/iw_cxgbe: Initialize the vma correctly in c4iw_mmap.
This fixes userspace RDMA applications that would fail due to mmap
failure.  The driver's mmap routine would succeed but later the
linux_compat.c mmap routine would fail because vma->vm_private_data
wasn't set properly.

This is catch-up with b633e08c70.

Reported by:	Veeresh @ Chelsio
Sponsored by:	Chelsio Communications
2022-04-01 13:09:40 -07:00
Mateusz Guzik
c4a08ef2af pf: handle duplicate rules gracefully
Reviewed by:	kp
Reported by:	dch
PR:		262971
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-01 18:01:48 +00:00
Randall Stewart
e88412d89b Opps sorry, typo in the cc_cubic fix when morphing it from nreno. 2022-04-01 08:37:04 -04:00
Randall Stewart
653cf466f0 hystart++ may not properly exit CSS back to slowstart.
In the changes to get hystart++ into cubic an inadvertent line
was removed in the conditional to figure out if you need to exit
hystart++ back to slowstart. The line of course is the most crucial
one (the others are valid but not critical) i.e. is the new rtt
less than the point where we entered hystart++. Without the line
we end up bouncing in and out of CSS.

Reported By: Reese Enghardt
Sponsored By: Netflix Inc.
2022-04-01 08:33:44 -04:00
Randall Stewart
ee1a08b8da rack may end up with a stuck connectin fi the rwnd is colapsed on sent data.
There is a case where rack will get stuck when it has outstanding data and
the peer collapses the rwnd down to 0. This leaves the session hung if
the rwnd update is not received. You can test this with the packet drill script
below. Without this fix it will be stuck and hang. With it we retransmit everything.
This also fixes the mtu retransmit case so we don't go into recovery when
the mtu is changed to a smaller value.

Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D34573
2022-04-01 08:29:27 -04:00
Warner Losh
161fcf7994 nvme: Publish the drive's capabilities
Add cap_lo and cap_hi sysctl to each nvme drive. This publishes the raw
capabilities of the drive. Now we can only discover these with
bootverbose.

Sponsored by:		Netflix
2022-03-31 21:13:16 -06:00
Warner Losh
6af6a52ee4 nvme: Save cap_lo and cap_hi
Save the capabilities for the drive.

Sponsored by:		Netflix
2022-03-31 21:12:38 -06:00
Warner Losh
a70b5660f3 nvme: MPS is a power of two, not a size / 8k
Setting MPS in the CC should be a power of 2 number (it specifies the
page size of the host is 2^(12+MPS)), so adjust the calcuation. There is
no functional change because we do not support any architecutres != 4k
pages (yet). Other changes are needed for architectures with 16k or 64k
pages, especially when the underlying NVMe drive doesn't support that
page size (Most drives support a range that's small, and many only
support 4k), but let's at least do this calculation correctly. 12 - 12
is just as much 0 as 4096 >> 13 is :)

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D34707
2022-03-31 21:12:38 -06:00
Jung-uk Kim
ab71bbb75a acpica: Import ACPICA 20220331
(cherry picked from commit ca1c95cc699a25d891e62ef863c8268c93b35cf8)
2022-03-31 21:59:23 -04:00
Bjoern A. Zeeb
20eeed6844 rtw88: add man pages and hook up to build
Add man pages for rtw88 and rtw88fw.  Install a copy of the firmware
license file and hook up the driver and firmware modules to the build.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Relnotes:	yes
2022-04-01 00:07:24 +00:00
Bjoern A. Zeeb
73d4ebea35 rtw88: import firmware for Realtek's rtw88 supported chipsets.
Import the most recent versions of the firmware images for the
rtw88 driver.

This is based on linux-firmware at 681281e49fb6778831370e5d94e6e1d97f0752d6.

The license of the firmware matches the previous rtwnfw(4) firmware
files (modulo a Copyright year) and you can find a copy in
sys/contrib/dev/rtw88fw/LICENCE.rtlwifi_firmware.txt.

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.

Approved by:	core (imp)
MFC after:	2 weeks
2022-04-01 00:07:24 +00:00
Bjoern A. Zeeb
2774f20680 rtw88: import Realtek's rtw88 driver
Import rtw88 based on wireless-testing at
5d5d68bcff1f7ff27ba0b938a4df5849849b47e3 with adjustments for FreeBSD.

While our version of the driver has knowledge about the incapablity
of DMA above 4GB we do see errors if people have more than that
often already showing when laoding firmware.
The problem for that is currently believed to be outside this driver
so importing it anyway for now.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core (imp) [1]
MFC after:	2 weeks
2022-04-01 00:07:24 +00:00
Colin Percival
ad93649d23 uart(4): Add a concept of "unique" serial devices
FreeBSD detects serial ports twice: First, very early in the boot
process, in order to obtain a usable console; and second, during
the device probe/attach process.  When a UART is discovered during
device probing, FreeBSD attempts to determine whether it is a
device which was already being used as a console; without this,
the console doesn't work in userland.

Unfortunately it's possible for a UART to be mapped to a different
location in memory when it is discovered on a bus than it has when
it is announced via the ACPI SPCR table; this breaks the matching
process, which relies on comparing bus addresses.

To address this, we introduce a concept of "unique" serial devices,
i.e. devices which are guaranteed to be present *only once* on any
system.  If we discover one of these during device probing, we can
match it to a same-PCI-vendor-and-device-numbers console which was
announced via the ACPI SPCR table, regardless of the differing bus
addresses.

At present, the only unique serial device is the "Amazon PCI serial
device" (vendor 0x1d0f, device 0x8250) found in some EC2 instances.
This unbreaks the serial console on those systems.

Reviewed by:	imp
MFC after:	3 days
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D34703
2022-03-31 16:02:24 -07:00
Xin LI
c61bc1110c MFV 7b495a2a7a (zlib): Correct incorrect inputs provided to the CRC
functions.

MFC after:	3 days
2022-03-31 15:35:58 -07:00
Doug Moore
557dc337e6 vm_phys: check small blocks to finish allocation
In vm_phys_alloc_queues_contig, in the case that a sequence of
max-order blocks are sought to fulfill an allocation, a sequence is
ruled out if it does not have enough max-order blocks to satisfy the
allocation. However, there may be smaller blocks of free memory that
follow the last max-order block in the sequence, and they may be big
enough to complete the allocation request, so check for that
possibility before giving up on that block sequence.

Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D34724
2022-03-31 16:19:55 -05:00
Dmitry Chagin
bafe3b8804 linsysfs: plug set-but-not-used vars.
MFC after:	2 weeks
2022-03-31 23:49:26 +03:00
Tong Zhang
2108cc7290 stge: fix null pointer dereference
stge_attach() could fail at line 464, sc->sc_spec remains NULL when
calling stge_detach(), thus bus_release_resources() at line 704 will
trigger null pointer dereference. We need to check the nulliness before
calling bus_release_resources().

PR:		258420
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34629
2022-03-31 15:54:56 -04:00
Dmitry Chagin
09d60bfae5 linux(4): Cleanup empty lines.
MFC after:		2 weeks
2022-03-31 21:23:12 +03:00
Dmitry Chagin
4e1e83461b linux(4): Fix KASSERT message.
MFC after:		2 weeks
2022-03-31 21:22:31 +03:00
Dmitry Chagin
d6ccce0aa2 linux(4): readlink should fail if bufzis <= 0.
MFC after:		2 weeks
2022-03-31 21:21:41 +03:00
Dmitry Chagin
b7df7b987e linprocfs: Add /proc/self/oom_score_adj.
To avoid annoyng messages from LTP test suites add the simple
implementation of /proc/self/oom_score_adj which is do nothing.

Reviewed by:		emaste
Differential revision:  https://reviews.freebsd.org/D34710
MFC after:		2 weeks
2022-03-31 21:04:44 +03:00
Dmitry Chagin
d5dc757e84 linux(4): Add compat.linux32.emulate_i386 knob.
Historically 32-bit Linuxulator under amd64 emulated the real i386
behavior. Since 3d8dd983 the old i386 Linux world can't be used under
amd64 Linuxulator as it don't know anything about amd64 machine (which
is returned now by newuname() syscall). So, add a knob to allow to swith
the behavior and use i386 Linux binaries on amd64.
Set knob to the new behavior as I think this is common to the modern
Linux distros.

Reviewed by:		Pau Amma (doc), emaste
Differential revision:	https://reviews.freebsd.org/D34708
MFC after:		2 weeks
2022-03-31 21:01:09 +03:00
Dmitry Chagin
099fa2feb3 linux(4): Fixup miscalculation of d_off of struct dirent in getdents() syscalls.
Avoid calculating d_off value as it is specific to the underlying filesystem
and can be used by others API, like lseek(), seekdir() as input offset.

Differential revision:  https://reviews.freebsd.org/D31551
MFC after:		2 weeks
2022-03-31 20:50:09 +03:00
Dmitry Chagin
9103c5582a linux(4): wait4() returns ESRCH if pid is INT_MIN.
Weird and undocumented patch was added to the Linux kernel in 2017,
fixes wait403 LTP test.

MFC after:	2 weeks
2022-03-31 20:49:39 +03:00
Dmitry Chagin
5bcf0f7cd7 linux(4): Rid unused defines from linux_mib.
Reviewed by:		trasz
Differential revision:  https://reviews.freebsd.org/D31591
MFC after:		2 weeks
2022-03-31 20:45:12 +03:00
Dmitry Chagin
4e3aefb923 linux(4): Fixup waitid handling P_PGID idtype.
Since Linux 5.4, if id is zero, then wait for any child that is in the same
process grop as the caller's process group.

Differential revision:  https://reviews.freebsd.org/D31567
MFC after:		2 weeks
2022-03-31 20:44:00 +03:00
Dmitry Chagin
be1e4a0bdf linux(4): Return ENOSYS for unsupported P_PIDFD waitid idtype.
Reviewed by:		emaste
Differential revision:  https://reviews.freebsd.org/D31559
MFC after:		2 weeks
2022-03-31 20:42:42 +03:00
Dmitry Chagin
c7ef7c3fac linux(4): Add support for __WALL wait option bit.
As FreeBSD does not have __WALL option bit analogue explicitly set all
possible option bits to emulate Linux __WALL wait option bit.

Reviewed by:		emaste
Differential revision:  https://reviews.freebsd.org/D31555
MFC after:		2 weeks
2022-03-31 20:42:03 +03:00
Dmitry Chagin
d7e1e138ec linux(4): Fixup options value validation in linux_waitid().
Reviewed by:		emaste
Differential revision:  https://reviews.freebsd.org/D31554
MFC after:		2 weeks
2022-03-31 20:41:19 +03:00
Dmitry Chagin
2fd480b318 linux(4): Eliminate bogus options value check validation.
The kernel do it for us.

Reviewed by:		emaste
Differential revision:  https://reviews.freebsd.org/D31553
MFC after:		2 weeks
2022-03-31 20:41:02 +03:00
Dmitry Chagin
0c6b1ff7de linux(4): Consolidate wait* facility into linux_common_wait().
Also fix bug in waitid() implementation, use wru_self not wru_children.

Differential revision:  https://reviews.freebsd.org/D31552
MFC after:		2 weeks
2022-03-31 20:40:22 +03:00
Bjoern A. Zeeb
86220d3cbd LinuxKPI: 802.11: fix compat code for i386
Compiling another driver on i386 revealed two problems:
- ieee80211_tx_info.status.status_driver_data space needs to be
  calculated.  While a pointer is 32bit vm_paddr_t is 64 bit on i386
  so we didn't fit more than one of these in but needed more space.
- the arguments to ieee80211_txq_get_depth() are expected to
  unsigned long and not uint64_t.

No user noticable changes.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-03-31 17:29:53 +00:00
George V. Neville-Neil
ca4cd20c4a Address issue pointed out in CVE-2020-25705
Add jitter to the ICMP bandwidth limit to deny a side-channel port scan.

Reviewed by:	kp, philip, cy, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27354
2022-03-31 16:45:50 +02:00
Xin LI
ab8ac4c285 Bump __FreeBSD_version for zlib upgrade. 2022-03-31 07:30:42 -07:00
Xin LI
cd8822075a MFV c144cc5479: zlib 1.2.12.
MFC after:	3 days
Relnotes:	yes
2022-03-31 07:25:53 -07:00
Doug Moore
342056fa1c vm_phys: alloc pages without duplicating searches.
In the search for contiguous pages, as each page segment is examined,
check to see if the free list set for the next page segment differs
from the set for the current segment, and avoid a pointless search if
they do not differ.

Discussed with:	alc
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D33947
2022-03-31 01:40:46 -05:00
Ed Maste
27ac4281fd mpr: add \n in diagnostic printf
Diff reduction between mpr and mps.

Fixes:		e2997a03b7 ("Diagnostic buffer fixes for the mps(4)...")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-03-30 20:14:07 -04:00
Mark Johnston
d53927b0ba uma: Don't allow a limit to be set in a warm zone
The limit accounting in UMA does not tolerate this.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-30 15:42:18 -04:00
Mark Johnston
54361f9020 uma: Use the correct type for a return value
zone_alloc_bucket() returns a pointer, not a bool.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-03-30 15:42:05 -04:00
Mark Johnston
7d1ab86691 pf: Initialize the table entry zone limit at initialization time
The limit may later be updated by the "set limit" directive in pf.conf.
UMA does not permit a limit to be set on a zone after any items have
been allocated from a zone.

Other UMA zones used by pf do not appear to be susceptible to this
problem: they either set a limit at zone creation time or never set one
at all.

PR:		260406
Reviewed by:	kp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34713
2022-03-30 15:41:44 -04:00
Ed Maste
8299f9a5c1 compat32: add size CTASSERTs for non-amd64 cases
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34712
2022-03-30 13:25:25 -04:00
Ed Maste
e5821a2156 syscalls.master: remove obsolete comment about compatibility tables
Compatibility ABIs no longer use a separate syscalls.master.

Fixes:		be67ea40c5 ("freebsd32: generate from ...")
Sponsored by:	The FreeBSD Foundation
2022-03-30 11:07:00 -04:00
Kristof Provost
d27c9f5bc3 pf: fixup match rules
Ensure that we can set and print match rules in ethernet rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-30 10:28:19 +02:00
Kristof Provost
81cac0d2f6 pf: add missing input/error validation for DIOCGETETHRULE
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-30 10:28:19 +02:00
Kristof Provost
9bb06778f8 pf: support listing ethernet anchors
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-30 10:28:19 +02:00
Wei Hu
5473dee730 Hyper-V: vPCI: Write back original BAR values after prepopulating bars
In vmbus_pcib_prepopulate_bars(), after writing all 1's to the
avialable device bars, those without being configured by device driver
are also set to its initialized values. However, this could cause
weird problem which results to device failure. The issue has been
reported to happen on LSI 9211-8i HBA card for DDA access on Hyper-V.
Writing back the orignal BAR values seem to work around this problem.

Reported by:	Alexander Motin <mavbsd@gmail.com>
Tested by:	Mathias Kraut <krautmaster@gmail.com>
Fixes:		75412a521f Hyper-V: vPCI: Prepopulate device bars
MFC after:	1 month
2022-03-30 06:56:09 +00:00
Michael Tuexen
218e463b85 sctp: ensure that ASCONF chunks are not too large
MFC after:	3 days
2022-03-30 01:22:20 +02:00