]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fc: add uevent for auto-connect
authorJames Smart <jsmart2021@gmail.com>
Thu, 14 Sep 2017 17:38:42 +0000 (10:38 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 4 Oct 2017 07:48:20 +0000 (09:48 +0200)
commit4d819408ffccb31cb9fc8db8a130cdcea9e7916d
treeee0eb14c65b75070ff55bb1763e02639dcc702d2
parent91959f3d71ecee59095d217b9145c77cc48cddac
nvme-fc: add uevent for auto-connect

To support auto-connecting to FC-NVME devices upon their dynamic
appearance, add a uevent that can kick off connection scripts.
uevent is posted against the fc_udev device.

patch set tested with the following rule to kick an nvme-cli connect-all
for the FC initiator and FC target ports. This is just an example for
testing and not intended for real life use.

ACTION=="change", SUBSYSTEM=="fc", ENV{FC_EVENT}=="nvmediscovery", \
        ENV{NVMEFC_HOST_TRADDR}=="*", ENV{NVMEFC_TRADDR}=="*", \
RUN+="/bin/sh -c '/usr/local/sbin/nvme connect-all --transport=fc --host-traddr=$env{NVMEFC_HOST_TRADDR} --traddr=$env{NVMEFC_TRADDR} >> /tmp/nvme_fc.log'"

I will post proposed udev/systemd scripts for possible kernel support.

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c
include/linux/nvme-fc-driver.h