ssa_path_record.h: Remove trailing spaces

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
access: Stop path record computation if PRDB is full

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
access: Add new AL function to return max. number of PR

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
plugin/configure.ac: Change '--enable-simulator-smdb' to '--enable-simulated-smdb'

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
plugin/ssa_extract.c: Remove unnecessary new line in log message

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
plugin/ssa_comparison.c: Fix pkey records comparison

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
acm.c: Report an error if ibv_query_gid is failed

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
acme.c: Exit with an error if path record validation fails

ib_acme utility returns non zero value if path validation
fails. Use of exit code allows ib_acme to be used by an
automatic script.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
access: Implement accurate number of PR calculation using LMC

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
access: Remove unused input parameters in ssa_pr_compute_pr_max_number

Access's data index doesn't improve performance because we have
to iterate over the GUID to LID table and perform look up.

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
acm.c: Change log level in cache popluation messages

The log level is changed from SSA_LOG_VERBOSE to
SSA_LOG_DB for some of the log messages in acm_xxx_dest
routines in order to reduce the ACM log file size
(especially when running SSA on large fabrics).

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
core.c: Lookup primary parent rather than child in core_update_tree

for decrementing child counts (of parent)

Pointed-out-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
core.c: Eliminate unneeded call to core_update_tree in core_process_leave

as core_update_tree just returns when child is NULL

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Add log message to ssa_riowrite routine

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Fix crash in downstream handler during sending SMDB

The crash was produced by the following scenario:

SSA tree: CORE + 1DL + 2AL

During SMDB update, one of the ALs was stuck in
the middle of SMDB receiving, and that prevented
the parent DL from receiving new SMDB updates
from CORE, but on each SSA_MSG_DB_UPDATE in DL
we had the following:
..
ssadb->p_db_field_tables = NULL;
ssadb->p_db_tables = NULL;
..
and after AL (that was stuck) kept running
DL crashed when continued sending corrupted SMDB.

Core dump BT:
*0 0x0000000000408564 in ssa_downstream_handle_query_field_defs (conn=0x7f57cc008590, hdr=0x7f57cc008870, events=1) at src/ssa.c:1890
*1 0x0000000000408ab0 in ssa_downstream_handle_op (conn=0x7f57cc008590, hdr=0x7f57cc008870, events=1, svc=0x7f57d00036f0, fds=0x7f57cc0008c0) at src/ssa.c:2001
*2 0x0000000000408ea3 in ssa_downstream_rrecv (conn=0x7f57cc008590, events=1, svc=0x7f57d00036f0, fds=0x7f57cc0008c0) at src/ssa.c:2080
*3 0x000000000040906e in ssa_downstream_handle_rsock_revents (conn=0x7f57cc008590, events=1, svc=0x7f57d00036f0, fds=0x7f57cc0008c0) at src/ssa.c:2125
*4 0x000000000040a728 in ssa_downstream_handler (context=0x7f57d00036f0) at src/ssa.c:2674
*5 0x00000038b9a07851 in start_thread () from /lib64/libpthread.so.0
*6 0x00000038b92e890d in clone () from /lib64/libc.so.6

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Updated a couple of comments due to previous commit

commit 42022d33cfcfa3d8a85ad7edf3dcdab746f2ac5d moved
some code from receipt of SSA_MSG_DB_UPDATE message
to SSA_DB_UPDATE_READY message so the comments
relating to flags in message should be updated
accordingly.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
acm.c: Add check for ssa_upstream_query_db() return value

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Add enums for response status to SSA_DB_QUERY message

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Return an error from ssa_open_devices if there is no IB device

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
ssa.c: Cosmetic change to log message

Make it more explicit to say "allocating memory for devices"

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