NTB: Add MSI interrupt support to ntb_transport
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 23 May 2019 22:30:59 +0000 (16:30 -0600)
committerJon Mason <jdmason@kudzu.us>
Thu, 13 Jun 2019 13:03:04 +0000 (09:03 -0400)
commit2b0569b3b7e6eac7a0c5aef741aeebe5675e1640
tree92c8db58edbb8a41037558f386d5ab52dd97be64
parent76ab785e7396796118016c8bc9fd62b58fe422ea
NTB: Add MSI interrupt support to ntb_transport

Introduce the module parameter 'use_msi' which, when set, uses
MSI interrupts instead of doorbells for each queue pair (QP). The
parameter is only available if NTB MSI support is configured into
the kernel. We also require there to be more than one memory window
(MW) so that an extra one is available to forward the APIC region.

To use MSIs, we request one interrupt per QP and forward the MSI address
and data to the peer using scratch pad registers (SPADS) above the MW
SPADS. (If there are not enough SPADS the MSI interrupt will not be used.)

Once registered, we simply use ntb_msi_peer_trigger and the receiving
ISR simply queues up the rxc_db_work for the queue.

This addition can significantly improve performance of ntb_transport.
In a simple, untuned, apples-to-apples comparision using ntb_netdev
and iperf with switchtec hardware, I see 3.88Gb/s without MSI
interrupts and 14.1Gb/s wit MSI, which is a more than 3x improvement.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Allen Hubbe <allenbh@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb_transport.c