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 C046F940FF8 for ; Fri, 19 Jan 2024 01:53:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=U5YlkxNgHqAYHJOuv+9t5wf2OxTZLOxqSuXD/67rwNE=; 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=1705629217; v=1; b=k6GzAWQOWQ7U8sNEtqh0DTzk5NMyVbSwopS/LRIzWHivRPh2ZZEvOQecPL86tf6b6u5bWHqI CmoYQK2T7Ar00XxWoWY5WtzWTF7VoPjE/0nWCFngTcq8BIqmUtY6d7NBSEYuVW8O8OCSrS9jY33 nZ1BPPE/kpL7gJ1hf9H6KhnQ= X-Received: by 127.0.0.2 with SMTP id IRYSYY7687511xBXS9NSihgC; Thu, 18 Jan 2024 17:53:37 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web10.12116.1705629216531233523 for ; Thu, 18 Jan 2024 17:53:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffUA+4Fn8/DqGvdVdpNd3kmWpZacSwtzKMtRLYVzdj4ALVa7UL+MWF67cIgGGr5MnWXwc99Wm+HeREBLiwYMR8Gu+RYtLek0FDuZNMjpOeOyq28F6yn1BkJVEk9sABhWYc2++0kDhTWyc5SMKunBuj+GHPAVN34ttGFI1zQ3Nz/jHFQwD2U3Ytsma3WI+KxLd2QAo82LPGIPBxQ+JD7Ut/WjO4xkmX+jT6rFwMvpon1peKNvTjA8YHuLqkPSseBrIE4gxowubF07srkPjnKRNyTRhCJcQJh4BWfb9xOKlvGkgecHr5YqlqE8ZyWTUjBfZf4fSp06CXyno6DoBIJyyA== 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=jYd4UhFH/MorGqf/c91JYBgHBHQXpLMi3RvGejWySZM=; b=g/ECYczegy6GwlGL60p1MY04N51r613D/ycU2puoUTf+tpgLggFcJ7UPSVMKIDw2j90byWNxsJwRW2hKikRIpPLkunnJh/YpeU6Jza4LcOptH2uFjhnCLsgefXTX5/nS4HO/FXni18elDnVVt/YAOamLmdinjuy/P0lRY2Kn0FGPftTbWkOI6za2/JFFhTckqiaBsnNfnH7d/5gXQVOKltC3JM054d8em6tNeRpy0mTLUTSjslNJPX9EDIzqrGXASeEu/tt5N/r3Nejf3jJh/2bt2FOtohlpTlDsK81LESH9XvWqKdrsK7vYxAydsnJxZyJnLZwrPvznse/lnEd54w== 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:53:29 +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:53:29 +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: AQHaLuc9P9mSwxDcuUyB3JunDYT5ybDFRozEgAHVYACAATCxsoAB974AgADi4GyAAJ7xgIAASRGvgBIv8qeAADfZAIAB9veAgAAokBQ= Date: Fri, 19 Jan 2024 01:53:29 +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: 744654b3-b9da-44f9-3881-08dc18916f6e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: zRMEQeUVoGc96ohL44rAUCfbWV6EPnPvjt1VnY5wKKDmQP6JNMdkXl5tDm2PLBIjvDPfTAE7bbFuu2vNn7GC9JsfnQBfCIdRrUihWf3EMV0ow9d+Ii0z8SLyozIdN22XytKnyy/RaoUVugDAT6829q69UtpYDzM06zMbWEoIbz0TPS5+wdBKyCQ0W+FniAHQTVSAl6duDLPtP07fIVcmCOV8eVTmfY0Yoenfmz8rmEUaDDD2y6uWzoCX3PpzdjvpWQyOr+dLnRckdZQbPUON3felqV7aH+qnqwZooPfFq2EV+bwTa35vhDXxvie4oCn6alx3BtL76Zx6+fpvE9Fz/dxVGWl7A8j28e1hBKl3jGaUkrmw1YzqOdibOE4lC7gZ3yeqGWPym5CMkQindjFaVAYwg1iOGSe+Psm3qQ1S2sS7uD5pFy9Gmrr5FxGDWmzrScDSMtY/2RCcdkx4h5mjgD3BJBcBlc039YZ2K8XXRL2an+W6xN1xOZTafM1w7MJqmyDIfKAQ1y3G0134F3axGonNdN6r/rSKWT9vzQu3nxSZUkByD6lx2WYkSY0AC9U4NjEVVIemq2tKPT6Xs5nB1k3tbtc2npYt8MpdT/3u/pRgpSrUGBrzK9sVXYN4kYPklzJjr25DxIvW5m3GEYd4QzBNnPJhvMGKeS1E43ab1bA= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?20T0VgS+ugtT06yKAwQwXHAdzgAfO5pMYeAP9SOLq8ppWC4/t1wimOR2w4hm?= =?us-ascii?Q?23PDpqYd4Lmvm8ctqQVkkoDsKNYd9Y4+tPEk4ZkXOYaRHPL082n/TG/gKmc+?= =?us-ascii?Q?KcpTfBtnpE2y+5hlTbgPIFEnmFadHv+b3qO7nWwE8+mAViRSIQc8NBnVjilW?= =?us-ascii?Q?8lZoH7vJLZRtvTY7HEF0pJrSJoR/iqJ6IcVQoUguZUr0LaEY6TbI//Ase5Pn?= =?us-ascii?Q?ZWXFzAbxqiq0KwTDEMaX6NxcaBlNc9+lvAcjbHxqNPxEmuvyB2G1ph+d3LVN?= =?us-ascii?Q?HVi8ggKbz7SQTpCQOn1AJHlceyyommwdb6CqKtA8q97fnORZJQWEqHp26/4/?= =?us-ascii?Q?X3zQ2xA9YWGehzgwTYAdhIn84PcjegHr1uaUZIlinMTViGhAy2yZdqpjjrJp?= =?us-ascii?Q?o+Q6m2EZNOFImKbphb0aINJK7RggzcU2Wb2RBT/CckpADRPOQF791d6tg5cr?= =?us-ascii?Q?/3x451b0Dw+Ug1J7qUuUx7F9JRbNa8WPsoE2+ZCBTVcT0UX6QjR6D+OJO3fG?= =?us-ascii?Q?1yGKWYREc1I35i/xQiW1CwmQX2EP1xxoIx07+fIjZ42TqpimDvfu2HDnSyfV?= =?us-ascii?Q?bmK9iMKuon9brfSHyn3kP5cSYunDRWjYR8WKW6d7rl4rGuSrAl0WWtQ4zZVg?= =?us-ascii?Q?Ehn7Ds0IFY2NINSt+gWKAr3jVSB7sj1dfZ5Sp+atZnOmwuMNMIQ7JSrWlZPs?= =?us-ascii?Q?w5ahte6Y/diHdnZTOsIDLXSCwFVkeXut6NsMuE3g0C+jUxmTwICPW32wrE9H?= =?us-ascii?Q?MlZSsXM63Aj7bmuAeBAWTEUgBcCb6qBkxnQ4sQm+PI7+ZLbp9EpmytBrRXV6?= =?us-ascii?Q?fcs/Y3MMbMmbu04qI/rnzlulq4SzfSgQgF8Q81sREUSSWJl67lynd/VsE6n2?= =?us-ascii?Q?EmbuYc0BPptqrM3UgWqWktowiVQetnsCCaSb9eKtJXVTM5+MhfwuAk2imGlI?= =?us-ascii?Q?234Y0H2FpclpRaafHXW+mG6zZgm39EDweVdCp82t/Lq2YtPzPoIYGRnwVU+V?= =?us-ascii?Q?YnfXsWQqDq3uKclkbbRMeH2OjLh1E89UL3SAnc0mPueKW/XTlZ8KvhDNNeDx?= =?us-ascii?Q?FeK5UDXfrKbAtpyIlw8F552NfckYLdzSnBQhBWsvn4KUuurGCtrIFHNaMBGn?= =?us-ascii?Q?lUGMp7PjbbzWS3rjCRwF3PJle2Tb25jGngAkQeSXvsUYr4XXKmuUpACn6DMA?= =?us-ascii?Q?byKrYLmKY+iemHLDXGIPxcZMdvKMiXo3yOS8XT9iBmPeOC9+Z3CXP/a74se3?= =?us-ascii?Q?h8oUIc5XTnu1AVVI1CaYbSEi2/HelwWp5+Z8h8Capvjg53h28LzxeqJ2C4Ug?= =?us-ascii?Q?UODuUeKGM9FYS9IRqFiaVYTVgE84wGFaJmYFLvt1opTlpXTFnqACC+3SW/TZ?= =?us-ascii?Q?uCNWmurWRSdPmmHMmWUBaf5gxE1xxUHLmjPR3laTW0eJy+nA12Ob1v9KUQyj?= =?us-ascii?Q?f8inSo5h47Mzj1P0AECHgSSSbRXfEsU4dICovJNyqBex8Lvycji1cOpnWL2g?= =?us-ascii?Q?QSLc2LK9PpGAjDg1wU3TBC5VcEVPR98qbjVlB32la9Kk7QycuJ2PORgTxkTG?= =?us-ascii?Q?6++fLzX6yDDpK3LWaC8rMrdIUoHjBPhMEu29eNc9?= 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: 744654b3-b9da-44f9-3881-08dc18916f6e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2024 01:53:29.8452 (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: gWPvLr7vEgcMHZ4bd6FTiaVInOpqH3E1jwOWLcvlDjMArDAV4bPRCeKJMgOedH3dgjRuBFAccnO2JBKmvrT6IQ== 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: Xft53TwV8xdkXSvnTOwTT4r0x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB5544BD2E54339CBA12430C45BA702BY5PR12MB5544namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=k6GzAWQO; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_BY5PR12MB5544BD2E54339CBA12430C45BA702BY5PR12MB5544namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 (#114021): https://edk2.groups.io/g/devel/message/114021 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_BY5PR12MB5544BD2E54339CBA12430C45BA702BY5PR12MB5544namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi Michael,

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

Thanks
Ashish

From: Kinney, Michael D <= ;michael.d.kinney@intel.com>
Sent: Friday, January 19, 2024 4:57 AM
To: Kasbekar, Saloni <saloni.kasbekar@intel.com>; Ashish Singh= al <ashishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.gro= ups.io>; Clark-williams, Zachary <zachary.clark-williams@intel.com>= ;; Jeff Brasen <jbrasen@nvidia.com>; Gao, Liming <gaoliming@byosof= t.com.cn>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Subject: RE: [PATCH] NetworkPkg/Ip4Dxe: Fix Reset To Default
 
External email: Use caution opening links or attac= hments


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 <mailt= o:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Cl= ark-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 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 <mailt= o:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io <= ;mailto:devel@edk2.groups.io>= ;; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidi= a.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 <mai= lto:saloni.kasbekar@intel.com>
Sent: Saturday, January 6, 2024 1:31 AM
To: Ashish Singhal <mailto:as= hishsingha@nvidia.com>; mailto:devel@edk2.groups.io <= ;mailto:devel@edk2.groups.io>= ;; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidi= a.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 <mailt= o:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Cl= ark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@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 <mai= lto:saloni.kasbekar@intel.com>
Sent: Friday, January 5, 2024 2:30 AM
To: Ashish Singhal <mailto:as= hishsingha@nvidia.com>; mailto:devel@edk2.groups.io <= ;mailto:devel@edk2.groups.io>= ;; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidi= a.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 <mailt= o:saloni.kasbekar@intel.com>; mailto:devel@edk2.groups.io; Cl= ark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@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 <mai= lto:saloni.kasbekar@intel.com>
Sent: Tuesday, January 2, 2024 1:47 PM
To: Ashish Singhal <mailto:as= hishsingha@nvidia.com>; mailto:devel@edk2.groups.io <= ;mailto:devel@edk2.groups.io>= ;; Clark-williams, Zachary <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidi= a.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@nvidi= a.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.c= om <mailto:saloni.kasbe= kar@intel.com>; mailto:zachary.clark-wi= lliams@intel.com <mailto:zachary.clark-williams@intel.com>; Jeff Brasen <mailto:jbrasen@nvidia.com>
Cc: Ashish Singhal <mailto:as= hishsingha@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 (#114021) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_BY5PR12MB5544BD2E54339CBA12430C45BA702BY5PR12MB5544namp_--