Clean up resources before exiting

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon: Log critical event number

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Keep running if the monitored IB port is down

Make sure that srp_daemon keeps running if an IB cable is disconnected
and reconnected. LID reassignment by the SM is already handled since
LIDs are queried before a recalculation starts.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Eliminate timer thread

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Move node_table_response_size from srp_daemon.h to srp_daemon.c

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
do_*_port_list(): Allocate MAD buffer dynamically

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon/srp_daemon.sh: Eliminate run_srp_daemon

The run_srp_daemon script is no longer necessary since srp_daemon
keeps running even if an IB cable is disconnected temporarily.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Make sysconfdir configurable

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Makefile.am: Introduce INSTALL_DATA

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon.sh: Fix a race condition

Avoid that two simultaneously started srp_daemon.sh instances can
overwrite each others $pidfile.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon/srpd: Add

Add a script that starts srp_daemon during boot and stops it during
shutdown.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Switch to syslog and logrotate

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon/srp_daemon.sh: Start srp_daemon only on ports that support SRP

Avoids starting srp_daemon e.g. on ports configured in Ethernet
mode.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon/srp_daemon.sh: Correct the name of a variable

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srptools.spec: Conditionally append /etc/infiniband/openib.conf

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srptools.spec: Disable /etc/init.d/srpd before uninstall

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srptools.spec: Run chkconfig after RPM installation
ibsrpdm: Add MAD RMPP support

srp_daemon and ibsrpdm share a lot of code. Hence reimplement
ibsrpdm by making the behavior of the srp_daemon process dependent
on the name of the executable (argv[0]). As a result ibsrpdm gains
MAD RMPP support and ibsrpdm does no longer trigger the old ABI
warning ("user_mad: process ibsrpdm did not enable P_Key index
support / user_mad: Documentation/infiniband/user_mad.txt has info
on the new ABI.").

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Increase version number from 0.4.0 to 1.0.0

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
srp_daemon: Add P_Key support

Discover new Targets over all non-zero port P_Keys.
Use correct P_Key for new/modified Targets in fabric.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>