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 F2868D8007D for ; Fri, 19 Jan 2024 01:55:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4sQk/catBtP6shY/JTZXtDDj8BDDkR8piiILk2hsmqA=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1705629299; v=1; b=f3aL2TEvTHx2ws68pfDhX3AGwx+S2kEJe94/h5sFfqGtx0FrjnoJYRW2APm3JOKkjdTxVD0b GHWt8wgvGDXEn2e9fdm6aHPcM7VSQoA4eQ5rX9HwCeh3kup2xr7b4OlSbvrunZ+M5DWZeSzzMYu 18KAc+Ci//GBCygw+9AkOGq8= X-Received: by 127.0.0.2 with SMTP id 0DPMYY7687511x4lGxWyfeoj; Thu, 18 Jan 2024 17:54:59 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.12061.1705629298973708787 for ; Thu, 18 Jan 2024 17:54:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QYbU+K559cTMKEDcqB10VNYnHwSJR/NKkXuBFUtRYLriIXDYEGOzO/5UaGpf6Yy3u80Qb1M0JT3xeKc26/JnjXDem/vsiQSsTyFgPxpYfvR6MAnBuzLlia4sdaS689NnvouM0xyeLexNfxKqsDQ8rFVmtgtBVuAZ3EVuuA+PF8jqryJBdtNCEFOGOt/vafoCEKIg9g6+USn/yISEMJB5aGlArfae/J9kN6mxEPMD1zXVLR89SmFafDJ7/WJAI+mc3UgLu6HvcH3jazkSIzCebf5FqPoFJPXpajbrQEgsGcWlxc/EbOKrxSlNTXW3GRZ46TkK1oCy4DhGp7QXlhFUaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xh6wJzKWsXaI0MBYAr3DMxL4lUNshkL5spb48OyHTM0=; b=VckMSPkFP+3HqweMROrhCgw1YV8F05/xeoR3OB/Yd0Ht2O3j9ts7UgKkarMK19p799htEJeX5lqzSdzLNdWOTD6ojbd/yBPKXs3EVnpOwtQTfpJQvKwkW2zVGtH0RCRPaZ1qJ8feCl1/xWDtO/IGtSDEbAnrIDaCespFI8DJXqYbOLxog2RkeaW/JjBAxvXt8k5gIHQ8Nz2Bsa3uQ+vy+961GvTi48b8GoVumToEcgWLRPh5BQ5fGaazCcL1VWkgLOHTGXSAfqjHmma49BzT5ZBS0GBh0MwQqNp7VSgz03AYjS/vfoTdYFyEbrcBH9MGfDMiRbgT/6d5pyvQLHPbAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com (2603:10b6:a03:1d9::22) by SN7PR12MB6957.namprd12.prod.outlook.com (2603:10b6:806:263::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.30; Fri, 19 Jan 2024 01:54:55 +0000 X-Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::24be:aa60:3324:1068]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::24be:aa60:3324:1068%7]) with mapi id 15.20.7202.024; Fri, 19 Jan 2024 01:54:55 +0000 From: "Ashish Singhal via groups.io" To: "Kinney, Michael D" , "Kasbekar, Saloni" , "devel@edk2.groups.io" , "Clark-williams, Zachary" , Jeff Brasen , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Topic: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thread-Index: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozEgAHVYACAATCxsoAB974AgADi4GyAAJ7xgIAASRGvgBIv8qeAADfZAIAB9veAgAAokBSAAACJfw== Date: Fri, 19 Jan 2024 01:54:55 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY5PR12MB5544:EE_|SN7PR12MB6957:EE_ x-ms-office365-filtering-correlation-id: f3285343-0c08-41fa-4805-08dc1891a265 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: wC+dW86+eFdZ1w0ZG/BQ7DJ8Vd8wCzAnY7Oeb8WT/NRa0k+/nQV8LeUAeJGZlQ+98VSTS6REprMnVpS5xs/+Rl5QWqEY+bNWLj8v9SJJDWi1lnQDKEJ9LnjkrehozmPwn8C/QW3vZBF2fYFBDrnSfqJ86Y+YlJd3WRvQJi16wX107DsWyfBAywEcoad3Nnu54AQmBAd+fqNP7pVLFY3V+fOUG4vuF0prQqC0C/+jSPS8EoW1xxtcItHWFw3Uwred1LSvSNi/dbr9bgPl7fvcU0JRQrJUJy3ciQh4s9nIqdxw1PU2wPDc+KNyWC5duu80/L44cDXOQ6axGV3IxhU3JO7mOpwY9O4Ojlie23wkz0OsE4gHBw0xMpuhNY1xkCOD33swfpNLiBEW3LTkHgRHI1jzYC34dhfICrImohRqI/qBPUdUZNxO2GfZ8Xn4b9coPnVRKvpV/+WopgAJj2W/Iq9XN5ZhxyODoBDTD3Bk/AL6sYPzgNPuKDkP/vJE5ggk/y9T9nzIyGu65q+PsJRKGjbMZlTWvExuzXBsipmz+BAvZUahVsEJHriXfOFUfZWq+pw8ldMNfOXV5uhJonbtM168MOl4FXaAbUfeNvj2It2Fz6MjSQA1wpXipCjInQbQAzB76sz2vM/R4FSFbW/zD18a6RiZJ3R6cz2aGQdnxXg= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Rey8PJWMvxj35/Yqw4FLyO5SC7a2IY0Zev5T/nr9if0ZAXWcw4QVSOIxEX?= =?iso-8859-1?Q?tAXsUANJkmvvOrm/hhaXGa2G6uFZa91xAA5l3hqn4+22wiPsYerOGp0IkN?= =?iso-8859-1?Q?G0Pf0fFD3d+9oMPBs5rT/XqJT/QXyHDcLENsR66IIlkk8bWaEeSjIl3DE0?= =?iso-8859-1?Q?KviLfiiqYingiVoxJ8289mqwRcsXJ6nL+kBa5Ri+Wvui+gAeNNdup44F3j?= =?iso-8859-1?Q?YdLlnBqaEEZFi0mVACJT7MIsGeqGcY+FnUIQtBBhwmEcHQazdTMXBXaD7k?= =?iso-8859-1?Q?SbdFAhvNF1Jw+VsrryBK2/jRoiTe2OkCxztG+/YoJ/ln5MB85gQE9kH5jY?= =?iso-8859-1?Q?w5tsg98cu0nnVDCAlwPh6i09lsVr4OqLThE/bdG4f5OS6PMd5Sjm+FZLOp?= =?iso-8859-1?Q?o9epYepd9Fycr6DPjyvnoZb1MDf6sJ07YprtFvbL9g8FOX7+a4BThJM0pl?= =?iso-8859-1?Q?1Vm4qLOnwiXdNN6D2bC6wI+I2RehlSut2AnvQcyiFBX8Vx+G55/WS26gJs?= =?iso-8859-1?Q?fs78V/hWHs9JVwEBCWy3xPJVdzMYkO00dCSN4r9KIGHogYNYSKcDeITITj?= =?iso-8859-1?Q?KkDVKdRrk8/unSJGEqs6fzNq8pAWU3D0FfIbhtH9DwzKtjOPpJhmP+pdBb?= =?iso-8859-1?Q?+3BE5cdw53Krov8xo7MbRRTWmPK5KOAuylp9UmgGVvk6xRQY372T/GM/w/?= =?iso-8859-1?Q?/lCqq2gva1PMaJ302O6c7SLtMC2UhvSopWxknRoxct5cg8O3R+9DFZURiJ?= =?iso-8859-1?Q?mDp7GTViASHklDMRCjs3O4PK8mbE5r4cJPeZzco+1K7Wv4y7UkFnfy+ZyL?= =?iso-8859-1?Q?Bl3JyuFlUdsEBGtRQZzg/nsF16TIL502Hy8g1EuqaBLWQop+mDCYB6l/Sa?= =?iso-8859-1?Q?Py2JxerdTf/xpryglq4aWg+sLEcXIP4mwN4tGCUrkcq+UXRtyqHYnWqVWA?= =?iso-8859-1?Q?YFUlq/28UyPRE8MBqB8plBk3snEl4OaWuREI+xLeYi4QOMqiYACFhuEdga?= =?iso-8859-1?Q?SxvQqU3HFN/kC6GQyeYWtkhSZ3M6KSW3rDuehq0sfmmLy0YqGzniNitkKE?= =?iso-8859-1?Q?L4lctbiT9yYBVurTepPFS5eXI9/de9irwxh9o2qmBp8iCDv9DGDHchbhIn?= =?iso-8859-1?Q?akpkmv7vuK2ZfOzOMUVOLSken3bsEpiFTmWg3d8vt+dZFgl8NZ4lFKbLM1?= =?iso-8859-1?Q?mF1yPa5SXwIWL7tLX4yh+L1ZJm5CKtyuUEP4R0OKkV0nTDvpow6KAx5gdq?= =?iso-8859-1?Q?lGywDjiqzbqWU1OtPTp5i2Dbs8GKsVAMaazqvEZ1gj+djJiZtNpy5uTS79?= =?iso-8859-1?Q?Peq39Sb9G8J6XPc6QhBlbHqNr52Rg0OC1h3nWPnmQkgg/Cwk0NzP5ORWTL?= =?iso-8859-1?Q?d/ikjVvqiSXiRH8NCPAA9XWRoe3PF3Br42adYTV52J728llUOCgypepIrO?= =?iso-8859-1?Q?UkkTE8DZefwTA1AYfWkEt7Xz2v2O+wPxCqdxqB9VAsQbcvRL8jQb2nNqCm?= =?iso-8859-1?Q?Wd39EhZw8d95l2AsWmRLiaLxoeEYpq/wwgfgV+bsLYEqdzgQWRo+LPQSOq?= =?iso-8859-1?Q?ECWtcyxPklx3ubv2vmUreUeiYLTNWz7RLWbHCFKAj9Uki3gPyEXZiiNFY+?= =?iso-8859-1?Q?WBnukpfgx3gG4m52kGITz2D/ve/4rEnGJR?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB5544.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3285343-0c08-41fa-4805-08dc1891a265 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2024 01:54:55.3601 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AN1PHRLLoxVso3pQzMkdpF5Cv0dFoqTnpv+lH5FyeXhtc9AMYI+uNyE9o6DqUMWqN0mTQiAP2B98c8tAaZs/lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6957 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,ashishsingha@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: RWI5yDBJuhg4Hl3pdQizoDjqx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB55446F8D338F1467DC9BCB71BA702BY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=f3aL2TEv; 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=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") --_000_BY5PR12MB55446F8D338F1467DC9BCB71BA702BY5PR12MB5544namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Replied too soon. I saw you had already closed mine. Thanks Ashish ________________________________ From: Ashish Singhal Sent: Friday, January 19, 2024 7:23 AM To: Kinney, Michael D ; Kasbekar, Saloni ; devel@edk2.groups.io ; Clark-w= illiams, Zachary ; Jeff Brasen ; Gao, Liming Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hi Michael, If you are going to create a new PR yourself instead of using the one I alr= eady created (https://github.com/tianocore/edk2/pull/5150), should I close = this one? Thanks Ashish ________________________________ From: Kinney, Michael D Sent: Friday, January 19, 2024 4:57 AM To: Kasbekar, Saloni ; Ashish Singhal ; devel@edk2.groups.io ; Clark-william= s, Zachary ; Jeff Brasen ; Gao, Liming Cc: Kinney, Michael D Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Acked-by: Michael D Kinney I will prepare PR for merge From: Kasbekar, Saloni Sent: Wednesday, January 17, 2024 9:27 AM To: Ashish Singhal ; devel@edk2.groups.io; Clark-w= illiams, Zachary ; Jeff Brasen ; Kinney, Michael D ; Gao, Liming Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Liming, Mike, Could you please help merge this PR? Thanks, Saloni From: Ashish Singhal Sent: Wednesday, January 17, 2024 6:08 AM To: Kasbekar, Saloni ; mailto:devel@edk2.= groups.io; Clark-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking back for an update on when this PR can be merged or if there are a= ny other changes you recommend. Thanks Ashish ________________________________________ From: Ashish Singhal Sent: Saturday, January 6, 2024 5:53 AM To: Kasbekar, Saloni ; mailto:devel@edk2.= groups.io ; Clark-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Thanks Saloni. PR for getting this merged is available at https://github.co= m/tianocore/edk2/pull/5150 Thanks Ashish ________________________________________ From: Kasbekar, Saloni Sent: Saturday, January 6, 2024 1:31 AM To: Ashish Singhal ; mailto:devel@edk2.grou= ps.io ; Clark-williams, Zachary ; Jeff Brasen Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Yes, SetData does reset the previous configuration. Reviewed-by: Saloni Kasbekar Thanks, Saloni From: Ashish Singhal Sent: Friday, January 5, 2024 2:34 AM To: Kasbekar, Saloni ; mailto:devel@edk2.= groups.io; Clark-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default I do not recommend doing that. Setting policy via SetData does enough to wi= pe out any previous manual configuration and that is the goal for reset to = default. ________________________________________ From: Kasbekar, Saloni Sent: Friday, January 5, 2024 2:30 AM To: Ashish Singhal ; mailto:devel@edk2.grou= ps.io ; Clark-williams, Zachary ; Jeff Brasen Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Makes sense. Should we also set IfrNvData->DhcpEnable =3D TRUE when updatin= g the Policy then? From: Ashish Singhal Sent: Wednesday, January 3, 2024 8:52 AM To: Kasbekar, Saloni ; mailto:devel@edk2.= groups.io; Clark-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello Saloni, Thanks for the feedback. After the reset, or when we disable configure from= menu, GetData returns policy to static as the enum value is 0. However, se= tting value as static does not have any benefit as it forces to reuse the o= ld network settings. Using DHCP really mimics the reset behavior that we se= e without any configuration done manually. Thanks Ashish ________________________________________ From: Kasbekar, Saloni Sent: Tuesday, January 2, 2024 1:47 PM To: Ashish Singhal ; mailto:devel@edk2.grou= ps.io ; Clark-williams, Zachary ; Jeff Brasen Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default External email: Use caution opening links or attachments Hi Ashish, + Ip4NvData->Policy =3D Ip4Config2PolicyDhcp; + Status =3D Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check it b= efore setting the policy and calling SetData()? Thanks, Saloni From: Ashish Singhal Sent: Monday, January 1, 2024 8:48 AM To: mailto:devel@edk2.groups.io; Kasbekar, Saloni ; Clark-williams, Zachary ; Jeff Brasen Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Hello, Checking again for some feedback on this. Thanks Ashish ________________________________________ From: Ashish Singhal Sent: Thursday, December 14, 2023 4:42 PM To: mailto:devel@edk2.groups.io ; mailto:salon= i.kasbekar@intel.com ; mailto:zachary.cla= rk-williams@intel.com ; Jeff Brase= n Cc: Ashish Singhal Subject: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default Exercising reset to default does not reset the settings. Add handler code for the case where configuration is disabled. Signed-off-by: Ashish Singhal --- NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config= 2Nv.c index e0b6a4d4a9..dac5817b7c 100644 --- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c +++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c @@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData ( } if (IfrFormNvData->Configure !=3D TRUE) { + if (Ip4NvData->DnsAddress !=3D NULL) { + FreePool (Ip4NvData->DnsAddress); + Ip4NvData->DnsAddress =3D NULL; + Ip4NvData->DnsAddressCount =3D 0; + } + + if (Ip4NvData->GatewayAddress !=3D NULL) { + FreePool (Ip4NvData->GatewayAddress); + Ip4NvData->GatewayAddress =3D NULL; + Ip4NvData->GatewayAddressCount =3D 0; + } + + if (Ip4NvData->ManualAddress !=3D NULL) { + FreePool (Ip4NvData->ManualAddress); + Ip4NvData->ManualAddress =3D NULL; + Ip4NvData->ManualAddressCount =3D 0; + } + + Ip4NvData->Policy =3D Ip4Config2PolicyDhcp; + Status =3D Ip4Cfg2->SetData ( + Ip4Cfg2, + Ip4Config2DataTypePolicy, + sizeof (EFI_IP4_CONFIG2_POLICY), + &Ip4NvData->Policy + ); return EFI_SUCCESS; } -- 2.17.1 Hello, Hello Saloni, Thanks -=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 (#114022): https://edk2.groups.io/g/devel/message/114022 Mute This Topic: https://groups.io/mt/103181314/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- --_000_BY5PR12MB55446F8D338F1467DC9BCB71BA702BY5PR12MB5544namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Replied too soon. I = saw you had already closed mine.

Thanks
Ashish


From: Ashish= Singhal <ashishsingha@nvidia.com>
Sent: Friday, January 19, 2024 7:23 AM
To: Kinney, Michael D <michael.d.kinney@intel.com>; Kasbe= kar, Saloni <saloni.kasbekar@intel.com>; devel@edk2.groups.io <dev= el@edk2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@i= ntel.com>; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoli= ming@byosoft.com.cn>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
Hi Michael,

If you are going to create a new PR yourself in= stead of using the one I already created (= https://github.com/tianocore/edk2/pull/5150), should I close this one?

Thanks
Ashish

From: Kinn= ey, Michael D <michael.d.kinney@intel.com>
Sent: Friday, January 19, 2024 4:57 AM
To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; Ashish = Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk= 2.groups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.c= om>; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoliming@b= yosoft.com.cn>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
External em= ail: Use caution opening links or attachments


Acked-by: Michael D Kinney <michael.d.kinney@intel.com>

I will prepare PR for merge




From: Kasbekar, Saloni <saloni.kasbekar@intel.com>
Sent: Wednesday, January 17, 2024 9:27 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.groups.io; C= lark-williams, Zachary <zachary.clark-williams@intel.com>; Jeff Brase= n <jbrasen@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.= com>; Gao, Liming <gaoliming@byosoft.com.cn>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

Liming, Mike,

Could you please help merge this PR?

Thanks,
Saloni

From: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Sent: Wednesday, January 17, 2024 6:08 AM
To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.= clark-williams@intel.com>; Jeff Brasen <mailto:jbr= asen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

Hello,

Checking back for an update on when this PR can be merged or if there are a= ny other changes you recommend.

Thanks
Ashish

________________________________________
From: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Sent: Saturday, January 6, 2024 5:53 AM
To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-will= iams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

Thanks Saloni. PR for getting this merged is available at https://github.com/tianocore/edk2/pull/5150

Thanks
Ashish

________________________________________
From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>
Sent: Saturday, January 6, 2024 1:31 AM
To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-will= iams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

External email: Use caution opening links or attachments

Yes, SetData does reset the previous configuration.

Reviewed-by: Saloni Kasbekar <mailto:saloni.kasbekar@intel.com>

Thanks,
Saloni

From: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Sent: Friday, January 5, 2024 2:34 AM
To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.= clark-williams@intel.com>; Jeff Brasen <mailto:jbr= asen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

I do not recommend doing that. Setting policy via SetData does enough to wi= pe out any previous manual configuration and that is the goal for reset to = default.
________________________________________
From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>
Sent: Friday, January 5, 2024 2:30 AM
To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-will= iams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

External email: Use caution opening links or attachments

Makes sense. Should we also set IfrNvData->DhcpEnable =3D TRUE when upda= ting the Policy then?

From: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Sent: Wednesday, January 3, 2024 8:52 AM
To: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Clark-williams, Zachary <mailto:zachary.= clark-williams@intel.com>; Jeff Brasen <mailto:jbr= asen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

Hello Saloni,

Thanks for the feedback. After the reset, or when we disable configure from= menu, GetData returns policy to static as the enum value is 0. However, se= tting value as static does not have any benefit as it forces to reuse the o= ld network settings. Using DHCP really mimics the reset behavior that we see without any configuration don= e manually.

Thanks
Ashish

________________________________________
From: Kasbekar, Saloni <mailto:saloni.kasbekar@intel.com>
Sent: Tuesday, January 2, 2024 1:47 PM
To: Ashish Singhal <mailto:ashishsingha@nvidia.com>; mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Clark-will= iams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

External email: Use caution opening links or attachments

Hi Ashish,

+    Ip4NvData->Policy =3D Ip4Config2PolicyDhcp;
+    Status        &= nbsp;   =3D Ip4Cfg2->SetData (
+            &n= bsp;            = ;          Ip4Cfg2,
+            &n= bsp;            = ;          Ip4Config2DataTypeP= olicy,
+            &n= bsp;            = ;          sizeof (EFI_IP4_CON= FIG2_POLICY),
+            &n= bsp;            = ;          &Ip4NvData->= Policy
+            &n= bsp;            = ;          );

Here we're assuming IfrFormNvData->DhcpEnable is TRUE. Should we check i= t before setting the policy and calling SetData()?

Thanks,
Saloni


From: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Sent: Monday, January 1, 2024 8:48 AM
To: mailto:devel@edk2.groups.io; Kasbekar, Saloni <mailto:saloni.kasbekar@intel.= com>; Clark-williams, Zachary <mailto:zachary.clark-williams@intel= .com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Subject: Re: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

Hello,

Checking again for some feedback on this.

Thanks
Ashish

________________________________________
From: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Sent: Thursday, December 14, 2023 4:42 PM
To: mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>; mailto:saloni.kasbekar@intel.com <mailto:saloni.kasbekar@intel.com&= gt;; mailto:zachary.clark-williams@intel.com <mailto:zachary.clark-wi= lliams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Cc: Ashish Singhal <mailto:ashishsingha@nvidia.com>
Subject: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default

Exercising reset to default does not reset the settings.
Add handler code for the case where configuration is
disabled.

Signed-off-by: Ashish Singhal <mailto:ashishsingha@nvidia.com>
---
 NetworkPkg/Ip4Dxe/Ip4Config2Nv.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c b/NetworkPkg/Ip4Dxe/Ip4Config= 2Nv.c
index e0b6a4d4a9..dac5817b7c 100644
--- a/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c
+++ b/NetworkPkg/Ip4Dxe/Ip4Config2Nv.c
@@ -586,6 +586,31 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
   }

   if (IfrFormNvData->Configure !=3D TRUE) {
+    if (Ip4NvData->DnsAddress !=3D NULL) {
+      FreePool (Ip4NvData->DnsAddress);
+      Ip4NvData->DnsAddress   &= nbsp;  =3D NULL;
+      Ip4NvData->DnsAddressCount =3D 0;
+    }
+
+    if (Ip4NvData->GatewayAddress !=3D NULL) {
+      FreePool (Ip4NvData->GatewayAddress); +      Ip4NvData->GatewayAddress  &nb= sp;   =3D NULL;
+      Ip4NvData->GatewayAddressCount =3D 0; +    }
+
+    if (Ip4NvData->ManualAddress !=3D NULL) {
+      FreePool (Ip4NvData->ManualAddress);
+      Ip4NvData->ManualAddress  &nbs= p;   =3D NULL;
+      Ip4NvData->ManualAddressCount =3D 0;
+    }
+
+    Ip4NvData->Policy =3D Ip4Config2PolicyDhcp;
+    Status        &= nbsp;   =3D Ip4Cfg2->SetData (
+            &n= bsp;            = ;          Ip4Cfg2,
+            &n= bsp;            = ;          Ip4Config2DataTypeP= olicy,
+            &n= bsp;            = ;          sizeof (EFI_IP4_CON= FIG2_POLICY),
+            &n= bsp;            = ;          &Ip4NvData->= Policy
+            &n= bsp;            = ;          );
     return EFI_SUCCESS;
   }

--
2.17.1
Hello,
Hello Saloni,
Thanks
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#114022) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BY5PR12MB55446F8D338F1467DC9BCB71BA702BY5PR12MB5544namp_--