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

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