Blame SOURCES/bz1364242-ethmonitor-add-intel-omnipath-support.patch

bb196a
From 5e8f593b58409c8c1c7793576a3980eb56e8c200 Mon Sep 17 00:00:00 2001
bb196a
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
bb196a
Date: Thu, 2 Nov 2017 14:01:05 +0100
bb196a
Subject: [PATCH 1/2] ethmonitor: add intel omnipath support
bb196a
bb196a
---
bb196a
 heartbeat/ethmonitor | 12 +++++++++---
bb196a
 1 file changed, 9 insertions(+), 3 deletions(-)
bb196a
bb196a
diff --git a/heartbeat/ethmonitor b/heartbeat/ethmonitor
bb196a
index 7f5579f94..952a9f91f 100755
bb196a
--- a/heartbeat/ethmonitor
bb196a
+++ b/heartbeat/ethmonitor
bb196a
@@ -219,7 +219,10 @@ infiniband_status()
bb196a
 		device="${OCF_RESKEY_infiniband_device}:${OCF_RESKEY_infiniband_port}"
bb196a
 	fi
bb196a
 	
bb196a
-	ibstatus ${device} | grep -q ACTIVE 
bb196a
+	case "${OCF_RESKEY_infiniband_device}" in
bb196a
+		*mlx*) ibstatus ${device} | grep -q ACTIVE ;;
bb196a
+		*hfi*) opainfo | grep -q Active ;;
bb196a
+	esac
bb196a
 }
bb196a
 
bb196a
 if_init() {
bb196a
@@ -291,8 +294,11 @@ if_init() {
bb196a
 	fi
bb196a
 
bb196a
 	if [ -n "$OCF_RESKEY_infiniband_device" ]; then
bb196a
-		#ibstatus is required if an infiniband_device is provided
bb196a
-		check_binary ibstatus
bb196a
+		#ibstatus or opainfo is required if an infiniband_device is provided
bb196a
+		case "${OCF_RESKEY_infiniband_device}" in
bb196a
+			*mlx*) check_binary ibstatus ;;
bb196a
+			*hfi*) check_binary opainfo ;;
bb196a
+		esac
bb196a
 	fi
bb196a
 	return $OCF_SUCCESS
bb196a
 }
bb196a
bb196a
From 7e15a3ccfa0bd0e9dab92a6be21df968b073ec3d Mon Sep 17 00:00:00 2001
bb196a
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
bb196a
Date: Tue, 7 Nov 2017 16:42:37 +0100
bb196a
Subject: [PATCH 2/2] ethmonitor: add /dev/ib* device to case-statement
bb196a
bb196a
---
bb196a
 heartbeat/ethmonitor | 4 ++--
bb196a
 1 file changed, 2 insertions(+), 2 deletions(-)
bb196a
bb196a
diff --git a/heartbeat/ethmonitor b/heartbeat/ethmonitor
bb196a
index 952a9f91f..21bf12be7 100755
bb196a
--- a/heartbeat/ethmonitor
bb196a
+++ b/heartbeat/ethmonitor
bb196a
@@ -220,7 +220,7 @@ infiniband_status()
bb196a
 	fi
bb196a
 	
bb196a
 	case "${OCF_RESKEY_infiniband_device}" in
bb196a
-		*mlx*) ibstatus ${device} | grep -q ACTIVE ;;
bb196a
+		*ib*|*mlx*) ibstatus ${device} | grep -q ACTIVE ;;
bb196a
 		*hfi*) opainfo | grep -q Active ;;
bb196a
 	esac
bb196a
 }
bb196a
@@ -296,7 +296,7 @@ if_init() {
bb196a
 	if [ -n "$OCF_RESKEY_infiniband_device" ]; then
bb196a
 		#ibstatus or opainfo is required if an infiniband_device is provided
bb196a
 		case "${OCF_RESKEY_infiniband_device}" in
bb196a
-			*mlx*) check_binary ibstatus ;;
bb196a
+			*ib*|*mlx*) check_binary ibstatus ;;
bb196a
 			*hfi*) check_binary opainfo ;;
bb196a
 		esac
bb196a
 	fi