From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org"
<benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Subject: Re: [PATCH] Add rdma service for kernel boot support
Date: Thu, 13 Jul 2017 12:20:18 -0600 [thread overview]
Message-ID: <20170713182018.GE11069@obsidianresearch.com> (raw)
In-Reply-To: <1499968101.2740.10.camel-Sjgp3cTcYWE@public.gmane.org>
On Thu, Jul 13, 2017 at 05:48:22PM +0000, Bart Van Assche wrote:
> On Thu, 2017-07-13 at 19:20 +0200, Benjamin Drung wrote:
> > Currently upstream does not provide a rdma or openibd service. Only the
> > RedHat package ships a rdma service and rdma modules configuration
> > files. The ibacm and srp_daemon services depend on the openibd service.
> >
> > Make RedHat's rdma service available to all distros by cherry-picking
> > the basic files for the rdma service to run and trim them down to the
> > minimum. Do not pick workarounds or other quirk that might not needed
> > any more. Then replace the openibd service dependency by the rdma
> > service.
>
> Hello Benjamin,
>
> Shouldn't the rdma / openibd service be split into multiple services -
> one for IPoIB, one for the SRP initiator driver, one for the SRP target
> driver, one for the iSER initiator driver, one for the iSER target driver,
> one for RDS and one for NFSoRDMA? I think that would allow us to get rid
> of the rdma.conf configuration file and also that this would allow systemd
> to load those services concurrently that do not depend on each other.
I broadly agree.
For instance, Bart's work has already completely fixed srp to load
properly and race free. The missing piece is to have it also autoload
the required srp kernel module.
Benjamin, I have a different, simpler suggestion for some of the other
bits, let me post an RFC
Here is an untested attempt to move module loading into srp_daemon -
what do you think Bart?
Jason
>From 28c1e19719ed850bc8f328d187c536c97eef7fd7 Mon Sep 17 00:00:00 2001
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Date: Thu, 13 Jul 2017 12:10:07 -0600
Subject: [PATCH] srp: Autoload the SRP kernel module if required
Doing this before starting the daemon ensures the daemon will work.
Since the daemon is using sysfs files there is no easy way to have the
kernel auto load it.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
srp_daemon/srp_daemon.service.in | 2 +-
srp_daemon/srp_daemon_port@.service.in | 1 +
srp_daemon/srp_kernel_module.service | 12 ++++++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 srp_daemon/srp_kernel_module.service
diff --git a/srp_daemon/srp_daemon.service.in b/srp_daemon/srp_daemon.service.in
index 33dddd5cb46fef..cca1fce9c99283 100644
--- a/srp_daemon/srp_daemon.service.in
+++ b/srp_daemon/srp_daemon.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Daemon that discovers and logs in to SRP target systems
-Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf
+Documentation=man:srp_daemon file:/etc/srp_daemon.conf
DefaultDependencies=false
Conflicts=emergency.target emergency.service
Before=remote-fs-pre.target
diff --git a/srp_daemon/srp_daemon_port@.service.in b/srp_daemon/srp_daemon_port@.service.in
index 0ec966f912aec8..3c9c824fd243aa 100644
--- a/srp_daemon/srp_daemon_port@.service.in
+++ b/srp_daemon/srp_daemon_port@.service.in
@@ -3,6 +3,7 @@ Description=SRP daemon that monitors port %i
Documentation=man:srp_daemon file:/etc/rdma/rdma.conf file:/etc/srp_daemon.conf
DefaultDependencies=false
Conflicts=emergency.target emergency.service
+Requires=srp_kernel_module.service
After=srp_daemon.service dev-infiniband-umad-%i.device network.target
BindsTo=srp_daemon.service dev-infiniband-umad-%i.device
Before=remote-fs-pre.target
diff --git a/srp_daemon/srp_kernel_module.service b/srp_daemon/srp_kernel_module.service
new file mode 100644
index 00000000000000..b779031578dae1
--- /dev/null
+++ b/srp_daemon/srp_kernel_module.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Load the SRP daemon kernel module
+Documentation=man:srp_daemon
+After=systemd-modules-load.service
+ConditionCapability=CAP_SYS_MODULE
+ConditionPathIsDirectory=!/sys/class/infiniband_srp/
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecPre=bash -c 'mkdir -p /run/modules-load.d && echo ib_srp > /run/modules-load.d/rdma_core_srp_modules.conf'
+ExecStart=/lib/systemd/systemd-modules-load
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-07-13 18:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 17:20 [PATCH] Add rdma service for kernel boot support Benjamin Drung
[not found] ` <20170713172057.25411-1-benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-13 17:48 ` Bart Van Assche
[not found] ` <1499968101.2740.10.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 18:20 ` Jason Gunthorpe [this message]
[not found] ` <20170713182018.GE11069-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-13 18:33 ` Bart Van Assche
[not found] ` <1499970786.2740.17.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 22:15 ` Jason Gunthorpe
[not found] ` <20170713221520.GA10088-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-13 22:36 ` Bart Van Assche
[not found] ` <1499985409.2740.24.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 22:41 ` Jason Gunthorpe
[not found] ` <20170713224137.GA24689-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-13 22:45 ` Bart Van Assche
[not found] ` <1499985913.2740.26.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-13 22:51 ` Jason Gunthorpe
2017-07-14 10:08 ` Benjamin Drung
[not found] ` <1500026921.3563.27.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-14 10:18 ` Benjamin Drung
2017-07-14 15:55 ` Jason Gunthorpe
[not found] ` <20170714155544.GA25760-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-14 16:23 ` Benjamin Drung
[not found] ` <1500049393.3563.42.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-14 16:40 ` Jason Gunthorpe
[not found] ` <20170714164029.GA9942-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-07-20 9:04 ` Benjamin Drung
[not found] ` <1500541450.4226.5.camel-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2017-07-21 2:45 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170713182018.GE11069@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org \
--cc=benjamin.drung-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox