From patchwork Fri Nov 15 17:07:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11246885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C1A413BD for ; Fri, 15 Nov 2019 17:07:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0C4520733 for ; Fri, 15 Nov 2019 17:07:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727552AbfKORHW (ORCPT ); Fri, 15 Nov 2019 12:07:22 -0500 Received: from mail-pl1-f169.google.com ([209.85.214.169]:43264 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727528AbfKORHW (ORCPT ); Fri, 15 Nov 2019 12:07:22 -0500 Received: by mail-pl1-f169.google.com with SMTP id a18so5058697plm.10 for ; Fri, 15 Nov 2019 09:07:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1EYBFDT7Yxn9EjoXkexEuSV1/U3eX7W64+vi+cOaK3o=; b=RU53n+lC8QD0C0C0pUxlROkzobnez5jdrAWM2yasmpzMghvmvOsniNQ3OEbQ2q+GfN NxTcHNsn8t2DZ6Kv6/4hwuhaQJakuNwp1SNUvECraJLn+4QY3kkViiaNYJssl+K76qXr ZEeCeVoigOqjOPMQr5c71W3wiqry+YKJ3cjenlKhE2c/RrgswVv5l3VZG9VYiBfgWNy+ yAN4cioDEX0ZQDG19F72gIGGPJkVkcGhdWhEkm91Fbogg1WFQSZCYoeDJ8lX3hGUx7Cu DD7hgkjjXej74hhPgJOVaOyab8LXzzTIFk+8v00E2Dhv3myyQv6ntAKMt3dIaU2vNabV 8TuA== X-Gm-Message-State: APjAAAVsms1CTTyfhDinQF4/B5Xo7cZfiOIlJFa/9e9qdRvRpnQro0af NOZGW7BqxxV4PlxnNjq5c1LPw+rZ X-Google-Smtp-Source: APXvYqxOSvLLP1IEFERAI+pkuPs53GSHWY92wy9ztmoV8KdCIuIjJx6hKfhwcWBGYp4tBpvYtSEG3A== X-Received: by 2002:a17:902:9689:: with SMTP id n9mr16445323plp.222.1573837641218; Fri, 15 Nov 2019 09:07:21 -0800 (PST) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id m7sm2364793pfb.153.2019.11.15.09.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 09:07:20 -0800 (PST) From: Bart Van Assche To: Omar Sandoval Cc: linux-block@vger.kernel.org, Bart Van Assche Subject: [PATCH blktests 1/4] common/multipath-over-rdma: Fix expand_ipv6_addr() Date: Fri, 15 Nov 2019 09:07:08 -0800 Message-Id: <20191115170711.232741-2-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog In-Reply-To: <20191115170711.232741-1-bvanassche@acm.org> References: <20191115170711.232741-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org For IPv6 address ::1, instead of returning 0:0000:0000:0000:0000:0000:0000:0000:0001, return 0000:0000:0000:0000:0000:0000:0000:0001. Signed-off-by: Bart Van Assche --- common/multipath-over-rdma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index 545a81e8c18e..15f296ef2ab7 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -61,7 +61,7 @@ get_ipv4_addr() { # Convert e.g. ::1 into 0000:0000:0000:0000:0000:0000:0000:0001. expand_ipv6_addr() { - awk -F : 'BEGIN{left=1} { for(i=1;i<=NF;i++) { a=substr("0000", 1+length($i)) $i; if ($i == "") left=0; else if (left) pre = pre ":" a; else suf = suf ":" a }; mid=substr(":0000:0000:0000:0000:0000:0000:0000:0000", (pre!="")+length(pre)+length(suf)); print substr(pre,2) mid suf}' + awk -F : '{ left=1; for(i=1;i<=NF;i++) { a=substr("0000", 1+length($i)) $i; if ($i == "") left=0; else if (left) pre = pre ":" a; else suf = suf ":" a }; mid=substr("0000:0000:0000:0000:0000:0000:0000:0000", (pre=="")+length(pre)+length(suf)); print substr(pre,2) mid suf}' } get_ipv6_addr() { From patchwork Fri Nov 15 17:07:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11246887 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCF5B13BD for ; Fri, 15 Nov 2019 17:07:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD32620728 for ; Fri, 15 Nov 2019 17:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727559AbfKORHZ (ORCPT ); Fri, 15 Nov 2019 12:07:25 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46959 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727528AbfKORHZ (ORCPT ); Fri, 15 Nov 2019 12:07:25 -0500 Received: by mail-pl1-f195.google.com with SMTP id l4so5054223plt.13 for ; Fri, 15 Nov 2019 09:07:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fZuM0OMnnuVK635Locm2PXONrFxTzuYB2o0guTYaPaU=; b=fwV4fxa5exluNqZ/+IxCLBA6kvTPOH9cpYZ7sENx32GgolOZ7i+2bUOun2TgHWGeDw Q0rFAr6qbI202OmoUIUOPZCEMeaaVMrNBKFgZzPTAg8zc52i8Et9DP/4xTwtwnnmSeiP 1bMC88qW+U+3H8qZRZZwk8cECQBTlJZOJxAW45B/f0ZwZSVUco9BY2cKVsdKklckC6oG u88NrsykB2e/1a9mLxQRqjrecW1Lg+q/f3zXfl/Lbn0uT9Dr/kt9THJHPht5g10kgrWB amemVrycUKmN/60Os22Uo9NOOd6umEU/5L4MndtV9Qgq/yGEpLTnsF5RMruI0T9Ump7u y1ww== X-Gm-Message-State: APjAAAVoDv7IzrekRXPPRIg90a9/G5a82e+ISXAUunUmxAMTspc18+Ao /iww5YPDZxpYvWvKolXChu4ATPt4 X-Google-Smtp-Source: APXvYqw/qC1jbnkzdA4Qr/DOwC47G7nZBAbl1YDb90u8B3mMRSIF2oOaEV/RjFOTKp03Y+ETBFJSuw== X-Received: by 2002:a17:902:be14:: with SMTP id r20mr15543734pls.297.1573837642930; Fri, 15 Nov 2019 09:07:22 -0800 (PST) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id m7sm2364793pfb.153.2019.11.15.09.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 09:07:21 -0800 (PST) From: Bart Van Assche To: Omar Sandoval Cc: linux-block@vger.kernel.org, Bart Van Assche Subject: [PATCH blktests 2/4] common/multipath-over-rdma: Rename two functions Date: Fri, 15 Nov 2019 09:07:09 -0800 Message-Id: <20191115170711.232741-3-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog In-Reply-To: <20191115170711.232741-1-bvanassche@acm.org> References: <20191115170711.232741-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Since the meaning of this functions will change, make sure that the function name will match the new meaning. Signed-off-by: Bart Van Assche --- common/multipath-over-rdma | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index 15f296ef2ab7..9f645f759d2d 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -409,7 +409,7 @@ has_rdma_rxe() { } # Load the rdma_rxe kernel module and associate it with all network interfaces. -start_rdma_rxe() { +start_soft_rdma() { { modprobe rdma_rxe || return $? ( @@ -425,7 +425,7 @@ start_rdma_rxe() { # Dissociate the rdma_rxe kernel module from all network interfaces and unload # the rdma_rxe kernel module. -stop_rdma_rxe() { +stop_soft_rdma() { ( cd /sys/class/net && for i in *; do @@ -608,7 +608,7 @@ unload_null_blk() { } setup_rdma() { - start_rdma_rxe + start_soft_rdma ( echo "RDMA interfaces:" cd /sys/class/infiniband && @@ -627,7 +627,7 @@ teardown_uncond() { killall -9 multipathd >&/dev/null rm -f /etc/multipath.conf stop_target - stop_rdma_rxe + stop_soft_rdma unload_null_blk } From patchwork Fri Nov 15 17:07:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11246889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 933301393 for ; Fri, 15 Nov 2019 17:07:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 755EE20728 for ; Fri, 15 Nov 2019 17:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727606AbfKORH1 (ORCPT ); Fri, 15 Nov 2019 12:07:27 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35221 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727528AbfKORH0 (ORCPT ); Fri, 15 Nov 2019 12:07:26 -0500 Received: by mail-pl1-f194.google.com with SMTP id s10so5081814plp.2 for ; Fri, 15 Nov 2019 09:07:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=drl3Eju3FzWAdVgHEQUgqm6x19DdmauK5QkwxXRH7qI=; b=kvKBhNGwXhMDa7wjtAJ9x1KwlS8lxcUhmJb4EvTCIhIPxurSYF/cOBDGj3MoYDKXDk 5AESoz2Q2eCZMwQJReTgmJO1u4e2u9R5BzW0oyn5q38fnLpgiWFXvgBbiEPxfQsOIHFt ELb3vSJOrX1B+lC3wpSIG8WbwPpOrSl2OnFD+MhwRG3h8HNUe4bSCnux/G5gsYckc1ov UgPSdTJKUW5eydVWwnO8JJQVQcYQeZsPMoy19mvlI9h8eh4nyQ6SMYwVHhEJG/U6NVQH BCY9mx7KK6F89mNW9z1JEM8xo/4t1MASjZXmyiJYnnkV98TW/sz5BU7Yk6v+pTIv7ZiH 8sOA== X-Gm-Message-State: APjAAAUTPZatddXzUxlKYoHx4y+4NqeL+mQMMGEviNYKTwRrxFZMX+FH lCAmzFBHI8rN+uOfAcR+wH8= X-Google-Smtp-Source: APXvYqx9938NVnh+6xvcDr9EfgENiuZi1nBozLpOQyCS7I/EZWRveBfiB3aCXwxvPD2R7gXaXNCCFg== X-Received: by 2002:a17:902:9882:: with SMTP id s2mr7580654plp.101.1573837644305; Fri, 15 Nov 2019 09:07:24 -0800 (PST) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id m7sm2364793pfb.153.2019.11.15.09.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 09:07:23 -0800 (PST) From: Bart Van Assche To: Omar Sandoval Cc: linux-block@vger.kernel.org, Bart Van Assche Subject: [PATCH blktests 3/4] common/multipath-over-rdma, tests/srp: Make it easy to use siw instead of rdma_rxe Date: Fri, 15 Nov 2019 09:07:10 -0800 Message-Id: <20191115170711.232741-4-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog In-Reply-To: <20191115170711.232741-1-bvanassche@acm.org> References: <20191115170711.232741-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Make all_primary_gids() return GIDs with zero suffix since SoftiWARP GIDs have such a suffix. Add SoftiWARP support in start_soft_rdma() and stop_soft_rdma(). Make do_rdma_cm_login() submit the source IP address and scope ID to the SRP initiator driver since that information is essential to establish an IPv6 connection between link-local addresses. Iterate over RDMA ports instead of UMAD device nodes in log_in() since no UMAD device node is associated with SoftiWARP ports. In start_lio_srpt(), use the GID format to identify SoftiWARP ports since the GID suffix for these ports is zero. Signed-off-by: Bart Van Assche --- common/multipath-over-rdma | 48 ++++++++++++++++--- tests/srp/rc | 98 ++++++++++++++++++++++---------------- 2 files changed, 99 insertions(+), 47 deletions(-) diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma index 9f645f759d2d..40efc4b3aa2e 100644 --- a/common/multipath-over-rdma +++ b/common/multipath-over-rdma @@ -11,6 +11,7 @@ filesystem_type=ext4 fio_aux_path=/tmp/fio-state-files memtotal=$(sed -n 's/^MemTotal:[[:blank:]]*\([0-9]*\)[[:blank:]]*kB$/\1/p' /proc/meminfo) max_ramdisk_size=$((1<<25)) +use_siw= ramdisk_size=$((memtotal*(1024/16))) # in bytes if [ $ramdisk_size -gt $max_ramdisk_size ]; then ramdisk_size=$max_ramdisk_size @@ -389,9 +390,13 @@ function mountpoint() { # All primary RDMA GIDs all_primary_gids() { - find /sys/devices -name infiniband | while read -r p; do - cat "$p"/*/ports/*/gids/0 - done | grep -v ':0000:0000:0000:0000$' + local gid p + + for p in /sys/class/infiniband/*/ports/*/gids/0; do + gid="$(<"$p")" + [ "$gid" != 0000:0000:0000:0000:0000:0000:0000:0000 ] && + echo "$gid" + done } # Check whether or not an rdma_rxe instance has been associated with network @@ -408,24 +413,40 @@ has_rdma_rxe() { return 1 } -# Load the rdma_rxe kernel module and associate it with all network interfaces. +# Load the rdma_rxe or siw kernel module and associate it with all network +# interfaces. start_soft_rdma() { { + if [ -n "$use_siw" ]; then + modprobe siw || return $? + ( + cd /sys/class/net && + for i in *; do + [ -e "$i" ] || continue + [ -e "/sys/class/infiniband/${i}_siw" ] && continue + rdma link add "${i}_siw" type siw netdev "$i" || + echo "Failed to bind the siw driver to $i" + done + ) + else modprobe rdma_rxe || return $? ( cd /sys/class/net && for i in *; do if [ -e "$i" ] && ! has_rdma_rxe "$i"; then - echo "$i" > /sys/module/rdma_rxe/parameters/add + echo "$i" > /sys/module/rdma_rxe/parameters/add || + echo "Failed to bind the rdma_rxe driver to $i" fi done ) + fi } >>"$FULL" } -# Dissociate the rdma_rxe kernel module from all network interfaces and unload -# the rdma_rxe kernel module. +# Dissociate the rdma_rxe or siw kernel module from all network interfaces and +# unload the rdma_rxe kernel module. stop_soft_rdma() { + { ( cd /sys/class/net && for i in *; do @@ -439,6 +460,19 @@ stop_soft_rdma() { echo "Unloading rdma_rxe failed" return 1 fi + ( + cd /sys/class/net && + for i in *_siw; do + [ -e "$i" ] || continue + rdma link del "${i}" || + echo "Failed to unbind the siw driver from ${i%_siw}" + done + ) + if ! unload_module siw 10; then + echo "Unloading siw failed" + return 1 + fi + } >>"$FULL" } # /dev/sd... device node assigned to the scsi_debug kernel module. diff --git a/tests/srp/rc b/tests/srp/rc index a1bc09b496ec..2738c8f6a4e5 100755 --- a/tests/srp/rc +++ b/tests/srp/rc @@ -138,30 +138,51 @@ do_ib_cm_login() { done } +rdma_dev_to_net_dev() { + local b d rdma_dev=$1 + + b=/sys/class/infiniband/$rdma_dev/parent + if [ -e "$b" ]; then + echo "$(<"$b")" + else + echo "${rdma_dev%_siw}" + fi +} + # Tell the SRP initiator to log in to an SRP target using the RDMA/CM. # Arguments: $1: SRP target IOC GUID; $2: IB device to log in to; $3: additional # login parameters. do_rdma_cm_login() { - local a b add_param d dest dests ibdev ioc_guid pd + local a b c add_param d dest dests ibdev ioc_guid params ioc_guid=$1 ibdev=$2 add_param=$3 - pd=/sys/class/infiniband/$ibdev/parent - if [ -e "$pd" ]; then - d=$(<"$pd") + if d=$(rdma_dev_to_net_dev "$ibdev"); then a=$(get_ipv4_addr "$(basename "$d")") b=$(get_ipv6_addr "$(basename "$d")") fi echo "Interface $d: IPv4 $a IPv6 $b" >>"$FULL" [ -n "$a$b" ] || return 1 + b=${b}%$(<"/sys/class/net/$d/ifindex") dests=() - [ -n "$a" ] && dests+=("${a}:${srp_rdma_cm_port}") - [ -n "$b" ] && dests+=("[${b}]:${srp_rdma_cm_port}") + for c in $a; do + dests+=("${c}:${srp_rdma_cm_port}") + done + for c in $b; do + dests+=("[${c}]:${srp_rdma_cm_port}") + done for dest in "${dests[@]}"; do + src=${dest%:*} for p in "/sys/class/infiniband_srp/srp-${2}-"*; do [ -e "$p" ] || continue - srp_single_login "id_ext=$ioc_guid,ioc_guid=$ioc_guid,dest=$dest,$add_param" "$p/add_target" + ibdev=$(<"$p/ibdev") + port=$(<"$p/port") + gid=$(<"/sys/class/infiniband/$ibdev/ports/$port/gids/0") + gid=${gid//:} + gid_pfx=${gid:0:16} + params+="id_ext=$ioc_guid,initiator_ext=$gid_pfx,ioc_guid=$ioc_guid,src=$src,dest=$dest,$add_param" + srp_single_login "${params}" "$p/add_target" done done } @@ -201,11 +222,11 @@ log_in() { ioc_guid=$(>"$FULL" for p in /sys/class/infiniband/*/ports/*; do [ -e "$p" ] || continue - link_layer=$(<"$p/link_layer") - case "$link_layer" in - InfiniBand) - guid=$(<"$p/gids/0") - gid=$(echo "${guid}" | sed 's/^fe8/0x000/;s/://g') - guid=${guid#fe80:0000:0000:0000:} - [ "$guid" = "0000:0000:0000:0000" ] && continue - ini_guids+=("$guid") - ini_gids+=("$gid") - ;; - *) - d=$(<"$(dirname "$(dirname "$p")")/parent") - for b in $(get_ipv4_addr "$d") \ - $(get_ipv6_addr "$d"|expand_ipv6_addr); do - ini_guids+=("$b") - ini_gids+=("$b") - done - ;; - esac + gid=$(<"$p/gids/0") + if [ "${gid#fe8}" != "$gid" ]; then + gid=${gid#fe80:0000:0000:0000:} + ini_ids+=("$gid") + else + gid="0x${gid//:}" + ini_ids+=("$gid") + fi + d=$(rdma_dev_to_net_dev "$(basename "$(dirname "$(dirname "$p")")")") + for b in $(get_ipv4_addr "$d") \ + $(get_ipv6_addr "$d"|expand_ipv6_addr); do + ini_ids+=("$b") + done done + echo "ini_ids=${ini_ids[*]}" >>"$FULL" mount_configfs || return $? modprobe target_core_mod || return $? modprobe target_core_iblock || return $? @@ -519,10 +540,7 @@ start_lio_srpt() { echo "${srp_rdma_cm_port}" > discovery_auth/rdma_cm_port || return $? fi - configure_target_ports "${target_guids[@]}" -- "${ini_guids[@]}" || { - echo "Retrying with old port name format" - configure_target_ports "${target_gids[@]}" -- "${ini_gids[@]}" - } + configure_target_ports "${target_ids[@]}" -- "${ini_ids[@]}" ) } From patchwork Fri Nov 15 17:07:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11246891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B232E159A for ; Fri, 15 Nov 2019 17:07:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C6A52073A for ; Fri, 15 Nov 2019 17:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727528AbfKORH1 (ORCPT ); Fri, 15 Nov 2019 12:07:27 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:40310 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727564AbfKORH0 (ORCPT ); Fri, 15 Nov 2019 12:07:26 -0500 Received: by mail-pl1-f193.google.com with SMTP id e3so5067789plt.7 for ; Fri, 15 Nov 2019 09:07:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZaxTzNmwwAn9HJVWyR+icmkGtWCz8kvI1scga3SLIPY=; b=SJ7X8U9jjnec8ohA2bWuceE0F33eWI1S0ILNM2IZCctalcoLLSlH9li1Az2yc0AwnU ZAK1Yg1Hd9cqYHVKRIUT9vx31WDO+O0Ui2COxq9RGD7CxXRU8nBbMSv/X2WLlZZ1HRpc h7FEA/JYxateZWqoYHl3nMhIw5acW7WsHU+4kJQDkoL5SsZPXjA9ZvjfoymMsV+Suem4 5nPXD87+iatVYrC9nKpNiyZBHn0KRTPCyeK6/PT73KtgaLLCNSiB3Qi7B/Z/h6MxFaC7 JQM4NG/xLzmkLEMWtWrzkO9K1QAVw0P2xBsaSg2byvrGURbUlFqHBk4YI65A3D4pnFUY 5d+Q== X-Gm-Message-State: APjAAAXvoMvRfL1y+2z12HOyogiCSVICHKQRB1K/avLpZ+TjQdauyMEb kiaCU4QVlK+IcvzMnb80Kp7WFy10 X-Google-Smtp-Source: APXvYqyRxpRHXH4ZFvlyepzAcBXuMn+SoNOqJvEYNKU9ehHB7WuJa/AI7jwdwekKnLxw7yCdkkoRtQ== X-Received: by 2002:a17:902:7287:: with SMTP id d7mr16451223pll.333.1573837646006; Fri, 15 Nov 2019 09:07:26 -0800 (PST) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id m7sm2364793pfb.153.2019.11.15.09.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 09:07:24 -0800 (PST) From: Bart Van Assche To: Omar Sandoval Cc: linux-block@vger.kernel.org, Bart Van Assche Subject: [PATCH blktests 4/4] tests/srp/015: Add a test that uses the SoftiWARP (siw) driver Date: Fri, 15 Nov 2019 09:07:11 -0800 Message-Id: <20191115170711.232741-5-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog In-Reply-To: <20191115170711.232741-1-bvanassche@acm.org> References: <20191115170711.232741-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Recently support has been added in the SRP initiator and target drivers for the SoftiWARP driver. Add a test for SRP over SoftiWARP. Signed-off-by: Bart Van Assche --- tests/srp/015 | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/srp/015.out | 2 ++ 2 files changed, 44 insertions(+) create mode 100755 tests/srp/015 create mode 100644 tests/srp/015.out diff --git a/tests/srp/015 b/tests/srp/015 new file mode 100755 index 000000000000..faef5089ec4c --- /dev/null +++ b/tests/srp/015 @@ -0,0 +1,42 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2019 Google LLC + +. tests/srp/rc + +DESCRIPTION="File I/O on top of multipath concurrently with logout and login (mq) using the SoftiWARP (siw) driver" +TIMED=1 + +requires() { + _have_modules siw +} + +test_disconnect_repeatedly() { + local dev fio_status m + + use_blk_mq y y || return $? + dev=$(get_bdev 0) || return $? + m=$(mountpoint 0) || return $? + create_filesystem "$dev" || return $? + mount_and_check "$dev" "$m" || return $? + # shellcheck disable=SC2064 + trap "unmount_and_check $m" RETURN + simulate_network_failure_loop "$dev" "$TIMEOUT" & + run_fio --verify=md5 --rw=randwrite --bs=4K --loops=$((10**6)) \ + --iodepth=64 --group_reporting --sync=1 --direct=1 \ + --ioengine=libaio --directory="$m" --runtime="${TIMEOUT}" \ + --name=data-integrity-test-mq --thread --numjobs=16 \ + --output="${RESULTS_DIR}/srp/fio-output-015.txt" \ + >>"$FULL" + fio_status=$? + wait + log_in + return $fio_status +} + +test() { + : "${TIMEOUT:=30}" + trap 'trap "" EXIT; teardown' EXIT + use_siw=1 + setup && test_disconnect_repeatedly && echo Passed +} diff --git a/tests/srp/015.out b/tests/srp/015.out new file mode 100644 index 000000000000..5e25d8e8672d --- /dev/null +++ b/tests/srp/015.out @@ -0,0 +1,2 @@ +Configured SRP target driver +Passed