]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
3 years agoMFC r368207,368607: master
mm [Wed, 16 Dec 2020 22:25:40 +0000 (22:25 +0000)]
MFC r368207,368607:

MFC r368207:
Update libarchive to 3.5.0

Relevant vendor changes:
  Issue #1258: add archive_read_support_filter_by_code()
  PR #1347: mtree digest reader support
  Issue #1381: skip hardlinks pointing to itself on extraction
  PR #1387: fix writing of cpio archives with hardlinks without file type
  PR #1388: fix rdev field in cpio format for device nodes
  PR #1389: completed support for UTF-8 encoding conversion
  PR #1405: more formats in archive_read_support_format_by_code()
  PR #1408: fix uninitialized size in rar5_read_data
  PR #1409: system extended attribute support
  PR #1435: support for decompression of symbolic links in zipx archives
  Issue #1456: memory leak after unsuccessful archive_write_open_filename

MFC r368607:
Sync libarchive with vendor.

Vendor changes:
  Issue #1461: Unbreak build without lzma
  Issue #1462: warc reader: Fix build with gcc11
  Issue #1463: Fix code compatibility in test_archive_read_support.c
  Issue #1464: Use built-in strnlen on platforms where not available
  Issue #1465: warc reader: fix undefined behaviour in deconst() function

git-svn-id: svn://svn.freebsd.org/base/stable/10@368708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoFix bug in ifconfig regarding VLAN creation.
hselasky [Thu, 10 Dec 2020 09:39:27 +0000 (09:39 +0000)]
Fix bug in ifconfig regarding VLAN creation.

Detection of VLAN interface type must happen before detection of
interface type by prefix. Else the following sequence of commands will
try to create a LAGG interface instead of a VLAN interface, which
accidentially works, because the data pointed to by the ifr_data
pointer is not parsed by the VLAN create ioctl(2).

How to reproduce:
# ifconfig lagg0 create
# ifconfig lagg0.256 create

This is a direct commit.

Differential Revision: https://reviews.freebsd.org/D27521
Tested by: raul.munoz@custos.es
Sponsored by: Mellanox Technologies // NVIDIA Networking

git-svn-id: svn://svn.freebsd.org/base/stable/10@368505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r367070:
cy [Fri, 30 Oct 2020 00:34:40 +0000 (00:34 +0000)]
MFC r367070:

Remove a random equal sign from the example. It should not be there.
It's a syntax error.

PR: 210303
Reported by: leventelist at gmail.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@367155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoCorrect location and date of the Boston Shoemakers' organization,
grog [Sun, 18 Oct 2020 01:57:49 +0000 (01:57 +0000)]
Correct location and date of the Boston Shoemakers' organization,
which significantly predated the USA.

Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html

git-svn-id: svn://svn.freebsd.org/base/stable/10@366804 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r363988:
dim [Mon, 10 Aug 2020 17:35:58 +0000 (17:35 +0000)]
MFC r363988:

Fix clang 11 -Wformat warnings in yp_mkdb:

usr.sbin/yp_mkdb/yp_mkdb.c:91:40: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat]
                printf("%.*s %.*s\n", (int)key.size, key.data, (int)data.size,
                        ~~~~                         ^~~~~~~~
usr.sbin/yp_mkdb/yp_mkdb.c:92:7: error: format specifies type 'char *' but the argument has type 'void *' [-Werror,-Wformat]
                    data.data);
                    ^~~~~~~~~

git-svn-id: svn://svn.freebsd.org/base/stable/10@364084 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r363453:
cy [Thu, 30 Jul 2020 02:52:55 +0000 (02:52 +0000)]
MFC r363453:

Document the IPFILTER_PREDEFINED environment variable.

PR: 248088
Reported by: joeb1@a1poweruser.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@363685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r362623:
dim [Tue, 30 Jun 2020 15:53:52 +0000 (15:53 +0000)]
MFC r362623:

Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.

git-svn-id: svn://svn.freebsd.org/base/stable/10@362800 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r362078:
rpokala [Fri, 19 Jun 2020 07:07:10 +0000 (07:07 +0000)]
MFC r362078:

Decode the "LACP Fast Timeout" LAGG option flag

r286700 added the "lacp_fast_timeout" option to `ifconfig', but we forgot to
include the new option in the string used to decode the option bits. Add
"LACP_FAST_TIMO" to LAGG_OPT_BITS.

Also, s/LAGG_OPT_LACP_TIMEOUT/LAGG_OPT_LACP_FAST_TIMO/g , to be clearer that
the flag indicates "Fast Timeout" mode.

git-svn-id: svn://svn.freebsd.org/base/stable/10@362368 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r362045:
hselasky [Thu, 18 Jun 2020 10:41:51 +0000 (10:41 +0000)]
MFC r362045:
Make sure packets generated by raw IP code is let through by mlx5en(4).

Allow the TCP header to reside in the mbuf following the IP header.
Else such packets will get dropped.

Backtrace:
mlx5e_sq_xmit()
mlx5e_xmit()
ether_output_frame()
ether_output()
ip_output_send()
ip_output()
rip_output()
sosend_generic()
sosend()
kern_sendit()
sendit()
sys_sendto()
amd64_syscall()
fast_syscall_common()

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@362313 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r362044:
hselasky [Thu, 18 Jun 2020 10:31:21 +0000 (10:31 +0000)]
MFC r362044:
Extend use of unlikely() in the fast path, in mlx5en(4).

Typically the TCP/IP headers fit within the first mbuf and should not
trigger any of the error cases. Use unlikely() for these cases.

No functional change.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@362310 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r362043:
hselasky [Thu, 18 Jun 2020 10:17:36 +0000 (10:17 +0000)]
MFC r362043:
Use const keyword when parsing the TCP/IP header in the fast path in mlx5en(4).

When parsing the TCP/IP header in the fast path, make it clear by using
the const keyword, no fields are to be modified inside the transmitted
packet.

No functional change.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@362307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361977: libusb: improve compatibility
kevans [Tue, 16 Jun 2020 12:21:55 +0000 (12:21 +0000)]
MFC r361977: libusb: improve compatibility

Specifically, add LIBUSB_CLASS_PHYSICAL and the libusb_has_capability API.
Descriptions and functionality for these derived from the
documentation at [0].  The current set of capabilities are all supported by
libusb.

These were detected as missing after updating net/freerdp to 2.1.1, which
attempted to use both.

[0] http://libusb.sourceforge.net/api-1.0/group__libusb__misc.html

git-svn-id: svn://svn.freebsd.org/base/stable/10@362224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r362056:
hselasky [Sun, 14 Jun 2020 05:33:25 +0000 (05:33 +0000)]
MFC r362056:
Add missing range checks when receiving USB ethernet packets.

Found by: Ilja Van Sprundel, IOActive
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@362168 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361294:
mm [Fri, 12 Jun 2020 23:02:34 +0000 (23:02 +0000)]
MFC r361294:
Update libarchive to 3.4.3

Relevant vendor changes:
  PR #1352: support negative zstd compression levels
  PR #1359: improve zstd version checking
  PR #1348: support RHT.security.selinux from GNU tar
  PR #1357: support for archives compressed with pzstd
  PR #1367: fix issues in acl tests
  PR #1372: child handling cleanup
  PR #1378: fix memory leak from passphrase callback

git-svn-id: svn://svn.freebsd.org/base/stable/10@362134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC 361721:
cy [Mon, 8 Jun 2020 14:00:11 +0000 (14:00 +0000)]
MFC 361721:

Per-rule hit counts (-h) can be used with either -i (input) or -o (output)
filter rule lists.

git-svn-id: svn://svn.freebsd.org/base/stable/10@361928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361827:
hselasky [Mon, 8 Jun 2020 09:34:16 +0000 (09:34 +0000)]
MFC r361827:
USB HID descriptors may push/pop the current state to allow
description of items residing in a so-called union. FreeBSD currently
only supports 4 such push levels.

If the push level is not restored within the processing of the same
HID item, an invalid memory location may be used for subsequent HID
item processing.

Verify that the push level is always valid when processing HID items.

Reported by: Andy Nguyen (Google)
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361921 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361582:
hselasky [Mon, 8 Jun 2020 09:31:14 +0000 (09:31 +0000)]
MFC r361582:
Fix check for wMaxPacketSize in USB bluetooth driver,
in case device is not FULL speed.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361916 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361581:
hselasky [Mon, 8 Jun 2020 09:28:26 +0000 (09:28 +0000)]
MFC r361581:
Implement helper function, usbd_get_max_frame_length(), which allows kernel
device drivers to correctly predict the default USB transfer frame length.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361912 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361577:
hselasky [Mon, 8 Jun 2020 09:25:01 +0000 (09:25 +0000)]
MFC r361577:
Don't allow USB device drivers to parent own interface.
It will prevent proper USB device detach.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361908 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r361075:
hselasky [Fri, 22 May 2020 09:01:26 +0000 (09:01 +0000)]
MFC r361075:
Assign process group of the TTY under the "proctree_lock".

This fixes a race where concurrent calls to doenterpgrp() and
leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp
changing value so that tty_rel_pgrp() misses clearing it to NULL. For
more details refer to the use of pgdelete() in the kernel.

No functional change intended.

Panic backtrace:
__mtx_lock_sleep() # page fault due to using destroyed mutex
tty_signal_pgrp()
tty_ioctl()
ptsdev_ioctl()
kern_ioctl()
sys_ioctl()
amd64_syscall()

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r360092:
hselasky [Mon, 18 May 2020 08:45:24 +0000 (08:45 +0000)]
MFC r360092:
Bring HCI error messages up-to-date.
See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes.

Submitted by: Marc Veldman <marc@bumblingdork.com>
PR: 245737
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r360070:
hselasky [Mon, 18 May 2020 08:43:05 +0000 (08:43 +0000)]
MFC r360070:
Add missing feature descriptions to hci_features2str().

The list of possible features in hccontrol/features2str() is incomplete.
Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition".

Submitted by: Marc Veldman <marc@bumblingdork.com>
PR: 245354
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@361154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r360322:
dim [Fri, 1 May 2020 18:27:14 +0000 (18:27 +0000)]
MFC r360322:

Fix race between prebuilding libsbuf and libgeom

The latter needs the former, but with a multi-job build on a fast
machine, the race is sometimes lost. This leads to "ld: error: unable to
find library -lsbuf", when linking libgeom.so.

Submitted by: kevans

git-svn-id: svn://svn.freebsd.org/base/stable/10@360542 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoRemove stray "DO NOT DELETE" line, which bmake apparently put in without
dim [Sun, 26 Apr 2020 15:52:41 +0000 (15:52 +0000)]
Remove stray "DO NOT DELETE" line, which bmake apparently put in without
my knowledge or consent. I did not intend to commit this.

git-svn-id: svn://svn.freebsd.org/base/stable/10@360340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoAdd casts to work around harmless -Werror warnings from clang 10.0.0,
dim [Sun, 26 Apr 2020 15:50:32 +0000 (15:50 +0000)]
Add casts to work around harmless -Werror warnings from clang 10.0.0,
such as:

usr.sbin/timed/timed/networkdelta.c:160:13: error: implicit conversion from 'long' to 'float' changes value from 9223372036854775807 to 9223372036854775808
      [-Werror,-Wimplicit-int-float-conversion]
        float ap = LONG_MAX;            /* bounds on the median */
              ~~   ^~~~~~~~

Direct commit to stable/{10,11,12}, since timed has been removed from
FreeBSD 13.

git-svn-id: svn://svn.freebsd.org/base/stable/10@360338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r360075:
hselasky [Sun, 26 Apr 2020 08:38:10 +0000 (08:38 +0000)]
MFC r360075:
Set the maximum exit latency to 0 for XHCI USB 3.0 devices, because we
don't implement link power management, LPM.

This fixes error code XHCI_TRB_ERROR_BANDWIDTH for isochronous USB 3.0
transactions.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@360335 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r359968:
hselasky [Sun, 26 Apr 2020 08:35:32 +0000 (08:35 +0000)]
MFC r359968:
Cast all ioctl command arguments through uint32_t internally.

Hide debug print showing use of sign extended ioctl command argument
under INVARIANTS. The print is available to all and can easily fill
up the logs.

No functional change intended.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@360332 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r348282 (by lwhsu):
dim [Sat, 25 Apr 2020 22:23:34 +0000 (22:23 +0000)]
MFC r348282 (by lwhsu):

Remove an uneeded indentation introduced in r286196 to silence gcc warnging

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@360326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r348445 (by lwhsu):
dim [Sat, 25 Apr 2020 13:14:06 +0000 (13:14 +0000)]
MFC r348445 (by lwhsu):

Add the missing braces to fix the code not guarded by the if clause and has
misleading indentation.  This is found by gcc -Wmisleading-indentation

Approved by: erj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20428

git-svn-id: svn://svn.freebsd.org/base/stable/10@360304 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoFix misleading indentation in sys/dev/drm2/radeon/evergreen.c
dim [Sat, 25 Apr 2020 13:10:17 +0000 (13:10 +0000)]
Fix misleading indentation in sys/dev/drm2/radeon/evergreen.c

This fixes the following warning from recent versions of clang and gcc:

sys/dev/drm2/radeon/evergreen.c:554:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]

Direct commit to stable/{10,11,12}, since this driver has been removed
from FreeBSD 13.

git-svn-id: svn://svn.freebsd.org/base/stable/10@360303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

3 years agoMFC r354834 (by jhibbits):
dim [Sat, 25 Apr 2020 12:57:20 +0000 (12:57 +0000)]
MFC r354834 (by jhibbits):

bsnmp: Fix operator precedence in error check in table_check_response

Summary:
The ?: operator has a lower precedence than == and &&, so the result will always
be recorded as true.  Found by gcc8.

Reviewed by: ngie, ae
Differential Revision: https://reviews.freebsd.org/D22427

git-svn-id: svn://svn.freebsd.org/base/stable/10@360301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359446:
hselasky [Mon, 13 Apr 2020 16:34:21 +0000 (16:34 +0000)]
MFC r359446:
Add support for multiple playback and recording devices per physical USB audio
device. This requires some structural refactoring inside the driver, mostly
about converting existing audio channel structures into arrays.

The main audio mixer is provided by the first PCM instance.
The non-first audio instances may only have a software mixer for PCM playback.

Tested by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359440:
hselasky [Mon, 13 Apr 2020 16:32:18 +0000 (16:32 +0000)]
MFC r359440:
Implement new mixer API to return the device pointer based on the mixer pointer.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359356:
hselasky [Mon, 13 Apr 2020 16:30:10 +0000 (16:30 +0000)]
MFC r359356:
Change default microphone level from 0 to 25.

Discussed with: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359355:
hselasky [Mon, 13 Apr 2020 16:28:15 +0000 (16:28 +0000)]
MFC r359355:
Improve USB audio mixer support for USB audio class 1 and 2.
- make sure volume controls are correctly mapped to "pcm" and "rec" depending
  on how they deliver audio to the USB host.
- make sure there are no duplicate record selections.
- remove internal only mixer class type.
- don't add software volume controls for recording only.
- some minor mixer code cleanup.

Tested by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359323:
hselasky [Mon, 13 Apr 2020 16:26:15 +0000 (16:26 +0000)]
MFC r359323:
Be more intelligent when classifying USB audio terminal types, so that we
don't end up using SOUND_MIXER_VOLUME for all undefined types.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359322:
hselasky [Mon, 13 Apr 2020 16:24:21 +0000 (16:24 +0000)]
MFC r359322:
Make mute controls available for USB audio mixers.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359321:
hselasky [Mon, 13 Apr 2020 16:22:15 +0000 (16:22 +0000)]
MFC r359321:
Factor out USB audio mixer value range check.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359872 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359320:
hselasky [Mon, 13 Apr 2020 16:19:45 +0000 (16:19 +0000)]
MFC r359320:
Avoid scaling USB audio mixer values twice.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359869 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359653:
hselasky [Mon, 13 Apr 2020 09:02:17 +0000 (09:02 +0000)]
MFC r359653:
Count number of times transmit ring is out of buffers in mlx5en(4).

Differential Revision: https://reviews.freebsd.org/D24273
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359855 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359654:
hselasky [Mon, 13 Apr 2020 08:33:49 +0000 (08:33 +0000)]
MFC r359654:
Ensure a minimum inline size of 16 bytes in mlx5en(4).

This includes 14 bytes of ethernet header and 2 bytes of VLAN header.

This allows for making assumptions about the inline size limit
in the fast transmit path later on.

Use a signed integer variable to catch underflow.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359120:
hselasky [Thu, 26 Mar 2020 05:38:33 +0000 (05:38 +0000)]
MFC r359120:
Correctly implement support for remote wakeup for USB 3.0 device.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r338422: Adding support for CS46xx MIDI output.
avatar [Fri, 20 Mar 2020 14:26:08 +0000 (14:26 +0000)]
MFC r338422: Adding support for CS46xx MIDI output.

With this patch, users can play the MIDI files through /dev/sequencer
device with tools like playmidi. The audio output will go through
the external MIDI device such like wavetable synthesis card.

Reviewed by: matk (a long time ago), kib
Tested with: Terratec SiXPack 5.1+ + Yamaha DB50XG

git-svn-id: svn://svn.freebsd.org/base/stable/10@359161 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r359014:
hselasky [Thu, 19 Mar 2020 09:20:41 +0000 (09:20 +0000)]
MFC r359014:
Fix for double unlock in ipoib.

The ipoib_unicast_send() function is not supposed to unlock the priv lock.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@359123 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358841:
hselasky [Fri, 13 Mar 2020 09:18:28 +0000 (09:18 +0000)]
MFC r358841:
Fix for building libusb under Linux.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358838:
hselasky [Fri, 13 Mar 2020 08:57:22 +0000 (08:57 +0000)]
MFC r358838:
Add support for the device statistics IOCTL, needed by the coming
linux_libusb upgrade.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358695:
hselasky [Fri, 13 Mar 2020 08:53:59 +0000 (08:53 +0000)]
MFC r358695:
Define more subsystem orders.
Intended for use with module_init_order() in the LinuxKPI.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358694:
hselasky [Fri, 13 Mar 2020 08:50:56 +0000 (08:50 +0000)]
MFC r358694:
Fix some whitespace issues in ipoib.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358933 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358533:
mm [Fri, 13 Mar 2020 01:06:08 +0000 (01:06 +0000)]
MFC r358533:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
  PR #1331: cpio.5: fix hard link description
  Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
  Issue #1338: XAR reader: fix UBSan warning about undefined behavior
  Issue #1339: bsdcpio_test: fix datatype in from_hex()
  Issue #1341: Safe writes: delete temporary file if rename fails.
  Issue #1341: Safe writes: improve error handling

git-svn-id: svn://svn.freebsd.org/base/stable/10@358927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358629:
hselasky [Wed, 11 Mar 2020 08:26:11 +0000 (08:26 +0000)]
MFC r358629:
Implement a detaching flag for the sound(4) subsystem to take
appropriate actions when we are trying to detach an audio device,
but cannot because someone is using it.

This avoids applications having to wait for the DSP read data
timeout before they receive any error indication.
Tested with virtual_oss(8).

Remove some unused definitions while at it.

PR: 194727
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r358738:
hselasky [Wed, 11 Mar 2020 08:21:48 +0000 (08:21 +0000)]
MFC r358738:
Remove the power bit from the super speed root hub port status register
because it clobbers the super speed link status when a device is in super
speed mode. Currently the power bit is not needed for anything in the USB
hub driver.

This fixes USB warm reset for super speed devices.

Tested by: Shichun.Ma@dell.com
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@358875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoRemove reference to the freebsd-mobile mailing list to fix the build.
gjb [Wed, 19 Feb 2020 15:30:13 +0000 (15:30 +0000)]
Remove reference to the freebsd-mobile mailing list to fix the build.

This is a direct commit to stable/10 as part of an ongoing investigation
regarding transient and silent build failures.

Sponsored by: Rubicon Communications, LLC (netgate.com)

git-svn-id: svn://svn.freebsd.org/base/stable/10@358119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356212,r356366,r356416,r357785
mm [Wed, 19 Feb 2020 01:51:44 +0000 (01:51 +0000)]
MFC r356212,r356366,r356416,r357785
Update libarchive to version 3.4.2

Relevant vendor changes (r356212):
  Issue #351: Refactor and implement private state logic for write filters
  PR #1252: RAR5 reader - verify window size for solid files (OSS-Fuzz 15482)
  PR #1255: zip writer - don't append unused NUL for directories
  PR #1260: Fix sparse file offset overflow on 32-bit systems
  PR #1263: UNICODE filename support for reading lha/lzh format
  Issue #1276: Bugfix and optimize archive_wstring_append_from_mbs()
  PR #1288: Add the "xattrhdr" option to pax write options
  PR #1295: 7z reader - fix reading archives with digests in PackInfo
  PR #1296: RAR5 reader - verify window size for multivolume archives
  PR #1297: ZIP reader - support LZMA_STREAM_END marker in 'lzma alone' files
  Issue #1298: Fix a heap-buffer-overflow in archive_string_append_from_wcs()
  OSS-Fuzz 19360, 19362: LHA reader - plug two memory leaks on error
  Fix possible off-by-one when dealing with readlink(2)

Relevant vendor changes (r356366):
  Issue #1302: Plug memory leak on failure of archive_write_client_open()

Relevant vendor changes (r356416):
  Issue #1302: Re-do fix for archive_write_client_open()

Relevant vendor changes (r357785):
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

git-svn-id: svn://svn.freebsd.org/base/stable/10@358090 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r357149
rmacklem [Mon, 17 Feb 2020 19:31:34 +0000 (19:31 +0000)]
MFC: r357149
Fix a crash in the NFSv4 server.

The PR reported a crash that occurred when a file was removed while
client(s) were actively doing lock operations on it.
Since nfsvno_getvp() will return NULL when the file does not exist,
the bug was obvious and easy to fix via this patch. It is a little
surprising that this wasn't found sooner, but I guess the above
case rarely occurs.

PR: 242768

git-svn-id: svn://svn.freebsd.org/base/stable/10@358035 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357212: libfetch: fix urldecode buffer overrun
emaste [Wed, 5 Feb 2020 18:26:50 +0000 (18:26 +0000)]
MFC r357212: libfetch: fix urldecode buffer overrun

Reported by: Duncan Overbruck
Security: CVE-2020-7450

git-svn-id: svn://svn.freebsd.org/base/stable/10@357582 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357340:
dim [Tue, 4 Feb 2020 19:46:29 +0000 (19:46 +0000)]
MFC r357340:

Merge r357339 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in bsnmpd:

usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
                        return (-1);
                        ^
usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here
                } else
                  ^

The intent was to group the return statement with the previous syslog()
call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357272:
dim [Tue, 4 Feb 2020 19:35:40 +0000 (19:35 +0000)]
MFC r357272:

Merge r357271 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in bsnmpd:

usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
                            begemotBridgeStpPortEnable_enabled ||
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

Work around it by casting the enum values to the type of val->v.integer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357268:
dim [Tue, 4 Feb 2020 19:31:01 +0000 (19:31 +0000)]
MFC r357268:

Merge r357260 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in procstat:

usr.bin/procstat/procstat_sigs.c:79:3: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]
                xo_close_container(name);
                ^
usr.bin/procstat/procstat_sigs.c:77:4: note: previous statement is here
        } else
          ^

The intent was to group the xo_close_container() call to the previous
snprintf() call.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357269:
dim [Tue, 4 Feb 2020 19:24:10 +0000 (19:24 +0000)]
MFC r357269:

Merge r357267 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in tip:

usr.bin/tip/tip/tip.c:428:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                        if (gch == EOF)
                        ^
usr.bin/tip/tip/tip.c:426:5: note: previous statement is here
                } else if (!cumode && gch == character(value(FORCE)))
                  ^

The intent was to have the EOF check grouped with the getchar() call
just above it.  This was accidentally introduced in r354624.

git-svn-id: svn://svn.freebsd.org/base/stable/10@357518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357223:
dim [Tue, 4 Feb 2020 19:19:48 +0000 (19:19 +0000)]
MFC r357223:

Merge r357222 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in rbootd:

libexec/rbootd/rmpproto.c:335:49: error: multiple unsequenced modifications to 'filename' [-Werror,-Wunsequenced]
        filename = (filename = strrchr(filepath,'/'))? ++filename: filepath;
                 ~                                     ^

git-svn-id: svn://svn.freebsd.org/base/stable/10@357517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357298:
hselasky [Mon, 3 Feb 2020 11:05:59 +0000 (11:05 +0000)]
MFC r357298:
Add missing mutex unlock in failure case.

Differential Revision: https://reviews.freebsd.org/D23430
Submitted by: cem
Reported by: Coverity
Coverity CID: 1368773
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@357439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356952:
hselasky [Mon, 3 Feb 2020 10:50:52 +0000 (10:50 +0000)]
MFC r356952:
Add new USB ID to uslcom(4).

Submitted by: Oleg Sharoyko <osharoiko@gmail.com>
PR: 243494
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@357432 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356633:
hselasky [Mon, 3 Feb 2020 10:47:44 +0000 (10:47 +0000)]
MFC r356633:
Make sure the VNET is properly set when reaping mbufs in ipoib.
Else the following panic may happen:

panic()
icmp_error()
ipoib_cm_mb_reap()
linux_work_fn()
taskqueue_run_locked()
taskqueue_thread_loop()
fork_exit()
fork_trampoline()

Submitted by: Andreas Kempe <kempe@lysator.liu.se>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@357429 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r357226:
dim [Fri, 31 Jan 2020 20:04:32 +0000 (20:04 +0000)]
MFC r357226:

Merge r357224 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0 in binutils:

contrib/binutils/bfd/peicode.h:1356:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (efi)
                ^
contrib/binutils/bfd/peicode.h:1353:8: note: previous statement is here
              if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
              ^
contrib/binutils/bfd/peicode.h:1370:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                if (!efi)
                ^
contrib/binutils/bfd/peicode.h:1367:8: note: previous statement is here
              if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch)
              ^

git-svn-id: svn://svn.freebsd.org/base/stable/10@357351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356545:
hselasky [Thu, 16 Jan 2020 08:53:59 +0000 (08:53 +0000)]
MFC r356545:
Fix a XHCI driver issue with Intel's Gemini Lake SOC.

Do not configure any endpoint twice, but instead keep track of which
endpoints are configured on a per device basis, and use an evaluate
endpoint context command instead. When changing the configuration make
sure all endpoints get deconfigured and the configured endpoint mask
is reset.

This fixes an issue where an endpoint might stop working if there is
an error and the endpoint needs to be reconfigured as a part of the
error recovery mechanism in the FreeBSD USB stack.

Tested by: Shichun.Ma@dell.com
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356783 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356551: arp(8): avoid segfaulting due to out-of-bounds memory access
eugen [Thu, 16 Jan 2020 08:27:30 +0000 (08:27 +0000)]
MFC r356551: arp(8): avoid segfaulting due to out-of-bounds memory access

Fix obvious mistake that sometimes results in reading memory
past end of an array.

PR:             242784

git-svn-id: svn://svn.freebsd.org/base/stable/10@356780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356409:
hselasky [Mon, 13 Jan 2020 11:33:03 +0000 (11:33 +0000)]
MFC r356409:
Add own counter for cancelled USB transfers.
Do not count these as errors.

Bump the FreeBSD version to force recompilation of external modules.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356681 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356201:
hselasky [Mon, 6 Jan 2020 09:51:54 +0000 (09:51 +0000)]
MFC r356201:
Fix spelling.

PR: 242891
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356412 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356137:
hselasky [Mon, 6 Jan 2020 09:40:59 +0000 (09:40 +0000)]
MFC r356137:
Implement dump_stats command for usbconfig(8).

This command is useful when debugging USB device issues.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r351146:
hselasky [Mon, 6 Jan 2020 09:40:18 +0000 (09:40 +0000)]
MFC r351146:
Implement detach_kernel_driver command in usbconfig(8).

Submitted by: Kevin Zheng <kevinz5000@gmail.com>
PR: 239916

git-svn-id: svn://svn.freebsd.org/base/stable/10@356407 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r333089:
hselasky [Mon, 6 Jan 2020 09:38:57 +0000 (09:38 +0000)]
MFC r333089:
Clean up the EXAMPLES section of usbconfig(8).  This removes parts that
become redundant after documenting all the subcommands, and switches
to the new syntax, without the '-d'.

Reviewed by: hselasky@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r332659:
hselasky [Mon, 6 Jan 2020 09:38:08 +0000 (09:38 +0000)]
MFC r332659:
Make it possible to pass the ugenX.Y to usbconfig(8) without using "-d",
eg "usbconfig ugen1.2 dump_all_desc".

Reviewed by: hselasky@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356405 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r330875:
hselasky [Mon, 6 Jan 2020 09:37:13 +0000 (09:37 +0000)]
MFC r330875:
Add "usbconfig dump_all_desc", a subcommand to dump all device and config
descriptors.

Reviewed by: hselasky@
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r327522:
hselasky [Mon, 6 Jan 2020 09:35:57 +0000 (09:35 +0000)]
MFC r327522:
Fix warnings from "mandoc -Tlint -Wwarning".

Reported by: Yuri Pankov <yuripv at gmx.com>
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@356403 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r327382:
hselasky [Mon, 6 Jan 2020 09:35:11 +0000 (09:35 +0000)]
MFC r327382:
Improve usbconfig(8) manual page by adding descriptions for subcommands.

Reviewed by: hselasky
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13445

git-svn-id: svn://svn.freebsd.org/base/stable/10@356402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356136:
hselasky [Mon, 6 Jan 2020 09:22:33 +0000 (09:22 +0000)]
MFC r356136:
Implement new libusb v2.0 API function, libusb20_dev_get_stats().

This function is useful when debugging USB device issues.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r356135:
hselasky [Mon, 6 Jan 2020 09:16:41 +0000 (09:16 +0000)]
MFC r356135:
Make USB statistics per device instead of per bus.

Bump the FreeBSD version due to structure change to
force recompilation of external USB modules.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356396 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r355447:
hselasky [Wed, 25 Dec 2019 09:34:16 +0000 (09:34 +0000)]
MFC r355447:
Fix compilation issue with mlx5core and sparc64 (gcc48):

sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@356074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r355108 and r355170:
hselasky [Thu, 5 Dec 2019 14:53:46 +0000 (14:53 +0000)]
MFC r355108 and r355170:
Fix panic when loading kernel modules before root file system is mounted.
Make sure the rootvnode is always NULL checked.

Differential Revision: https://reviews.freebsd.org/D22545
PR: 241639
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@355419 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agor355120 | dim | 2019-11-26 23:01:09 +0100 (Tue, 26 Nov 2019) | 32 lines
dim [Wed, 4 Dec 2019 17:45:34 +0000 (17:45 +0000)]
r355120 | dim | 2019-11-26 23:01:09 +0100 (Tue, 26 Nov 2019) | 32 lines

The fdlibm hypot() implementations shouldn't potentially left-shift
negative numbers (invoking undefined behavior)

Summary:
Various paths through hypot(x, y) will multiply x and y by a power of
two, perform the calculation in a range where IEEE-754 provides greater
precision, then undo the multiplication to determine the true result.
Undoing that multiplication is implemented as t1*w, where t1=2**k.

2**k is often computed by taking the high word of 1.0, then adding k<<20
(for doubles or long doubles) or k<<23 (for floats) to it, then
overwriting that high word. But when k is negative this left-shifts a
negative value -- and that's undefined behavior in many editions of C
and C++.

This patch should fix all hypot implementations to compute 2**k without
triggering this particular bit of undefined behavior.

Test Plan: I've only very lightly tested out the hypot(double, double)
change, in SpiderMonkey's JavaScript engine, for consistency with prior
behavior.  The other functions' changes have more or less only been
eyeballed.  Careful examination appreciated!  Do note, however, that an
error in any of these changes would most likely produce a value that is
incorrect by a factor of two, so any mistake would most likely be
glaring if invoked.

Submitted by: Jeff Walden <jwalden@mit.edu>
Obtained from: https://github.com/freebsd/freebsd/pull/414
Reviewed by: dim, lwhsu
Differential Revision: https://reviews.freebsd.org/D22354

git-svn-id: svn://svn.freebsd.org/base/stable/10@355395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r354255:
dim [Sun, 10 Nov 2019 17:33:10 +0000 (17:33 +0000)]
MFC r354255:

Add __isnan()/__isnanf() aliases for compatibility with glibc and CUDA

Even though clang comes with a number of internal CUDA wrapper headers,
compiling sample CUDA programs will result in errors similar to:

In file included from <built-in>:1:
In file included from /usr/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
/usr/home/arr/cuda/var/cuda-repo-10-0-local-10.0.130-410.48/usr/local/cuda-10.0//include/crt/math_functions.hpp:2910:7: error: no matching function for call to '__isnan'
  if (__isnan(a)) {
      ^~~~~~~
/usr/lib/clang/9.0.0/include/__clang_cuda_device_functions.h:460:16: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ int __isnan(double __a) { return __nv_isnand(__a); }
               ^

CUDA expects __isnan() and __isnanf() declarations to be available,
which are glibc specific extensions, equivalent to the regular isnan()
and isnanf().

To provide these, define __isnan() and __isnanf() as aliases of the
already existing static inline functions __inline_isnan() and
__inline_isnanf() from math.h.

Reported by: arrowd
PR: 241550

git-svn-id: svn://svn.freebsd.org/base/stable/10@354596 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoReplace current with stable/10
imp [Wed, 6 Nov 2019 14:34:14 +0000 (14:34 +0000)]
Replace current with stable/10

Direct commit because not relevant to other branches

Reported by: Jamie Landeg-Jones

git-svn-id: svn://svn.freebsd.org/base/stable/10@354393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r353778 (partial)
marius [Wed, 30 Oct 2019 21:49:34 +0000 (21:49 +0000)]
MFC: r353778 (partial)

In em_handle_link(), only re-arm the link state change interrupt for
82574 and also only if such a device uses MSI-X, i. e. takes advantage
of autoclearing. In case of INTx and MSI re-arming isn't appropriate
here and setting EM_MSIX_LINK isn't either.

git-svn-id: svn://svn.freebsd.org/base/stable/10@354209 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r319872, r321063, r321582, r322034, r322425, r322962, r322985,
np [Thu, 10 Oct 2019 23:27:02 +0000 (23:27 +0000)]
MFC r319872, r321063, r321582, r322034, r322425, r322962, r322985,
r325596, r326026, r328420, r331472, r333276, r333650, r333652, r334406,
r334409-r334410, r334489, r336042, r340651, r342603, and r345083.

This updates the cxgbe firmwares in stable/10 and also pulls in support
for some newer boards and flash parts.

r319872:
cxgbe(4):  Do not request an FEC setting that the port does not support.

r321063:
cxgbe(4): Various link/media related improvements.

r321582:
cxgbe(4): Some updates to the common code.

r322034:
cxgbe(4): Always use the first and not the last virtual interface
associated with a port in begin_synchronized_op.

r322425:
cxgbe(4): Save the last reported link parameters and compare them with
the current state to determine whether to generate a link-state change
notification.  This fixes a bug introduced in r321063 that caused the
driver to sometimes skip these notifications.

r322962:
cxgbe(4): Remove write only variable from t4_port_init.

r322985:
cxgbe(4): Maintain one ifmedia per physical port instead of one per
Virtual Interface (VI).  All autonomous VIs that share a port share the
same media.

r325596:
cxgbe(4): Do not request settings not supported by the port.

r326026:
cxgbe(4): Add a custom board to the device id list.

r328420:
cxgbe(4): Do not display harmless warning in non-debug builds.

r331472:
cxgbe(4): Always initialize requested_speed to a valid value.

This fixes an avoidable EINVAL when the user tries to disable AN after
the port is initialized but l1cfg doesn't have a valid speed to use.

r333276:
cxgbe(4): Update all firmwares to 1.19.1.0.

r333650:
cxgbe(4): Claim some more T5 and T6 boards.

r333652:
cxgbe(4): Add support for two more flash parts.

r334406:
cxgbe(4): Consider all supported speeds when building the ifmedia list
for a port.  Fix other related issues while here:
- Require port lock for access to link_config.
- Allow 100Mbps operation by tracking the speed in Mbps.  Yes, really.
- New port flag to indicate that the media list is immutable.  It will
  be used in future refinements.

This also fixes a bug where the driver reports incorrect media with
recent firmwares.

r334409:
cxgbe(4): Implement ifm_change callback.

r334410:
cxgbe(4): Use ifm for ifmedia just like the rest of the kernel.

No functional change.

r334489:
cxgbe(4): Include full duplex mediaopt in media that can be reported as
active.  Always report full duplex in active media.

r336042:
cxgbe(4): Assume that any unknown flash on the card is 4MB and has 64KB
sectors, instead of refusing to attach to the card.

r340651:
cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3.

r342603:
cxgbe(4): Attach to two T540 variants.

r345083:
cxgbe(4): Update T4/5/6 firmwares to 1.23.0.0.

git-svn-id: svn://svn.freebsd.org/base/stable/10@353418 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r318147 (by erj@):
np [Thu, 10 Oct 2019 20:28:34 +0000 (20:28 +0000)]
MFC r318147 (by erj@):

Add several new media types to if_media.h

These include several 25G types (for active direct attach cables and LR modules),
and a missing type for 10G active direct attach.

git-svn-id: svn://svn.freebsd.org/base/stable/10@353414 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r316456,352732:
mm [Wed, 9 Oct 2019 22:19:48 +0000 (22:19 +0000)]
MFC r316456,352732:
Sync libarchive with vendor.

MFC r316456:
Vendor changes (FreeBSD-related):
  Report which extended attributes could not be restored
  Update archive_read_disk.3 and archive_write_disk.3 manual pages
  Plug memory leaks in xattr tests.

MFC r352732:
Relevant vendor changes:
  Issue #1237: Fix integer overflow in archive_read_support_filter_lz4.c
  PR #1249: Correct some typographical and grammatical errors.
  PR #1250: Minor corrections to the formatting of manual pages

git-svn-id: svn://svn.freebsd.org/base/stable/10@353377 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352556:
hselasky [Mon, 7 Oct 2019 08:25:25 +0000 (08:25 +0000)]
MFC r352556:
Add quirk for XHCI(4) controllers to support USB control transfers
above 1Kbyte.  It might look like some XHCI(4) controllers do not
support when the USB control transfer is split using a link TRB. The
next NORMAL TRB after the link TRB is simply failing with XHCI error
code 4. The quirk ensures we allocate a 64Kbyte buffer so that the
data stage TRB is not broken with a link TRB.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@353179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352555:
hselasky [Mon, 7 Oct 2019 08:13:49 +0000 (08:13 +0000)]
MFC r352555:
Increase the maximum user-space buffer size from 256kBytes to 32MBytes for
libusb. This is useful for speeding up large data transfers while reducing
the interrupt rate.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@353175 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352554:
hselasky [Mon, 7 Oct 2019 08:11:12 +0000 (08:11 +0000)]
MFC r352554:
The maximum TD size is 31 and not 15.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@353171 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r353116:
cy [Mon, 7 Oct 2019 04:44:01 +0000 (04:44 +0000)]
MFC r353116:

Add missing definition in DEBUG code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@353164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352783:
cy [Mon, 30 Sep 2019 02:32:51 +0000 (02:32 +0000)]
MFC r352783:

Fix a typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@352884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352737:
cy [Sun, 29 Sep 2019 03:41:15 +0000 (03:41 +0000)]
MFC r352737:

ipf mistakenly regards UDP packets with a checksum of 0xffff as bad.

Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443

git-svn-id: svn://svn.freebsd.org/base/stable/10@352866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r352710:
dim [Sat, 28 Sep 2019 08:57:29 +0000 (08:57 +0000)]
MFC r352710:

Do not left-shift a negative number (inducing undefined behavior in
C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate
computations that compute the IEEE-754 bit pattern for |2**k| for
integer |k|.

The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to
compute IEEE-754 bit patterns for 2**k in certain places.  (k is an
integer and 2**k is exactly representable in IEEE-754.)

Currently they do things like 0x3FF0'0000+(k<<20), which is to say they
take the bit pattern representing 1 and then add directly to the
exponent field to get the desired power of two.  This is fine when k is
non-negative.

But when k<0 (and certain classes of input trigger this), this
left-shifts a negative number -- an operation with undefined behavior in
C and C++.

The desired semantics can be achieved by instead adding the
possibly-negative k to the IEEE-754 exponent bias to get the desired
exponent field, _then_ shifting that into its proper overall position.

(Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD
and SET_FLOAT_WORD uses further down in each of these files that perform
shift operations involving k, but by these points k's range has been
restricted to 2 < k <= 56, and the shift operations under those
circumstances can't do anything that would be UB.)

Submitted by: Jeff Walden, https://github.com/jswalden
Obtained from: https://github.com/freebsd/freebsd/pull/411
Obtained from: https://github.com/freebsd/freebsd/pull/412

git-svn-id: svn://svn.freebsd.org/base/stable/10@352835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r351380:
cy [Sun, 25 Aug 2019 01:09:31 +0000 (01:09 +0000)]
MFC r351380:

Specifying array sizes for fully initialized tables at compile time is
redundant.

git-svn-id: svn://svn.freebsd.org/base/stable/10@351468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r350396:
hselasky [Wed, 14 Aug 2019 09:42:26 +0000 (09:42 +0000)]
MFC r350396:
Add support for tethering with Nokia 7 plus and the alike.

PR: 239495
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@351017 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r350855: Upgrade to Bzip2 version 1.0.8.
delphij [Wed, 14 Aug 2019 06:41:22 +0000 (06:41 +0000)]
MFC r350855: Upgrade to Bzip2 version 1.0.8.

git-svn-id: svn://svn.freebsd.org/base/stable/10@351008 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349927, r349929:
cy [Fri, 12 Jul 2019 02:14:05 +0000 (02:14 +0000)]
MFC r349927, r349929:

r349927:
  Resolve IPv6 checksum errors with stateful inspection. According to
  PR/203585 this appears to have been broken by r235959, which predates
  the ipfilter 5.1.2 import into FreeBSD.

  The IPv6 checksum calculation is incorrect. To resolve this we call
  in6_cksum() to do the the heavy lifting for us, through a new function
  ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
  is added to aid with future debugging.

  Plus whitespace adjustments (r348989).

  PR: 203275, 203585
  Differential Revision: https://reviews.freebsd.org/D20583

r349929:
  Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c.
  The reason for this is that ipftest(8), which still works on FreeBSD-11,
  fails to link to it, breaking stable/11 builds.

  ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle.
  glebius@ suggested we disable building it until I can get around to
  fixing it. Hence this was not caught in -current.

  The intention is to fix ipftest(8) as it is used by the netbsd-tests
  (imported by ngie@ many moons ago) for regression testing.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349931 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348987, r348989:
cy [Fri, 12 Jul 2019 00:50:33 +0000 (00:50 +0000)]
MFC r348987, r348989:

Resolve IPv6 checksum errors with stateful inspection. According to
PR/203585 this appears to have been broken by r235959, which predates
the ipfilter 5.1.2 import into FreeBSD.

The IPv6 checksum calculation is incorrect. To resolve this we call
in6_cksum() to do the the heavy lifting for us, through a new function
ipf_pcksum6(). Should we need to revisit this area again, a DTrace probe
is added to aid with future debugging.

Plus whitespace adjustments (r348989).

PR: 203275, 203585
Differential Revision: https://reviews.freebsd.org/D20583

git-svn-id: svn://svn.freebsd.org/base/stable/10@349927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC 349843:
cy [Thu, 11 Jul 2019 00:44:09 +0000 (00:44 +0000)]
MFC 349843:

Update frtuc struct comments. It not only defines TCP things we are
interested in but also UDP.

While at it document the source and destination port variables.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349903 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349842:
cy [Thu, 11 Jul 2019 00:38:10 +0000 (00:38 +0000)]
MFC r349842:

Correct the description for the low port in the port compare struct.

Adjust the high port description to match that of the low port
description.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349902 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f