test/nvmf: make check_ip_is_soft_roce() more generic
Sample output from rxe_cfg: Name Link Driver Speed NMTU IPv4_addr RDEV RMTU eno1 yes tg3 1500 192.168.100.1 rxe0 1024 (3) eno2 no tg3 1500 192.168.100.2 rxe1 1024 (3) eno3 no tg3 1500 192.168.100.3 rxe2 1024 (3) Sample output from other systems rxe_cfg: Name Link Driver Speed NMTU IPv4_addr RDEV RMTU ens3 yes e1000 rxe0 1024 (3) ens4 yes e1000 rxe1 1024 (3) Looking at the above output, amount of columns after greping particular line varies between systems and configurations. Meanwhile "rxe_cfg status" is an equivalent command, but allows to add argument that will be matched to RDEV name. With this patch we no longer depend on awk to select columns, but instead printout all soft roce enabled devices and grep for particular dev name. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: Id4483c58f0fdcef2f38abdf56257658643a3069f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/619 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
17d9050f5f
commit
01f2a6e0b1
@ -251,7 +251,7 @@ function check_ip_is_soft_roce()
|
|||||||
IP=$1
|
IP=$1
|
||||||
if hash rxe_cfg; then
|
if hash rxe_cfg; then
|
||||||
dev=$(ip -4 -o addr show | grep $IP | cut -d" " -f2)
|
dev=$(ip -4 -o addr show | grep $IP | cut -d" " -f2)
|
||||||
if (rxe_cfg | grep $dev | awk '{print $4}' | grep -q "rxe"); then
|
if (rxe_cfg status "rxe" | grep -q $dev); then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user