Re: [PATCH v4 7/7] nvme: support rdma transport type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8/14/20 6:49 PM, Yi Zhang wrote:


On 8/14/20 2:18 PM, Sagi Grimberg wrote:
Signed-off-by: Sagi Grimberg <sagi@xxxxxxxxxxx>
---
  tests/nvme/rc | 15 +++++++++++++++
  1 file changed, 15 insertions(+)

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 3e97801bbb30..675acbfa7012 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -5,6 +5,7 @@
  # Test specific to NVMe devices
    . common/rc
+. common/multipath-over-rdma
    def_traddr="127.0.0.1"
  def_adrfam="ipv4"
@@ -25,6 +26,12 @@ _nvme_requires() {
          _have_modules nvmet nvme-core nvme-tcp nvmet-tcp
          _have_configfs
          ;;
+    rdma)
+        _have_modules nvmet nvme-core nvme-rdma nvmet-rdma
+        _have_configfs
+        _have_program rdma
+        _have_modules rdma_rxe siw

start_soft_rdma can use siw or rdma_rxe(default one) module, but some old distros may not support siw, but suppor rdma_rxe.
how about:
_have_modules rdma_rxe || _have_modules siw
+        ;;
      *)
          SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}"
          return 1
@@ -115,6 +122,9 @@ _cleanup_nvmet() {
          modprobe -r nvmet-${nvme_trtype} 2>/dev/null
      fi
      modprobe -r nvmet 2>/dev/null
+    if [[ "${nvme_trtype}" == "rdma" ]]; then
+        stop_soft_rdma
+    fi
  }
    _setup_nvmet() {
@@ -124,6 +134,11 @@ _setup_nvmet() {
          modprobe nvmet-${nvme_trtype}
      fi
      modprobe nvme-${nvme_trtype}
+    if [[ "${nvme_trtype}" == "rdma" ]]; then
+        start_soft_rdma
+        rdma_intfs=$(rdma_network_interfaces)
+        def_traddr=$(get_ipv4_addr ${rdma_intfs[0]})
The first rdma_intfs here maybe have DOWN state, which doesn't have an addr[1], I found similar check code here[2]
[1]
# echo $rdma_intfs
rdma_intfs:eno1
eno2
eno3
eno4
eno49
eno50
# [root@hpe-dl380gen9-01 blktests]# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 3c:a8:2a:21:7d:a4 brd ff:ff:ff:ff:ff:ff
3: eno49: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 8c:dc:d4:1e:7a:78 brd ff:ff:ff:ff:ff:ff
    inet 10.16.203.27/24 brd 10.16.203.255 scope global dynamic noprefixroute eno49
       valid_lft 84814sec preferred_lft 84814sec
    inet6 2620:52:0:10cb:8edc:d4ff:fe1e:7a78/64 scope global dynamic noprefixroute
       valid_lft 2591978sec preferred_lft 604778sec
    inet6 fe80::8edc:d4ff:fe1e:7a78/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
[2]
# grep -rin rdma_network_ tests/nvmeof-mp/
tests/nvmeof-mp/rc:93:        for i in $(rdma_network_interfaces); do
tests/nvmeof-mp/rc:235:        ) && for i in $(rdma_network_interfaces); do

+    fi
  }
    _nvme_disconnect_ctrl() {


_______________________________________________
Linux-nvme mailing list
Linux-nvme@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-nvme





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux