]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
8 years agostaging/rdma/hfi1: Fix for 32-bit counter overflow in driver and hfi1stats
Sebastian Sanchez [Wed, 3 Feb 2016 22:32:40 +0000 (14:32 -0800)]
staging/rdma/hfi1: Fix for 32-bit counter overflow in driver and hfi1stats

When 32-bit hardware counters overflow, hfi1stats misinterprets
the counters as being 64 bits causing the deltas for the
counters to be a huge number. This patch makes hfi1stats
aware that a counter is 32 bits by making the driver write
<counter name>,32 to debugfs.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Skip lcb init for simulation
Dean Luick [Wed, 3 Feb 2016 22:32:31 +0000 (14:32 -0800)]
staging/rdma/hfi1: Skip lcb init for simulation

The simulator does not correctly handle LCB cclk loopback.
Skip that step for simulation - it is not needed.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: No firmware retry for simulation
Dean Luick [Wed, 3 Feb 2016 22:32:23 +0000 (14:32 -0800)]
staging/rdma/hfi1: No firmware retry for simulation

Simulation has no firmware, so it will never move firmware
acquire to the FINAL state.  Avoid that by skiping the TRY
state and moving directly to FINAL.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Don't attempt to qualify or tune loopback plugs
Easwar Hariharan [Wed, 3 Feb 2016 22:32:14 +0000 (14:32 -0800)]
staging/rdma/hfi1: Don't attempt to qualify or tune loopback plugs

Loopback plugs used for testing hardware don't need to be qualified to
bring the link up unlike production cables. This patch adds an exception
for loopback plugs to the QSFP and SerDes tuning algortihm.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Make firmware failure messages warnings
Dean Luick [Wed, 3 Feb 2016 22:32:06 +0000 (14:32 -0800)]
staging/rdma/hfi1: Make firmware failure messages warnings

Make firmware validation failure and missing firmware messages
a warning since alternates can be tried.  Add an error message
when all attempts fail.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Only warn when board description is not found
Dean Luick [Wed, 3 Feb 2016 22:31:57 +0000 (14:31 -0800)]
staging/rdma/hfi1: Only warn when board description is not found

Change-Id: Icc4ad27c4c67e51df8c8a203c4f16973793678ec
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Fix per-VL transmit discard counts
Mike Marciniszyn [Wed, 3 Feb 2016 22:31:49 +0000 (14:31 -0800)]
staging/rdma/hfi1: Fix per-VL transmit discard counts

Implement per-VL transmit counters.  Not all errors can be
attributed to a particular VL, so make a best attempt.
o Extend the egress error bits used to count toward transmit
  discard.
o When an egress error or send error occur, try to map back
  to a VL.
o Implement a SDMA engine to VL (back) map.
o Add per-VL port transmit counters

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Fix missing firmware NULL dereference
Dean Luick [Wed, 3 Feb 2016 22:31:40 +0000 (14:31 -0800)]
staging/rdma/hfi1: Fix missing firmware NULL dereference

The gen3 bump code must mark a firmware download failure as fatal.
Otherwise a later load attempt will fail with a NULL dereference.

Also:
o Only do a firmware back-off for RTL.  There are no alternates for
  FPGA or simulation.
o Rearrange OS firmware request order to match what is actually
  loaded.  This results in more coherent informational messages
  in the case of missing firmware.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Support external device configuration requests from 8051
Easwar Hariharan [Wed, 3 Feb 2016 22:31:31 +0000 (14:31 -0800)]
staging/rdma/hfi1: Support external device configuration requests from 8051

This patch implements support for turning on and off the clock data
recovery mechanisms implemented in QSFP cable on request by the DC 8051
on a per-lane basis.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Get port type from configuration file
Easwar Hariharan [Wed, 3 Feb 2016 22:31:22 +0000 (14:31 -0800)]
staging/rdma/hfi1: Get port type from configuration file

The current code employs a heuristic to guess the port type.
The canonical location to identify the port type of the
designed platform is from the platform configuration data.

This patch uses the previously fetched port type from the platform
configuration and removes the now obsolete heuristic routine
and its associated defines.

Reviewed-by: Arthur Kepner <arthur.kepner@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Add active and optical cable support
Easwar Hariharan [Wed, 3 Feb 2016 22:31:14 +0000 (14:31 -0800)]
staging/rdma/hfi1: Add active and optical cable support

This patch qualifies and tunes active and optical cables for optimal
bit error rate and signal integrity settings. These settings are
fetched from the platform configuration data.

Based on attributes of the QSFP cable as read from the SFF-8636
compliant memory map, we select the appropriate settings from the
platform configuration data (examples: TX/RX equalization, enabling
cable high power, enabling TX/RX clock data recovery mechanisms, and RX
amplitude control) and apply them to the SERDES and QSFP cable.

The platform configuration data also contains system parameters such
as maximum power dissipation supported, and the cables are qualified
based on these parameters. As part of qualifying the cables, the
correct OfflineDisabledReasons are set for the appropriate scenarios.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Brent R Rothermel <brent.r.rothermel@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Fix QSFP memory read/write across 128 byte boundary
Mike Marciniszyn [Wed, 3 Feb 2016 22:31:05 +0000 (14:31 -0800)]
staging/rdma/hfi1: Fix QSFP memory read/write across 128 byte boundary

The QSFP memory cache reads both lower and upper page 0H in one shot,
which leads to the address counter wrapping around to the beginning of
lower page 00H at byte 128, as defined by SFF-8636.
This patch fixes this by modifying the underlying QSFP read and writes
to avoid this wrap around.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: cleanup messages on qsfp_read() failure
Easwar Hariharan [Wed, 3 Feb 2016 22:30:57 +0000 (14:30 -0800)]
staging/rdma/hfi1: cleanup messages on qsfp_read() failure

The ":" in "%s:" adds no value.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: HFI reports wrong offline disabled reason when cable removed
Bryan Morgan [Wed, 3 Feb 2016 22:30:49 +0000 (14:30 -0800)]
staging/rdma/hfi1: HFI reports wrong offline disabled reason when cable removed

Removing QSFP cable should report 'No Local Media' instead of
'Transient' as reported by 'opaportinfo'.
Workaround is to change the state to
OPA_LINKDOWN_REASON_LOCAL_MEDIA_NOT_INSTALLED in cable handler.

With cable still removed, 'opaportinfo bounce' should not cause a
state change to Polling, as reported by 'opaportinfo'.
Resolution is to prevent physical state change from Offline->Polling.

Use a macro to mask lower nibble of OPA_LINKDOWN_REASON* as needed
for offline_disabled_reason.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com>
Reviewed-by: Dean Luick <dean.luick@intel.com>
Reported-by: Todd Rimmer <todd.rimmer@intel.com>
Signed-off-by: Bryan Morgan <bryan.c.morgan@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove srq functionality
Jubin John [Wed, 3 Feb 2016 22:30:40 +0000 (14:30 -0800)]
staging/rdma/hfi1: Remove srq functionality

srq functionality is now in rdmavt. Remove it from the hfi1 driver.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove hfi1_query_qp function
Harish Chegondi [Tue, 19 Jan 2016 22:44:17 +0000 (14:44 -0800)]
staging/rdma/hfi1: Remove hfi1_query_qp function

Rely on rvt_query_qp function defined in rdmavt

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove create and free mad agents
Dennis Dalessandro [Tue, 19 Jan 2016 22:44:11 +0000 (14:44 -0800)]
staging/rdma/hfi1: Remove create and free mad agents

Get rid of create and free mad agent from the driver and use rdmavt
version.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use rdmavt device allocation function
Dennis Dalessandro [Tue, 19 Jan 2016 22:44:06 +0000 (14:44 -0800)]
staging/rdma/hfi1: Use rdmavt device allocation function

No longer do drivers need to call into the IB core to allocate the verbs
device.  Use the functionality provided by rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Clean up register device
Dennis Dalessandro [Tue, 19 Jan 2016 22:44:01 +0000 (14:44 -0800)]
staging/rdma/hfi1: Clean up register device

Now that rdmavt has solidified in its design we can clean up the driver
specific register device functions. This handles hfi1.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove post_recv and use rdmavt version
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:55 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove post_recv and use rdmavt version

This patch removes the simple post recv function in favor of using rdmavt.
The packet receive processing still lives in the driver though.

Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove destroy qp verb
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:50 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove destroy qp verb

This removes the destroy qp verbs in favor of using rdmavt.

Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove modify queue pair from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:44 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove modify queue pair from hfi1

In addition to removing the modify queue pair verb from hfi1 we also
remove ancillary functions which existed only for modify queue pair and
are also already present in hfi1.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove multicast verbs functions
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:39 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove multicast verbs functions

Multicast is now supported by rdmavt. Remove the verbs multicast functions
and use that.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use rdmavt version of post_send
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:33 +0000 (14:43 -0800)]
staging/rdma/hfi1: Use rdmavt version of post_send

This patch removes the post_send and post_one_send from the hfi1 driver.
The "posting" of sends will be done by rdmavt which will walk a WQE and
queue work. This patch will still provide the capability to schedule that
work as well as kick the progress. These are provided to the rdmavt layer.

Reviewed-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Edward Mascarenhas <edward.mascarenhas@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Clean up return handling
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:28 +0000 (14:43 -0800)]
staging/rdma/hfi1: Clean up return handling

Return directly from rvt_resize_cq rather than use a goto/label.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove CQ data structures and functions from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:22 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove CQ data structures and functions from hfi1

The completion queue is not a complex data structure and it can be removed
at the same time as its functions. Unlike the more complicated queue pair
which was done in multiple patches. This single patch removes all traces
of hfi1 specific completeion queues from the hfi1 driver.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove query_device function
Harish Chegondi [Tue, 19 Jan 2016 22:43:17 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove query_device function

Removed hfi1 query_device function to use rdmavt rvt_query_device function
The rvt dev info device attributes still need to be filled in by the driver

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove create_qp functionality
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:12 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove create_qp functionality

Rely on rdmavt to provide queue pair creation.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove qpdev and qpn table from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:06 +0000 (14:43 -0800)]
staging/rdma/hfi1: Remove qpdev and qpn table from hfi1

Another change on the way to removing queue pair functionality from
hfi1. This patch removes the private queue pair structure and the table
which holds the queue pair numbers in favor of using what is provided
by rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use rdmavt send flags and recv flags
Dennis Dalessandro [Tue, 19 Jan 2016 22:43:01 +0000 (14:43 -0800)]
staging/rdma/hfi1: Use rdmavt send flags and recv flags

Use the definitions of the s_flags and r_flags which are now in rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove user context allocation and de-alloction functions
Harish Chegondi [Tue, 19 Jan 2016 22:42:55 +0000 (14:42 -0800)]
staging/rdma/hfi1: Remove user context allocation and de-alloction functions

IB user context alloc and dealloc functions have been added to rdmavt.
This patch removes them from hfi1.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use rdmavt pkey verbs function
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:50 +0000 (14:42 -0800)]
staging/rdma/hfi1: Use rdmavt pkey verbs function

No need to keep providing the query pkey function. This is now being
done in rdmavt. Remove support from hfi1. The allocation and
maintenance of the list still resides in the driver.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove mmap from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:44 +0000 (14:42 -0800)]
staging/rdma/hfi1: Remove mmap from hfi1

Mmap data structure has already been moved to rdmavt and hfi1 supports
it. Now that the mmap functionality has also been moved to rdmavt its
time for hfi1 to use that as well.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove ibport and use rdmavt version
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:39 +0000 (14:42 -0800)]
staging/rdma/hfi1: Remove ibport and use rdmavt version

Remove most of the ibport members from hfi1 and use the rdmavt version.
Also register the port with rdmavt.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove srq from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:33 +0000 (14:42 -0800)]
staging/rdma/hfi1: Remove srq from hfi1

SRQ data structure has been moved to rdmavt. Make use of it.

Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove hfi1 MR and hfi1 specific qp type
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:28 +0000 (14:42 -0800)]
staging/rdma/hfi1: Remove hfi1 MR and hfi1 specific qp type

This patch does the actual removal of the queue pair from the hfi1 driver
along with a number of dependent data structures. These were moved to rvt.

It also removes the MR functions to use those in rdmavt.

These two pieces can not reasonably be split apart becuase they depend on
each other.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Implement hfi1 support for AH notification
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:22 +0000 (14:42 -0800)]
staging/rdma/hfi1: Implement hfi1 support for AH notification

For OPA devices additional work is required to create an AH.
This patch adds support to set the VL correctly.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use address handle in rdmavt and remove from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:17 +0000 (14:42 -0800)]
staging/rdma/hfi1: Use address handle in rdmavt and remove from hfi1

Original patch from Kamal Heib <kamalh@mellanox.com>, split
apart from original and modified to accomodate recent changes
in rdmavt.

Remove AH from hfi1 and use rdmavt version.

Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use correct rdmavt header files after move.
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:11 +0000 (14:42 -0800)]
staging/rdma/hfi1: Use correct rdmavt header files after move.

Rdmavt split the header files to be based on ibta object. This patch
makes changes in hfi1 to account for the move.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Add device specific info prints
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:06 +0000 (14:42 -0800)]
staging/rdma/hfi1: Add device specific info prints

Implement get_card_name and get_pci_dev helper functions for rdmavt
for hfi1.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove driver specific members from hfi1 qp type
Dennis Dalessandro [Tue, 19 Jan 2016 22:42:00 +0000 (14:42 -0800)]
staging/rdma/hfi1: Remove driver specific members from hfi1 qp type

In preparation for moving the queue pair data structure to rdmavt the
members of the driver specific queue pairs which are not common need to be
pushed off to a private driver structure. This structure will be available
in the queue pair once moved to rdmavt as a void pointer. This patch while
not adding a lot of value in and of itself is a prerequisite to move the
queue pair out of the drivers and into rdmavt.

The driver specific, private queue pair data structure should condense as
more of the send side code moves to rdmavt.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Remove MR data structures from hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:41:55 +0000 (14:41 -0800)]
staging/rdma/hfi1: Remove MR data structures from hfi1

Remove MR data structures from hfi1 and use the version in rdmavt

Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Use rdmavt protection domain
Dennis Dalessandro [Tue, 19 Jan 2016 22:41:50 +0000 (14:41 -0800)]
staging/rdma/hfi1: Use rdmavt protection domain

Remove protection domain from hfi1 and use rdmavt's version.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Consolidate dma ops for hfi1
Ira Weiny [Tue, 19 Jan 2016 22:41:44 +0000 (14:41 -0800)]
staging/rdma/hfi1: Consolidate dma ops for hfi1

Remove the dma.c file from hfi1 in favor of using that which is
present in rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Add basic rdmavt capability flags for hfi1
Dennis Dalessandro [Tue, 19 Jan 2016 22:41:39 +0000 (14:41 -0800)]
staging/rdma/hfi1: Add basic rdmavt capability flags for hfi1

Most functionality is still being done in the driver, set flags so that
rdmavt will let hfi1 continue to handle mr, qp, and cq init.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agostaging/rdma/hfi1: Begin to use rdmavt for verbs
Dennis Dalessandro [Tue, 19 Jan 2016 22:41:33 +0000 (14:41 -0800)]
staging/rdma/hfi1: Begin to use rdmavt for verbs

This patch begins to make use of rdmavt by registering with it and
providing access to the header files. This is just the beginning of
rdmavt support in hfi1.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove modify_port and port_immutable functions
Harish Chegondi [Wed, 3 Feb 2016 22:20:52 +0000 (14:20 -0800)]
IB/qib: Remove modify_port and port_immutable functions

Delete code from query_port which has been moved into rvt_query_port
Create a call back function to shut down a port which may be called from
rvt_modify_port

Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Support query gid in rdmavt
Dennis Dalessandro [Wed, 3 Feb 2016 22:20:44 +0000 (14:20 -0800)]
IB/qib: Support query gid in rdmavt

Query gid is in rdmavt, but still relies on the driver to maintain the
guid table. Add the necessary driver call back and remove the existing
verb handler.

Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove destroy queue pair code
Harish Chegondi [Wed, 3 Feb 2016 22:20:35 +0000 (14:20 -0800)]
IB/qib: Remove destroy queue pair code

Destroy QP functionality in rdmavt will be used instead.
Remove the remove_qp function being called exclusively by destroy qp code.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove modify queue pair code
Harish Chegondi [Wed, 3 Feb 2016 22:20:27 +0000 (14:20 -0800)]
IB/qib: Remove modify queue pair code

Modify queue pair functionality in rdmavt will be used instead.
Remove ancillary functions which are being used by modify QP code.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qib_lookup_qpn and use rvt_lookup_qpn instead
Harish Chegondi [Wed, 3 Feb 2016 22:20:19 +0000 (14:20 -0800)]
IB/qib: Remove qib_lookup_qpn and use rvt_lookup_qpn instead

Add calls to rcu_read_lock()/rcu_read_unlock() as rvt_lookup_qpn callers
must hold the rcu_read_lock before calling and keep the lock until the
returned qp is no longer in use.

Remove lookaside qp and some qp refcount atomics in the sdma send code
that is redundant with the s_dma_busy refcount, which will also stall
the state processing to the reset state.

Change the qpn hash function to hash_32 which is hash function used
in rvt_lookup_qpn. qpn_hash function would be eliminated in later patches.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Clean up register_ib_device
Dennis Dalessandro [Wed, 3 Feb 2016 22:20:10 +0000 (14:20 -0800)]
IB/qib: Clean up register_ib_device

Remove some of the unnecessary code from qib_register_ib_device.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove srq functionality
Jubin John [Wed, 3 Feb 2016 22:20:02 +0000 (14:20 -0800)]
IB/qib: Remove srq functionality

srq functionality is now in rdmavt. Remove it from the qib driver.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Properly pass gfp to hw driver function
Ira Weiny [Wed, 3 Feb 2016 22:15:28 +0000 (14:15 -0800)]
IB/rdmavt: Properly pass gfp to hw driver function

alloc_qpn must use GFP and the hardware drivers should use it as well.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add support for query_port, modify_port and get_port_immutable
Harish Chegondi [Wed, 3 Feb 2016 22:15:20 +0000 (14:15 -0800)]
IB/rdmavt: Add support for query_port, modify_port and get_port_immutable

rvt_query_port calls into the driver through a call back function
query_port_state to populate the rest of ib_port_attr elements.
rvt_modify_port calls into the driver if needed through a call back
function shut_down_port()

Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add query gid support.
Dennis Dalessandro [Wed, 3 Feb 2016 22:15:11 +0000 (14:15 -0800)]
IB/rdmavt: Add query gid support.

Addin query gid support. Rdmavt still relies on the driver to maintain
the gid table. Rdmavt simply calls into the driver to retrive the guid
for a particular port.

Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Clean up distinction between port number and index
Dennis Dalessandro [Wed, 3 Feb 2016 22:15:02 +0000 (14:15 -0800)]
IB/rdmavt: Clean up distinction between port number and index

IB core uses 1 relative indexing for ports. All of our data structures
use 0 based indexing. Add an inline function that we can use whenever we
need to validate a legal value and try to convert a port number to a
port index at the entrance into rdmavt.

Try to follow the policy that when we are talking about a port from IB
core point of view we refer to it as a port number. When port is an
index into our arrays refer to it as a port index.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add Mem affinity support
Mitko Haralanov [Wed, 3 Feb 2016 22:14:54 +0000 (14:14 -0800)]
IB/rdmavt: Add Mem affinity support

Change verbs memory allocations to the device numa node.  This keeps memory
close to the device for optimal performance.

Reviewed-by: Dean Luick <dean.luick@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add hardware driver send work request check
Ira Weiny [Wed, 3 Feb 2016 22:14:45 +0000 (14:14 -0800)]
IB/rdmavt: Add hardware driver send work request check

Some hardware drivers requires additional checks on send WRs.  Create an
optional call back to allow hardware drivers to reject a send WR.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add srq functionality to rdmavt
Jubin John [Wed, 3 Feb 2016 22:14:36 +0000 (14:14 -0800)]
IB/rdmavt: Add srq functionality to rdmavt

Fill in srq function stubs with code derived from hfi1 and qib.
Move necessary functions and data structure members as well.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qib_query_qp function
Harish Chegondi [Fri, 22 Jan 2016 21:08:01 +0000 (13:08 -0800)]
IB/qib: Remove qib_query_qp function

Rely on rvt_query_qp function defined in rdmavt

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qib multicast verbs functions
Harish Chegondi [Fri, 22 Jan 2016 21:07:55 +0000 (13:07 -0800)]
IB/qib: Remove qib multicast verbs functions

Multicast is now supported by rdmavt. Remove the verbs multicast functions
and use that.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qib_post_receive and use rdmavt version
Harish Chegondi [Fri, 22 Jan 2016 21:07:49 +0000 (13:07 -0800)]
IB/qib: Remove qib_post_receive and use rdmavt version

This patch removes the simple post recv function in favor of using rdmavt.
The packet receive processing still lives in the driver though.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Use rdmavt version of post_send
Harish Chegondi [Fri, 22 Jan 2016 21:07:42 +0000 (13:07 -0800)]
IB/qib: Use rdmavt version of post_send

This patch removes the post_send and post_one_send from the qib driver.
The "posting" of sends will be done by rdmavt which will walk a WQE and
queue work. This patch will still provide the capability to schedule that
work as well as kick the progress. These are provided to the rdmavt layer.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove completion queue data structures and functions from qib
Harish Chegondi [Fri, 22 Jan 2016 21:07:36 +0000 (13:07 -0800)]
IB/qib: Remove completion queue data structures and functions from qib

Use the completion queue functionality provided by rdmavt.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove create and free mad agents
Dennis Dalessandro [Fri, 22 Jan 2016 21:07:30 +0000 (13:07 -0800)]
IB/qib: Remove create and free mad agents

Get rid of create and free mad agent from the driver and use rdmavt
version.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Use rdmavt device allocation function
Dennis Dalessandro [Fri, 22 Jan 2016 21:07:23 +0000 (13:07 -0800)]
IB/qib: Use rdmavt device allocation function

No longer do drivers need to call into the IB core to allocate the verbs
device.  Use the functionality provided by rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add support for rvt_query_qp
Harish Chegondi [Fri, 22 Jan 2016 21:05:04 +0000 (13:05 -0800)]
IB/rdmavt: Add support for rvt_query_qp

Drivers using rdmavt can rely on rvt_query_qp instead of defining their own
query_qp functions.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Fix copyright date
Dennis Dalessandro [Fri, 22 Jan 2016 21:04:58 +0000 (13:04 -0800)]
IB/rdmavt: Fix copyright date

Update all files added by rdmavt which do not yet have 2016 as the
copyright year.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add mad agents to rdmavt
Dennis Dalessandro [Fri, 22 Jan 2016 21:04:51 +0000 (13:04 -0800)]
IB/rdmavt: Add mad agents to rdmavt

This patch adds mad agent create and free to rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add device structure allocation
Dennis Dalessandro [Fri, 22 Jan 2016 21:04:45 +0000 (13:04 -0800)]
IB/rdmavt: Add device structure allocation

This patch adds rdmavt device structure allocation in rdamvt. The
ib_device alloc is now done in rdmavt instead of the driver. Drivers
need to tell rdmavt the number of ports when calling.

A side of effect of this patch is fixing a bug with port initialization
where the device structure port array was allocated over top of an
existing one.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: add modify queue pair driver helpers
Ira Weiny [Fri, 22 Jan 2016 21:04:38 +0000 (13:04 -0800)]
IB/rdmavt: add modify queue pair driver helpers

Low level drivers need to be able to check incoming attributes as well as be
able to adjust their private data on queue pair modification.  Add 2 driver
callbacks, check_modify_qp and modify_qp, to facilitate this.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Remove unused variable from Queue Pair
Ira Weiny [Fri, 22 Jan 2016 21:04:32 +0000 (13:04 -0800)]
IB/rdmavt: Remove unused variable from Queue Pair

s_sde should be in the low level driver QP private data.

Remove the definition from rvt_qp.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add misc dev register functionality
Dennis Dalessandro [Fri, 22 Jan 2016 21:01:01 +0000 (13:01 -0800)]
IB/rdmavt: Add misc dev register functionality

There are a number of minor things that should be set by rdmavt rather
than by the drivers. Now that rdmavt has solidified in its design we can
go ahead and clean up this stuff.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add multicast functions
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:55 +0000 (13:00 -0800)]
IB/rdmavt: Add multicast functions

This patch adds in the multicast add and remove functions as well as the
ancillary infrastructure needed.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add post receive to rdmavt
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:48 +0000 (13:00 -0800)]
IB/rdmavt: Add post receive to rdmavt

This patch adds the simple post receive verbs call to rdmavt. The actual
interrupt handling and packet processing is still done in the low level
driver.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add destroy qp verb
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:42 +0000 (13:00 -0800)]
IB/rdmavt: Add destroy qp verb

This patch adds in support the qp destroy verb call.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add modify qp
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:35 +0000 (13:00 -0800)]
IB/rdmavt: Add modify qp

Add modify qp and supporting functions.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add support for tracing events
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:28 +0000 (13:00 -0800)]
IB/rdmavt: Add support for tracing events

This patch adds support of tracing events using the kernels built-in event
tracing infrastructure. This can be extended to provide a wide range of
trace and debug capabilities which have a negligible impact on performance
when enabled. These should be preferred over the use of the rvt_pr*
functions.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add post send to rdmavt
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:22 +0000 (13:00 -0800)]
IB/rdmavt: Add post send to rdmavt

Add in a post_send and post_one_send to rdmavt. The ULP will provide a WQE
to rdmavt which will then walk and queue each element. Rdmavt will then
queue the work to be done in the driver or kick the driver's progress
routine.

There needs to be a follow on patch which adds in another lock for the
head of the queue so that it can be added to and read from in parallel.
This will touch protocol handlers and require other changes in the
drivers. This will be done separately.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add completion queue functions
Dennis Dalessandro [Fri, 22 Jan 2016 21:00:15 +0000 (13:00 -0800)]
IB/rdmavt: Add completion queue functions

Brings in completion queue functionality. A kthread worker is added to
the rvt_dev_info to serve as a worker for completion queues.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove create qp and create qp table functionality
Harish Chegondi [Fri, 22 Jan 2016 20:56:52 +0000 (12:56 -0800)]
IB/qib: Remove create qp and create qp table functionality

Rely on rdmavt functions for creation of qp and qp table.  Function to
allocate a qpn is still being provided by qib as the algorithm to allocate
a qpn in qib is different from that of the algorithm in rdmavt.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Use rdmavt send and receive flags
Harish Chegondi [Fri, 22 Jan 2016 20:56:46 +0000 (12:56 -0800)]
IB/qib: Use rdmavt send and receive flags

Use the definitions of the s_flags and r_flags which are now in rdmavt.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qib_query_device function
Harish Chegondi [Fri, 22 Jan 2016 20:56:40 +0000 (12:56 -0800)]
IB/qib: Remove qib_query_device function

Removed qib_query_device function to use rdmavt rvt_query_device function
The device attributes still need to be filled in by the driver.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Delete QIB user context allocation and de-alloction functions
Harish Chegondi [Fri, 22 Jan 2016 20:56:33 +0000 (12:56 -0800)]
IB/qib: Delete QIB user context allocation and de-alloction functions

IB user context alloc and dealloc functions have been added to rdmavt.
Delete the QIB user context alloc/dealloc functions and use the ones in
rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qpn, qp tables and related variables from qib
Harish Chegondi [Fri, 22 Jan 2016 20:56:27 +0000 (12:56 -0800)]
IB/qib: Remove qpn, qp tables and related variables from qib

This patch removes the private queue pair structure and the table which
holds the queue pair numbers in favor of using what is provided by rdmavt.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Use rdmavt pkey verbs function
Harish Chegondi [Fri, 22 Jan 2016 20:56:21 +0000 (12:56 -0800)]
IB/qib: Use rdmavt pkey verbs function

Remove qib query pkey function which is no longer needed as this is now
being done in rdmavt. The allocation and maintenance of the list still
resides in the driver.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove mmap from qib
Harish Chegondi [Fri, 22 Jan 2016 20:56:14 +0000 (12:56 -0800)]
IB/qib: Remove mmap from qib

Since mmap functionality has been moved into rdmavt, its time for qib to
use that.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Implement qib support for AH notification
Harish Chegondi [Fri, 22 Jan 2016 20:56:08 +0000 (12:56 -0800)]
IB/qib: Implement qib support for AH notification

Additional work is required to create an AH. This patch adds support to
set the VL correctly.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove ibport and use rdmavt version
Harish Chegondi [Fri, 22 Jan 2016 20:56:02 +0000 (12:56 -0800)]
IB/qib: Remove ibport and use rdmavt version

Remove several ibport members from qib and use the rdmavt version. rc_acks,
rc_qacks, and rc_delayed_comp are defined as per CPU variables in rdmavt.
Add support for these rdmavt per CPU variables which were not per cpu
variables in qib ibport structure.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Support creating qps with GFP_NOIO flag
Mike Marciniszyn [Fri, 22 Jan 2016 20:50:43 +0000 (12:50 -0800)]
IB/rdmavt: Support creating qps with GFP_NOIO flag

The current code is problematic when the QP creation and ipoib is
used to support NFS and NFS desires to do IO for paging purposes.
In that case, the GFP_KERNEL allocation within create_qp causes
a deadlock in tight memory situations.

This fix adds support to create queue pair with GFP_NOIO flag for
connected mode only to cleanly fail the create queue pair in those
situations.

This was previously fixed in qib but needed to get ported to hfi1.
This patch handles that for both hardwares in the new rdmavt common
layer.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add support for rvt_query_device function
Harish Chegondi [Fri, 22 Jan 2016 20:50:36 +0000 (12:50 -0800)]
IB/rdmavt: Add support for rvt_query_device function

With this commit, the drivers using rdmavt need not define query_device
function. But they should fill in the IB device attributes structure
rvt_dev_info.dparms.props

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Allow reserving just one qpn
Harish Chegondi [Fri, 22 Jan 2016 20:50:30 +0000 (12:50 -0800)]
IB/rdmavt: Allow reserving just one qpn

qib needs to reserve only one qpn for non-verbs stuff. Also fixed the for
loop to reserve the end qpn.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Export reset_qp in rdmavt
Dennis Dalessandro [Fri, 22 Jan 2016 20:50:24 +0000 (12:50 -0800)]
IB/rdmavt: Export reset_qp in rdmavt

Until all queue pair functionality is moved to rdmavt we need to provide
access to the reset function. This is only temporary and will be reverted
back to a static, non exported function in the end.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add create queue pair functionality
Dennis Dalessandro [Fri, 22 Jan 2016 20:50:17 +0000 (12:50 -0800)]
IB/rdmavt: Add create queue pair functionality

Add create queue pair verbs call as well as supporting functions.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add R and S flags for queue pairs
Dennis Dalessandro [Fri, 22 Jan 2016 20:50:11 +0000 (12:50 -0800)]
IB/rdmavt: Add R and S flags for queue pairs

Use the flags originally provided for hfi1 in the rdmavt driver. These will
be made available to drivers in the qp header file.

Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/rdmavt: Add IB user context allocation and de-alloction functions
Harish Chegondi [Fri, 22 Jan 2016 20:50:05 +0000 (12:50 -0800)]
IB/rdmavt: Add IB user context allocation and de-alloction functions

Adding IB user context alloc and dealloc functions to rdmavt so that the
drivers that use rdmavt can use these functions instead of defining their
own functions.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove srq from qib
Dennis Dalessandro [Fri, 22 Jan 2016 20:46:17 +0000 (12:46 -0800)]
IB/qib: Remove srq from qib

Remove srq from qib now that it has been moved into rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Use address handle in rdmavt and remove from qib
Dennis Dalessandro [Fri, 22 Jan 2016 20:46:07 +0000 (12:46 -0800)]
IB/qib: Use address handle in rdmavt and remove from qib

Original patch from Kamal Heib <kamalh@mellanox.com>, split
apart from original.

Remove AH from qib and use rdmavt version.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
8 years agoIB/qib: Remove qp and mr functionality from qib
Dennis Dalessandro [Fri, 22 Jan 2016 20:45:59 +0000 (12:45 -0800)]
IB/qib: Remove qp and mr functionality from qib

Remove qp and mr support from qib and use rdmavt. These two changes
cannot be reasonably be split apart into separate patches because they
depend on each other in mulitple places. This paves the way to remove
even more functions in subsequent patches.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>