From: Chuck Lever <cel@kernel.org>
To: kdevops@lists.linux.dev
Subject: [PATCH RFC] bringup: Add soft iWARP bring-up option
Date: Wed, 24 Jan 2024 21:25:01 -0500 [thread overview]
Message-ID: <170614950178.1377604.2396910201664717408.stgit@renoir.1015granger.net> (raw)
From: Chuck Lever <chuck.lever@oracle.com>
An iWARP device on the target hosts enables testing RDMA-based
storage protocols such as SMB Direct, NVMeoF, or NFS/RDMA.
"rdma link" has to be done after every boot; it's not sticky, since
there's no physical RDMA device involved. Thus a udev rule is
inserted on each host to instantiate the siw device for the local
eth0, whenever it is rebooted.
Note that the Linux kernel Kconfig option
CONFIG_RDMA_SIW
must be set to M or Y in order for the siw.ko driver to be built for
the target hosts.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
Makefile | 4 ++++
kconfigs/Kconfig.bringup.goals | 11 +++++++++++
playbooks/roles/siw/tasks/main.yml | 23 +++++++++++++++++++++++
playbooks/roles/siw/templates/99-siw.rules | 2 ++
playbooks/siw.yml | 4 ++++
scripts/bringup.Makefile | 4 ++++
scripts/siw.Makefile | 5 +++++
7 files changed, 53 insertions(+)
create mode 100644 playbooks/roles/siw/tasks/main.yml
create mode 100644 playbooks/roles/siw/templates/99-siw.rules
create mode 100644 playbooks/siw.yml
create mode 100644 scripts/siw.Makefile
diff --git a/Makefile b/Makefile
index c9ee45a7a639..ad34743e3e53 100644
--- a/Makefile
+++ b/Makefile
@@ -118,6 +118,10 @@ ifeq (y,$(CONFIG_WORKFLOWS))
include workflows/Makefile
endif # CONFIG_WORKFLOWS
+ifeq (y,$(CONFIG_KDEVOPS_SETUP_SIW))
+include scripts/siw.Makefile
+endif # CONFIG_KDEVOPS_SETUP_SIW
+
ifeq (y,$(CONFIG_KDEVOPS_SETUP_KTLS))
include scripts/ktls.Makefile
endif # CONFIG_KDEVOPS_SETUP_KTLS
diff --git a/kconfigs/Kconfig.bringup.goals b/kconfigs/Kconfig.bringup.goals
index 8e4a8735f8e0..71948e9b65c6 100644
--- a/kconfigs/Kconfig.bringup.goals
+++ b/kconfigs/Kconfig.bringup.goals
@@ -77,6 +77,17 @@ config KDEVOPS_TRY_INSTALL_KDEV_TOOLS
most kernel developers might prefer to have installed on target
systems.
+config KDEVOPS_SETUP_SIW
+ bool "Configure soft iWARP on all test systems"
+ default n
+ help
+ Configure software-emulated RDMA on all target hosts via the
+ kernel siw.ko driver. siw can be used with any standard
+ Ethernet device, including virtio-net devices.
+
+ Because siw is currently not enabled in most Linux distro
+ kernels, this option defaults to N.
+
config KDEVOPS_SETUP_KTLS
bool "Configure ktls on the hosts with self-signed CA"
default n
diff --git a/playbooks/roles/siw/tasks/main.yml b/playbooks/roles/siw/tasks/main.yml
new file mode 100644
index 000000000000..6b0ab7ac02c0
--- /dev/null
+++ b/playbooks/roles/siw/tasks/main.yml
@@ -0,0 +1,23 @@
+- name: Import optional extra_args file
+ include_vars: "{{ item }}"
+ ignore_errors: yes
+ with_first_found:
+ - files:
+ - "../extra_vars.yml"
+ - "../extra_vars.yaml"
+ - "../extra_vars.json"
+ skip: true
+
+- name: Insert udev rule to create siw device
+ become: yes
+ become_method: sudo
+ template:
+ src: "99-siw.rules"
+ dest: "/usr/lib/udev/rules.d/"
+ owner: "root"
+ group: "root"
+
+- name: Reload udev rules
+ become: yes
+ become_method: sudo
+ ansible.builtin.command: "udevadm control --reload"
diff --git a/playbooks/roles/siw/templates/99-siw.rules b/playbooks/roles/siw/templates/99-siw.rules
new file mode 100644
index 000000000000..6c0cc7810e8e
--- /dev/null
+++ b/playbooks/roles/siw/templates/99-siw.rules
@@ -0,0 +1,2 @@
+ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth0", \
+ PROGRAM="/usr/sbin/rdma link add siw0 type siw netdev eth0"
diff --git a/playbooks/siw.yml b/playbooks/siw.yml
new file mode 100644
index 000000000000..5258a5af9dca
--- /dev/null
+++ b/playbooks/siw.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+ roles:
+ - role: siw
diff --git a/scripts/bringup.Makefile b/scripts/bringup.Makefile
index dcab51556ddb..6e64b6c12172 100644
--- a/scripts/bringup.Makefile
+++ b/scripts/bringup.Makefile
@@ -29,6 +29,10 @@ KDEVOPS_BRING_UP_DEPS += ktls
KDEVOPS_DESTROY_DEPS += ktls-destroy
endif # KDEVOPS_SETUP_KTLS
+ifeq (y,$(CONFIG_KDEVOPS_SETUP_SIW))
+KDEVOPS_BRING_UP_DEPS += siw
+endif # KDEVOPS_SETUP_SIW
+
ifeq (y,$(CONFIG_DEVCONFIG_ENABLE_SYSTEMD_JOURNAL_REMOTE))
JOURNAL_REMOTE:=$(subst ",,$(CONFIG_DEVCONFIG_SYSTEMD_JOURNAL_REMOTE_URL))
diff --git a/scripts/siw.Makefile b/scripts/siw.Makefile
new file mode 100644
index 000000000000..80f963092b11
--- /dev/null
+++ b/scripts/siw.Makefile
@@ -0,0 +1,5 @@
+siw:
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --extra-vars=@./extra_vars.yaml \
+ -f 30 -i hosts playbooks/siw.yml
+
+PHONY += siw
next reply other threads:[~2024-01-25 2:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 2:25 Chuck Lever [this message]
2024-01-25 13:26 ` [PATCH RFC] bringup: Add soft iWARP bring-up option Jeff Layton
2024-01-25 16:23 ` Chuck Lever III
2024-01-25 16:28 ` Luis Chamberlain
2024-01-25 16:35 ` Chuck Lever III
2024-01-25 16:46 ` Luis Chamberlain
2024-01-25 19:21 ` Chuck Lever III
2024-01-25 19:26 ` Luis Chamberlain
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=170614950178.1377604.2396910201664717408.stgit@renoir.1015granger.net \
--to=cel@kernel.org \
--cc=kdevops@lists.linux.dev \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).