summaryrefslogtreecommitdiff
path: root/drivers/staging/rdma/hfi1/mad.c
AgeCommit message (Collapse)AuthorFilesLines
2016-03-17IB/hfi1: Improve LED beaconingEaswar Hariharan1-10/+10
The current LED beaconing code is unclear and uses the timer handler to turn off the timer. This patch simplifies the code by removing the special semantics of timeon = timeoff = 0 being interpreted as a request to turn off the beaconing. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Fix reporting of LED status in Get(LedInfo) and Get(PortInfo)Easwar Hariharan1-5/+19
The LedInfo SMA attribute is redefined to control the LED beaconing state machine instead of the LED directly. In accordance, we now return the state of LED beaconing, represented by whether the beaconing timer is active, instead of the state of the LED itself for SMA queries Get(LedInfo) and Get(PortInfo). While we are at it, we fix the beaconing timer control code so that the state of the timer is accurately updated. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Fix headerJubin John1-4/+1
Fix the header by moving the copyright notice out of the license text and to the top of the header. Also, update the copyright date. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Add braces on all arms of statementJubin John1-11/+12
Add braces on all arms of statements to fix checkpatch check: CHECK: braces {} should be used on all arms of this statement 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Fix code alignmentJubin John1-67/+74
Fix code alignment to fix checkpatch check: CHECK: Alignment should match open parenthesis 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Fix block commentsJubin John1-23/+39
Fix block comments with proper formatting to fix checkpatch warnings: WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Split multiple assignmentsJubin John1-4/+4
Split multiple assignments into individual assignments to fix checkpatch check: CHECK: multiple assignments should be avoided 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Remove unnecessary parenthesesJubin John1-7/+7
Remove unnecessary parentheses around addressof single $Lvals to fix checkpatch check: CHECK: Unnecessary parentheses around $var 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Fix logical continuationsJubin John1-6/+6
Move logical continuations to previous line to fix checkpatch check: CHECK: Logical continuations should be on the previous line 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Remove blank line before close braceJubin John1-2/+0
Remove extra blank line before close brace to fix checkpatch check: CHECK: Blank lines aren't necessary before a close brace '}' 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Remove blank line after an open braceJubin John1-2/+0
Remove blank line after an open brace to fix checkpatch check: CHECK: Blank lines aren't necessary after an open brace '{' 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Fix comparison to NULLJubin John1-4/+4
Convert pointer comparisons to NULL to !pointer to fix checkpatch check: CHECK: Comparison to NULL could be written "!pointer" 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Remove space after castJubin John1-24/+24
Remove the space after a cast to fix checkpatch check: CHECK: No space is necessary after a cast 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Remove multiple blank linesJubin John1-1/+0
Remove multiple blank lines to fix checkpatch check: CHECK: Please don't use multiple blank lines 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Add spaces around binary operatorsJubin John1-11/+11
Add spaces around binary operators. Fixes checkpatch check: CHECK: spaces preferred around that 'x' where x is a binary operator 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: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Put QPs into error state after SL->SC table changesKaike Wan1-2/+11
If an SL->SC mapping table change occurs after an RC/UC QP is created, there is no mechanism to change the SC nor the VL for that QP. The fix is to place the QP into error state so that ULP can recreate the QP with the new SL->SC mapping. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Kaike Wan <kaike.wan@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Adding support for hfi counters via sysfsSebastian Sanchez1-54/+252
It enables access to counters in /sys/class/infiniband/hfi1_0/ports/1/counters by providing infrastructure when PMA queries occur. Counters symbol_error and VL15_dropped are not supported in OPA, therefore, 0 will always be returned. In addition, two common routines (pma_get_opa_port_dctrs, pma_get_opa_port_ectrs) were created to query counters to avoid code duplication. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Replacement of goto's for break/returnsSebastian Sanchez1-26/+30
It replaces goto's for break and return statements in process_perf_opa(). Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Change for data type of port numberSebastian Sanchez1-7/+7
This commit changes the data type for port_num in pma_get_opa_porterrors() from unsigned long to u8. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Remove modify_port and port_immutable functionsHarish Chegondi1-1/+4
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>
2016-03-11staging/rdma/hfi1: Implement LED beaconing for maintenanceEaswar Hariharan1-3/+6
This patch implements LED beaconing for maintenance. A MAD packet with the LEDInfo attribute set to 1 will enable LED beaconing with a duty cycle of 2s on and 1.5s off. A MAD packet with the LEDInfo attribute set to 0 will disable beaconing and return the LED to normal operation. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com> Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-11staging/rdma/hfi1: Get port type from configuration fileEaswar Hariharan1-11/+1
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>
2016-03-11staging/rdma/hfi1: HFI reports wrong offline disabled reason when cable removedBryan Morgan1-9/+15
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>
2016-03-11staging/rdma/hfi1: Remove create and free mad agentsDennis Dalessandro1-70/+6
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>
2016-03-11staging/rdma/hfi1: Remove ibport and use rdmavt versionDennis Dalessandro1-74/+77
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>
2016-03-11staging/rdma/hfi1: Use address handle in rdmavt and remove from hfi1Dennis Dalessandro1-1/+1
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>
2016-03-11staging/rdma/hfi1: Use correct rdmavt header files after move.Dennis Dalessandro1-2/+2
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>
2016-03-11staging/rdma/hfi1: Begin to use rdmavt for verbsDennis Dalessandro1-2/+3
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>
2016-03-11staging/hfi1: Fix Xmit Wait calculationIra Weiny1-13/+20
Total XMIT wait needs to sum the xmit wait values of all the VLs not just those requested in the query. Also, make the algorithm used for both PortStatus and PortDataCounters the same. Reviewed-by: Arthur Kepner <arthur.kepner@intel.com> Reviewed-by: Breyer, Scott J <scott.j.breyer@intel.com> Signed-off-by: Ira Weiny <iweiny@gmail.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-01staging/hfi1: Use BIT macrojubin.john@intel.com1-2/+2
This patch fixes the checkpatch issue: CHECK: Prefer using the BIT macro Use of BIT macro for HDRQ_INCREMENT in chip.h causes a change in format specifier for error message in init.c in order to avoid a build warning. Reviewed-by: Dean Luick <dean.luick@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-12-22staging/rdma/hfi1: HFI now sends OPA Traps instead of IBTAErik E. Kahn1-60/+61
send_trap() was still using old ib_smp instead of opa_smp for formatting and sending traps. Reviewed-by: Arthur Kepner <arthur.kepner@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Erik E. Kahn <erik.kahn@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-22staging/rdma/hfi1: Adding counter resolutions for DataPortCountersAndrea Lowe1-12/+26
Changing the 32-bit reserved field in opa_port_data_counters_msg to the new 'resolution' field. PMA will use resolutions to right- shift values for LocalLinkIntegrity and LinkErrorRecovery when computing the ErrorCounterSummary for a DataPortCounters request. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Andrea Lowe <andrea.l.lowe@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-22staging/rdma/hfi1: Remove rcv bubbles codeIra Weiny1-62/+2
Rcv bubbles were improperly calculated for HFIs, fix that here. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-by: Arthur Kepner <arthur.kepner@intel.com> Signed-off-by: Ira Weiny <iweiny@gmail.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-16staging/rdma/hfi1: Fix for opaportconfig ledon by not checking for portNumSebastian Sanchez1-2/+2
opaportconfig ledon fails with error message due to port number being checked in the attr modifier. This change removes the check for the port number in AttrMod, so the P field is ignored. Reviewed-by: Easwar Hariharan <easwar.hariharan@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging/rdma/hfi1: Add irqsaves in the packet processing pathDean Luick1-2/+2
In preparation for threading the receive interrupt, add irqsaves in the packet processing path. When the receive interrupt is threaded, the packet processing path is no longer guaranteed to have IRQs disabled. Add irqsaves where needed on several locks in the packet processing path. Anything that did not have an obvious, "close" irqsave in its caller is a candidate. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17Staging: rdma: mad: Remove explicit castShivani Bhardwaj1-4/+4
Explicit type casting is not required as compiler can type cast variables implicitly. Therefore, it should be removed. Semantic patch used: @@ type T; T e; identifier x; @@ * T x = (T)e; Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17Staging: rdma: hfi1: Remove unnecessary cast on void pointerShraddha Barke1-4/+4
void pointers do not need to be cast to other pointer types. The semantic patch used to find this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-18IB/hfi1: fix pstateinfo from returning improperly byteswapped valueIra Weiny1-2/+2
Byteswap link_width_downgrade_*_active values before sending on the wire. In addition properly define the Port State Info structure. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Christian Gomez <christian.gomez@intel.com> Signed-off-by: Rimmer, Todd <todd.rimmer@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-08-29staging/hfi1: replace indent spaces with tabsJeff Becker1-5/+5
Running checkpatch.pl on mad.c produces several "ERROR: code indent should use tabs where possible" messages. This patch fixes these. Signed-off-by: Jeff Becker <Jeffrey.C.Becker@nasa.gov> Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-08-29IB/hfi1: add driver filesMike Marciniszyn1-0/+4257
Signed-off-by: Andrew Friedley <andrew.friedley@intel.com> Signed-off-by: Arthur Kepner <arthur.kepner@intel.com> Signed-off-by: Brendan Cunningham <brendan.cunningham@intel.com> Signed-off-by: Brian Welty <brian.welty@intel.com> Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Easwar Hariharan <easwar.hariharan@intel.com> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Jim Snow <jim.m.snow@intel.com> Signed-off-by: John Gregor <john.a.gregor@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Kaike Wan <kaike.wan@intel.com> Signed-off-by: Kevin Pine <kevin.pine@intel.com> Signed-off-by: Kyle Liddell <kyle.liddell@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Signed-off-by: Ravi Krishnaswamy <ravi.krishnaswamy@intel.com> Signed-off-by: Sadanand Warrier <sadanand.warrier@intel.com> Signed-off-by: Sanath Kumar <sanath.s.kumar@intel.com> Signed-off-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Vlad Danushevsky <vladimir.danusevsky@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>