Commit Graph

16 Commits

Author SHA1 Message Date
Conrad Meyer
f1a516bcf9 NTB: Add ntb_db_vector_mask() missed in r289546
This is the last one.

Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-19 18:06:35 +00:00
Conrad Meyer
95a3f7fb33 if_ntb: MFV e26a5843: Move MW/DB management to if_ntb
This is the last e26a5843 patch.  The general thrust of the rewrite was
to move more responsibility for Memory Window and Doorbell interrupt
management from the ntb_hw driver to if_ntb.

A number of APIs have been added, removed, or replaced.  The old
DB callback mechanism has been excised.  Instead, callers (if_ntb) are
responsible for configuring MWs and handling their interrupts more
directly.

This adds a tunable, hw.ntb.max_mw_size, allowing users to limit the
size of memory windows used by if_ntb (identical to the Linux modparam
of the same name).

Despite attempts to keep mechanical name changes to separate commits,
some have snuck in here.  At least the driver should be much more
similar to the latest Linux one now -- making porting fixes easier.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-18 20:20:57 +00:00
Conrad Meyer
763fa8ae30 if_ntb: Rename things to match Linux driver
No functional change.  Part of the huge rewrite (e26a5843).

Obtained from:	Linux (e26a5843) (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-18 20:20:48 +00:00
Conrad Meyer
fe1a66fccf NTB: "Split ntb_hw_intel and ntb_transport drivers"
This Linux commit was more or less a rewrite.  Unfortunately, the commit
log does not give a lot of context for the rewrite.  I have tried to
faithfully follow the changes made upstream, including matching function
names where possible, while churning the FreeBSD driver as little as
possible.

This is the bulk of the rewrite.  There are two groups of changes to
follow in separate commits: fleshing out the rest of the changes to
xeon_setup_b2b_mw(), and some changes to if_ntb.

Yes, this is a big patch (3 files changed, 416 insertions(+), 237
deletions(-)), but the Linux patch was 13 files changed, 2,589
additions(+) and 2,195 deletions(-).

Original Linux commit log:
Change ntb_hw_intel to use the new NTB hardware abstraction layer.

Split ntb_transport into its own driver.  Change it to use the new NTB
hardware abstraction layer.

Authored by:	Allen Hubbe
Obtained from:	Linux (e26a5843) (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-18 20:20:20 +00:00
Conrad Meyer
60c996fc4a NTB: Rename some variables/functions to match Linux
No functional change.

Still part of the huge e26a5843 rewrite.  I'm trying to make it less of
a complete rewrite in the FreeBSD version of the driver.  Still, it
helps if our names match Linux.

Obtained from:	Linux (e26a5843) (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-18 20:19:53 +00:00
Conrad Meyer
c1f81cacd9 NTB: Rename some constants to match Linux
No functional change.

Obtained from:	Linux (part of e26a5843) (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-18 20:19:44 +00:00
Conrad Meyer
3952d9c9de NTB: MFV ab760a0c: Add split BAR support for Haswell
On the Haswell platform, a split BAR option to allow creation of 2 32bit
BARs (4 and 5) from the 64bit BAR 4. Adding support for this new option.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-15 23:46:07 +00:00
Conrad Meyer
b8a291bdea NTB: Add variable number MW, DB CB support code
This is a follow-up to r289208: "Xeon Errata Workaround."

Add logic to support a variable number of memory windows and doorbell
callbacks.  This was added to the Linux driver in the "Xeon Errata
Workaround" commit, but I skipped it because it didn't look neccessary
at the time.  It is needed for future Haswell split-BAR support, so
bring it in now.

A new tunable was added for if_ntb, 'hw.ntb.max_num_clients'.  By
default, it is set to zero -- infer the number of clients from the
number of memory windows available from the hardware.  Any other
positive value can specify a different number of clients, limited by the
number of doorbell callbacks available (4 under MSI-X, or 15 (Xeon) or
34 (SoC) under legacy INTx).

Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-15 23:45:43 +00:00
Conrad Meyer
531c7b9969 NTB: MFV 403c63cb: client event cleanup
Provide a better event interface between the client and transport.

Authored by:	Jon Mason
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-14 23:44:42 +00:00
Conrad Meyer
737bc5014c NTB: MFV e8aeb60c: Disable interrupts and poll under high load
Authored by:	Jon Mason
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-14 02:14:45 +00:00
Conrad Meyer
1d9352af47 NTB: MFV 49793889: Rename Variables for NTB-RP
Many variable names in the NTB driver refer to the primary or secondary
side.  However, these variables will be used to access the reverse case
when in NTB-RP mode.  Make these names more generic in anticipation of
NTB-RP support.

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-13 19:44:25 +00:00
Conrad Meyer
08f35652eb NTB: Update pci ids
Add JSF, HSX, BDX ids; add two additional Xeon errata flags while we're
here.

Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-13 17:21:38 +00:00
Conrad Meyer
59cf83b813 NTB: MFV 948d3a65: Xeon Errata Workaround
There is a Xeon hardware errata related to writes to SDOORBELL or B2BDOORBELL
in conjunction with inbound access to NTB MMIO Space, which may hang the
system.  To workaround this issue, use one of the memory windows to access the
interrupt and scratch pad registers on the remote system.  This bypasses the
issue, but removes one of the memory windows from use by the transport.  This
reduction of MWs necessitates adding some logic to determine the number of
available MWs.

Since some NTB usage methodologies may have unidirectional traffic, the ability
to disable the workaround via modparm has been added.

See BF113 in
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-c5500-c3500-spec-update.pdf
See BT119 in
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e5-family-spec-update.pdf

Authored by:	Jon Mason
Obtained from:	Linux
Sponsored by:	EMC / Isilon Storage Division
2015-10-13 03:12:11 +00:00
Conrad Meyer
902362c988 NTB: Add hw.ntb sysctl node 2015-10-13 03:11:21 +00:00
Carl Delsey
d43c0fbae1 Add some logging to ntb link up.
Approved by:	jimharris
Sponsored by:	Intel
2013-09-05 22:46:48 +00:00
Carl Delsey
e47937d1b7 Add a new driver to support the Intel Non-Transparent Bridge(NTB).
The NTB allows you to connect two systems with this device using a PCI-e
link. The driver is made of two modules:
 - ntb_hw which is a basic hardware abstraction layer for the device.
 - if_ntb which implements the ntb network device and the communication
   protocol.

The driver is limited at the moment to CPU memcpy instead of using DMA, and
only Back-to-Back mode is supported. Also the network device isn't full
featured yet. These changes will be coming soon. The DMA change will also
bring in the ioat driver from the project branch it is on now.

This is an initial port of the GPL/BSD Linux driver contributed by Jon Mason
from Intel. Any bugs are my contributions.

Sponsored by: Intel
Reviewed by: jimharris, joel (man page only)
Approved by: jimharris (mentor)
2013-04-29 22:48:53 +00:00