opensm/osm_vendor_ibumad.c: Add management class to error log message

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm: fix default cc_max_outstanding_mads assignment

Should be: OSM_CC_DEFAULT_MAX_OUTSTANDING_QUERIES instead of
OSM_PERFMGR_DEFAULT_MAX_OUTSTANDING_QUERIES

Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/osm_sw_info_rcv.c: Fixed locking issue on osm_get_node_by_guid error

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm: improve search common pkeys.

improving runtim of search comon pkeys code to o(n).

Signed-off-by: Daniel Klein <danielk@mellanox.com>
[alexne@mellanox.com: removed unused variables]
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm: Manage ports that do not support congestion control

Support the ability to run congestion support in an environment
where some IB hardware does not support congestion control.

In addition, by flagging ports that do not support congestion
control, we can reduce the amount of MAD traffic and log messages.

Signed-off-by: Albert Chu <chu11@llnl.gov>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm: osm_pkey: Remove unused variables

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alex Netes <alexne@mellanox.com>
OpenSM: Add new Mellanox OUI

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
osmtest/osmt_multicast.c: Fix 02BF error

when running osmtest -f m -M 2

Reported-by: Daniel Klein <danielk@mellanox.com>

Sep 04 20:27:28 920578 [D2499700] 0x02 -> osmt_run_mcast_flow: Checking partial JoinState delete request - removing NonMember (o15.0.1.14)...
Sep 04 20:27:28 920863 [D2499700] 0x02 -> osmt_run_mcast_flow: Validating Join State removal of Non Member bit (o15.0.1.14)...
Sep 04 20:27:28 921510 [D2499700] 0x02 -> osmt_run_mcast_flow: Validating Join State update remove (o15.0.1.14)...
Sep 04 20:27:28 921518 [D2499700] 0x01 -> osmt_run_mcast_flow: ERR 02BF: Validating JoinState update failed. Expected 0x25 got: 0x20
Sep 04 20:27:28 921527 [D2499700] 0x01 -> osmtest_run: ERR 0152: Multicast Flow failed: (IB_ERROR)
OSMTEST: TEST "Multicast" FAIL

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/configure.in: check that compiler supports __builtin_expect()

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/complib: define macros for for "if" statements with branch prediction hints

Defined "PT" and "PF" for "predict true"
and "predict false" respectively.

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/osm_node_info_rcv.c: using "PF" hint for all the fatal conditions

This is just the first file - similar optimization will be done
on other MADs receivers.

Note that this patch doesn't mess with all the non-fatal cases.
The goal was not to help SM to perform better with all the
validations that it does, but to make sure that the fatal
cases will never be predicted wrong, so any fatal check (existing
or a newely added one) won't affect the SM performance.

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/libvendor/osm_vendor_ibumad_sa.c: use wrapper function instead of direct access

Use existing wrapper function to get to context instead of direct access.

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/libvendor/osm_vendor_ibumad.c:rename "mad" to "p_mad" to indicate pointer

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/libvendor/osm_vendor_ibumad.c: validate response MAD properties

Check that attribute ID, attribute modifier and
transaction ID are the same in request and response.

Note that just by checking these we cover a very wide
range of possible bugs in SMAs. Attribute modifier is
used in PortInfo, LFT, MFT, and others.

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/osm_port_info_rcv.c: check received local_port_num

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/osm_port_info_rcv.c: use PF() hint on fatal conditions

Signed-off-by: Yevgeny Kliteynik <kliteyn@dev.mellanox.co.il>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm: Add .gitignore

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/osm_torus.c: Add error code to error log message

Also, cosmetic formatting change

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/complib/cl_spinlock.h: Remove some unimplemented routines

Remove cl_spinlock_acquire_irq and cl_spinlock_release_irq

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>
opensm/ib_types.h: Commentary and cosmetic formatting change

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Alex Netes <alexne@mellanox.com>