From 09b34121c443998ffe4df38084b19696bd3ef902 Mon Sep 17 00:00:00 2001 From: Lee Duncan Date: Fri, 27 Aug 2021 13:09:11 -0700 Subject: Handle qedi correctly in NPAR mode Use the correct driver, and handle the NPAR 4-MAC-ADDr offset of qedi, unlike other Offload cards. Found-by: David Bond --- utils/iscsi_offload | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/utils/iscsi_offload b/utils/iscsi_offload index 833d26f..1869fe1 100755 --- a/utils/iscsi_offload +++ b/utils/iscsi_offload @@ -85,10 +85,11 @@ iscsi_macaddress_from_pcifn() local h local host local ifmac + local olemacoffset=$3 ifmac=$(ip addr show dev $if | sed -n 's/ *link\/ether \(.*\) brd.*/\1/p') m5=$(( 0x${ifmac##*:} )) - m5=$(( $m5 + 1 )) + m5=$(( $m5 + $olemacoffset )) ifmac=$(printf "%s:%02x" ${ifmac%:*} $m5) for host in /sys/class/iscsi_host/host* ; do if [ -L "$host" ] ; then @@ -190,10 +191,7 @@ case "$driver" in qla*) mod=qla4xxx ;; - qede) - mod=qede - ;; - qedi) + qed*) mod=qedi ;; esac @@ -221,11 +219,11 @@ if [ "$mod" = "bnx2i" ] ; then elif [ "$mod" = "cxgb3i" ] ; then mac=$(iscsi_macaddress_from_pcidevice $pcipath $IFNAME) elif [ "$mod" = "be2iscsi" ] ; then - mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME) + mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME 1) elif [ "$mod" = "qla4xxx" ] ; then - mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME) + mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME 1) elif [ "$mod" = "qede" -o "$mod" = "qedi" ] ; then - mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME) + mac=$(iscsi_macaddress_from_pcifn $pcipath $IFNAME 4) fi if [ -z "$mac" ] ; then -- cgit v1.2.1