From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BC97F2095B09E for ; Tue, 17 Oct 2017 23:49:43 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 17 Oct 2017 23:53:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,394,1503385200"; d="scan'208";a="163909564" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.187]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2017 23:53:18 -0700 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Karunakar P , Ye Ting , Fu Siyuan , Wu Jiaxin Date: Wed, 18 Oct 2017 14:53:14 +0800 Message-Id: <1508309596-13880-2-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1508309596-13880-1-git-send-email-jiaxin.wu@intel.com> References: <1508309596-13880-1-git-send-email-jiaxin.wu@intel.com> Subject: [Patch v3 1/3] NetworkPkg/IScsiDxe: Fix the incorrect/needless DHCP process. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 06:49:43 -0000 The existing attempt should not trigger the DHCP process if it doesn't associates with the current NIC. That's incorrect when displaying the initiator info in attempt page. Cc: Karunakar P Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- NetworkPkg/IScsiDxe/IScsiMisc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c index efd05cf..0a0a3f5 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.c +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c @@ -1992,13 +1992,16 @@ IScsiGetConfigData ( AttemptTmp ); continue; } - } else if (AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp && !AttemptTmp->ValidPath) { + } else if (AttemptTmp->SessionConfigData.InitiatorInfoFromDhcp && + !AttemptTmp->ValidPath && + AttemptTmp->NicIndex == mPrivate->CurrentNic) { // - // Get DHCP information for already added, but failed, attempt. + // If the attempt associates with the current NIC, we can + // get DHCP information for already added, but failed, attempt. // AttemptTmp->DhcpSuccess = FALSE; if (!mPrivate->Ipv6Flag && (AttemptTmp->SessionConfigData.IpMode == IP_MODE_IP4)) { Status = IScsiDoDhcp (Private->Image, Private->Controller, AttemptTmp); if (!EFI_ERROR (Status)) { -- 1.9.5.msysgit.1