]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoRemove unused function mana_reset_counters.
Wei Hu [Fri, 20 Aug 2021 15:00:02 +0000 (15:00 +0000)]
Remove unused function mana_reset_counters.

This fixes the build warning caused by this function.
Reported by: markj
Tested by: whu
MFC after: 2 weeks
Sponsored by: Microsoft

2 years agoFully revert f83f5d58394db57576bbed6dc7531997cabeb102 for the sys/dev/usb/serial
Hans Petter Selasky [Fri, 20 Aug 2021 15:59:29 +0000 (17:59 +0200)]
Fully revert f83f5d58394db57576bbed6dc7531997cabeb102 for the sys/dev/usb/serial
folder, only keeping the zero length packet API introduced in sys/dev/usb
after more reports of USB serial devices not supporting ZLPs.

Reported by: mav@
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agompr(4): Handle mprsas_alloc_tm() errors on device removal.
Alexander Motin [Fri, 20 Aug 2021 13:46:51 +0000 (09:46 -0400)]
mpr(4): Handle mprsas_alloc_tm() errors on device removal.

SAS9305-16e with firmware 16.00.01.00 report HighPriorityCredit of
only 8, while for comparison some other combinations I have report
100 or even 128.  In case of large JBOD detach requirement to send
target reset command to each target same time overflows the limit,
and without adequate handling makes devices stuck in half-detached
state, preventing later re-attach.

To handle that in case of allocation error mark the target with new
MPRSAS_TARGET_TOREMOVE flag, and retry the removal attempt next time
something else free high priority command.  With this patch I can
successfully detach/attach 102 disk JBOD from/to the SAS9305-16e.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

2 years agolibpfctl: Fix endianness issues
Kristof Provost [Fri, 20 Aug 2021 11:43:15 +0000 (13:43 +0200)]
libpfctl: Fix endianness issues

Several fields are supplied in big-endian format, so we need to convert
them before we display them.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agosctp: improve handling of illegal parameters of INIT-ACK chunks
Michael Tuexen [Fri, 20 Aug 2021 12:03:49 +0000 (14:03 +0200)]
sctp: improve handling of illegal parameters of INIT-ACK chunks

MFC after: 3 days

2 years agoMicrosoft Azure Network Adapter(MANA) VF support
Wei Hu [Fri, 20 Aug 2021 08:43:10 +0000 (08:43 +0000)]
Microsoft Azure Network Adapter(MANA) VF support

MANA is the new network adapter from Microsoft which will be available
in Azure public cloud. It provides SRIOV NIC as virtual function to
guest OS running on Hyper-V.

The code can be divided into two major parts. Gdma_main.c is the one to
bring up the hardware board and drives all underlying hardware queue
infrastructure. Mana_en.c contains all main ethernet driver code.
It has only tested and supported on amd64 architecture.

PR: 256336
Reviewed by: decui@microsoft.com
Tested by: whu
MFC after: 2 week
Relnotes: yes
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D31150

2 years agoufs_dirhash: Correct a typo in a comment
Gordon Bergling [Fri, 20 Aug 2021 07:59:18 +0000 (09:59 +0200)]
ufs_dirhash: Correct a typo in a comment

- s/memry/memory/

MFC after: 3 days

2 years agoPartial revert of f83f5d58394db57576bbed6dc7531997cabeb102 for uftdi(4).
Hans Petter Selasky [Fri, 20 Aug 2021 07:52:32 +0000 (09:52 +0200)]
Partial revert of f83f5d58394db57576bbed6dc7531997cabeb102 for uftdi(4).
Apparently devices with bcdDevice less than 0x0600, have problems receiving ZLPs.

Reported by: kevlo@
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agols: prevent no-color build from complaining when COLORTERM is non-empty
Piotr Pawel Stefaniak [Wed, 18 Aug 2021 20:47:37 +0000 (22:47 +0200)]
ls: prevent no-color build from complaining when COLORTERM is non-empty

As 257886 reports, if ls(1) is built with WITHOUT_LS_COLORS="YES", it
issues a warning whenever COLORTERM is non-empty. The warning is not
useful, so I thought to remove it, but as Ed pointed out, we may want
to have a way to determine whether a particular copy of ls has been
compiled with color support or not.

Therefore move the warnx() call to the getopt loop in
a WITHOUT_LS_COLORS build to fire when the user asks for colored output.

PR: 257886
Reported by: Marko Turk
Reviewed by: kevans

2 years agocrunch: drop WARNS override
Kyle Evans [Thu, 19 Aug 2021 06:33:13 +0000 (01:33 -0500)]
crunch: drop WARNS override

crunchide and crunchgen now build fine with default WARNS

2 years agocrunchgen: fix remaining issues under WARNS=6
Kyle Evans [Thu, 19 Aug 2021 06:22:16 +0000 (01:22 -0500)]
crunchgen: fix remaining issues under WARNS=6

Entirely variables that should be static, save for one 'no previous
declaration' in mkskel.sh.

Reviewed by: arichardson, imp
Differential Revision: https://reviews.freebsd.org/D31610

2 years agocrunchide: static'ify remaining non-exported functions
Kyle Evans [Thu, 19 Aug 2021 06:29:02 +0000 (01:29 -0500)]
crunchide: static'ify remaining non-exported functions

Reviewed by: arichardson, imp
Differential Revision: https://reviews.freebsd.org/D31609

2 years agocrunchide: address complaints from WARNS=6
Kyle Evans [Thu, 19 Aug 2021 06:17:36 +0000 (01:17 -0500)]
crunchide: address complaints from WARNS=6

- One (1) constify
- One (1) argument is unused
- One (1) local shadows a global
- Various globals that should be static

Reviewed by: arichardson, imp
Differential Revision: https://reviews.freebsd.org/D31608

2 years agocrunchgen: sprinkle some const-poisoning around
Kyle Evans [Thu, 19 Aug 2021 06:13:13 +0000 (01:13 -0500)]
crunchgen: sprinkle some const-poisoning around

Reviewed by: arichardson, imp
Differential Revision: https://reviews.freebsd.org/D31607

2 years agolocaledef: unbreak WITHOUT_LOCALES
Bjoern A. Zeeb [Thu, 19 Aug 2021 17:27:04 +0000 (12:27 -0500)]
localedef: unbreak WITHOUT_LOCALES

After 0fa5403d493b ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is empty but
C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus
after the replacement FILES= is set to only .LC_CTYPE which results in
a build failure not knowing how to build that. Tweak the substitution to
replace only non-empty words so that FILES remains harmlessly empty.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D31589

2 years agoDisable the accelerated arm64 sha25 in static libraries
Andrew Turner [Thu, 19 Aug 2021 16:48:30 +0000 (16:48 +0000)]
Disable the accelerated arm64 sha25 in static libraries

We don't have ifunc support in static arm64 binaries. Until we do
disable the accelerated sha256 code in a static libmd as it uses an
ifunc.

Reported by: brd
Sponsored by: The FreeBSD Foundation

2 years agoe1000: Update intel shared code
Kevin Bowling [Thu, 19 Aug 2021 14:59:34 +0000 (07:59 -0700)]
e1000: Update intel shared code

Sync the e1000 shared code with DPDK shared code
"cid-gigabit.2020.06.05.tar.gz released by ND"

Primary focus was on client platforms (ich8lan). More work remains here
but we need an Intel contact for client networking.

Reviewed by: grehan, Intel Networking (erj, earlier rev)
Obtained from: DPDK <http://git.dpdk.org/dpdk/tree/drivers/net/e1000/base>
MFC after: 1 week
Sponsored by: me
Differential Revision: https://reviews.freebsd.org/D31547

2 years agolibsa: cstyle cleanup of dosfs.c
Toomas Soome [Thu, 19 Aug 2021 14:33:24 +0000 (17:33 +0300)]
libsa: cstyle cleanup of dosfs.c

No functional changes intended.

MFC after: 1 week

2 years agodhclient: skip_to_semi() consumes semicolon already
Franco Fichtner [Thu, 19 Aug 2021 13:11:38 +0000 (09:11 -0400)]
dhclient: skip_to_semi() consumes semicolon already

When invalid statement is found the next statement is skipped even if it
is valid.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31527

2 years agodhclient: remove patching of static values in BPF programs
Franco Fichtner [Thu, 19 Aug 2021 13:08:59 +0000 (09:08 -0400)]
dhclient: remove patching of static values in BPF programs

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31502

2 years agortsold: make it work on if_vlan interfaces
Luiz Otavio O Souza [Thu, 19 Aug 2021 09:48:04 +0000 (11:48 +0200)]
rtsold: make it work on if_vlan interfaces

Reviewed by: kp
Obtained from: pfsense
MFC after: 1 week

2 years agotruncate(1): Fix missing -d option manpage
Ka Ho Ng [Thu, 19 Aug 2021 10:45:25 +0000 (18:45 +0800)]
truncate(1): Fix missing -d option manpage

Mention that either one of the -r, -s and -d options must be specified.

Sponsored by: The FreeBSD Foundation

2 years agotruncate(1): Add hole-punching support
Ka Ho Ng [Thu, 19 Aug 2021 10:30:41 +0000 (18:30 +0800)]
truncate(1): Add hole-punching support

This commit adds hole-punching support to the truncate(1) utility. If
the option -d is specified, truncate(1) performs zeroing, and if
possible hole-punching in case the operation is supported by the
underlying file system of the specified files.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31556

2 years agomd: Replace BIO_DELETE emulation with vn_deallocate(9)
Ka Ho Ng [Thu, 19 Aug 2021 10:30:13 +0000 (18:30 +0800)]
md: Replace BIO_DELETE emulation with vn_deallocate(9)

Both zero-filling and/or deallocation can be done with vn_deallocate(9).

Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D28899

2 years agopf: implement set-tos for IPv6
Samuel Robinette [Sun, 15 Aug 2021 18:26:41 +0000 (20:26 +0200)]
pf: implement set-tos for IPv6

Extend the existing set-tos keyword to also be able to set traffic class
on IPv6 traffic.
Add tests for this as well.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D31564

2 years agolagg: don't update link layer addresses on destroy
Luiz Otavio O Souza [Tue, 17 Aug 2021 14:23:50 +0000 (16:23 +0200)]
lagg: don't update link layer addresses on destroy

When the lagg is being destroyed it is not necessary update the
lladdr of all the lagg members every time we update the primary
interface.

Reviewed by: scottl
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31586

2 years agoipfw: use unsigned int for dummynet bandwidth
Luiz Otavio O Souza [Tue, 17 Aug 2021 07:54:40 +0000 (09:54 +0200)]
ipfw: use unsigned int for dummynet bandwidth

This allows the maximum value of 4294967295 (~4Gb/s) instead of previous
value of 2147483647 (~2Gb/s).

Reviewed by: np, scottl
Obtained from: pfSense
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31582

2 years agosh: fix NO_HISTORY build
Piotr Pawel Stefaniak [Wed, 18 Aug 2021 20:40:39 +0000 (22:40 +0200)]
sh: fix NO_HISTORY build

Move code added in b315a7296d2a ("autocomplete commands") to
conditionally compiled part under #ifndef NO_HISTORY.

Reported by: bdrewery
Fixes: b315a7296d2a

2 years agosctp: improve handling of INIT chunks with invalid parameters
Michael Tuexen [Wed, 18 Aug 2021 22:31:35 +0000 (00:31 +0200)]
sctp: improve handling of INIT chunks with invalid parameters

MFC after: 3 days

2 years agogeli(8): Do not report error on resize to the same size.
Alexander Motin [Wed, 18 Aug 2021 21:11:03 +0000 (17:11 -0400)]
geli(8): Do not report error on resize to the same size.

Just validate the old metadata and exit.  Originally the check was
added to not thash the only copy of metadata, but we can achieve the
same just by skipping the writing/trashing.  The metadata validation
should protect user from wrongly specifying new size instead of old.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

2 years agoiscsi: Teach the iSCSI stack about "large" received PDUs.
John Baldwin [Wed, 18 Aug 2021 17:56:28 +0000 (10:56 -0700)]
iscsi: Teach the iSCSI stack about "large" received PDUs.

When using iSCSI PDU offload (cxgbei) on T6 adapters, a burst of
received PDUs can be reported via a single message to the driver.

Previously the driver passed these multi-PDU bursts up to the iSCSI
stack up as a single "large" PDU by rewriting the buffer offset, data
segment length, and DataSN fields in the iSCSI header.  The DataSN
field in particular was rewritten so that each of the "large" PDUs
used consecutively increasing values.  While this worked, the forged
DataSN values did not match the ExpDataSN value in the subsequent SCSI
Response PDU.  The initiator does not currently verify this value, but
the forged DataSN values prevent adding a check.

To avoid this, allow a logical iSCSI PDU (struct icl_pdu) to describe
a burst of PDUs via a new 'ip_additional_pdus' field.  Normally this
field is set to zero when 'struct icl_pdu' represents a single PDU.
If logical PDU represents a burst of on-the-wire PDUs, then 'ip_npdus'
contains the count of additional on-the-wire PDUs.  The header of this
"large" PDU is still modified, but the DataSN field now contains the
DataSN value of the first on-the-wire PDU in the burst.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31577

2 years agouipc: avoid circular pr_{slow,fast}timos
Kyle Evans [Wed, 18 Aug 2021 17:31:45 +0000 (12:31 -0500)]
uipc: avoid circular pr_{slow,fast}timos

domain_init() gets reinvoked for each vnet on a system, so we must not
alter global state.  Practically speaking, we were creating circular
lists and tying up a softclock thread into an infinite loop.

The breakage here was most easily observed by simply creating a jail
in a new vnet and watching the system suddenly become erratic.

Reported by: markj
Fixes: e0a17c3f063f ("uipc: create dedicated lists for fast ...")
Pointy hat: kevans

2 years agovmm: Add credential to cdev object
Cyril Zhang [Wed, 18 Aug 2021 17:41:33 +0000 (13:41 -0400)]
vmm: Add credential to cdev object

Add a credential to the cdev object in sysctl_vmm_create(), then check
that we have the correct credentials in sysctl_vmm_destroy(). This
prevents a process in one jail from opening or destroying the /dev/vmm
file corresponding to a VM in a sibling jail.

Add regression tests.

Reviewed by: jhb, markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31156

2 years agodhclient: support supersede statement for option 54
Fabian Kurtz [Wed, 18 Aug 2021 17:12:48 +0000 (10:12 -0700)]
dhclient: support supersede statement for option 54

PR: 217978
Reported by: Franco Fichtner <franco@opnsense.org>
Reviewed by: markj
Obtained from: OPNsense
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31503

2 years agogre: simplify RSS ifdefs
Franco Fichtner [Wed, 18 Aug 2021 17:05:29 +0000 (10:05 -0700)]
gre: simplify RSS ifdefs

Use the early break to avoid else definitions. When RSS gains a
runtime option previous constructs would duplicate and convolute
the existing code.

While here init flowid and skip magic numbers and late default
assignment.

Reviewed by: melifaro, kbowling
Obtained from: OPNsense
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31584

2 years agotruncate(1): main() return statement style fix
Ka Ho Ng [Wed, 18 Aug 2021 15:45:20 +0000 (23:45 +0800)]
truncate(1): main() return statement style fix

Sponsored by: The FreeBSD Foundation

2 years agoarm: hide busdma statistics behind ifdef ARM_BUSDMA_MAPLOAD_STATS
Mateusz Guzik [Wed, 21 Jul 2021 03:34:32 +0000 (05:34 +0200)]
arm: hide busdma statistics behind ifdef ARM_BUSDMA_MAPLOAD_STATS

Stat collection using counter(9) is quite expensive on this platform and
these counters are normally not needed.

In particular we see about 1.5% bump in packet rate using Cortex-A9

Reviewed by: ian
Sponsored by: Rubicon Communications, LLC ("Netgate")
Different Revision: https://reviews.freebsd.org/D31592

2 years agoMake sure the uftdi(4) driver doesn't start a USB transfer when being cancelled.
Hans Petter Selasky [Wed, 18 Aug 2021 09:41:49 +0000 (11:41 +0200)]
Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled.

MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agowitness: remove ifnet_rw
Kristof Provost [Tue, 17 Aug 2021 10:56:11 +0000 (12:56 +0200)]
witness: remove ifnet_rw

This lock no longer exists. It was removed in
a60100fdfc10 (if: Remove ifnet_rwlock, 2020-11-25)

Reviewed by: mjg
Pointed out by: Dheeraj Kandula <dheerajk@netapp.com>
Different Revision: https://reviews.freebsd.org/D31585

2 years agoIntroduce m_get3()
Kristof Provost [Sat, 7 Aug 2021 18:02:21 +0000 (20:02 +0200)]
Introduce m_get3()

Introduce m_get3() which is similar to m_get2(), but can allocate up to
MJUM16BYTES bytes (m_get2() can only allocate up to MJUMPAGESIZE).

This simplifies the bpf improvement in f13da24715.

Suggested by: glebius
Differential Revision: https://reviews.freebsd.org/D31455

2 years agoiflib: emulate counters in netmap mode
Stephan de Wit [Wed, 18 Aug 2021 07:17:43 +0000 (00:17 -0700)]
iflib: emulate counters in netmap mode

When iflib devices are in netmap mode the driver
counters are no longer updated making it look from
userspace tools that traffic has stopped.

Reported by: Franco Fichtner <franco@opnsense.org>
Reviewed by: vmaffione, iflib (erj, gallatin)
Obtained from: OPNsense
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31550

2 years agoipmi: fix negative logic in watchdog control flag
Wojciech Macek [Wed, 18 Aug 2021 06:21:14 +0000 (08:21 +0200)]
ipmi: fix negative logic in watchdog control flag

Use wd_enable instead of wd_disable

2 years ago- Fix the growfs rc script to cope with diskid labels.
Scott Long [Tue, 17 Aug 2021 21:50:18 +0000 (21:50 +0000)]
- Fix the growfs rc script to cope with diskid labels.
- Fix a warning in growfs. gpart commit is supposed to be called on disk
  device.
- Silence a gpart commit warning in growfs.

Submitted by: loos
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D31587
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoUPDATING: Add a note about OpenSSL defaulting KTLS to off.
John Baldwin [Tue, 17 Aug 2021 21:40:33 +0000 (14:40 -0700)]
UPDATING: Add a note about OpenSSL defaulting KTLS to off.

Sponsored by: Netflix
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D31444

2 years agoOpenSSL: Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD.
John Baldwin [Tue, 17 Aug 2021 21:40:16 +0000 (14:40 -0700)]
OpenSSL: Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD.

FreeBSD's kernel TLS supports Chacha20 for both TLS 1.2 and TLS 1.3.

NB: This commit has not yet been merged upstream as it is deemed a new
feature and did not make the feature freeze cutoff for OpenSSL 3.0.

Reviewed by: jkim
MFC after: 5 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31443

2 years agoOpenSSL: Refactor KTLS tests to better support TLS 1.3.
John Baldwin [Tue, 17 Aug 2021 21:39:58 +0000 (14:39 -0700)]
OpenSSL: Refactor KTLS tests to better support TLS 1.3.

Most of this upstream commit touched tests not included in the
vendor import.  The one change merged in is to remove a constant
only present in an internal header to appease the older tests.

Reviewed by: jkim
Obtained from: OpenSSL (e1fdd5262e4a45ce3aaa631768e877ee7b6da21b)
MFC after: 5 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31442

2 years agoOpenSSL: Update KTLS documentation
John Baldwin [Tue, 17 Aug 2021 21:39:32 +0000 (14:39 -0700)]
OpenSSL: Update KTLS documentation

KTLS support has been changed to be off by default, and configuration is
via a single "option" rather two "modes". Documentation is updated
accordingly.

Reviewed by: jkim
Obtained from: OpenSSL (6878f4300213cfd7d4f01e26a8b97f70344da100)
MFC after: 5 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31441

2 years agoOpenSSL: Only enable KTLS if it is explicitly configured
John Baldwin [Tue, 17 Aug 2021 21:39:03 +0000 (14:39 -0700)]
OpenSSL: Only enable KTLS if it is explicitly configured

It has always been the case that KTLS is not compiled by default. However
if it is compiled then it was automatically used unless specifically
configured not to. This is problematic because it avoids any crypto
implementations from providers. A user who configures all crypto to use
the FIPS provider may unexpectedly find that TLS related crypto is actually
being performed outside of the FIPS boundary.

Instead we change KTLS so that it is disabled by default.

We also swap to using a single "option" (i.e. SSL_OP_ENABLE_KTLS) rather
than two separate "modes", (i.e. SSL_MODE_NO_KTLS_RX and
SSL_MODE_NO_KTLS_TX).

Reviewed by: jkim
Obtained from: OpenSSL (a3a54179b6754fbed6d88e434baac710a83aaf80)
MFC after: 5 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31440

2 years agoOpenSSL: ktls: Initial support for ChaCha20-Poly1305
John Baldwin [Tue, 17 Aug 2021 21:38:47 +0000 (14:38 -0700)]
OpenSSL: ktls: Initial support for ChaCha20-Poly1305

Linux kernel is going to support ChaCha20-Poly1305 in TLS offload.
Add support for this cipher.

Reviewed by: jkim
Obtained from: OpenSSL (3aa7212e0a4fd1533c8a28b8587dd8b022f3a66f)
MFC after: 5 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31439

2 years agoOpenSSL: Correct the return value of BIO_get_ktls_*().
John Baldwin [Tue, 17 Aug 2021 21:37:47 +0000 (14:37 -0700)]
OpenSSL: Correct the return value of BIO_get_ktls_*().

BIO_get_ktls_send() and BIO_get_ktls_recv() are documented as
returning either 0 or 1.  However, they were actually returning the
internal value of the associated BIO flag for the true case instead of
1.

Also trim redundant ternary operators.

Reviewed by: jkim
Obtained from: OpenSSL (f16e52b67c9261bdc7e1284a50502a802921ac6d)
MFC after: 5 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31438

2 years agorouting: Fix crashes with dpdk_lpm[46] algo.
Alexander V. Chernikov [Sun, 15 Aug 2021 22:25:21 +0000 (22:25 +0000)]
routing: Fix crashes with dpdk_lpm[46] algo.

When a prefix gets deleted from the RIB, dpdk_lpm algo needs to know
 the nexthop of the "parent" prefix to update its internal state.
The glue code, which utilises RIB as a backing route store, uses
 fib[46]_lookup_rt() for the prefix destination after its deletion
 to fetch the desired nexthop.
This approach does not work when deleting less-specific prefixes
 with most-specific ones are still present. For example, if
 10.0.0.0/24, 10.0.0.0/23 and 10.0.0.0/22 exist in RIB, deleting
 10.0.0.0/23 would result in 10.0.0.0/24 being returned as a search
 result instead of 10.0.0.0/22. This, in turn, results in the failed
 datastructure update: part of the deleted /23 prefix will still
 contain the reference to an old nexthop. This leads to the
 use-after-free behaviour, ending with the eventual crashes.

Fix the logic flaw by properly fetching the prefix "parent" via
 newly-created rt_get_inet[6]_parent() helpers.

Differential Revision: https://reviews.freebsd.org/D31546
PR: 256882,256833
MFC after: 1 week

2 years agotcp: Add support for DSACK based reordering window to rack.
Randall Stewart [Tue, 17 Aug 2021 20:29:22 +0000 (16:29 -0400)]
tcp: Add support for DSACK based reordering window to rack.

The rack stack, with respect to the rack bits in it, was originally built based
on an early I-D of rack. In fact at that time the TLP bits were in a separate
I-D. The dynamic reordering window based on DSACK events was not present
in rack at that time. It is now part of the RFC and we need to update our stack
to include these features. However we want to have a way to control the feature
so that we can, if the admin decides, make it stay the same way system wide as
well as via socket option. The new sysctl and socket option has the following
meaning for setting:

00 (0) - Keep the old way, i.e. reordering window is 1 and do not use DSACK bytes to add to reorder window
01 (1) - Change the Reordering window to 1/4 of an RTT but do not use DSACK bytes to add to reorder window
10 (2) - Keep the reordering window as 1, but do use SACK bytes to add additional 1/4 RTT delay to the reorder window
11 (3) - reordering window is 1/4 of an RTT and add additional DSACK bytes to increase the reordering window (RFC behavior)

The default currently in the sysctl is 3 so we get standards based behavior.
Reviewed by: tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D31506

2 years agopf: assert dir state on pf_test{,6}
Mateusz Guzik [Tue, 17 Aug 2021 18:16:09 +0000 (20:16 +0200)]
pf: assert dir state on pf_test{,6}

The intent is to line up various enums so that branching in the lines of:

idx = (dir == PF_IN ? PF_SK_WIRE : PF_SK_STACK);

is avoided.

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopf: save on branching in the common case in pf_test
Mateusz Guzik [Tue, 17 Aug 2021 18:04:31 +0000 (20:04 +0200)]
pf: save on branching in the common case in pf_test

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agouipc: create dedicated lists for fast and slow timeout callbacks
Mateusz Guzik [Sun, 15 Aug 2021 21:41:47 +0000 (23:41 +0200)]
uipc: create dedicated lists for fast and slow timeout callbacks

This avoids having to walk all possible protocols only to check if they
have one (vast majority does not).

Original patch by kevans@.

Reviewed by: kevans
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agobootstrap-tools: Don't copy host tools with make -n
Bryan Drewery [Tue, 17 Aug 2021 19:25:44 +0000 (12:25 -0700)]
bootstrap-tools: Don't copy host tools with make -n

2 years agozfs: merge openzfs/zfs@8ae86e2ed (master) into main
Martin Matuska [Tue, 17 Aug 2021 19:10:18 +0000 (21:10 +0200)]
zfs: merge openzfs/zfs@8ae86e2ed (master) into main

Notable upstream pull request merges:
  #12422 Fix/improve dbuf hits accounting
  #12406 Increase default volblocksize from 8KB to 16KB
  #12398 Remove b_pabd/b_rabd allocation from arc_hdr_alloc()
  #12397 Run arc_evict thread at higher priority
  #12297 Avoid vq_lock drop in vdev_queue_aggregate()
  #12161 Restore FreeBSD sysctl processing for arc.min and arc.max

Obtained from: OpenZFS
OpenZFS commit: 8ae86e2edc736483c1530fd689525aa2460eaec8

2 years ago_worldtmp: Fix some sub-makes not working with make -n
Bryan Drewery [Tue, 17 Aug 2021 19:06:14 +0000 (12:06 -0700)]
_worldtmp: Fix some sub-makes not working with make -n

2 years agocxgbei: Restrict received PDUs to 4 DDP pages in length.
John Baldwin [Tue, 17 Aug 2021 18:14:37 +0000 (11:14 -0700)]
cxgbei: Restrict received PDUs to 4 DDP pages in length.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31576

2 years agocxgbei: Only round PDU data segment lengths down by 512 on T5.
John Baldwin [Tue, 17 Aug 2021 18:14:29 +0000 (11:14 -0700)]
cxgbei: Only round PDU data segment lengths down by 512 on T5.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31575

2 years agocxgbei: Restructure how PDU limits are managed.
John Baldwin [Tue, 17 Aug 2021 18:14:11 +0000 (11:14 -0700)]
cxgbei: Restructure how PDU limits are managed.

- Compute data segment limits in read_pdu_limits() rather than PDU
  length limits.

- Add back connection-specific PDU overhead lengths to compute PDU
  length limits in icl_cxgbei_conn_handoff().

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D31574

2 years agoZTS: Add tests for creation time
Ryan Moeller [Mon, 26 Jul 2021 20:08:52 +0000 (16:08 -0400)]
ZTS: Add tests for creation time

Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #12432

2 years agoLinux 4.11 compat: statx support
Richard Yao [Sun, 17 Mar 2019 00:43:13 +0000 (20:43 -0400)]
Linux 4.11 compat: statx support

Linux 4.11 added a new statx system call that allows us to expose crtime
as btime. We do this by caching crtime in the znode to match how atime,
ctime and mtime are cached in the inode.

statx also introduced a new way of reporting whether the immutable,
append and nodump bits have been set. It adds support for reporting
compression and encryption, but the semantics on other filesystems is
not just to report compression/encryption, but to allow it to be turned
on/off at the file level. We do not support that.

We could implement semantics where we refuse to allow user modification
of the bit, but we would need to do a dnode_hold() in zfs_znode_alloc()
to find out encryption/compression information. That would introduce
locking that will have a minor (although unmeasured) performance cost.
It also would be inferior to zdb, which reports far more detailed
information. We therefore omit reporting of encryption/compression
through statx in favor of recommending that users interested in such
information use zdb.

Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Closes #8507

2 years agomount.h: improve a comment about flags
Piotr Pawel Stefaniak [Sat, 14 Aug 2021 20:07:09 +0000 (22:07 +0200)]
mount.h: improve a comment about flags

The comment only specifies MNT_ROOTFS - which is set by the kernel when
mounting its root file system. So it's not clear if any other flags
are not quite right and for what reason.

2 years agostyle.9: remove an outdated comment about indent(1)
Piotr Pawel Stefaniak [Tue, 17 Aug 2021 15:56:41 +0000 (17:56 +0200)]
style.9: remove an outdated comment about indent(1)

indent(1) has had -ncs and -nbs for some time now.

2 years agozfs.4: Fix typo s/compatiblity/compatibility/
Gordon Bergling [Tue, 17 Aug 2021 17:01:07 +0000 (19:01 +0200)]
zfs.4: Fix typo s/compatiblity/compatibility/

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Gordon Bergling <gbergling@googlemail.com>
Closes #12464

2 years agoMark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now
Alex Richardson [Tue, 17 Aug 2021 16:44:40 +0000 (17:44 +0100)]
Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now

I enabled these options again in 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3,
but unfortunately only my specific build configuration worked whereas the
build with default options is still broken.

2 years agofstyp: add BeFS support
Piotr Pawel Stefaniak [Tue, 17 Aug 2021 15:07:31 +0000 (17:07 +0200)]
fstyp: add BeFS support

A simple support for detecting BeFS (BeOS) filesystem

Submitted by: Miguel Gocobachi
Differential Revision: https://reviews.freebsd.org/D29917

2 years agoRemove b_pabd/b_rabd allocation from arc_hdr_alloc()
Alexander Motin [Tue, 17 Aug 2021 16:15:54 +0000 (12:15 -0400)]
Remove b_pabd/b_rabd allocation from arc_hdr_alloc()

When a header is allocated for full overwrite it is a waste of time
to allocate b_pabd/b_rabd for it, since arc_write() will free them
without ever being touched.  If it is a read or a partial overwrite
then arc_read() and arc_hdr_decrypt() allocate them explicitly.

Reduced memory allocation in user threads also reduces ARC eviction
throttling there, proportionally increasing it in ZIO threads, that
is not good.  To minimize or even avoid it introduce ARC allocation
reserve, allowing certain arc_get_data_abd() callers to allocate a
bit longer in situations where user threads will already throttle.

Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12398

2 years agosysctl.9: put negative sense sysctl note in own paragraph
Ed Maste [Tue, 17 Aug 2021 15:58:03 +0000 (11:58 -0400)]
sysctl.9: put negative sense sysctl note in own paragraph

The sysctl man page cautions against negative-sense boolean sysctls
(foobar_disable), but it gets lost at the end of a large paragraph.
Move it to a separate paragraph in an attempt to make it more clear.

This man page could use a more holistic review and edit pass.  This
change is simple and straightforward and I hope provides a small but
immediate benefit.

2 years agoIncrease default volblocksize from 8KB to 16KB
Alexander Motin [Tue, 17 Aug 2021 15:59:46 +0000 (11:59 -0400)]
Increase default volblocksize from 8KB to 16KB

Many things has changed since previous default was set many years ago.
Nowadays 8KB does not allow adequate compression or even decent space
efficiency on many of pools due to 4KB disk physical block rounding,
especially on RAIDZ and DRAID.  It effectively limits write throughput
to only 2-3GB/s (250-350K blocks/s) due to sync thread, allocation,
vdev queue and other block rate bottlenecks.  It keeps L2ARC expensive
despite many optimizations and dedup just unrealistic.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #12406

2 years agoOptimize arc_l2c_only lists assertions
Alexander Motin [Tue, 17 Aug 2021 15:55:34 +0000 (11:55 -0400)]
Optimize arc_l2c_only lists assertions

It is very expensive and not informative to call multilist_is_empty()
for each arc_change_state() on debug builds to check for impossible.
Instead implement special index function for arc_l2c_only->arcs_list,
multilists, panicking on any attempt to use it.

Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12421

2 years agoFix/improve dbuf hits accounting
Alexander Motin [Tue, 17 Aug 2021 15:50:31 +0000 (11:50 -0400)]
Fix/improve dbuf hits accounting

Instead of clearing stats inside arc_buf_alloc_impl() do it inside
arc_hdr_alloc() and arc_release().  It fixes statistics being wiped
every time a new dbuf is filled from the ARC.

Remove b_l1hdr.b_l2_hits. L2ARC hits are accounted at b_l2hdr.b_hits.
Since the hits are accounted under hash lock, replace atomics with
simple increments.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <george.wilson@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12422

2 years agoAvoid vq_lock drop in vdev_queue_aggregate()
Alexander Motin [Tue, 17 Aug 2021 15:47:00 +0000 (11:47 -0400)]
Avoid vq_lock drop in vdev_queue_aggregate()

vq_lock is already too congested for two more operations per I/O.
Instead of dropping and reacquiring it inside vdev_queue_aggregate()
delegate the zio_vdev_io_bypass() and zio_execute() calls for parent
I/Os to callers, that drop the lock any way to execute the new I/O.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12297

2 years agoUse more atomics in refcounts
Alexander Motin [Tue, 17 Aug 2021 15:44:34 +0000 (11:44 -0400)]
Use more atomics in refcounts

Use atomic_load_64() for zfs_refcount_count() to prevent torn reads
on 32-bit platforms.  On 64-bit ones it should not change anything.

When built with ZFS_DEBUG but running without tracking enabled use
atomics instead of mutexes same as for builds without ZFS_DEBUG.
Since rc_tracked can't change live we can check it without lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12420

2 years agonetinet tests: delete an interface with pending lookups
Kristof Provost [Tue, 17 Aug 2021 14:19:29 +0000 (16:19 +0200)]
netinet tests: delete an interface with pending lookups

This has been known to trigger panics. It currently doesn't, but we may
as well have a test for it.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agolibfetch: use more portable getline() interface
Daniel Kolesa [Tue, 17 Aug 2021 14:01:46 +0000 (16:01 +0200)]
libfetch: use more portable getline() interface

this is for better portability in order to avoid using a function
which is BSD-only or available via libbsd

MFC after: 3 weeks

2 years agortld: constify most variables holding references to the environment values
Konstantin Belousov [Mon, 16 Aug 2021 16:55:06 +0000 (19:55 +0300)]
rtld: constify most variables holding references to the environment values

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31545

2 years agortld: provide private getenv(3)
Konstantin Belousov [Mon, 16 Aug 2021 14:02:48 +0000 (17:02 +0300)]
rtld: provide private getenv(3)

Reviewed by: arichardson, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31545

2 years agortld: avoid use of of getenv(3) for evaluating rtld env vars (LD_XXX)
Konstantin Belousov [Mon, 16 Aug 2021 12:59:05 +0000 (15:59 +0300)]
rtld: avoid use of of getenv(3) for evaluating rtld env vars (LD_XXX)

Scan through the set of environment variables during initialization and
store values in the corresponding ld_env_var_desc structure, in the
single pass at init time. This does not eliminate use of getenv(3) and
unsetenv(3) completely, but provides a foundation to do that as the next
step.

Also organize the scan in a way that makes it easier to support aliases
like LD_DEBUG vs. LD_64_DEBUG.

Suggested by: arichardson
Reviewed by: arichardson, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31545

2 years agortld: rework how environment variables are named
Konstantin Belousov [Sun, 15 Aug 2021 18:57:42 +0000 (21:57 +0300)]
rtld: rework how environment variables are named

Instead of specifying the main name part of the environment variable as the
string literal, create array of the var names and access them by symbolic
index.  Convert main name parts into complete names by prefixing with
ABI-specific ld_env_vars.

This way the name is not repeated, and also it can carry additional
proporties explicitly.  For instance, cleanup of the environment for
the setuid image does not require retyping all names.

Reviewed by: arichardson, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D31545

2 years agounbound: Vendor import 1.13.2
Cy Schubert [Tue, 17 Aug 2021 09:32:56 +0000 (02:32 -0700)]
unbound: Vendor import 1.13.2

Merge commit '625f1c1312fb7defbd148c8ba121a0cf058707ef'

MFC after: 1 month

2 years agoEnable rc.d/jail within jails
Dan Langille [Sun, 15 Aug 2021 16:53:16 +0000 (12:53 -0400)]
Enable rc.d/jail within jails

Jails with jails is a supported. This change allows the script to run
upon startup with a jail. Without this, jails are not automatically
started within jails.

2 years agoipfw: fix possible data race between jump cache reading and updating.
Andrey V. Elsukov [Tue, 17 Aug 2021 08:08:28 +0000 (11:08 +0300)]
ipfw: fix possible data race between jump cache reading and updating.

Jump cache is used to reduce the cost of rule lookup for O_SKIPTO and
O_CALLRETURN actions. It uses rules chain id to check correctness of
cached value. But due to the possible race, there is the chance that
one thread can read invalid value. In some cases this can lead to out
of bounds access and panic.

Use thread fence operations to constrain the reordering of accesses.
Also rename jump_fast and jump_linear functions to jump_cached and
jump_lookup_pos respectively.

Submitted by: Arseny Smalyuk
Reviewed by: melifaro
Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D31484

2 years agosdhci_xenon: remove redundant code in property parsing
Bartlomiej Grzesik [Thu, 15 Jul 2021 15:20:46 +0000 (17:20 +0200)]
sdhci_xenon: remove redundant code in property parsing

Remove redundant ofw property parsing in driver code, is already
taken care of in mmc_fdt_helpers.

Move ofw parsing to attach method.

Reviewed by: manu
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D31409

2 years agosdhci_xenon: add AP807 compatible string
Bartlomiej Grzesik [Wed, 14 Jul 2021 12:47:40 +0000 (14:47 +0200)]
sdhci_xenon: add AP807 compatible string

This patch adds compatible string for xenon controller found on
AP807 north brige. It is fully compatible with existing driver.

Reviewed by: manu
Sponsored by: Semihalf
Differential Revision: https://reviews.freebsd.org/D31407

2 years agoipmi: New tunable to deactivate IPMI watchdog
Wojciech Macek [Tue, 17 Aug 2021 06:28:21 +0000 (08:28 +0200)]
ipmi: New tunable to deactivate IPMI watchdog

In case we want to use other WD than IPMI-provided, add
sysctl to disable initialization.

Obtained from: Semihalf
Sponsored by: Stormshield
Differential revision: https://reviews.freebsd.org/D31548

2 years agounbound: Vendor import 1.13.2
Cy Schubert [Mon, 16 Aug 2021 23:55:17 +0000 (16:55 -0700)]
unbound: Vendor import 1.13.2

2 years agoZTS: Avoid unset $tmpdir in redacted_panic
Ryan Moeller [Mon, 16 Aug 2021 23:38:34 +0000 (19:38 -0400)]
ZTS: Avoid unset $tmpdir in redacted_panic

The redacted_send tests make use of a $tmpdir variable, except in
redacted_send/redacted_panic the variable is never defined.

Use $TEST_BASE_DIR instead.

Clean up the stream file after the test.

Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #12455

2 years agorouting: add IPv6 fib validation procedure.
Alexander V. Chernikov [Mon, 16 Aug 2021 23:02:29 +0000 (23:02 +0000)]
routing: add IPv6 fib validation procedure.

Allow consistency validation of the inet6 fib based on rib data.
Validation can be kicked off by loading test_lookup module and
 running sysctl net.route.test.run_inet6_scan=1

MFC after: 1 week

2 years agoevdev: Use bit_foreach helper macro
Vladimir Kondratyev [Mon, 16 Aug 2021 21:28:37 +0000 (00:28 +0300)]
evdev: Use bit_foreach helper macro

for traversing all bits set in the bitstring(9).

While here move bit_change() definition to common header.

MFC after: 1 week

2 years agoAdd gone_in(9) man page
Ed Maste [Wed, 9 Jun 2021 17:19:16 +0000 (13:19 -0400)]
Add gone_in(9) man page

Reviewed by: imp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30703

2 years agobitstring(3): Add bitstring traversal macros.
Vladimir Kondratyev [Mon, 16 Aug 2021 20:18:58 +0000 (23:18 +0300)]
bitstring(3): Add bitstring traversal macros.

The macro bit_foreach() traverses all set bits in the bitstring in the
forward direction, assigning each location in turn to variable.

The macro bit_foreach_at() traverses all set bits in the bitstring in
the forward direction at or after the zero-based bit index, assigning
each location in turn to variable.

The bit_foreach_unset() and bit_foreach_unset_at() macros which
traverses unset bits are implemented for completeness.

Reviewed by: asomers, dougm
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D31469

2 years agohms(4): Allow attachment to pointer top level collection.
Vladimir Kondratyev [Mon, 16 Aug 2021 20:18:43 +0000 (23:18 +0300)]
hms(4): Allow attachment to pointer top level collection.

to be in line with Microsoft mouse driver [1]

[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/top-level-collections-opened-by-windows-for-system-use

MFC after: 1 week

2 years agops4dshock(4): Fix touchpad width in HID report descriptor
Vladimir Kondratyev [Mon, 16 Aug 2021 20:18:27 +0000 (23:18 +0300)]
ps4dshock(4): Fix touchpad width in HID report descriptor

MFC after: 1 week

2 years agohid: move proper hat switch handling from ps4dshock to hgame
Greg V [Mon, 16 Aug 2021 20:18:09 +0000 (23:18 +0300)]
hid: move proper hat switch handling from ps4dshock to hgame

Generic "DirectInput" HID gamepads need this handling too.

Reviewed by: wulf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31398

2 years agohmt(4): Do not ignore constant usages in HID report descriptor parser
Jack [Mon, 16 Aug 2021 20:17:41 +0000 (23:17 +0300)]
hmt(4): Do not ignore constant usages in HID report descriptor parser

This fixes hmt to work with MELF0411 1FD2:7012 touchscreen

Obtained from: sysutils/iichid
MFC after: 1 week

2 years agohid: Add extra constant to units of measurement
Vladimir Kondratyev [Mon, 16 Aug 2021 20:13:24 +0000 (23:13 +0300)]
hid: Add extra constant to units of measurement

Some devices like eGalax touchscreens use value of 0x33 instead of 0x13
for inches as unit of measure.

Reported by: Mark Kane <mark_AT_kane_DOT_mn>
MFC after: 1 week

2 years agoevdev: Do not check maximal contact number for MT initialization
Vladimir Kondratyev [Mon, 16 Aug 2021 20:12:01 +0000 (23:12 +0300)]
evdev: Do not check maximal contact number for MT initialization

This allows singletouch devices which use multitouch protocols to work.

Reported by: Mark Kane <mark_AT_kane_DOT_mn>
MFC after: 1 week

2 years agohmt(4): Store Contact Count in separate variable.
Vladimir Kondratyev [Mon, 16 Aug 2021 20:11:36 +0000 (23:11 +0300)]
hmt(4): Store Contact Count in separate variable.

No functional changes.

MFC after: 1 week