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/9@364084
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
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/9@362800
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
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/9@362224
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Tue, 9 Jun 2020 22:15:45 +0000 (22:15 +0000)]
Adapt merge of r361581 to 9-stable to unbreak kernel compilation.
This is a direct commit.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@361989
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 8 Jun 2020 09:35:32 +0000 (09:35 +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/9@361922
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 8 Jun 2020 09:31:52 +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/9@361917
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 8 Jun 2020 09:29:08 +0000 (09:29 +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/9@361913
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 8 Jun 2020 09:25:40 +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/9@361909
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 22 May 2020 09:02:40 +0000 (09:02 +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/9@361359
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sun, 26 Apr 2020 08:38:53 +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/9@360336
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 26 Mar 2020 05:39:20 +0000 (05:39 +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/9@359319
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 19 Mar 2020 09:21:27 +0000 (09:21 +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/9@359124
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 13 Mar 2020 09:15:13 +0000 (09:15 +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/9@358946
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 13 Mar 2020 09:14:05 +0000 (09:14 +0000)]
MFC r253338:
Add some missing LIBUSB IOCTL conversion codes.
git-svn-id: svn://svn.freebsd.org/base/stable/9@358945
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 13 Mar 2020 09:10:44 +0000 (09:10 +0000)]
Define USB_FS_OPEN_STREAM, even if not supported.
This is a direct commit.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@358944
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 13 Mar 2020 08:54:57 +0000 (08:54 +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/9@358938
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 13 Mar 2020 08:51:46 +0000 (08:51 +0000)]
MFC r358694:
Fix some whitespace issues in ipoib.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@358934
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Wed, 11 Mar 2020 08:26:52 +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/9@358880
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Wed, 11 Mar 2020 08:23:14 +0000 (08:23 +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/9@358876
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
emaste [Sun, 8 Mar 2020 16:53:46 +0000 (16:53 +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/9@358741
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 3 Feb 2020 11:18:07 +0000 (11:18 +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/9@357441
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 3 Feb 2020 11:17:34 +0000 (11:17 +0000)]
MFC r349409 and r349410:
Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all
devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE
flag. Make sure when the flag is not specified no arrival events are
generated for currently enumerated devices.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@357440
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
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/9@357351
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
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/9@352835
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Tue, 11 Jun 2019 08:54:21 +0000 (08:54 +0000)]
MFC r348797:
Fix for reading the configuration descriptor in libusb. Catch invalid
configuration descriptor reads early on to avoid issues with devices
that don't check for a valid USB configuration read request.
Submitted by: takahiro.kurosawa@gmail.com
PR: 238412
git-svn-id: svn://svn.freebsd.org/base/stable/9@348896
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 10 Jun 2019 13:38:57 +0000 (13:38 +0000)]
MFC r348631:
In usb(4) fix a lost completion event issue towards libusb(3). It may happen
if a USB transfer is cancelled that we need to fake a completion event.
Implement missing support in ugen_fs_copy_out() to handle this.
This fixes issues with webcamd(8) and firefox.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@348858
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 5 Apr 2019 11:37:17 +0000 (11:37 +0000)]
MFC r345499:
Change all kernel C-type macros into static inline functions.
The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.
This breaks code like:
isalpha(*ptr++)
Use static inline functions instead of macros to fix this.
Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@345944
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 15 Feb 2019 09:25:52 +0000 (09:25 +0000)]
MFC r343905:
Improve Bluetooth device discovery support for Android and Microsoft devices.
Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
project at github.com.
PR: 210089
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@344147
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 8 Feb 2019 10:31:45 +0000 (10:31 +0000)]
MFC r343572:
Add support for Audio Sink and Audio Source profiles to sdpd(8).
This allows user-space programs like virtual_oss(8) to act
as a Bluetooth speaker device.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@343903
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 3 Jan 2019 09:30:10 +0000 (09:30 +0000)]
MFC r342549:
Add USB quirk for SPL Crimson Rev 1.
PR: 234380
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@342729
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 3 Jan 2019 09:29:37 +0000 (09:29 +0000)]
MFC r342456:
Fix reading of USB sample rate descriptor for SPL Crimson Rev 1.
Read first one entry, then try to read the full rate descriptor table.
PR: 234380
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@342728
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sun, 11 Nov 2018 12:35:30 +0000 (12:35 +0000)]
MFC r340248:
Don't read the USB audio sync endpoint when we don't use it to save
isochronous bandwidth.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@340353
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Mon, 29 Oct 2018 21:46:12 +0000 (21:46 +0000)]
MFC r339366
Add support for Error Recovery
Submitted by:Vaishali.Kulkarni@cavium.com
git-svn-id: svn://svn.freebsd.org/base/stable/9@339887
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Mon, 29 Oct 2018 21:36:10 +0000 (21:36 +0000)]
MFC r338734
Fixed isses:
State check before enqueuing transmit task in bxe_link_attn() routine.
State check before invoking bxe_nic_unload in bxe_shutdown().
Submitted by:Vaishali.Kulkarni@cavium.com
git-svn-id: svn://svn.freebsd.org/base/stable/9@339885
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 29 Oct 2018 12:13:05 +0000 (12:13 +0000)]
MFC r339587:
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.
Submitted by: Gabor Simon <gabor.simon75@gmail.com>
PR: 225932
Differential revision: https://reviews.freebsd.org/D16639
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@339854
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 25 Oct 2018 14:57:33 +0000 (14:57 +0000)]
MFC r339582:
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.
Found by: Peter Holm <peter@holm.cc>
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@339722
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 25 Oct 2018 14:36:56 +0000 (14:36 +0000)]
MFC r339581:
Fix off-by-one which can lead to panics.
Found by: Peter Holm <peter@holm.cc>
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@339716
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dteske [Wed, 24 Oct 2018 23:31:33 +0000 (23:31 +0000)]
MFC r339509: Fix loader.conf(5) "password" feature
Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).
PR: kern/207069
Reported by: david@dcrosstech.com
Sponsored by: Smule, Inc.
git-svn-id: svn://svn.freebsd.org/base/stable/9@339699
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
avatar [Wed, 10 Oct 2018 22:45:08 +0000 (22:45 +0000)]
MFC r338200: Adding device ID for Terratec SiXPack 5.1+.
git-svn-id: svn://svn.freebsd.org/base/stable/9@339295
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 5 Oct 2018 07:52:28 +0000 (07:52 +0000)]
MFC r338993:
When multiple threads are involved receiving completion events in LibUSB
make sure there is always a master polling thread, by setting the "ctx_handler"
field in the context. Else the reception of completion events can stop.
This happens if event threads are created and destroyed during runtime.
Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231742
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@339191
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Wed, 19 Sep 2018 08:13:58 +0000 (08:13 +0000)]
MFC r338679:
Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.
Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231264
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@338793
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Wed, 19 Sep 2018 08:09:59 +0000 (08:09 +0000)]
MFC r338616:
Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.
Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231076
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@338790
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Tue, 18 Sep 2018 20:46:55 +0000 (20:46 +0000)]
MFC r309748 (by glebius):
Treat R_X86_64_PLT32 relocs as R_X86_64_PC32.
If we load a binary that is designed to be a library, it produces
relocatable code via assembler directives in the assembly itself
(rather than compiler options). This emits R_X86_64_PLT32 relocations,
which are not handled by the kernel linker.
Submitted by: gallatin
Reviewed by: kib
PR: 231451
git-svn-id: svn://svn.freebsd.org/base/stable/9@338756
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
avatar [Sun, 26 Aug 2018 13:05:12 +0000 (13:05 +0000)]
MFC r338038: Extending the delay cycles to give the codec more time to pump ADC data across the AC-link.
Without this patch, some CS4614 cards will need users to reload the driver manually or
the hardware won't be initialised properly. Something like:
# kldload snd_csa
# kldunload snd_csa
# kldload snd_csa
Tested with: Terratec SiXPack 5.1+
git-svn-id: svn://svn.freebsd.org/base/stable/9@338327
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dteske [Fri, 10 Aug 2018 20:07:59 +0000 (20:07 +0000)]
MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)
PR: bin/229806
Reported by: Andreas Sommer <andreas.sommer87@googlemail.com>
Sponsored by: Smule, Inc.
git-svn-id: svn://svn.freebsd.org/base/stable/9@337588
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Thu, 9 Aug 2018 00:52:38 +0000 (00:52 +0000)]
MFC r336438
Fixes for the following issues:
1. Fix taskqueues drain/free to fix panic seen when interface is being
bought down and in parallel asynchronous link events happening.
2. Fix bxe_ifmedia_status()
Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com
git-svn-id: svn://svn.freebsd.org/base/stable/9@337512
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 30 Jul 2018 09:29:32 +0000 (09:29 +0000)]
MFC r336632:
Update modify counter when setting a mixer control.
PR: 229969
git-svn-id: svn://svn.freebsd.org/base/stable/9@336891
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 30 Jul 2018 09:22:21 +0000 (09:22 +0000)]
MFC r335700:
Improve the kernel's USB descriptor reading function.
Some USB devices does not allow a partial descriptor readout.
Found by: bz@
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@336888
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 30 Jul 2018 09:18:45 +0000 (09:18 +0000)]
MFC r335669:
Improve the userspace USB string reading function in LibUSB.
Some USB devices does not allow a partial descriptor readout.
Found by: bz @
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@336885
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Wed, 9 May 2018 20:22:09 +0000 (20:22 +0000)]
MFC r333004
Fix Issue with adding MUltiCast Addresses. When multicast addresses are
added/deleted, the delete the multicast addresses previously programmed
in HW and reprogram the new set of multicast addresses.
Submitted by:Vaishali.Kulkarni@cavium.com
git-svn-id: svn://svn.freebsd.org/base/stable/9@333432
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Wed, 9 May 2018 18:39:31 +0000 (18:39 +0000)]
MFC r333003
Upgraded FW Related Files to version 5.4.67
git-svn-id: svn://svn.freebsd.org/base/stable/9@333423
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Thu, 5 Apr 2018 00:03:38 +0000 (00:03 +0000)]
MFC r331739
1. Add additional debug prints.
2. Break transmit when IFF_DRV_RUNNING is OFF.
3. set desc_count=0 for default case in switch in ql_rcv_isr()
git-svn-id: svn://svn.freebsd.org/base/stable/9@332054
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Tue, 6 Mar 2018 23:28:12 +0000 (23:28 +0000)]
MFC r329855
1. Added support to offline a port if is error recovery on successful.
2. Sysctls to enable/disable driver_state_dump and error_recovery.
3. Sysctl to control the delay between hw/fw reinitialization and
restarting the fastpath.
4. Stop periodic stats retrieval if interface has IFF_DRV_RUNNING flag off.
5. Print contents of PEG_HALT_STATUS1 and PEG_HALT_STATUS2 on heartbeat
failure.
6. Speed up slowpath shutdown during error recovery.
7. link_state update using atomic_store.
8. Added timestamp information on driver state and minidump captures.
9. Added support for Slowpath event logging
10.Added additional failure injection types to simulate failures.
git-svn-id: svn://svn.freebsd.org/base/stable/9@330557
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Tue, 27 Feb 2018 19:02:49 +0000 (19:02 +0000)]
Avoid using the C++11 auto keyword, which was introduced in r328555, as
part of an upstream change. This is not supported by gcc 4.2.1, which
is still the default system compiler for some architectures.
Direct commit to stable/9 and stable/10, since this does not apply to
stable/11 and head.
Reported by: jau@iki.fi
PR: 202665,226068
git-svn-id: svn://svn.freebsd.org/base/stable/9@330080
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 1 Feb 2018 13:17:42 +0000 (13:17 +0000)]
MFC r328623:
Properly implement the cond_resched() function macro in the LinuxKPI.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@328657
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Mon, 29 Jan 2018 18:11:27 +0000 (18:11 +0000)]
Pull in r217197 from upstream clang trunk (by Richard Smith):
PR20844: If we fail to list-initialize a reference, map to the
referenced type before retrying the initialization to produce
diagnostics. Otherwise, we may fail to produce any diagnostics, and
silently produce invalid AST in a -Asserts build. Also add a note to
this codepath to make it more clear why we were trying to create a
temporary.
This should fix assertions when parsing some forms of incomplete list
intializers.
Direct commit to stable/9 and stable/10, since stable/11 and head
already have this upstream fix.
Reported by: ajcbowhill@gmail.com
PR: 202665
git-svn-id: svn://svn.freebsd.org/base/stable/9@328555
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
bdrewery [Wed, 10 Jan 2018 21:59:21 +0000 (21:59 +0000)]
MFC r289410:
Avoid warning race with creating 'ldscripts' directory during build.
git-svn-id: svn://svn.freebsd.org/base/stable/9@327797
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Mon, 1 Jan 2018 20:39:12 +0000 (20:39 +0000)]
MFC r327164:
Fix clang 6.0.0 compiler warnings in binutils
Latest clang git has a warning -Wnull-pointer-arithmetic which will
trigger a -Werror failure. Addition and subtraction from a null pointer
is undefined behaviour and could be optimized into anything.
Furthermore, using the difference between two pointers and casting the
result back to a pointer is not portable since the size of ptrdiff_t
does not necessary have to be the same as size of void* (this happens
e.g. on CHERI). Using intptr_t instead fixes this portability issue and
the compiler warning.
Submitted by; Alexander Richardson
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D12928
git-svn-id: svn://svn.freebsd.org/base/stable/9@327471
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Mon, 1 Jan 2018 20:24:16 +0000 (20:24 +0000)]
MFC r327167:
Remove obsolete register keyword from opensolaris's sysmacros.h. When
compiling zfsd with recent clang, it leads to a warning about the
register storage class being incompatible with C++17.
git-svn-id: svn://svn.freebsd.org/base/stable/9@327470
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Tue, 19 Dec 2017 11:44:24 +0000 (11:44 +0000)]
MFC r326880:
Pull in r320755 from upstream clang trunk (by me):
Don't trigger -Wuser-defined-literals for system headers
Summary:
In D41064, I proposed adding `#pragma clang diagnostic ignored
"-Wuser-defined-literals"` to some of libc++'s headers, since these
warnings are now triggered by clang's new `-std=gnu++14` default:
$ cat test.cpp
#include <string>
$ clang -std=c++14 -Wsystem-headers -Wall -Wextra -c test.cpp
In file included from test.cpp:1:
In file included from /usr/include/c++/v1/string:470:
/usr/include/c++/v1/string_view:763:29: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<char> operator "" sv(const char *__str, size_t __len)
^
/usr/include/c++/v1/string_view:769:32: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len)
^
/usr/include/c++/v1/string_view:775:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len)
^
/usr/include/c++/v1/string_view:781:33: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len)
^
In file included from test.cpp:1:
/usr/include/c++/v1/string:4012:24: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<char> operator "" s( const char *__str, size_t __len )
^
/usr/include/c++/v1/string:4018:27: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<wchar_t> operator "" s( const wchar_t *__str, size_t __len )
^
/usr/include/c++/v1/string:4024:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<char16_t> operator "" s( const char16_t *__str, size_t __len )
^
/usr/include/c++/v1/string:4030:28: warning: user-defined literal suffixes not starting with '_' are reserved [-Wuser-defined-literals]
basic_string<char32_t> operator "" s( const char32_t *__str, size_t __len )
^
8 warnings generated.
Both @aaron.ballman and @mclow.lists felt that adding this workaround
to the libc++ headers was the wrong way, and it should be fixed in
clang instead.
Here is a proposal to do just that. I verified that this suppresses
the warning, even when -Wsystem-headers is used, and that the warning
is still emitted for a declaration outside of system headers.
Reviewers: aaron.ballman, mclow.lists, rsmith
Reviewed By: aaron.ballman
Subscribers: mclow.lists, aaron.ballman, andrew, emaste, cfe-commits
Differential Revision: https://reviews.llvm.org/D41080
This will allow to compile some of the libc++ headers in C++14 mode
(which is the default for gcc 6 and higher, and will be the default for
clang 6.0.0 and higher), with -Wsystem-headers and -Werror enabled.
Reported by: andrew
git-svn-id: svn://svn.freebsd.org/base/stable/9@326976
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 8 Dec 2017 15:30:59 +0000 (15:30 +0000)]
MFC r326362:
Disallow TUN and TAP character device IOCTLs to modify the network device
type to any value. This can cause page faults and panics due to accessing
uninitialized fields in the "struct ifnet" which are specific to the network
device type.
Found by: jau@iki.fi
PR: 223767
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@326693
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 4 Dec 2017 09:48:31 +0000 (09:48 +0000)]
MFC r326161:
Implement atomic_fetchadd_64() for i386. This function is needed by the
atomic64 header file in the LinuxKPI for i386.
Reviewed by: kib
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@326517
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 4 Dec 2017 09:36:47 +0000 (09:36 +0000)]
MFC r326392:
Properly define the VLAN_XXX() function macros to avoid miscompilation when
used inside "if" statements comparing with another value.
Detailed explanation:
"if (a ? b : c != 0)" is not the same like "if ((a ? b : c) != 0)"
which is the expected behaviour of a function macro.
Affects:
toecore, linuxkpi and ibcore.
Reviewed by: kib
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@326513
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 17 Nov 2017 15:32:27 +0000 (15:32 +0000)]
MFC r325533:
Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard
to the "dev" argument.
Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications
git-svn-id: svn://svn.freebsd.org/base/stable/9@325938
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 20 Oct 2017 10:07:17 +0000 (10:07 +0000)]
MFC r324445:
When showing the sleepqueues from the in-kernel debugger,
properly dump all the sleepqueues and not just the first one
History:
It appears that in the commit which introduced the code,
r165272, the array indexes of "sq_blocked[0]" and "td_name[i]"
were interchanged. In r180927 "td_name[i]" was corrected to
"td_name[0]", but "sq_blocked[0]" was left unchanged.
PR: 222624
Discussed with: kmacy @
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@324801
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Thu, 19 Oct 2017 17:57:38 +0000 (17:57 +0000)]
MFC r324538
Added support driver state capture/retrieval
git-svn-id: svn://svn.freebsd.org/base/stable/9@324766
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Thu, 19 Oct 2017 17:40:51 +0000 (17:40 +0000)]
MFC r324535
Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots
in Tx Ring map to empty slot in Tx_buf array before Transmits. If the
checks fail further Transmission on that Tx Ring is prevented.
git-svn-id: svn://svn.freebsd.org/base/stable/9@324765
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Thu, 5 Oct 2017 19:03:50 +0000 (19:03 +0000)]
MFC r324065
Tx Ring Shadow Consumer Index Register needs to be cleared prior
to passing it's physical address to the FW during Tx Create Context.
git-svn-id: svn://svn.freebsd.org/base/stable/9@324333
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Thu, 5 Oct 2017 19:01:47 +0000 (19:01 +0000)]
MFC r324026
Fix delete all multicast addresses
Submitted by: Anand.Khoje@cavium.com
git-svn-id: svn://svn.freebsd.org/base/stable/9@324332
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Tue, 26 Sep 2017 22:32:08 +0000 (22:32 +0000)]
MFC r323824
1. ql_hw.c:
In ql_hw_send() return EINVAL when TSO framelength exceeds max
supported length by HW.(davidcs)
2. ql_os.c:
In qla_send() call bus_dmamap_unload before freeing mbuf or
recreating dmmamap.(davidcs)
In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING
Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing
mbuf.
Submitted by: David.Bachu@netapp.com
git-svn-id: svn://svn.freebsd.org/base/stable/9@324036
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Tue, 26 Sep 2017 22:29:43 +0000 (22:29 +0000)]
MFC r323782
Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval
git-svn-id: svn://svn.freebsd.org/base/stable/9@324035
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Tue, 26 Sep 2017 22:28:00 +0000 (22:28 +0000)]
MFC r323781
Update minidump template for version 5.4.66
git-svn-id: svn://svn.freebsd.org/base/stable/9@324034
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Wed, 20 Sep 2017 14:46:24 +0000 (14:46 +0000)]
MFC r322530 and r323220:
Add new USB quirk(s).
PR: 221775
PR: 221328
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@323810
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
dim [Tue, 5 Sep 2017 17:35:33 +0000 (17:35 +0000)]
MFC r323001:
In compiler-rt, a few assembler implementations for i386 floating point
conversion functions use SSE2 instructions, but these are not guarded by
#ifdef __SSE2__, and there is no implementation using general purpose
registers. For these functions, use the generic C variants instead,
otherwise they will cause SIGILL on older processors.
Reported by: bsdpr@phoe.frmug.org
PR: 221733
MFC r323014:
Follow-up to r323001: if the actually selected CPUTYPE is capable of
SSE2 instructions, we can use them.
Suggested by: jkim
git-svn-id: svn://svn.freebsd.org/base/stable/9@323190
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Mon, 28 Aug 2017 18:01:36 +0000 (18:01 +0000)]
MFC 322771
Upgrade FW to 5.4.66
sysctls to display stats, stats polled every 2 seconds
Modify QLA_LOCK()/QLA_UNLOCK() to not sleep after acquiring mtx_lock
Add support to turn OFF/ON error recovery following heartbeat failure for
debug purposes.
Set default max values to 32 Tx/Rx/SDS rings
git-svn-id: svn://svn.freebsd.org/base/stable/9@322973
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Tue, 15 Aug 2017 12:28:16 +0000 (12:28 +0000)]
MFC r322248:
Fix for mlx4en(4) to properly call m_defrag().
The m_defrag() function can only defrag mbuf chains which have a valid
mbuf packet header. In r291699 when the mlx4en(4) driver was converted
into using BUSDMA(9), the call to m_defrag() was moved after the part
of the transmit routine which strips the header from the mbuf chain.
This effectivly disabled the mbuf defrag mechanism and such packets
simply got dropped.
This patch removes the stripping of mbufs from a chain and loads all
mbufs using busdma. If busdma finds there are no segments, unload
the DMA map and free the mbuf right away, because that means all
data in the mbuf has been inlined in the TX ring. Else proceed
as usual.
Add a per-ring rounter for the number of defrag attempts and
make sure the oversized_packets counter gets zeroed while at it.
The counters are per-ring to avoid excessive cache misses in the
TX path.
Submitted by: mjoras@
Differential Revision: https://reviews.freebsd.org/D11683
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322536
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 14 Aug 2017 13:37:46 +0000 (13:37 +0000)]
MFC r322306:
Print maximum MTU when trying to set invalid MTU in the mlx4en(4) driver.
Useful for debugging.
Submitted by: Sepherosa Ziehau <sephe@dragonflybsd.org>
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322506
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 14 Aug 2017 13:27:08 +0000 (13:27 +0000)]
MFC r322304:
Add support for RX and TX statistics when the mlx4en(4) PCI device
is in VF or SRIOV mode typically in a virtual machine environment.
Submitted by: Sepherosa Ziehau <sephe@dragonflybsd.org>
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322503
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 14 Aug 2017 13:25:35 +0000 (13:25 +0000)]
MFC r289577:
Merge LinuxKPI changes from DragonflyBSD:
- Map more Linux compiler related defines to FreeBSD ones.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322502
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 14 Aug 2017 13:15:13 +0000 (13:15 +0000)]
MFC r292537 and r314878:
Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE().
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322501
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 7 Aug 2017 13:27:35 +0000 (13:27 +0000)]
MFC r321782:
Remove some dead statistics related code and a structure field from the
mlx4en driver which is used by its Linux counterpart, but not under
FreeBSD.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322166
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 7 Aug 2017 13:17:57 +0000 (13:17 +0000)]
MFC r321772:
Fix broken usage of the mlx4_read_clock() function:
- return value has too small width
- cycle_t is unsigned and cannot be less than zero
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322163
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 7 Aug 2017 13:07:58 +0000 (13:07 +0000)]
MFC r321780:
Make sure on-stack buffer is properly aligned.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322160
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 7 Aug 2017 12:59:32 +0000 (12:59 +0000)]
MFC r321986:
Change reject message type when destroying cm_id in ibore.
This patch fixes an interopability issue between FreeBSD and non-FreeBSD
systems when the connection establishment is aborted. Refer to the
initial commit in Linux, drivers/infiniband/core/cm.c,
for a more detailed description.
Obtained from: Linux
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322157
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 7 Aug 2017 12:56:03 +0000 (12:56 +0000)]
MFC r321985:
Ticks are 32-bit in FreeBSD.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@322154
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
philip [Tue, 1 Aug 2017 13:40:37 +0000 (13:40 +0000)]
MFC r320941: Fix GRE over IPv6 tunnels with IPFW
Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless
net.inet6.ip6.fw.deny_unknown_exthdrs was unset).
PR: 220640
Submitted by: Kun Xie <kxie@xiplink.com>
git-svn-id: svn://svn.freebsd.org/base/stable/9@321874
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Wed, 26 Jul 2017 01:48:57 +0000 (01:48 +0000)]
MFC 321233
Raise the watchdog timer interval to 2 ticks, there by guaranteeing
that it fires between 1ms and 2ms. `
Treat two consecutive occurrences of Heartbeat failures as a legitimate
Heartbeat failure
git-svn-id: svn://svn.freebsd.org/base/stable/9@321503
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Wed, 26 Jul 2017 01:46:25 +0000 (01:46 +0000)]
MFC 320705
Release mtx hw_lock before calling pause() in qla_stop() and
qla_error_recovery()
git-svn-id: svn://svn.freebsd.org/base/stable/9@321501
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Wed, 26 Jul 2017 01:43:44 +0000 (01:43 +0000)]
MFC 320694
Allow MTU changes without ifconfig down/up
git-svn-id: svn://svn.freebsd.org/base/stable/9@321500
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Thu, 13 Jul 2017 15:12:01 +0000 (15:12 +0000)]
MFC r320876:
Make sure the mlx4en RX DMA ring gets stamped with software ownership
in order to prevent the flow of QP to error in the firmware once
UPDATE_QP is called.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@320946
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
delphij [Mon, 3 Jul 2017 02:18:10 +0000 (02:18 +0000)]
MFC r320494: Fix double free by reverting r300385 and r300624 which was
false positive reported by cppcheck.
git-svn-id: svn://svn.freebsd.org/base/stable/9@320583
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
davidcs [Mon, 26 Jun 2017 19:40:10 +0000 (19:40 +0000)]
MFC r320175
Add pkts_cnt_oversized to stats.
git-svn-id: svn://svn.freebsd.org/base/stable/9@320371
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
delphij [Sun, 25 Jun 2017 06:55:42 +0000 (06:55 +0000)]
MFC r320216: Fix use-after-free introduced in r300388.
In r300388, endnetconfig() was called on nc_handle which would release
the associated netconfig structure, which means tmpnconf->nc_netid
would be a use-after-free.
Solve this by doing endnetconfig() in return paths instead.
Reported by: jemalloc via kevlo
Reviewed by: cem, ngie (earlier version)
git-svn-id: svn://svn.freebsd.org/base/stable/9@320326
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sun, 18 Jun 2017 11:50:09 +0000 (11:50 +0000)]
MFC r319972:
Use static device numbering instead of dynamic one when creating
mlx4en network interfaces. This prevents infinite unit number growth
typically when the mlx4en driver is used inside virtual machines which
support runtime PCI attach and detach.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@320068
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sun, 4 Jun 2017 08:48:26 +0000 (08:48 +0000)]
MFC r319413:
Free hardware queue resource after port is stopped in the mlx4en(4)
driver. Else if the port is up the resource might still be busy and
the MTT free will fail.
PR: 216493
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@319568
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sun, 4 Jun 2017 08:30:55 +0000 (08:30 +0000)]
MFC r319414:
Allow communication between functions on the same host when using the
mlx4en(4) driver in SRIOV mode.
Place a copy of the destination MAC address in the send WQE only under
SRIOV/eSwitch configuration or when the device is in selftest. This
allows communication between functions on the same host.
PR: 216493
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@319565
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sun, 28 May 2017 10:45:28 +0000 (10:45 +0000)]
MFC r318860:
Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of
binary data from sound.ko and the kernel.
git-svn-id: svn://svn.freebsd.org/base/stable/9@319067
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Sat, 27 May 2017 08:28:51 +0000 (08:28 +0000)]
MFC r318820:
Increase the allowed maximum number of audio channels from 31 to 127
in the PCM feeder mixer. Without this change a value of 32 channels is
treated like zero, due to using a mask of 0x1f, causing a kernel
assert when trying to playback bitperfect 32-channel audio. Also
update the AWK script which is generating the division tables to
handle more than 18 channels. This commit complements r282650.
git-svn-id: svn://svn.freebsd.org/base/stable/9@318980
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Mon, 22 May 2017 08:20:50 +0000 (08:20 +0000)]
MFC r318531:
mlx4: Use the CQ quota for SRIOV when creating completion EQs
When creating EQs to handle CQ completion events for the PF or for
VFs, we create enough EQE entries to handle completions for the max
number of CQs that can use that EQ.
When SRIOV is activated, the max number of CQs a VF (or the PF) can
obtain is its CQ quota (determined by the Hypervisor resource
tracker). Therefore, when creating an EQ, the number of EQE entries
that the VF should request for that EQ is the CQ quota value (and not
the total number of CQs available in the firmware).
Under SRIOV, the PF, also must use its CQ quota, because the resource
tracker also controls how many CQs the PF can obtain.
Using the firmware total CQs instead of the CQ quota when creating EQs
resulted wasting MTT entries, due to allocating more EQEs than were
needed.
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@318629
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f
hselasky [Fri, 19 May 2017 13:05:40 +0000 (13:05 +0000)]
MFC r317505:
Don't free uninitialized sysctl contexts in the mlx4en driver. This
can cause NULL pointer panics during failed device attach.
Differential Revision: https://reviews.freebsd.org/D8876
Sponsored by: Mellanox Technologies
git-svn-id: svn://svn.freebsd.org/base/stable/9@318541
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f