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

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