From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 085B72116820C for ; Thu, 11 Oct 2018 22:53:39 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 22:53:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,371,1534834800"; d="scan'208";a="265046472" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 11 Oct 2018 22:53:18 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 Oct 2018 22:53:18 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 Oct 2018 22:53:17 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.111]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Fri, 12 Oct 2018 13:53:08 +0800 From: "Zhu, Yonghong" To: "Carsey, Jaben" , "Gao, Liming" , "Tomas Pilar (tpilar)" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override Thread-Index: AQHUWl7GbkvKP3x0IE2Pkg2ah0RYXaUUFTmAgADfJgCABjXZMA== Date: Fri, 12 Oct 2018 05:53:08 +0000 Message-ID: References: <436c51f1-3ca0-9efa-c79d-b12f46be10ff@solarflare.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E331FCA@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWJhYTZiZmMtOTQ3MS00YzNmLTk4YzgtN2IwNTM2NzgyMWZhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidm1zZjFvWVJHNUQ1ZU9TNERKempoTXRRZFNoRWU5QTdyOThWcU1rZTdJYlQxOGdIbEhnOTRuUFBxNTNiUmFZaSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 05:53:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Pilar, Will you update a V2 to cover Jaben's comment ? Best Regards, Zhu Yonghong -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Cars= ey, Jaben Sent: Monday, October 8, 2018 11:00 PM To: Gao, Liming ; Tomas Pilar (tpilar) ; edk2-devel@lists.01.org Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf Op= tionROM override > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of=20 > Gao, Liming > Sent: Sunday, October 07, 2018 6:42 PM > To: Tomas Pilar (tpilar) ;=20 > edk2-devel@lists.01.org > Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in=20 > Fdf OptionROM override >=20 > Pilar: > The change is good. Could you also update INF and FDF spec for this usa= ge? > If you don't know how to update INF and FDF spec, please submit BZ. I=20 > will provide the spec patch. >=20 > Reviewed-by: Liming Gao >=20 > Thanks > Liming > >-----Original Message----- > >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf=20 > >Of Tomas Pilar (tpilar) > >Sent: Tuesday, October 02, 2018 10:46 PM > >To: edk2-devel@lists.01.org > >Subject: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf=20 > >OptionROM override > > > >Contributed-under: TianoCore Contribution Agreement 1.1 > >Signed-off-by: Tomas Pilar > >--- > > BaseTools/Source/Python/GenFds/FdfParser.py | 11 ++++++++--- > > 1 file changed, 8 insertions(+), 3 deletions(-) > > > >diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py > >b/BaseTools/Source/Python/GenFds/FdfParser.py > >index 63687e98bb..a65f2cfd2d 100644 > >--- a/BaseTools/Source/Python/GenFds/FdfParser.py > >+++ b/BaseTools/Source/Python/GenFds/FdfParser.py > >@@ -4469,10 +4469,15 @@ class FdfParser: > > if self.__IsKeyword( "PCI_DEVICE_ID"): > > if not self.__IsToken( "=3D"): > > raise Warning("expected '=3D'", self.FileName, > >self.CurrentLineNumber) > >- if not self.__GetNextHexNumber(): > >- raise Warning("expected Hex device id", self.Fi= leName, > >self.CurrentLineNumber) > > > >- Overrides.PciDeviceId =3D self.__Token > >+ # Get a list of PCI IDs > >+ Overrides.PciDeviceId =3D "" > >+ > >+ while self.__GetNextHexNumber(): > >+ Overrides.PciDeviceId +=3D " " + self.__Token Can we change to minimize looping string concatenation here? This in a loo= p will cause lots of memory allocation/deallocation and slow things down. Maybe :=20 Overrides.PciDeviceId =3D "{} {}".format(Overrides.PciDeviceId, self.__Toke= n) > >+ > >+ if not Overrides.PciDeviceId: > >+ raise Warning("expected one or more Hex=20 > >+ device ids", > >self.FileName, self.CurrentLineNumber) > > continue > > > > if self.__IsKeyword( "PCI_REVISION"): > >-- > >2.17.1 > > > >_______________________________________________ > >edk2-devel mailing list > >edk2-devel@lists.01.org > >https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel