From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 40FE1D80689 for ; Tue, 27 Feb 2024 12:06:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sQERe9ZbGzp7Bw7eA9fJdw/RPJUNZR30IL9Kw/SIM/k=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1709035594; v=1; b=OnrALCrDDBKmULDk1p3oTn5WbOTF8ExpuUCy0CVal7g3JOkABWQY2TdKE7WtUjNvghu8uujt 86vZUofKOXwBBKmwQ+ItsCAwajodv9wt2glrEEx1ecgXj+JACOHbdYXCrj6Ql/qWyKWG+hXVKn4 HCa7GRVdFsHY7hnsO8fCdVLs= X-Received: by 127.0.0.2 with SMTP id XKTgYY7687511xoEBsovyNSp; Tue, 27 Feb 2024 04:06:34 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.10512.1709035593650750651 for ; Tue, 27 Feb 2024 04:06:33 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-GEWsRNShOR--OZW-9lmryg-1; Tue, 27 Feb 2024 07:06:29 -0500 X-MC-Unique: GEWsRNShOR--OZW-9lmryg-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06CB31C09830; Tue, 27 Feb 2024 12:06:29 +0000 (UTC) X-Received: from [10.39.192.152] (unknown [10.39.192.152]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 195D7C185C0; Tue, 27 Feb 2024 12:06:25 +0000 (UTC) Message-ID: Date: Tue, 27 Feb 2024 13:06:24 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue To: Sivaraman Nainar , "devel@edk2.groups.io" , Santhosh Kumar V , Saloni Kasbekar , Zachary Clark-williams Cc: Raj V Akilan , Soundharia R , Oliver Steffen References: <20240221171347.1343-1-santhoshkumarv@ami.com> <21b2d17d-5de5-5f08-ef6b-a0a285b05917@redhat.com> <17B60D00FAC661AD.27859@groups.io> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: maiQYO5KhVH44RwdsQXTMUzsx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=OnrALCrD; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 2/27/24 05:49, Sivaraman Nainar wrote: > Hi Laszlo, >=20 > We can see the issue not only with SLES, it can be seen with Ubuntu 22 al= so. >=20 > Do we have any channel to work with grub team to fix this issue? No particular channel. Oliver has been participating in upstream grub2 development (CC'd), so I figure bug analysis and bugfix posting should occur on their normal development mailing list. Laszlo > -----Original Message----- > From: Sivaraman Nainar > Sent: Monday, February 26, 2024 4:01 PM > To: devel@edk2.groups.io; Sivaraman Nainar ; Laszlo E= rsek ; Santhosh Kumar V ; Saloni= Kasbekar ; Zachary Clark-williams > Cc: Raj V Akilan ; Soundharia R > Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Cons= ecutive Pxe-Http Boot Issue >=20 > @Saloni Kasbekar, @Zachary Clark-williams, >=20 > Could you please add your feedback on the changes proposed? >=20 > Thanks > Siva > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Sivaraman = Nainar via groups.io > Sent: Thursday, February 22, 2024 7:33 AM > To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kuma= r V ; Saloni Kasbekar ; = Zachary Clark-williams > Cc: Raj V Akilan ; Soundharia R > Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecut= ive Pxe-Http Boot Issue >=20 >=20 > **CAUTION: The e-mail below is from an external source. Please exercise c= aution before opening attachments, clicking links, or following guidance.** >=20 > Laszlo: >=20 > Thanks for the detailed feedback on the changes for this issue. Since we = are not sure if this change are valid / violate some purpose of SNP driver,= it mentioned as Workaround. >=20 > @Saloni Kasbekar and @Clark-williams, Zachary can add more on these chang= es. >=20 > As you recommended, we can have PCD which controls these changes till the= changes are addressed in grub. >=20 > @Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be = found in any OS having Grub 2.x? >=20 > Thanks > Siva > -----Original Message----- > From: Laszlo Ersek > Sent: Thursday, February 22, 2024 5:15 AM > To: devel@edk2.groups.io; Santhosh Kumar V > Cc: Sivaraman Nainar ; Raj V Akilan ; = Soundharia R ; Saloni Kasbekar ; Zachary Clark-williams > Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecut= ive Pxe-Http Boot Issue >=20 >=20 > **CAUTION: The e-mail below is from an external source. Please exercise c= aution before opening attachments, clicking links, or following guidance.** >=20 > On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote: >> The customer has a server environment where PXE and HTTP service run in = same Linux Server. In this environment a SUT trying to boot to SLES 15 OS v= ia PXE from the Boot Menu. After PXE Boot file downloaded and grub Loaded w= ithout continuing for installation Exit is pressed and control back to Setu= p. >> Now the HTTP boot to SLES 15 OS tried in the same environment and failed= to download the file. If there is a reconnect -r performed before this HTT= P Boot then boot file download and installation is getting success. >> Root cause of the issue is, when Exit from grub performed, boot Loader S= tops the SNP Driver and starts the same. >=20 > This sentence feels like the key one. >=20 > Are you saying that grub calls Snp->Start() just before it exits? >=20 > If so, am I right to suspect that that's a grub bug? It sounds like a res= ource leak, after all. >=20 > Can you perhaps include a grub source code location / pointer in the comm= it message? >=20 >> During this process SNP is in Initialized State. When HTTP boot is perfo= rmed immediately after PXE Failure, the MNP configure method initiates the = SNP Start again. Since the SNP already started by grub it returns EFI_ALREA= DY_STARTED and none of the upper Layer drivers are getting started. >> As a work around in MNPConfigure(), if the SNP Start failed with Already= Started and in Initialized state we can return success so that rest of the= drivers can be loaded and HTTP boot can work. >> >> >> Cc: Saloni Kasbekar >> Cc: Zachary Clark-williams >> >> Signed-off-by: SanthoshKumar >> --- >> NetworkPkg/MnpDxe/MnpConfig.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c >> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644 >> --- a/NetworkPkg/MnpDxe/MnpConfig.c >> +++ b/NetworkPkg/MnpDxe/MnpConfig.c >> @@ -1120,7 +1120,9 @@ MnpStartSnp ( >> // Start the simple network. >> >> // >> >> Status =3D Snp->Start (Snp); >> >> - >> >> + if ((Status =3D=3D EFI_ALREADY_STARTED ) && (Snp->Mode->State =3D=3D >> + EfiSimpleNetworkInitialized)) { >> >> + return EFI_SUCCESS; >> >> + } >> >> if (!EFI_ERROR (Status)) { >> >> // >> >> // Initialize the simple network. >> >=20 > The commit message does say this is a workaround, and I don't immediately= any see why this workaround (in the code) would be problematic in practice= , but it still leaves a bad taste in my mouth. >=20 > Consider: the call path is the following: >=20 > MnpConfigure() [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Confi= gure() protocol member function > MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c] > MnpStart() [NetworkPkg/MnpDxe/MnpConfig.c] > // see notes! > MnpStartSnp() [NetworkPkg/MnpDxe/MnpConfig.c] >=20 > Notes: the MnpStartSnp() call in MnpStart() is conditional on two circums= tances (at the same time): > - "If it's not a configuration update, increase the configured children n= umber." > - "It's the first configured child, start the simple network." >=20 > In other words, the MNP driver has just bound SNP "BY_DRIVER" (i.e., excl= usively), installed the MNP service binding protocol for each vlan (IIUC), = and one of those SB instances is now being used to create the first MNP ins= tance. I think that under these circumstances, it is reasonable for the MNP= driver to expect that the underlying SNP be in stopped state. :/ >=20 > How long would NetworkPkg have to carry this workaround? (I.e., how long = before the grub issue is fixed, and the buggy version deprecated?) >=20 > I'd prefer at least a comment in the code that the return path is a worka= round for (I feel) an earlier SNP usage violation. >=20 > A FeaturePCD to disable the workaround could be reasonable too (but the N= etworkPkg maintainers could disagree about that). >=20 >=20 > BTW, the commit message should be wrapped at 75 characters. These long li= nes (in the body) will pass PatchCheck, but generate warnings. Those warnin= gs are tolerable for log quotes, URLs, etc, but for normal English text, wr= apping is much preferred. >=20 >=20 > Another comment on the commit message: the subject line should state some= thing like >=20 > NetworkPkg/MnpDxe: work aroung SNP state leak in grub >=20 > Laszlo >=20 > -The information contained in this message may be confidential and propri= etary to American Megatrends (AMI). This communication is intended to be re= ad only by the individual or entity to whom it is addressed or by their des= ignee. If the reader of this message is not the intended recipient, you are= on notice that any distribution of this message, in any form, is strictly = prohibited. Please promptly notify the sender by reply e-mail or by telepho= ne at 770-246-8600, and then delete or destroy all copies of the transmissi= on. >=20 >=20 >=20 >=20 >=20 > -The information contained in this message may be confidential and propri= etary to American Megatrends (AMI). This communication is intended to be re= ad only by the individual or entity to whom it is addressed or by their des= ignee. If the reader of this message is not the intended recipient, you are= on notice that any distribution of this message, in any form, is strictly = prohibited. Please promptly notify the sender by reply e-mail or by telepho= ne at 770-246-8600, and then delete or destroy all copies of the transmissi= on. >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116033): https://edk2.groups.io/g/devel/message/116033 Mute This Topic: https://groups.io/mt/104498511/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-