Blob Blame History Raw
From 4031a2fa642c1db897c1340ad2718301bf873fb3 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Fri, 3 Jul 2015 13:44:16 +0200
Subject: [PATCH] fcoe: EDD parsing patch for i40e

---
 modules.d/95fcoe/fcoe-edd.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules.d/95fcoe/fcoe-edd.sh b/modules.d/95fcoe/fcoe-edd.sh
index 5a81a2e..d0ea60d 100755
--- a/modules.d/95fcoe/fcoe-edd.sh
+++ b/modules.d/95fcoe/fcoe-edd.sh
@@ -11,8 +11,21 @@ fi
 
 for disk in /sys/firmware/edd/int13_*; do
     [ -d $disk ] || continue
+    if [ -e ${disk}/pci_dev/driver ]; then
+	    driver=`readlink ${disk}/pci_dev/driver`
+	    driver=${driver##*/}
+    fi
+    # i40e uses dev_port 1 for a virtual fcoe function
+    if [ "${driver}" == "i40e" ]; then
+	    dev_port=1
+    fi
     for nic in ${disk}/pci_dev/net/*; do
         [ -d $nic ] || continue
+	if [ -n "${dev_port}" -a -e ${nic}/dev_port ]; then
+		if [ `cat ${nic}/dev_port` -ne ${dev_port} ]; then
+			continue
+		fi
+	fi
         if [ -e ${nic}/address ]; then
 	    fcoe_interface=${nic##*/}
 	    if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then