Commit Graph

33918 Commits

Author SHA1 Message Date
Navdeep Parhar
6320b0f850 cxgbe(4): Always use the first and not the last virtual interface
associated with a port in begin_synchronized_op.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-08-04 01:28:06 +00:00
Navdeep Parhar
f856f099cb cxgbe(4): Initial import of the "collect" component of Chelsio unified
debug (cudbg) code, hooked up to the main driver via an ioctl.

The ioctl can be used to collect the chip's internal state in a
compressed dump file.  These dumps can be decoded with the "view"
component of cudbg.

Obtained from:	Chelsio Communications
MFC after:	2 months
Sponsored by:	Chelsio Communications
2017-08-03 14:43:30 +00:00
Hans Petter Selasky
713dd5cb9e Resolve locking issue for non-sleepable context in the mlx5core.
Code inspection reveals the busdma unload and free functions
do not write to the belonging dma tag and does not need to be
serialized. This allows mlx5_fwp_free() to be called from
software interrupt context.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2017-08-03 09:14:43 +00:00
Hans Petter Selasky
1d4905b5b0 Using GFP_ATOMIC with firmware commands is not supported after busdma was
introduced in the mlx5core, because busdma might sleep when loading memory
into DMA.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2017-08-03 09:11:51 +00:00
Mark Johnston
069555390b Remove D_TRACKCLOSE now that ksyms no longer has a close method.
Reported by:	jhb
X-MFC with:	r321963
2017-08-03 05:55:01 +00:00
Sepherosa Ziehau
fe167cce54 hyperv/kvp: Use proper size macro for adapter id.
Submitted by:	Christopher Ertl <Christopher.Ertl microsoft com>
MFC after:	3 days
Sponsored by:	Microsoft
2017-08-03 01:44:40 +00:00
Mark Johnston
22e406c80b Rework and simplify the ksyms(4) implementation.
- Store the symbol table contents in an anonymous swap-backed object. Have
  mmap(/dev/ksyms) map that object, and stop mapping the symbol table into
  the calling process in ksyms_open(). Previously we would cache a pointer
  to the pmap of the opening process, and mmap(/dev/ksyms) would create a
  mapping using the physical address found by a pmap lookup at the initial
  mapping address. However, this assumes that the cached pmap is valid,
  which may not be the case. [1]
- Remove the ksyms ioctl interface. It appears to have been added to work
  around a limitation in libelf that no longer exists; see r321842.
  Moreover, the interface is difficult to support and isn't present in
  illumos. Since ksyms was added specifically to support lockstat(1), it
  is expected that this removal won't have any real impact.
- Simplify ksyms_read() to avoid unnecessary copying.
- Don't call the device handle destructor if we fail to capture a snapshot
  of the kernel's symbol table. devfs will do that for us.

Reported by:	Ilja van Sprundel <ivansprundel@ioactive.com> [1]
Reviewed by:	kib (previous revision)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11789
2017-08-03 00:38:13 +00:00
Marius Strobl
cd85acba1a - Correct the remainder of confusing and error prone mix-ups between
"br" or "bridge" where - according to the terminology outlined in
  comments of bridge.h and mmcbr_if.m  around since their addition in
  r163516 - the bus is meant and used instead. Some of these instances
  are also rather old, while those in e. g. mmc_subr.c are as new as
  r315430 and were caused by choosing mmc_wait_for_request(), i. e. the
  one pre-r315430 outliner existing in mmc.c, as template for function
  parameters in mmc_subr.c inadvertently. This correction translates to
  renaming "brdev" to "busdev" and "mmcbr" to "mmcbus" respectively as
  appropriate.
  While at it, also rename "reqdev" to just "dev" in mmc_subr.[c,h]
  for consistency with was already used in mmm.c pre-r315430, again
  modulo mmc_wait_for_request() that is.
- Remove comment lines from bridge.h incorrectly suggesting that there
  would be a MMC bridge base class driver.
- Update comments in bridge.h regarding the star topology of SD and SDIO;
  since version 3.00 of the SDHCI specification, for eSD and eSDIO bus
  topologies are actually possible in form of so called "shared buses"
  (in some subcontext later on renamed to "embedded" buses).
2017-08-02 21:11:51 +00:00
Roger Pau Monné
d4ed36cde2 pci: fix write order when sizing BARs
According to the PCI Local Specification rev. 3.0 in case of a 64-bit
BAR both the low and the high parts of the register should be set to
~0 before attempting to read back the size.

So far I have found no single device that has problems with the
previous approach, but I think it's better to stay on the safe size.

This commit should not introduce any functional change.

MFC after:		3 weeks
Sponsored by:		Citrix Systems R&D
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D11750
2017-08-01 10:47:44 +00:00
Alexander Motin
40715e9ed7 Add explicit check for PCI bus to r321720.
Reported by:	jhb
MFC after:	6 days
2017-08-01 09:22:10 +00:00
Ian Lepore
94759a2448 Add a driver for the Intersil ISL12xx family of i2c RTC chips.
Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC
functionality, not all the other fancy stuff the chips can do).
2017-08-01 04:16:52 +00:00
Sepherosa Ziehau
f41e0df406 hyperv/hn: Add comment about ether_ifattach event subscription.
MFC after:	3 days
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D11710
2017-08-01 02:55:43 +00:00
Sepherosa Ziehau
962f035786 hyperv/hn: Renaming and minor cleanup
This prepares for the upcoming transparent VF support.

MFC after:	3 days
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D11708
2017-08-01 02:45:54 +00:00
Ian Lepore
012e41a7a8 Bugfixes and enhancements...
Don't enable the oscillator when it is found to be stopped at init time,
just let the first setting of valid time start it.  But still report a dead
battery if it's stopped at init time.

Don't force the chip into 24hr mode, just cope with whatever mode it is
already in.

Schedule the clock_settime() callbacks to align the RTC clock to top of
second when setting it.
2017-07-31 22:00:00 +00:00
Ian Lepore
13fd9ff767 No need to call getnanotime() now that the waiting is done by the central
subr_rtc code, switch from CLOCKF_SETTIME_NO_TS to CLOCKF_SETTIME_NO_ADJ
so that we get fed a timestamp, but it's not adjusted to compensate for
inaccuracy in setting time.
2017-07-31 21:53:00 +00:00
Scott Long
2068b2aa88 Fix a logic bug in the split PCI interrupt code that slipped through
Reported by:	Harry Schmalzbauer
2017-07-31 16:55:56 +00:00
Ian Lepore
def6c0c3ee Restore a few rather important lines of code that got fumbled in r321746. 2017-07-31 16:46:16 +00:00
Ian Lepore
bf9c1267f3 Check the clock-halted flag every time the clock is read, not just once
at startup.  The flag stays set until the clock is loaded with good time,
so we need to keep saying the time is invalid until that happens.
2017-07-31 15:24:40 +00:00
Ian Lepore
ccf32b9887 Add a detach() method. 2017-07-31 14:58:01 +00:00
Ian Lepore
cf24e991a6 Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
that transfers will be done with proper ownership of the bus. No
behavioral changes.  Also add a detach() method.
2017-07-31 14:57:02 +00:00
Hans Petter Selasky
3f38293d29 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
MFC after:	1 week
2017-07-31 12:09:24 +00:00
Hans Petter Selasky
f40410e868 Make sure on-stack buffer is properly aligned.
Sponsored by:	Mellanox Technologies
MFC after:	1 week
2017-07-31 12:03:45 +00:00
Hans Petter Selasky
b0259ad374 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
MFC after:	1 week
2017-07-31 09:15:15 +00:00
Ian Lepore
4c0c8a36da Remove now-unused variable. 2017-07-31 03:19:16 +00:00
Ian Lepore
02d094ff04 Use the new clock_schedule() to arrange for clock_settime() to be called
at the right time to keep the RTC hardware time in sync, instead of using
pause_sbt() to sleep until the right time.
2017-07-31 01:36:51 +00:00
Scott Long
b618318ae3 Don't re-parse PCI IDs in order to set card-specific flags, use
the flags field in the PCIID table.
2017-07-31 00:05:49 +00:00
Andriy Voskoboinyk
9dba612805 rtwn_usb: add support for fragmented Rx.
Since device can pass multiple frames in a single payload temporary
Rx buffer was big enough to hold all of them; now the driver can
concatenate a single frame from multiple payloads.

The Rx buffer size may be configured via tunable (dev.rtwn.%d.rx_buf_size).

Tested with:
 - rtl8188cus, rtl8188eu and rtl8821au (STA mode).
 - (by kevlo) rtl8192cu and rtl8188eu.

PR:		218527
Reviewed by:	kevlo
Differential Revision:	https://reviews.freebsd.org/D11705
2017-07-30 23:35:21 +00:00
Scott Long
055e2653d4 Change from using underbar function names to normal function names for
the informational print functions.  Collapse the debug API a bit to be
more generic and not require as much code duplication.  While here, fix
a bug in MPS that was already fixed in MPR.
2017-07-30 22:34:24 +00:00
Andriy Voskoboinyk
a08e9300f3 zyd: code cleanup + drop unneeded cast.
No functional change intended.
2017-07-30 22:17:08 +00:00
Andriy Voskoboinyk
ff97f477b9 rtwn: drop unnecessary / wrong conversion.
The 'chan' field occupies only one byte.
2017-07-30 21:50:45 +00:00
Ian Lepore
2e639013ed Fix AM/PM mode handling. The bits to mask off in the hours register changes
between 12/24 hour mode.  Also fix conversion between 12 and 24 hour mode.
It's not as easy as adding/subtracting 12, because the clock doesn't roll
over 11->0, it rolls over 12->1; 0 isn't a valid hour in AM/PM mode.
2017-07-30 19:58:31 +00:00
Ian Lepore
d0462804d4 Bugfixes and enhancements...
Don't enable the oscillator when it is found to be stopped at init time,
just let the first setting of valid time start it.  But still report a dead
battery if it's stopped at init time.

Don't force the chip into 24hr mode, just cope with whatever mode it is
already in.

Align the RTC clock to top of second when setting it.
2017-07-30 18:46:38 +00:00
Hans Petter Selasky
bd9175e1aa Properly range check length of parsed information elements in RSU driver.
Found by:		Ilja van Sprundel <ivansprundel@ioactive.com>
MFC after:		3 days
Sponsored by:		Mellanox Technologies
2017-07-30 16:45:28 +00:00
Ian Lepore
723a81dec6 Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
that transfers will be done with proper ownership of the bus. No
behavioral changes.
2017-07-30 16:17:06 +00:00
Alexander Motin
26567f6924 Attach ichwd(4) only to ISA bus of the LPC bridge.
Resource allocation for parent device does not look good by itself, but
attempt to allocate them for unrelated device just does not end up good.
On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI
this reported to cause kernel panic on shutdown due to messed resources:
https://bugs.freenas.org/issues/25237.

MFC after:	1 week
2017-07-30 15:19:07 +00:00
Scott Long
252b2b4f4f Split the interrupt setup code into two parts: allocation and configuration.
Do the allocation before requesting the IOCFacts message.  This triggers
    the LSI firmware to recognize the multiqueue should be enabled if available.
    Multiqueue isn't used by the driver yet, but this also fixes a problem with
    the cached IOCFacts not matching latter checks, leading to potential problems
    with error recovery.

    As a side-effect, fetch the driver tunables as early as possible.

Reviewed by:	slm
Obtained from:	Netflix
Differential Revision:	D9243
2017-07-30 06:53:58 +00:00
Ian Lepore
e25f1cf5be Fix building this driver on non-FDT platforms. 2017-07-30 00:00:30 +00:00
Ian Lepore
207fe81ea8 Replace the pcf8563 i2c RTC driver with a new nxprtc driver which handles
all the chips in the NXP PCA212x and PCA/PCF85xx series.  In addition to
supporting more chips, this driver uses the countdown timer on the chips as
a fractional seconds counter, giving it a resolution of about 15 milliseconds.
2017-07-29 23:45:57 +00:00
Ian Lepore
d35f6548e6 Add inline functions to convert between sbintime_t and decimal time units.
Use them in some existing code that is vulnerable to roundoff errors.

The existing constant SBT_1NS is a honeypot, luring unsuspecting folks into
writing code such as long_timeout_ns*SBT_1NS to generate the argument for a
sleep call.  The actual value of 1ns in sbt units is ~4.3, leading to a
large roundoff error giving a shorter sleep than expected when multiplying
by the trucated value of 4 in SBT_1NS.  (The evil honeypot aspect becomes
clear after you waste a whole day figuring out why your sleeps return early.)
2017-07-29 17:00:23 +00:00
Kristof Provost
83699dfd09 vtnet: Support jumbo frames without TSO/GSO
Currently in Virtio driver without TSO/GSO features enabled, the max scatter
gather segments for the TX path can be 4, which limits the support for 9K JUMBO
frames. 9K JUMBO frames results in more than 4 scatter gather segments and
virtio driver fails to send the frame down to host OS. With TSO/GSO feature
enabled max scatter gather segments can be 64, then 9K JUMBO frames are fine,
this is making virtio driver to support JUMBO frames only with TSO/GSO.

Increasing the VTNET_MIN_TX_SEGS which is the case for non TSO/GSO to 32 to
support upto 64K JUMBO frames to Host.

Submitted by:	Lohith Bellad <lohithbsd@gmail.com>
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8803
2017-07-29 09:22:48 +00:00
Navdeep Parhar
f8d0488ec6 cxgbe/iw_cxgbe: Log the end point's history and flags to the trace
buffer just before it's freed.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2017-07-28 22:28:45 +00:00
Jung-uk Kim
5f9b24fa43 Merge ACPICA 20170728. 2017-07-28 22:23:29 +00:00
Mark Johnston
1e16346226 Fix style bugs in ksyms.c.
No functional change intended.

MFC after:	3 days
2017-07-28 03:18:18 +00:00
Mark Johnston
7c86ae1a00 Restrict permissions on /dev/ksyms to 0400.
The ksyms(4) device was added specifically for use by lockstat(1), which
as a DTrace consumer must run as root.

Discussed with:	emaste
MFC after:	3 days
2017-07-28 03:14:31 +00:00
Sean Bruno
b7e0bde0af Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
queue lock when the uppoer stack is called inside TCP_LRO

Submitted by:	Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by:	erj
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D11724
2017-07-27 23:01:07 +00:00
Sean Bruno
9bc7588cb6 Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
were redundant and not being used to set anything up.

Submitted by:	Matt Macy <mmacy@mattmacy.io>
Reported by:	Jeb Cramer <cramerj@intel.com>
Sponsored by:	Limelight Networks
2017-07-27 21:21:43 +00:00
Kenneth D. Merry
fefd924a01 Remove duplicate assignments from r321622.
Submitted by:	mav
MFC after:	3 days
Sponsored by:	Spectra Logic
2017-07-27 15:51:56 +00:00
Kenneth D. Merry
a0acb3512c Fix probing FC targets with hard addressing turned on.
This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.

The intent of that change was to keep loop IDs persistent across
chip reinits.

The problem is that the change turned on the PREVLOOP /
PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
Qlogic chip to not participate in the loop if it can't get the
requested loop address.  It also turned off soft addressing on 2400
(4Gb) and newer controllers.

The isp(4) driver defaults to loop address 0, and the tape drives
I have tested default to loop address 0 if hard addressing is turned
on.  So when hard loop addressing is turned on on the drive, the isp(4)
driver just refuses to participate in the loop.

The solution is to largely revert that change.  I left some elements
in place that are related to virtual ports, since they were new.

This does work with IBM tape drives with hard and soft addressing
turned on.  I have tested it with 4Gb, 8Gb, and 16Gb controllers.

sys/dev/isp.c:
	Largely revert FreeBSD SVN change 289937.  I left the
	ispmbox.h changes in place.

	Don't use the PREV_ADDRESS bit on initialization.  It tells
	the chip to not participate if it can't get the requested
	loop ID.

	Do use soft addressing on 2400 and newer chips.

	Use hard addressing when the user has requested a specific
	initiator ID.  (hint.isp.X.iid=N in /boot/loader.conf)

	Leave some of the virtual port options from that change in
	place, but don't turn on the PREV_ADDRESS bit.

Reviewed by:	mav
MFC after:	3 days
Sponsored by:	Spectra Logic
2017-07-27 15:33:57 +00:00
Ed Maste
059178b639 uart: add AX99100 chipset support
PR:		215837
Submitted by:	joe@thrallingpenguin.com
MFC after:	2 weeks
2017-07-27 02:53:18 +00:00
Luiz Otavio O Souza
0e779c2f7b Fix the port vlan support in e6000 based switches.
Reduce the use of local copies of switch register data.

The switch now works with the upstream dsa node (i.e. the upstream DTS).

Tested on:	ClearFog Pro (88E6176), SG-3100 (88E6141)
Sponsored by:	Rubicon Communications, LLC (Netgate)
2017-07-27 02:38:53 +00:00