Commit Graph

30522 Commits

Author SHA1 Message Date
David C Somayajulu
bb329d4b5a Remove dead code. Code Cleanup. Improve clarity in debug messages
MFC after:5 days
2016-02-19 22:46:52 +00:00
Eric Joyner
42d7398e7e ixl(4): Fix errors in queue interrupt setup in MSIX mode.
- I40E_PFINT_DYN_CTLN needs to be cleared, and not have a queue index
  written to it.
- The interrupt linked list for each queue is changed to only include
  the queue's Rx and Tx queues.

Differential Revision:	https://reviews.freebsd.org/D5206
Reviewed by:	sbruno
Tested by:	jeffrey.e.pieper@intel.com
Sponsored by:	Intel Corporation
2016-02-19 22:45:09 +00:00
Eric Joyner
300d145480 ixl(4): Remove unsupported device IDs.
There is no official support for 20G SKUs on FreeBSD, and the KX_A
device ID was never used.

Differential Revision:	https://reviews.freebsd.org/D5204
Reviewed by:	sbruno, jeffrey.e.pieper@intel.com
Sponsored by:	Intel Corporation
2016-02-19 22:33:50 +00:00
Eric Joyner
c11f1016ec ixl(4): Fix two important RSS bugs.
- Change tc_mapping field to assign 64 queues instead of 16 to the PF's VSI;
  add comments to describe how this is done.

- Set hash lut size to 512 when setting filter control; the lut size defaults
  to 128 if this isn't set.

Differential Revision:	https://reviews.freebsd.org/D5203
Reviewed by:	gallatin
Tested by:	jeffrey.e.pieper@intel.com
Sponsored by:	Intel Corporation
2016-02-19 21:58:14 +00:00
David C Somayajulu
34b133bcd5 Modified the use of bxe_grc_dump() function so that it can be invoked directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved.
The sysctl trigger_grcdump can be used to manually trigger a fwdump.

MFC after:5 days
2016-02-19 21:32:49 +00:00
Pedro F. Giffuni
e0f6860d51 qlxgb: fix mismatch.
Found by:	PVS Static Analysis
Reviewed by:	davidcs
MFC after:	1 month
2016-02-19 18:05:02 +00:00
Stefan Eßer
5a1a8ad938 Fix syntax error introduced in previous commit where I removed one
character to few. I should have waited for the kernel compile to finish,
even though the change seemed so trivial.
2016-02-19 16:53:21 +00:00
Stefan Eßer
755ae20cd7 Remove redundant check for "(dinfo != NULL)", it has already been performed
as the first part of this complex loop conditional.

Found by:    PVS Static Analysis
2016-02-19 16:43:03 +00:00
Pedro F. Giffuni
930143bd86 firewire: fix a mismatch introduced in r230558.
Found by:	PVS Static Analysis
Reviewed by:	sbruno
MFC after:	1 month
2016-02-19 15:35:20 +00:00
Sepherosa Ziehau
563d00ab5c hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed
Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5318
2016-02-19 05:13:56 +00:00
Sepherosa Ziehau
ea2f3d1776 hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012)
Tested on Windows Server 2012.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5317
2016-02-19 05:08:44 +00:00
Sepherosa Ziehau
5788ded618 hyperv/hn: Add option to bind TX taskqueues to the specified CPU
It will be used to help tracking host side transmission ring selection
issue; and it will be turned on by default, once we have concrete result.

Reviewed by:	adrian, Jun Su <junsu microsoft com>
Approved by:	adrian (mento)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5316
2016-02-19 05:03:17 +00:00
Adrian Chadd
ad73b30173 document some ACPI related sysctls.
Submitted by:	Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by:	HardenedBSD
Differential Revision:	https://reviews.freebsd.org/D5263
2016-02-19 05:02:17 +00:00
Justin Hibbits
43cd61606b Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()
Since these calls only use default arguments, bus_alloc_resource_any() is the
right call.

Differential Revision: https://reviews.freebsd.org/D5306
2016-02-19 03:37:56 +00:00
Kevin Lo
277db30576 Remove bogus cast. 2016-02-19 01:57:51 +00:00
Kevin Lo
29899c0add Add missing parentheses.
Found by:	PVS-Studio
2016-02-19 01:56:59 +00:00
Navdeep Parhar
40bf7442fa cxgbe: catch up with the latest hardware-related definitions.
Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications
2016-02-19 00:29:16 +00:00
Jung-uk Kim
bfe2514a08 Remove a bogus bzero() call.
Found by:	PVS-Studio
2016-02-18 23:32:11 +00:00
Zbigniew Bodek
910905c74f Fix build for i386 and arm64 after r295755
- Take bus_space_tag_t type into consideration when returning
  default, zero value.
- Include missing rman.h required by ofw_pci.h
2016-02-18 15:44:45 +00:00
Zbigniew Bodek
a259e55bb9 Extract common code from PowerPC's ofw_pci
Import portions of the PowerPC OF PCI implementation into
new file "ofw_pci.c", common for other platforms. The files ofw_pci.c and
ofw_pci.h from sys/powerpc/ofw no longer exist. All required declarations
are moved to sys/dev/ofw/ofw_pci.h.

This creates a new ofw_pci_write_ivar() function and modifies
ofw_pci_nranges(), ofw_pci_read_ivar(), ofw_pci_route_interrupt() methods.
Most functions contain existing ppc implementations in the majority
unchanged. Now there is no need to have multiple identical copies
of methods for various architectures.

Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Annapurna Labs
Reviewed by:   jhibbits, mmel
Differential Revision: https://reviews.freebsd.org/D4879
2016-02-18 13:07:21 +00:00
Zbigniew Bodek
e2d4f32f4e Fix bug in ofwbus_release_resource() for non-ofwbus descendants
Resource list for devices that are not ofwbus descendants, but
got to ofwbus method via bus_generic_release_resource() call chain,
cannot be found using BUS_GET_RESOURCE_LIST() used by ofwbus.
In that case, changing device's resource list should be avoided
(will not contain resource list prepared by ofw or simplebus).

Pointy-hat to: zbb
Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5304
2016-02-18 11:53:57 +00:00
Sepherosa Ziehau
57fb9b3fd1 hyperv/hn: Use buf_ring for txdesc list
So one spinlock is avoided, which would be potentially dangerous for
virtual machine, if the spinlock holder was scheduled out by the host,
as noted by royger.

Old spinlock based txdesc list is still kept around, so we could have
a safe fallback.

No performance regression nor improvement is observed.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5290
2016-02-18 07:44:14 +00:00
Sepherosa Ziehau
dbfb4eba54 hyperv/hn: Split TX ring data structure out of softc
This paves the way for upcoming vRSS stuffs and eases more code cleanup.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5283
2016-02-18 07:37:59 +00:00
Sepherosa Ziehau
b8f2d59daf hyperv/hn: Use non-fast taskqueue for transmission
Performance stays same; so no need to use fast taskqueue here.

Suggested by:	royger
Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5282
2016-02-18 07:28:45 +00:00
Sepherosa Ziehau
4d8e8cb113 hyperv/hn: Use taskqueue_enqueue()
This also eases experiment on the non-fast taskqueue.

Reviewed by:	adrian, Jun Su <junsu microsoft com>
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5276
2016-02-18 07:23:05 +00:00
Sepherosa Ziehau
17ab6c4f17 hyperv/hn: Split RX ring data structure out of softc
This paves the way for upcoming vRSS stuffs and eases more code cleanup.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5275
2016-02-18 07:16:31 +00:00
Sepherosa Ziehau
f9c55d1c83 hyperv/hn: Change global tunable prefix to hw.hn
And use SYSCTL+CTLFLAG_RDTUN for them.

Suggested by:	adrian
Reviewed by:	adrian, Hongjiang Zhang <honzhan microsoft com>
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5274
2016-02-18 07:06:44 +00:00
Sepherosa Ziehau
01610d88da hyperv/hn: Always do transmission scheduling.
This one gives the best performance so far.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5273
2016-02-18 07:00:47 +00:00
Sepherosa Ziehau
58f5a606fa hyperv/hn: Add option to allow sharing TX taskq between hn instances
It is off by default.  This eases further experimenting on this driver.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5272
2016-02-18 06:55:05 +00:00
Sepherosa Ziehau
aa7f74113e hyperv/hn: Set the TCP ACK/data segment aggregation limit
Set TCP ACK append limit to 1, i.e. aggregate 2 ACKs at most.  Aggregating
anything more than 2 hurts TCP sending performance in hyperv.  This
significantly improves the TCP sending performance when the number of
concurrent connetion is low (2~8).  And it greatly stabilizes the TCP
sending performance in other cases.

Set TCP data segments aggregation length limit to 37500.  Without this
limitation, hn(4) could aggregate ~45 TCP data segments for each
connection (even at 64 or more connections) before dispatching them to
socket code; large aggregation slows down ACK sending and eventually
hurts/destabilizes TCP reception performance.  This setting stabilizes
and improves TCP reception performance for >4 concurrent connections
significantly.

Make them sysctls so they could be adjusted.

Reviewed by:	adrian, gallatin (previous version), hselasky (previous version)
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5185
2016-02-18 04:59:37 +00:00
Pyun YongHyeon
4a1ff07b39 Fix a bug introduced in r295736
TX descriptor address should be updated for valid chain.

Pointed out by:	jmallett
2016-02-18 03:05:08 +00:00
Pyun YongHyeon
90cf5d3043 Remove duplicated check.
Found by:	PVS-Studio
2016-02-18 01:30:49 +00:00
Pyun YongHyeon
9dda5c8ffc Fix variable assignment.
Found by:	PVS-Studio
2016-02-18 01:24:10 +00:00
Gleb Smirnoff
7b0c04c29c Fix a potentially "forever" loop.
Found by:	PVS-Studio
2016-02-17 21:24:26 +00:00
Gleb Smirnoff
ec911df8da Ternary operator has lower priority than OR.
Found by:	PVS-Studio
2016-02-17 21:13:33 +00:00
Gleb Smirnoff
9389e53fd4 Add missing braces.
Found by:	PVS-Studio
Approved by:	so (implicit)
2016-02-17 21:09:19 +00:00
Warner Losh
c55f57071a Create an API to reset a struct bio (g_reset_bio). This is mandatory
for all struct bio you get back from g_{new,alloc}_bio. Temporary
bios that you create on the stack or elsewhere should use this before
first use of the bio, and between uses of the bio. At the moment, it
is nothing more than a wrapper around bzero, but that may change in
the future. The wrapper also removes one place where we encode the
size of struct bio in the KBI.
2016-02-17 17:16:02 +00:00
Justin Hibbits
89977ce227 Convert a few more long -> rman_res_t. 2016-02-16 17:55:10 +00:00
Andrew Turner
45fd186285 Allow callers of OF_decode_addr to get the size of the found mapping. This
will allow for code that uses the old fdt_get_range and fdt_regsize
functions to find a range, map it, access, then unmap to replace this, up
to and including the map, with a call to OF_decode_addr.

As this function should only be used in the early boot code the unmap is
mostly do document we no longer need the mapping as it's a no-op, at least
on arm.

Reviewed by:	jhibbits
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D5258
2016-02-16 15:18:12 +00:00
Eric van Gyzen
bb51c27943 ichsmb: add PCI device ID for Intel Sunrise Point-H SMBus controller
MFC after:	3 days
Sponsored by:	Dell Inc.
2016-02-16 02:23:39 +00:00
Bryan Drewery
a2109e0056 Filemon: Fix panic when fork1() is called from kproc_create().
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:25 +00:00
Andrew Turner
740be1dc58 Fix the spelling of OF_getencprop. It will fix the data correctly for the
endian of the CPU so there is no need to call fdt32_to_cpu.

Sponsored by:	ABT Systems Ltd
2016-02-15 17:14:10 +00:00
Andrew Turner
5f250b53e8 Add support for the Allwinner i2c device. This is similar to the existing
Marvell twsi part, however uses different register locations, as such split
the existing driver into Marvell and Allwinner attachments.

While here clean a few style issues.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision:	https://reviews.freebsd.org/D4846
2016-02-15 15:11:26 +00:00
Andrew Turner
632381ed9d Move the twsi driver source to be under iicbus. It is in a separate
directory as it is expected multiple attachments will be added for the SoC
families that use this hardware.

Sponsored by:	ABT Systems Ltd
2016-02-14 23:51:13 +00:00
Conrad Meyer
f98d21e561 NTB: workaround for high traffic hardware hang
This patch comes from Dave Jiang's Linux tree, davejiang/ntb.  It hasn't
been accepted into Linus' tree, so I do not have an authoritative SHA1
to point at.  Original commit log:

=====================================================================
A hardware errata causes the NTB to hang when heavy bi-directional
traffic in addition to the usage of BAR0/1 (where the registers reside,
including the doorbell registers to trigger interrupts).

This workaround is only available on Haswell and Broadwell platform.
The workaround is to enable split BAR in the BIOS to allow the 64bit
BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed
to LAPIC region of the remote host. We will bypass the db mechanism and
directly trigger the MSIX interrupts. The offsets and vectors are
exchanged during transport scratch pad negotiation. The scratch pads are
now overloaded in order to allow the exchange of the information. This
gets around using the doorbell and prevents the lockup with additional
pcode changes in BIOS.

Signed-off-by:	Dave Jiang <dave.jiang@intel.com>
=====================================================================

Notable changes in the FreeBSD version of this patch:
* The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx).
  The Linux version of the patch only uses BAR4.
* MSIX negotiation aborts if the link goes down.

Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2016-02-14 22:37:28 +00:00
Hans Petter Selasky
d5fb67a401 Restore maximum number of host keys to 64.
Discussed with:	adrian @ and avos @
2016-02-14 16:18:39 +00:00
Colin Percival
bcccdfa37b Don't dereference a pointer immediately after determining that it is
equal to NULL. [1]

While I'm here, s/xb/xbd/ (the name changed a long time ago but this
instance wasn't corrected).

Reported by:	PVS-Studio [1]
2016-02-14 13:42:16 +00:00
Hans Petter Selasky
8cb15594b3 Fix variable assignment inside if-clause in the smsc driver.
Found by D5245 / PVS.

MFC after:	1 week
2016-02-14 07:20:07 +00:00
Hans Petter Selasky
fe3e452399 Reduce the number of supported WLAN keys in the rum driver, else we
risk bit shifting overflows. Found by D5245 / PVS.

MFC after:	1 week
2016-02-14 07:16:36 +00:00
Sepherosa Ziehau
ffc6b639c2 hyperv/hn: Fix typo in comment
Noticed by:	avos
Reviewed by:	adrian, avos, Hongjiang Zhang <honzhan microsoft com>
Approved by:	adrian
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5199
2016-02-14 02:28:59 +00:00