Commit Graph

30647 Commits

Author SHA1 Message Date
Navdeep Parhar
b3500921c4 cxgbe(4): Updates to the shared routines that deal with the serial EEPROM,
flash, and VPD.

Obtained from:	Chelsio Communications
2016-03-08 07:48:55 +00:00
Navdeep Parhar
948d0ec074 cxgbe(4): Updates to mailbox routines in the shared code.
Obtained from:	Chelsio Communications
2016-03-08 06:27:47 +00:00
Navdeep Parhar
207d9fea78 cxgbe(4): Update the interrupt handlers for hardware errors.
Obtained from:	Chelsio Communications
2016-03-08 02:44:32 +00:00
Navdeep Parhar
700cfba72d cxgbe(4): Overhaul the shared code that deals with the chip's TP block,
which is responsible for filtering and RSS.

Add the ability to use filters that match on PF/VF (aka "VNIC id") while
here.  This is mutually exclusive with filtering on outer VLAN tag with
Q-in-Q.

Sponsored by:	Chelsio Communications
2016-03-08 02:04:05 +00:00
Navdeep Parhar
90e7434a6d cxgbe(4): Add a struct sge_params to store per-adapter SGE parameters.
Move the code that reads all the parameters to t4_init_sge_params in the
shared code.  Use these per-adapter values instead of globals.

Sponsored by:	Chelsio Communications
2016-03-08 00:23:56 +00:00
Bryan Drewery
1e35cdf678 Add missing break for r296472.
This was lost in git rebasing, though it has no functional change.

X-MFC-With:	r296472
MFC after:	1 week
2016-03-07 21:45:24 +00:00
Bryan Drewery
4039c53163 Require kldunload -f to unload.
Code may still be executing from the wrappers at unload time and thus is
not generally safe to unload.  Converting the wrappers to use
EVENTHANDLER(9) will allow this to safely drain on active threads in
hooks.  More work on EVENTHANDLER(9) is needed first.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-03-07 21:39:29 +00:00
Navdeep Parhar
4f8a1fd8cd cxgbe(4): Updated register dumps.
- Get the list of registers to read during a regdump from the shared
  code instead of the OS specific code.  This follows a similar move
  internally.  The shared code includes the list for T6.

- Update cxgbetool to be able to decode T5 VF, T6, and T6 VF register
  dumps (and catch up with some updates to T4 and T5 register decode).

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications
2016-03-07 21:11:35 +00:00
Bryan Drewery
8a81693ad5 Only call bwillwrite() for logging to vnodes, as other fo_write() calls do.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-03-07 21:10:19 +00:00
Sean Bruno
7bfed09e02 The register read/write mphy functions have misleading whitespace around
the locked check. This cleanup merely preserves the existing functionality
while improving the ready check.

Submitted by:	Jim Thompson
Reviewed by:	gnn erj
Obtained from:	Netgate
MFC after:	2 weeks
Sponsored by:	Netgate
Differential Revision:	https://reviews.freebsd.org/D5448
2016-03-04 14:23:34 +00:00
Navdeep Parhar
d1205d093d cxgbe(4): Very basic T6 awareness. This is part of ongoing work to
update to the latest internal shared code.

- Add a chip_params structure to keep track of hardware constants for
  all generations of Terminators handled by cxgbe.
- Update t4_hw_pci_read_cfg4 to work with T6.
- Update the hardware debug sysctls (hidden within dev.<tNnex>.<n>.misc.*) to
  work with T6.  Most of the changes are in the decoders for the CIM
  logic analyzer and the MPS TCAM.
- Acquire the regwin lock around indirect register accesses.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications
2016-03-04 13:11:13 +00:00
Sepherosa Ziehau
05c0884ee1 hyperv/hn: Add per-TX ring stats for # of transmitted packets
MFC after:	2 weeks
Sponsored by:	Microsoft OSTC
2016-03-04 07:07:42 +00:00
Sepherosa Ziehau
7dda664075 hyperv/hn: Pass channel to send done callbacks.
Mainly to strigent the data packet send done check.

MFC after:	2 weeks
Sponsored by:	Microsoft OSTC
2016-03-04 07:00:37 +00:00
Sepherosa Ziehau
21640df213 hyperv/hn: Add multiple channel support, a.k.a. vRSS
Each channel contains one RX ring and one TX ring.  And we
try to distribute the channels to different evenly.

Note: Currently we don't have enough information to extract
the RSS type and RSS hash value from the received packets.

This greatly improves the TX/RX performance for 8 virtual CPU
Hyper-V over 10Ge: it can max out 10Ge for TCP when multiple
RX/TX rings are enabled.

This almost doubles the TX/RX performance for locally connected
Hyper-Vs: was 6Gbps w/ 128 TCP streams, now 11Gbps w/ multiple
RX/TX rings enabled.

It is not enabled by default; it will be switched on after more
tests.

Collaborated with:	Hongjiang Zhang <honzhan microsoft com>
MFC after:	2 week
Sponsored by:	Microsoft OSTC
2016-03-04 06:52:11 +00:00
Justin Hibbits
e8cf8358d0 Remove default initializations for rman, a'la r296331 2016-03-04 01:25:45 +00:00
Jared McNeill
d7acb49aee Add support for resetting the PHY via GPIO.
Submitted by:		Emmanuel Vadot <manu@bidouilliste.com>
Reviewed by:		andrew, jmcneill
Approved by:		adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5505
2016-03-03 22:26:36 +00:00
Andriy Voskoboinyk
ae132f1122 zyd, run, ural: do not corrupt MAC address
Do not use ic_macaddr as a storage for current BSSID;
it may be reused in vap creation procedure;
similar to r288619.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5513
2016-03-03 20:06:16 +00:00
Steven Hartland
eb4cd7cb9a Fix ixl with RSS
Fix compilation of ixl when RSS option is set, broken by r295946

MFC after:	3 weeks
X-MFC-With:	r295946
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D5428
2016-03-03 19:49:37 +00:00
Hans Petter Selasky
24fe42dcdd Allow for overlapping quirk device ranges. Prior to this patch only
the first device entry matching the USB vendor, product and revision
would be searched for quirks. After this patch all device entries will
be searched for quirks.

MFC after:	1 week
2016-03-03 08:47:27 +00:00
Justin Hibbits
534ccd7bbf Replace all resource occurrences of '0UL/~0UL' with '0/~0'.
Summary:
The idea behind this is '~0ul' is well-defined, and casting to uintmax_t, on a
32-bit platform, will leave the upper 32 bits as 0.  The maximum range of a
resource is 0xFFF.... (all bits of the full type set).  By dropping the 'ul'
suffix, C type promotion rules apply, and the sign extension of ~0 on 32 bit
platforms gets it to a type-independent 'unsigned max'.

Reviewed By: cem
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5255
2016-03-03 05:07:35 +00:00
Navdeep Parhar
ecdff8fa76 cxgbe(4): First of many changes to reduce diffs with internal shared
code:

- Rename some CamelCase variables.
- s/t4_link_start/t4_link_l1cfg/g
- Pull in t4_get_port_type_description.
- Move t4_wait_op_done to t4_hw.c.
- Flip the order of the RDMA stats.
- Remove unsused function t4_iq_start_stop.
- Move t4_wait_op_done and t4_wait_op_done_val to t4_hw.c

Obtained from:	Chelsio Communications
2016-03-03 01:41:53 +00:00
Justin Hibbits
6c3e542b3d Allocate the PCI BAR resource with bus_alloc_resource_any()
We don't support allocating any other range with PCI BARs.
2016-03-03 01:07:17 +00:00
Bjoern A. Zeeb
788c03c3d8 Add gem5 support, so we attach there as well.
Fix the boundary limit to end at the end of the region and not one beyond (1).

Diagnosed by:		andrew (1)
Reviewed by:		andrew, br
Sponsored by:		DARPA/AFRL
Differential Revision:	https://reviews.freebsd.org/D5493
2016-03-02 15:26:55 +00:00
Wojciech Macek
4d185754cf Support for Enhanced Allocation in PCI
On some platforms, BAR entries are hardcoded and must not be accessed
    using standard method. Add functionality to identify this situation
    and configure the bus based on Enhanced Allocation structure.

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           jhb
Differential revision: https://reviews.freebsd.org/D5242
2016-03-02 09:54:58 +00:00
Sepherosa Ziehau
3951eba165 hyperv/hn: Make # of rings configurable
And since the host may not being able to allocate the # of rings
requested by us, save the # of rings allocated by the host in the
ring_inuse counters; use ring_inuse counters for run time operation.

This paves the way for the upcoming vRSS support.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-02 05:24:55 +00:00
Mark Johnston
925bcbd658 Use m_catpkt(9) to ensure that pkthdr fields are updated properly.
Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5497
2016-03-02 05:05:02 +00:00
Justin Hibbits
82ed3cb0e4 Replace some more default range checks with RMAN_IS_DEFAULT_RANGE().
This is a follow-on to r295832.
2016-03-02 03:26:56 +00:00
Sepherosa Ziehau
33c6a6670f hyperv/hn: Fix typo in comment
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-02 03:19:59 +00:00
Sepherosa Ziehau
6c03f94bb3 hyperv/hn: Make read buffer per-channel
Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Reorganized by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-02 03:07:31 +00:00
Justin Hibbits
5670e3473f Use the m_extadd() function instead of deprecated MEXTADD().
Suggested by:	glebius
2016-03-02 02:29:35 +00:00
Justin Hibbits
9324dcb395 Remove some debug printfs 2016-03-02 02:27:53 +00:00
Sepherosa Ziehau
2ad2701c2a hyperv/hn: Pass channel to hv_nv_on_receive_completion()
While I'm here, staticize this function.

Submitted by:	Hongjiang Zhang <honzhan microsoft com>
Modified by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-03-02 02:27:13 +00:00
Sepherosa Ziehau
9e5c6042f9 hyperv/chan: Factor out the vcpu setting
And use it for cpu0 assignment; it does not sound right to assume that
cpu0 maps to vcpu0.  And this factored out function will be exposed to
drivers, if driver specific CPU binding is needed, e.g. hn(4).

Move default cpu select after saving channel offer message. This makes
sure that all useful information of the channel has been setup.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5504
2016-03-02 01:40:47 +00:00
Sepherosa Ziehau
990aae810b hyperv/chan: Function renaming; no functional change
The renamed function create a sysctl tree for channel, and many
non-statistics nodes exists, so don't claim it only adds sysctl
nodes for statistics.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5503
2016-03-02 01:33:30 +00:00
Sepherosa Ziehau
87d697796a hyperv/chan: Add sysctl node to check whether monitor is allocated or not
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5502
2016-03-02 01:26:05 +00:00
Bryan Drewery
e0dae8f1c0 Remove filemon->lock wrappers.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-03-02 00:13:13 +00:00
John Baldwin
cbc4d2db75 Remove taskqueue_enqueue_fast().
taskqueue_enqueue() was changed to support both fast and non-fast
taskqueues 10 years ago in r154167.  It has been a compat shim ever
since.  It's time for the compat shim to go.

Submitted by:	Howard Su <howard0su@gmail.com>
Reviewed by:	sephe
Differential Revision:	https://reviews.freebsd.org/D5131
2016-03-01 17:47:32 +00:00
Michal Meloun
8a4ba03859 OFW_GPIOBUS: Add utility functions for easier handling of OFW GPIO pins.
Reviewed by: ian, loos (paritaly)
2016-03-01 16:10:15 +00:00
Andrew Turner
9636600cf2 Make the memory size returned from fdt_get_mem_regions a 64-bit type. This
is the physical memory size so may be larger than a u_long can hold, e.g.
on ARM with LPAE we could see an address space of up to 40 bits. On ARM
u_long is only 32 bits so the memory size will be truncated, possibly to
zero.

Reported by:	bz
Sponsored by:	ABT Systems Ltd
2016-03-01 11:39:07 +00:00
Andrew Turner
a43760692b Make the fdt_get_mem_regions memsize argument optional. It's only used in
by a few callers.

Sponsored by:	ABT Systems Ltd
2016-03-01 09:45:27 +00:00
Sepherosa Ziehau
b431335d25 hyperv/channel: Nuke useless stack variable
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5499
2016-03-01 05:15:26 +00:00
Sepherosa Ziehau
4663ccd32e hyperv/hn: Set hash per-packet-info for each packet transmission
So that the host could dispatch the TX done back to this TX ring's
owner channel

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5498
2016-03-01 04:59:18 +00:00
Navdeep Parhar
dd991bd5a1 cxgbe(4): Update T5 and T4 firmwares to 1.15.28.0.
These firmwares were obtained from the beta "Chelsio T5/T4 Unified Wire
v2.12.0.2 for Linux" release.  Changes since last release are listed in the
"Release Notes" accompanying the beta release and are copy-pasted here as well.

The plan is to have only GA'd firmwares in any -STABLE FreeBSD branch so I'll
MFC this (after 2 months) only if it ends up in a GA release.

================================================================================
================================================================================

22.1. T5 Firmware
+++++++++++++++++++++++++++++++++

Version : 1.15.28.0
Date    : 02/29/2016
================================================================================

FIXES
-----

BASE:
 - Fixed an issue in FW_RSS_VI_CONFIG_CMD handling where the default ingress
   queue was ignored.
 - Fixed an issue where adapter failed to load fw by adjusting DRAM frequency.
 - Fixed an issue in watchdog which was causing VM bring-up failure after
   reboot.
 - Fixed 40G link failures with some switches when auto-negotiation enabled.
 - Fixed to improve on link bring-up time.
 - Per port buffer groups size doubled to improve performance.
 - Fixed an issue where bogus d3hot bits were set causing traffic stall.
 - Fixed an issue where sometimes adapter was not seen after reboot.
 - Fixed an issue where iWARP was crashing in conjunction with traffic
   management.
 - Fixed an issue where link failed to come up after removing twinax cable and
   inserting optical module.

OFLD
 - Fixed a potential iSCSI data corruption issue by disabling RxFragEn flag.

FOiSCSI
 - Fixed an issue in recovery path where connection was getting closed before
   recovery processing was done.
 - Fixed an issue in TCP port reuse.
 - Fixed an issue in recovery path when large number (>64) of iSCSI connections
   were in use.
 - Returned ENETUNREACH if IP was not been provisioned yet and driver tried to
   use given inerface.

ENHANCEMENTS
------------

BASE:
 - Added new interface to program DCA settings in SGE contexts; allow 32-byte
   IQE size
 - Added PTP interface fw_ptp_ts to support PTP Frequeny and Offset adjustment.
 - Added MPS raw interface.

ETH:
 - New mailbox command FW_DCB_IEEE_CMD api added for IEEE dcbx.

OFLD:
 - WR opcode is returned to host in cqe error response.

================================================================================
================================================================================

22.2. T4 Firmware
+++++++++++++++++

Version : 1.15.28.0
Date    : 02/29/2016
================================================================================

FIXES
-----

BASE:
 - Fixed an issue in FW_RSS_VI_CONFIG_CMD handling where default ingress queue
   was ignored.
 - Fixed an issue in watchdog which was causing VM bring-up failure after
   reboot.
 - Per port buffer groups size doubled to improve performance.
 - Fixed an issue where iWARP was crashing in conjunction with traffic
   management.

FOiSCSI:
 - Fixed an issue in recovery path where connection was getting closed before
   recovery processing was done.
 - Fixed an issue in TCP port reuse.
 - Fixed an issue in recovery path when large number (>64) of iSCSI connections
   were in use.
 - Returned ENETUNREACH if IP had not been provisioned yet and driver tried to
   use given inerface.

ENHANCEMENTS
------------

BASE:
 - Added MPS raw interface.

ETH:
 - New mailbox command FW_DCB_IEEE_CMD api added for IEEE dcbx.

================================================================================

Obtained from:	Chelsio Communications
MFC after:	2 months
Sponsored by:	Chelsio Communications
2016-03-01 02:36:50 +00:00
Gleb Smirnoff
56a5f52e80 New way to manage reference counting of mbuf external storage.
The m_ext.ext_cnt pointer becomes a union. It can now hold the refcount
value itself. To tell that m_ext.ext_flags flag EXT_FLAG_EMBREF is used.
The first mbuf to attach a cluster stores the refcount. The further mbufs
to reference the cluster point at refcount in the first mbuf. The first
mbuf is freed only when the last reference is freed.

The benefit over refcounts stored in separate slabs is that now refcounts
of different, unrelated mbufs do not share a cache line.

For EXT_EXTREF mbufs the zone_ext_refcnt is no longer needed, and m_extadd()
becomes void, making widely used M_EXTADD macro safe.

For EXT_SFBUF mbufs the sf_ext_ref() is removed, which was an optimization
exactly against the cache aliasing problem with regular refcounting.

Discussed with:		rrs, rwatson, gnn, hiren, sbruno, np
Reviewed by:		rrs
Differential Revision:	https://reviews.freebsd.org/D5396
Sponsored by:		Netflix
2016-03-01 00:17:14 +00:00
Wojciech Macek
e571e15cb0 Fix fdt_get_mem_regions() to work with 64-bit addresses
Use u_long instead of uint32_t variables to avoid overflow
    in case of PA space bigger than 32-bit.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Approved by:           cognet (mentor)
Reviewed by:           andrew, br, wma
Differential revision: https://reviews.freebsd.org/D5393
2016-02-29 09:22:39 +00:00
Sepherosa Ziehau
6512e69278 hyperv/channel: Add sysctl node for channel owner cpu
And add sysctl node for sub-channel's channel id.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5489
2016-02-29 09:14:55 +00:00
Sepherosa Ziehau
bd2f53618c hyperv/hn: Utilize mbuf flowid
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5488
2016-02-29 09:05:33 +00:00
Sepherosa Ziehau
f4e778c14d hyperv/hn: Put LRO aggregation limit settings under FreeBSD version check
This simplifies MFC to 10-stable

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5487
2016-02-29 08:53:53 +00:00
Sepherosa Ziehau
27a185fc4a hyperv/hn: Switch to if_transmit by default after r296178
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5485
2016-02-29 08:45:07 +00:00
Sepherosa Ziehau
77394b18ab hyperv/channel: Add debug sysctl nodes for channel indices
It would serve as a debug tool, if the shared buffer ring's indices
stopped updating.

Submitted by:	HongJiang Zhang <honzhan microsoft com>
Reviewed by:	sephe, Jun Su <junsu microsoft com>
Modified by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5402
2016-02-29 05:24:29 +00:00