Commit Graph

29765 Commits

Author SHA1 Message Date
Adrian Chadd
5433f3578a otus(4): begin supporting raw transmit parameters in otus_tx()
* Add a comment about the parameters I should support, stolen shamelessly
  from iwn(4);
* Implement the rate bit for the raw transmit path;
* Print out the host-order versions of each of the transmit bits, so
  I have a hope in heck of debugging why things are going wrong.

This still doesn't fix 5GHz in the office but that's likely due to a lot
of other configuration parameters being 2GHz-specific.  That'll come next.

Tested:

* AR9170 + AR9103 (2/5GHz) 2x2, 5GHz association
2015-10-23 00:48:00 +00:00
Conrad Meyer
592fe72d77 ioat_test: Add a colon (':') for style
Missed in r289776.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 23:08:08 +00:00
Conrad Meyer
1c25420ea8 ioat: Clean up logging
Replace custom Linux-like logging with a thin shim around
device_printf(), when the softc is available.

In ioat_test, shim around printf(9) instead.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 23:03:33 +00:00
Conrad Meyer
f09b75d4b5 if_ntb: Use ffsll() now that it is broadly available
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 23:03:24 +00:00
Conrad Meyer
0a7663c2c0 NTB: Add device introspection sysctl hierarchy
This should export all of the same information as the Linux ntb_hw_intel
debugfs info file, but with a bit more structure, in the sysctl tree
rooted at 'dev.ntb_hw.<N>.debug_info'.

Raw registers are marked as OPAQUE because reading them on some hardware
revisions may cause a hard lockup (NTB errata).  They can be read with
'sysctl -x dev.ntb_hw.<N>.debug_info.registers'.  On Xeon platforms,
some additional registers are available under 'registers.xeon_stats' and
'registers.xeon_hw_err'.  They are exported as big-endian values so that
the 'sysctl -x' output is legible.

Shrink the feature mask to 32 bits so we can use the %b formatter in
'debug_info.features'.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 23:03:15 +00:00
Conrad Meyer
7afbb2638e ioat: Fix some attach/detach issues
Don't run the selftest until after we've enabled bus mastering, or the
DMA engine can't copy anything for our test.

Create the ioat_test device on attach, if so tuned.  Destroy the
ioat_test device on teardown.

Replace deprecated 'CALLOUT_MPSAFE' with correct '1' in callout_init().

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 16:46:21 +00:00
Andriy Voskoboinyk
5a5461d8e0 urtwn(4): replace hardcoded rate indices with their names
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3967
2015-10-22 15:42:53 +00:00
Andriy Voskoboinyk
f9e5b3821a wtap: remove some obsolete radiotap(9) code
This code is not needed since r192468.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3975
2015-10-22 15:20:33 +00:00
Alexander Motin
ed8ba339fe Remove residual verbosity.
firmware_register() already reports errors.
2015-10-22 15:13:47 +00:00
Andriy Voskoboinyk
cc52232057 Initialize radiotap header fields before calling ieee80211_radiotap_rx()
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3951
2015-10-22 12:15:40 +00:00
Hans Petter Selasky
2da3897d01 Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is a
kernel programming interface module, KPI, to avoid confusion with the
existing Linux userspace binary compatibility shims. Bump the
FreeBSD_version number.

Reviewed by:	np @
Suggested by:	dumbbell @
Sponsored by:	Mellanox Technologies
2015-10-22 09:50:45 +00:00
Conrad Meyer
7c69db50df Improve flexibility of ioat_test / ioatcontrol(8)
The test logic now preallocates memory before running the test.

The buffer size is now configurable.  Post-copy verification is
configurable.  The number of copies to chain into one transaction (one
interrupt) is configurable.

A 'duration' mode is added, which repeats the test until the duration
has elapsed, reporting the B/s and transactions completed.

ioatcontrol.8 has been updated to document the new arguments.

Initial limits (on this particular Broadwell-DE) (and when the
interrupts are working) seem to be: 256 interrupts/sec or ~6 GB/s,
whichever limit is more restrictive.

Unfortunately, it seems the interrupt-reset handling on Broadwell isn't
working as intended.  That will be fixed in a later commit.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:38:05 +00:00
Conrad Meyer
b81eee4a22 ioat: Define IOAT_XFERCAP_VALID_MASK and use in ioat_read_xfercap
Instead of ANDing a magic constant later.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:33:05 +00:00
Kevin Lo
92619f554a Fix IEEE80211_ADDR_COPY() usage.
Reviewed by:	adrian
2015-10-22 01:36:16 +00:00
Ian Lepore
b180eb215d Add FDT compatibility to the icee driver.
The FDT bindings for eeprom parts don't include any metadata about the
device other than the part name encoded in the compatible property.
Instead, a driver is required to have a compiled-in table of information
about the various parts (page size, device capacity, addressing scheme).  So
much for FDT being an abstract description of hardware characteristics, huh?

In addition to the FDT-specific changes, this also switches to using the
newer iicbus_transfer_excl() mechanism which holds bus ownership for the
duration of the transfer.  Previously this code held the bus across all
the transfers needed to complete the user's IO request, which could be
up to 128KB of data which might occupy the bus for 10-20 seconds.  Now the
bus will be released and re-aquired between every page-sized (8-256 byte)
transfer, making this driver a much nicer citizen on the i2c bus.

The hint-based configuration mechanism is still in place for non-FDT systems.

Michal Meloun contributed some of the code for these changes.
2015-10-22 01:04:31 +00:00
Ian Lepore
4c1e5d32b2 Add iicbus_transfer_excl(), a helper routine to do an i2c bus transaction
while holding exclusive ownership of the bus.  This is the routine most
slave drivers should use unless they have a need to acquire and hold the
bus across a series of related operations that involves multiple transfers.
2015-10-22 00:54:59 +00:00
John Baldwin
d836c868a8 i915_gem_do_execbuffer() holds the pages backing each relocation region for
various reasons while executing user commands.  After these commands are
completed, the pages backing the relocation regions are unheld.

Since relocation regions do not have to be page aligned, the code in
validate_exec_list() allocates 2 extra page pointers in the array of
held pages populated by vm_fault_quick_hold_pages().  However, the cleanup
code that unheld the pages always assumed that only the buffer size /
PAGE_SIZE pages were used.  This meant that non-page aligned buffers would
not unheld the last 1 or 2 pages in the list.  Fix this by saving the
number of held pages returned by vm_fault_quick_hold_pages() for each
relocation region and using this count during cleanup.

Reviewed by:	dumbbell, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3965
2015-10-21 20:49:45 +00:00
Alexander Motin
d775427348 Pass proper device to pci_read_config().
For some reason JMicron driver was different from others at this point.
2015-10-21 17:27:43 +00:00
Ian Lepore
9a2bb68894 Fix parsing of I2C addresses properties in fdt data. I2C address is
represented in 7-bits format in DT files, but system expect it in 8-bit
format.  Also, fix two drivers that locally hack around this bug.

Submitted by:	Michal Meloun <meloun@miracle.cz>
2015-10-21 15:41:16 +00:00
Roger Pau Monné
3778878d7c netfront: fix LINT-NOIP
r289587 broke LINT-NOIP kernels because the lro and queued local variables
are defined but not used. Add preprocessor guards around them.

Reported by:	emaste
Sponsored by:	Citrix Systems R&D
2015-10-21 13:53:07 +00:00
Roger Pau Monné
2f9ec994bc xen: Code cleanup and small bug fixes
xen/hypervisor.h:
 - Remove unused helpers: MULTI_update_va_mapping, is_initial_xendomain,
   is_running_on_xen
 - Remove unused define CONFIG_X86_PAE
 - Remove unused variable xen_start_info: note that it's used inpcifront
   which is not built at all
 - Remove forward declaration of HYPERVISOR_crash

xen/xen-os.h:
 - Remove unused define CONFIG_X86_PAE
 - Drop unused helpers: test_and_clear_bit, clear_bit,
   force_evtchn_callback
 - Implement a generic version (based on ofed/include/linux/bitops.h) of
   set_bit and test_bit and prefix them by xen_ to avoid any use by other
   code than Xen. Note that It would be worth to investigate a generic
   implementation in FreeBSD.
 - Replace barrier() by __compiler_membar()
 - Replace cpu_relax() by cpu_spinwait(): it's exactly the same as rep;nop
   = pause

xen/xen_intr.h:
 - Move the prototype of xen_intr_handle_upcall in it: Use by all the
   platform

x86/xen/xen_intr.c:
 - Use BITSET* for the enabledbits: Avoid to use custom helpers
 - test_bit/set_bit has been renamed to xen_test_bit/xen_set_bit
 - Don't export the variable xen_intr_pcpu

dev/xen/blkback/blkback.c:
 - Fix the string format when XBB_DEBUG is enabled: host_addr is typed
   uint64_t

dev/xen/balloon/balloon.c:
 - Remove set but not used variable
 - Use the correct type for frame_list: xen_pfn_t represents the frame
   number on any architecture

dev/xen/control/control.c:
 - Return BUS_PROBE_WILDCARD in xs_probe: Returning 0 in a probe callback
   means the driver can handle this device. If by any chance xenstore is the
   first driver, every new device with the driver is unset will use
   xenstore.

dev/xen/grant-table/grant_table.c:
 - Remove unused cmpxchg
 - Drop unused include opt_pmap.h: Doesn't exist on ARM64 and it doesn't
   contain anything required for the code on x86

dev/xen/netfront/netfront.c:
 - Use the correct type for rx_pfn_array: xen_pfn_t represents the frame
   number on any architecture

dev/xen/netback/netback.c:
 - Use the correct type for gmfn: xen_pfn_t represents the frame number on
   any architecture

dev/xen/xenstore/xenstore.c:
 - Return BUS_PROBE_WILDCARD in xctrl_probe: Returning 0 in a probe callback
   means the driver can handle this device. If by any chance xenstore is the
  first driver, every new device with the driver is unset will use xenstore.

Note that with the changes, x86/include/xen/xen-os.h doesn't contain anymore
arch-specific code. Although, a new series will add some helpers that differ
between x86 and ARM64, so I've kept the headers for now.

Submitted by:		Julien Grall <julien.grall@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3921
Sponsored by:		Citrix Systems R&D
2015-10-21 10:44:07 +00:00
Alexander Motin
b5024bfde9 Some more defines and polishing for INIT_FIRMWARE. 2015-10-21 08:23:19 +00:00
Kevin Lo
b020e15ebd Remove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it's
no valid flag there.
2015-10-21 06:23:57 +00:00
Kevin Lo
4b0d8bec6b Switch PCI register reads from using magic numbers to using the names
defined in pcireg.h
2015-10-21 02:50:22 +00:00
Adrian Chadd
8f1cf028d3 AR8327: Fix up the ability to configure the vlangroup configuration for the CPU port
I messed up when doing the reset_vlans method - setting vid[0] = 1 here
was making it 'hidden' from configuration (as it needed ETHERSWITCH_VID_VALID
as well) and so there was no way to configure vlangroup0.

In per-port VLAN mode, vlangroup0 is for the CPU port (port0).
Now, it normally wouldn't really matter - the CPU port thus sees
all other ports. However there are two CPU ports on the AR8327 and
so port0 (arge0) was seeing all traffic on port6 (arge1).
If you thus tried to use arge1/port6 for anything (eg a WAN port)
in a bridge group then things would very upset very quickly.

Whilst here, add a comment to remind myself that yes, it'd be nice
if we could specify a boot-time switch config.

Tested:

* AP135 reference platform w/ AR8327N switch
2015-10-20 21:18:02 +00:00
Jean-Sébastien Pédron
238b89fcad iicbus: Use device_delete_children() instead of explicit child removal
If the bus is detached and deleted by a call to device_delete_child() or
device_delete_children() on a device higher in the tree, I²C children
were already detached and deleted. So the device_t pointer stored in sc
points to freed memory: we must not try to delete it again.

By using device_delete_children(), we let subr_bus.c figure out if there
are children to take care of.

While here, make sure iicbus_detach() and iicoc_detach() call
device_delete_children() too, to be safe.

Reviewed by:	jhb, imp
Approved by:	jhb, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3926
2015-10-20 19:52:59 +00:00
Jean-Sébastien Pédron
b90d6d94c1 iicbus: Remove trailing whitespaces
MFC after:	1 week
2015-10-20 19:47:08 +00:00
Conrad Meyer
a69ff5b1ee NTB: Revert r289645
Per Benno, this is a Linuxism we do not need in FreeBSD.

Suggested by:	benno
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:32:16 +00:00
Conrad Meyer
d9503a7fcd if_ntb: Diff-reduce with Linux; add queue index type
Add ntb_q_idx_t so it is more clear which struct members are of the same
type (some bogus uint64_ts snuck in that should have been unsigned int).

Add tx_err_no_buf and s/ENOMEM/EBUSY/ in tx_enqueue to match Linux.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:21:01 +00:00
Conrad Meyer
2d6501b281 NTB: MFV 8c9edf63: Fix zero size or integer overflow in ntb_set_mw
A plain 32 bit integer will overflow for values over 4GiB.

Change the plain integer size to the appropriate size type in
ntb_set_mw.  Change the type of the size parameter and two local
variables used for size.

Even if there is no overflow, a size of zero is invalid here.

Authored by:	Allen Hubbe
Reported by:	Juyoung Jung
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:52 +00:00
Conrad Meyer
4994fe1295 NTB: MFV da2e5ae5: Fix ntb_transport out-of-order RX update
It was possible for a synchronous update of the RX index in the error
case to get ahead of the asynchronous RX index update in the normal
case.  Change the RX processing to preserve an RX completion order.

There were two error cases.  First, if a buffer is not present to
receive data, there would be no queue entry to preserve the RX
completion order.  Instead of dropping the RX frame, leave the RX frame
in the ring.  Schedule RX processing when RX entries are enqueued, in
case there are RX frames waiting in the ring to be received.

Second, if a buffer is too small to receive data, drop the frame in the
ring, mark the RX entry as done, and indicate the error in the RX entry
length.  Check for a negative length in the receive callback in
ntb_netdev, and count occurrences as rx_length_errors.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:42 +00:00
Conrad Meyer
8a26cf17c6 if_ntb: Correct over-long lines, use qmin()
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:33 +00:00
Conrad Meyer
bbea13c586 if_ntb: Use if_printf instead of device_printf
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:24 +00:00
Conrad Meyer
eccd1f0a14 NTB: MFV 2f887b9a: Rename Intel code names to platform names
Mechanically replace "SOC" with "ATOM" to match Linux.  No functional
change.  Original Linux commit log follows:

Instead of using the platform code names, use the correct platform names
to identify the respective Intel NTB hardware.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:15 +00:00
Conrad Meyer
3a8a0a9dfa NTB: Don't abort if setting a MW write-combine fails
Also log BAR mapping results more verbosely.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:06 +00:00
Conrad Meyer
217453caed NTB: Fix typo in bar5 tunables
Typo introduced in r289614.

Pointy-hat:	cem
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:19:57 +00:00
Conrad Meyer
43a191ed78 NTB: MFV 7eb38781: Print driver name in module init
Prints driver name to indicate what is being loaded.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:19:48 +00:00
David C Somayajulu
467dcb5a1f ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
ql_os.c: removed unnecessary debug printf
ql_ver.h: updated version number
MFC after:5 days
2015-10-20 17:27:11 +00:00
Alexander Motin
21c2207ffc Update firmware images for Qlogic 24xx/25xx from 5.5.0 to 7.3.0.
This also removes separate "_multi" images, since this funcationality is
now in base, and there is simply no new images without it for years.
2015-10-20 12:27:59 +00:00
Alexander Motin
b363245a31 Zero mbox[0] for INIT_FIRMWARE to fix version 7.3 firmware.
While there, add new fields to isp_icb_2400_t structure.
2015-10-20 10:16:03 +00:00
Alexander Motin
261286a787 Decode more firmware attributes. 2015-10-20 08:29:30 +00:00
Conrad Meyer
5165422dff NTB: Clean up safely if attach fails early
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:52 +00:00
Conrad Meyer
98580c064c NTB: MFV 9891417d: Increase transport MTU to 64k from 16k
Benchmarking showed a significant performance increase with the MTU size
to 64k instead of 16k.  Change the driver default to 64k.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:43 +00:00
Conrad Meyer
6a88fb3ef8 if_ntb: Fix typo in qp_link_work to match Linux
Throw away the result of the peer SPAD read.  The peer will write our
local SPAD and we need to keep the locally read SPAD value to check if
the remote side is up.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:34 +00:00
Conrad Meyer
d5bd08b091 NTB: MFV 42fefc86: Add parameters for Intel SNB B2B addresses
Add module parameters for the addresses to be used in B2B topology.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:25 +00:00
Conrad Meyer
25ff5df7c4 if_ntb: MFV 2849b5d7: Reset transport QP link stats on down
Reset the link stats when the link goes down.  In particular, the TX and
RX index and count must be reset, or else the TX side will be sending
packets to the RX side where the RX side is not expecting them.  Reset
all the stats, to be consistent.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:16 +00:00
Conrad Meyer
0326e4d6b5 NTB: Change Atom (BWD/SoC) pci_id name to match others
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:08 +00:00
Conrad Meyer
fb6531b056 NTB: MFV 5ae0beb6: Enable link for Intel root port mode in probe
We skip actually bringing up Rootport/Transparent configurations, so
most of this doesn't apply.  Original Linux commit log:

Link training should be enabled in the driver probe for root port mode.
We should not have to wait for transport to be loaded for this to
happen.  Otherwise the ntb device will not show up on the transparent
bridge side of the link.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:46:14 +00:00
Conrad Meyer
6849146f9d NTB: enum-ify some HW constants
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:46:05 +00:00
Conrad Meyer
2d53c202a1 NTB: Pull copy of soc_link_is_err out of recover_soc_link
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:45:57 +00:00