Blame SOURCES/0268-fcoe-EDD-parsing-patch-for-i40e.patch

18971c
From 4031a2fa642c1db897c1340ad2718301bf873fb3 Mon Sep 17 00:00:00 2001
18971c
From: Chris Leech <cleech@redhat.com>
18971c
Date: Fri, 3 Jul 2015 13:44:16 +0200
18971c
Subject: [PATCH] fcoe: EDD parsing patch for i40e
18971c
18971c
---
18971c
 modules.d/95fcoe/fcoe-edd.sh | 13 +++++++++++++
18971c
 1 file changed, 13 insertions(+)
18971c
18971c
diff --git a/modules.d/95fcoe/fcoe-edd.sh b/modules.d/95fcoe/fcoe-edd.sh
18971c
index 5a81a2e3..d0ea60d5 100755
18971c
--- a/modules.d/95fcoe/fcoe-edd.sh
18971c
+++ b/modules.d/95fcoe/fcoe-edd.sh
18971c
@@ -11,8 +11,21 @@ fi
18971c
 
18971c
 for disk in /sys/firmware/edd/int13_*; do
18971c
     [ -d $disk ] || continue
18971c
+    if [ -e ${disk}/pci_dev/driver ]; then
18971c
+	    driver=`readlink ${disk}/pci_dev/driver`
18971c
+	    driver=${driver##*/}
18971c
+    fi
18971c
+    # i40e uses dev_port 1 for a virtual fcoe function
18971c
+    if [ "${driver}" == "i40e" ]; then
18971c
+	    dev_port=1
18971c
+    fi
18971c
     for nic in ${disk}/pci_dev/net/*; do
18971c
         [ -d $nic ] || continue
18971c
+	if [ -n "${dev_port}" -a -e ${nic}/dev_port ]; then
18971c
+		if [ `cat ${nic}/dev_port` -ne ${dev_port} ]; then
18971c
+			continue
18971c
+		fi
18971c
+	fi
18971c
         if [ -e ${nic}/address ]; then
18971c
 	    fcoe_interface=${nic##*/}
18971c
 	    if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then