forked from linux-rdma/rdma-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rdma-ndd: add rdma-ndd from infiniband-diags
rdma-ndd updates the node description sysfs attribute with a user settable value, notably it can keep it in sync with the system's hostname. This functionality will be removed from infiniband-diags when this is accepted. Signed-off-by: Ira Weiny <[email protected]>
- Loading branch information
Showing
10 changed files
with
553 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
lib/systemd/system/rdma-ndd.service | ||
lib/udev/rules.d/rdma-ndd.rules | ||
usr/sbin/rdma-ndd | ||
usr/share/doc/rdma-core/MAINTAINERS | ||
usr/share/doc/rdma-core/README.md | ||
usr/share/man/man8/rdma-ndd.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# COPYRIGHT (c) 2016 Intel Corporation. See COPYING file | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") | ||
|
||
rdma_sbin_executable(rdma-ndd | ||
rdma-ndd.c | ||
) | ||
|
||
target_link_libraries(rdma-ndd LINK_PRIVATE ${UDEV_LIBRARIES}) | ||
|
||
# FIXME Autogenerate from the .rst | ||
rdma_man_pages( | ||
rdma-ndd.8.in | ||
) | ||
|
||
install(FILES "rdma-ndd.rules" DESTINATION "${CMAKE_INSTALL_UDEV_RULESDIR}") | ||
|
||
rdma_subst_install(FILES "rdma-ndd.service.in" | ||
DESTINATION "${CMAKE_INSTALL_SYSTEMD_SERVICEDIR}" | ||
RENAME "rdma-ndd.service") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.\" Man page generated from reStructuredText. | ||
. | ||
.TH RDMA-NDD 8 "@BUILD_DATE@" "" "OpenIB Diagnostics" | ||
.SH NAME | ||
RDMA-NDD \- RDMA device Node Description update daemon | ||
. | ||
.nr rst2man-indent-level 0 | ||
. | ||
.de1 rstReportMargin | ||
\\$1 \\n[an-margin] | ||
level \\n[rst2man-indent-level] | ||
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] | ||
- | ||
\\n[rst2man-indent0] | ||
\\n[rst2man-indent1] | ||
\\n[rst2man-indent2] | ||
.. | ||
.de1 INDENT | ||
.\" .rstReportMargin pre: | ||
. RS \\$1 | ||
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] | ||
. nr rst2man-indent-level +1 | ||
.\" .rstReportMargin post: | ||
.. | ||
.de UNINDENT | ||
. RE | ||
.\" indent \\n[an-margin] | ||
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] | ||
.nr rst2man-indent-level -1 | ||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] | ||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u | ||
.. | ||
.SH SYNOPSIS | ||
.sp | ||
rdma\-ndd <options> | ||
.SH DESCRIPTION | ||
.sp | ||
rdma\-ndd is a system daemon which watches for rdma device changes and/or | ||
hostname changes and updates the Node Description of the rdma devices based on | ||
those changes. | ||
.SH DETAILS | ||
.sp | ||
Full operation of this daemon requires kernels which support polling of the | ||
procfs hostname file as well as libudev. | ||
.sp | ||
If your system does not support either of these features, the daemon will set | ||
the Node Descriptions at start up and then sleep forever. | ||
.SS Node Description configuration | ||
.sp | ||
The daemon uses the environment variable RDMA_NDD_ND_FORMAT to set the node | ||
description. The following wild cards can be specified for more dynamic | ||
control. | ||
.sp | ||
%h \-\- replace with the current hostname (not including domain) | ||
.sp | ||
%d \-\- replace with the device name (for example mlx4_0, qib0, etc.) | ||
.sp | ||
If not specified the default is "%h %d". | ||
.sp | ||
NOTE: At startup, and on new device detection, the Node Description is always | ||
written to ensure the SM and rdma\-ndd are in sync. Subsequent events will only | ||
write the Node Description on a device if it has changed. | ||
.SS Using systemd | ||
.sp | ||
Setting the environment variable for the daemon is normally be done via a | ||
systemd drop in unit. For example the following could be added to a file named | ||
/etc/systemd/system/rdma\-ndd.service.d/nd\-format.conf to use only the | ||
hostname as your node description. | ||
.sp | ||
[Service] | ||
Environment="RDMA_NDD_ND_FORMAT=%%h" | ||
.sp | ||
NOTE: Systemd requires an extra \(aq%\(aq. | ||
.SH OPTIONS | ||
.sp | ||
\fB\-f, \-\-foreground\fP | ||
Run in the foreground instead of as a daemon | ||
.sp | ||
\fB\-d, \-\-debugging\fP | ||
Log additional debugging information to syslog | ||
.SH AUTHOR | ||
.INDENT 0.0 | ||
.TP | ||
.B Ira Weiny | ||
< \fI\%[email protected]\fP > | ||
.UNINDENT | ||
.\" Generated by docutils manpage writer. | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
======== | ||
RDMA-NDD | ||
======== | ||
|
||
------------------------------------------ | ||
RDMA device Node Description update daemon | ||
------------------------------------------ | ||
|
||
:Date: @BUILD_DATE@ | ||
:Manual section: 8 | ||
:Manual group: OpenIB Diagnostics | ||
|
||
|
||
SYNOPSIS | ||
======== | ||
|
||
rdma-ndd <options> | ||
|
||
DESCRIPTION | ||
=========== | ||
|
||
rdma-ndd is a system daemon which watches for rdma device changes and/or | ||
hostname changes and updates the Node Description of the rdma devices based on | ||
those changes. | ||
|
||
|
||
DETAILS | ||
======= | ||
|
||
Full operation of this daemon requires kernels which support polling of the | ||
procfs hostname file as well as libudev. | ||
|
||
If your system does not support either of these features, the daemon will set | ||
the Node Descriptions at start up and then sleep forever. | ||
|
||
|
||
Node Description configuration | ||
------------------------------ | ||
|
||
The daemon uses the environment variable RDMA_NDD_ND_FORMAT to set the node | ||
description. The following wild cards can be specified for more dynamic | ||
control. | ||
|
||
%h -- replace with the current hostname (not including domain) | ||
|
||
%d -- replace with the device name (for example mlx4_0, qib0, etc.) | ||
|
||
If not specified the default is "%h %d". | ||
|
||
NOTE: At startup, and on new device detection, the Node Description is always | ||
written to ensure the SM and rdma-ndd are in sync. Subsequent events will only | ||
write the Node Description on a device if it has changed. | ||
|
||
Using systemd | ||
------------- | ||
|
||
Setting the environment variable for the daemon is normally be done via a | ||
systemd drop in unit. For example the following could be added to a file named | ||
/etc/systemd/system/rdma-ndd.service.d/nd-format.conf to use only the | ||
hostname as your node description. | ||
|
||
[Service] | ||
Environment="RDMA_NDD_ND_FORMAT=%%h" | ||
|
||
NOTE: Systemd requires an extra '%'. | ||
|
||
|
||
OPTIONS | ||
======= | ||
|
||
**-f, --foreground** | ||
Run in the foreground instead of as a daemon | ||
|
||
**-d, --debugging** | ||
Log additional debugging information to syslog | ||
|
||
|
||
AUTHOR | ||
====== | ||
|
||
Ira Weiny | ||
< [email protected] > |
Oops, something went wrong.