314667 |
04-Mar-2017 |
avg |
MFC r283291: don't use CALLOUT_MPSAFE with callout_init()
The main purpose of this MFC is to reduce conflicts for other merges. Parts of the original change have already "trickled down" via individual MFCs. |
312742 |
25-Jan-2017 |
mav |
MFC r311935: Pretend we support some IOCTLs to not scary upper layers. |
304410 |
18-Aug-2016 |
mav |
MFC r303561: Wrap previous MSIX workaround into #ifndef EARLY_AP_STARTUP.
With EARLY_AP_STARTUP we can successfully negotiate MSIX earlier. |
304409 |
18-Aug-2016 |
mav |
MFC r303554: Block MSIX negotiation until SMP started and IRQ reshuffled. |
304408 |
18-Aug-2016 |
mav |
MFC r303553: Make MAC address generation more random.
'ticks' approach does not work at boot time. |
304407 |
18-Aug-2016 |
mav |
MFC r303514: Fix NTBT_QP_LINKS negotiation.
I believe it never worked correctly for more the one queue even in Linux. This fixes case when one of consumer drivers is not loaded on one side, but its queues still announced as ready if something else brought link up.
While there, remove some pointless NULL checks. |
304406 |
18-Aug-2016 |
mav |
MFC r303510: Clear scratchpad after MSIX negotiation to not leak garbage. |
304405 |
18-Aug-2016 |
mav |
MFC r303494: Once more refactor KPI between ntb_transport(4) and if_ntb(4).
New design allows to attach multiple consumers to ntb_transport(4) instance. Previous design obtained from Linux theoretically allowed that, but was not practically usable (Linux also has only one consumer driver now). |
304404 |
18-Aug-2016 |
mav |
MFC r303429, r303437, r303551: Once more refactor KPI between NTB hardware and consumers.
New design allows hardware resources to be split between several consumers. For example, one BAR can be dedicated for remote memory access, while other resources can be used for packet transport for virtual Ethernet interface. And even without resource split, this code allows to specify which consumer driver should attach the hardware.
From some points this makes the code even closer to Linux one, even though Linux does not provide the described flexibility. |
304401 |
18-Aug-2016 |
mav |
MFC r303266: Postpone ntb_get_msix_info() till we need to negotiate MSIX.
Calling it earlier increases the window when MSIX info may change. This change does not solve the problem completely, but seems logical. Complete solution should probably include link reset in case of MSIX remap to trigger new negotiation, but we have no way to get notified about that now. |
304400 |
18-Aug-2016 |
mav |
MFC r302622 (by sephe): ntb: Fix LINT |
304399 |
18-Aug-2016 |
mav |
MFC r302531: Revert odd change, setting limit registers before base.
I don't know what errata is mentioned there, I was unable to find it, but setting limit before the base simply does not work at all. According to specification attempt to set limit out of the present window range resets it to zero, effectively disabling it. And that is what I see in practice.
Fixing this properly disables access for remote side to our memory until respective xlat is negotiated and set. As I see, Linux does the same. |
304398 |
18-Aug-2016 |
mav |
MFC r302530: Fix wrong copy/paste in r302510. |
304397 |
18-Aug-2016 |
mav |
MFC r302529: Remove callout_reset(link_work) from ntb_transport_attach().
At that point link is quite likely not established yet, so messing with scratch registers is premature there. Original commit message mentioned code diff reduction from Linux, but this line is not present in Linux now. |
304396 |
18-Aug-2016 |
mav |
MFC r302510: Simplify MSIX MW BAR xlat setup, and don't forget to unlock its limit.
The last fixes SB01BASE_LOCKUP workaround after driver reload. |
304394 |
18-Aug-2016 |
mav |
MFC r302508: Disable SB01BASE_LOCKUP workaround when split BARs disabled.
For some reason hack with sending MSI-X interrupts by writing to remote LAPIC memory works only for 32-bit BARs, that are available only if split BARs mode is enabled in BIOS. If it is not, complain loudly and fall back to less efficient workaround. |
304393 |
18-Aug-2016 |
mav |
Direct commit to stable/10 to fix build without newer interface KPIs. |
304392 |
18-Aug-2016 |
mav |
MFC r302499: Improve checksum "offload" support.
For compatibility reasons make driver not report any checksum offload by default, since there is indeed none. But if administrator knows that interface is used only for local traffic, he can enable fake checksum offload manually on both sides to save some CPU cycles, since the data are already protected by CRC32 of PCIe link.
Sponsored by: iXsystems, Inc. |
304391 |
18-Aug-2016 |
mav |
MFC r302496: Rewrite if_ntb to use modern interface KPIs and features.
It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc.
Sponsored by: iXsystems, Inc. |
304390 |
18-Aug-2016 |
mav |
MFC r302495: Improve memory allocation errors handling on receive. |
304389 |
18-Aug-2016 |
mav |
MFC r302494: Synchronize MTU code with Linux.
It is mandatory for transport compatibility. |
304388 |
18-Aug-2016 |
mav |
MFC r302493: Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.
This allows at least first three doorbells to work very close to normal hardware, properly signaling events to upper layers without spurious or lost events. Doorbells above the first three may still report spurious events due to lack of reliable information, but they are rarely used. |
304387 |
18-Aug-2016 |
mav |
MFC r302492: Bring some more order into link and qp state handling.
Do not touch scratchpad registers until link is reported up. Mask and do not handle doorbell events until respective qp is up. |
304386 |
18-Aug-2016 |
mav |
MFC r302491: Switch ctx_lock from mutex to rmlock.
It is odd idea to serialize different MSI-X vectors. Use of rmlocks here allows them to execute in parallel, but still protects ctx. If upper layers require any additional serialization -- they can do it by themselves. |
304385 |
18-Aug-2016 |
mav |
MFC r302490: Create separate RX taskqueue for each qp. |
304384 |
18-Aug-2016 |
mav |
MFC r302489: Remove rx_completion_task taskqueue.
It is not needed after RX lock removed in previous commit. |
304383 |
18-Aug-2016 |
mav |
MFC r302488: Remove unneeded RX lock, and make TX lock per-qp. |
304382 |
18-Aug-2016 |
mav |
MFC r302487: Reduce code divergence from Linux, preparing for DMA support. |
304381 |
18-Aug-2016 |
mav |
MFC r302486: Fix operation with multiple qps. |
304380 |
18-Aug-2016 |
mav |
MFC r302484: NewBus'ify NTB subsystem.
This follows NTB subsystem modularization in Linux, tuning it to FreeBSD native NewBus interfaces. This change allows to support different types of hardware with different drivers, support multiple NTB instances in a system, ntb_transport module use for needs other then if_ntb, etc.
Sponsored by: iXsystems, Inc. |
304377 |
18-Aug-2016 |
mav |
MFC r302483: Remove some dead code found by Clang static analyzer. |
304376 |
18-Aug-2016 |
mav |
MFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround.
Since SBARxSZ register can be write-once, it can be unusable for disabling the SBAR. For such case also set SBARxBASE to zero to not intersect with config BAR. |
304375 |
18-Aug-2016 |
mav |
MFC r302014: Fix if_ntb interface setup to include IFF_MULTICAST.
This allows IPv6 link local addresses (and other IPv6 functionality) to work. |
301904 |
15-Jun-2016 |
mav |
MFC r301293: When negotiating NTB_SB01BASE_LOCKUP workaround, don't try to limit the BAR size to 1MB. According to Xeon v3 specifications and my tests, that size register is write-once and so not writeable after BIOS written it.
Instead of that, make the code work with BAR of any sufficient size, properly calculating offset within its base. It also simplifies the code.
Sponsored by: iXsystems, Inc. |
301903 |
15-Jun-2016 |
mav |
MFC r301292: When negotiating MSIX parameters, give other head time to see our NTB_MSIX_RECEIVED status, before making upper layers overwrite it.
This is not completely perfect, but now it works better then before.
Sponsored by: iXsystems, Inc. |
301902 |
15-Jun-2016 |
mav |
MFC r300610: Re-enable write combining, disabled by default at r295486.
if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s to 8-10Gbit/s on my tests. |
301811 |
10-Jun-2016 |
ngie |
MFC r295618,r300100,r300531:
r295618 (by cem):
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)
r300100 (by cem):
ntb_hw(4): Add sysctls for administrative/test link config, state
dev.ntb_hw.0.admin_up=0/1: Like ifconfig UP/DOWN. dev.ntb_hw.0.active=0/1: Like ifconfig 'status'
r300531 (by cem):
ntb_hw(4): Only record the first three MSIX vectors
Don't overrun the msix_data array by reading the (unused) link state interrupt information. |
300516 |
23-May-2016 |
mav |
Add respective tunables to all sysctls.
This is direct commit to stable/10, since head does not need it any more. |
300373 |
21-May-2016 |
mav |
MFC 103 ntb(4) patches by cem@ up to r295487. |
256281 |
10-Oct-2013 |
gjb |
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
255281 |
05-Sep-2013 |
carl |
Remove contractions.
Approved by: jimharris Sponsored by: Intel
|
255280 |
05-Sep-2013 |
carl |
Only tear down interface and transport if they've been successfully setup.
Approved by: jimharris Sponsored by: Intel
|
255279 |
05-Sep-2013 |
carl |
Workaround an issue with hardware by accessing remote device through mem window.
Approved by: jimharris Sponsored by: Intel
|
255278 |
05-Sep-2013 |
carl |
Simplify register access macros by removing one level of indirection.
Approved by: jimharris Sponsored by: Intel
|
255277 |
05-Sep-2013 |
carl |
Cleaning up spacing and making hex value case consistent.
Approved by: jimharris Sponsored by: Intel
|
255276 |
05-Sep-2013 |
carl |
Implement workaround for IvyTown 4K BAR size issue.
Approved by: jimharris Sponsored by: Intel
|
255275 |
05-Sep-2013 |
carl |
Simplifying bus alloc resource call since we only need the default values.
Approved by: jimharris Sponsored by: Intel
|
255274 |
05-Sep-2013 |
carl |
Add support for per device features and workarounds.
Approved by: jimharris Sponsored by: Intel
|
255272 |
05-Sep-2013 |
carl |
Restructure the PCI bar initialization code in anticipation of upcoming bug fixes.
Approved by: jimharris Sponsored by: Intel
|
255271 |
05-Sep-2013 |
carl |
Fix name change from ntb_transport to if_ntb. A few places were overlooked.
Approved by: jimharris Sponsored by: Intel
|
255269 |
05-Sep-2013 |
carl |
Throw a bit to enable the link to come up on Xeon.
Approved by: jimharris Sponsored by: Intel
|
255268 |
05-Sep-2013 |
carl |
Add some logging to ntb link up.
Approved by: jimharris Sponsored by: Intel
|
250079 |
29-Apr-2013 |
carl |
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)
|