public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
@ 2018-10-02 14:46 Tomas Pilar (tpilar)
  2018-10-02 14:52 ` Laszlo Ersek
  2018-10-08  1:41 ` Gao, Liming
  0 siblings, 2 replies; 6+ messages in thread
From: Tomas Pilar (tpilar) @ 2018-10-02 14:46 UTC (permalink / raw)
  To: edk2-devel@lists.01.org

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Tomas Pilar <tpilar@solarflare.com>
---
 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( "="):
                         raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
-                    if not self.__GetNextHexNumber():
-                        raise Warning("expected Hex device id", self.FileName, self.CurrentLineNumber)
 
-                    Overrides.PciDeviceId = self.__Token
+                    # Get a list of PCI IDs
+                    Overrides.PciDeviceId = ""
+
+                    while self.__GetNextHexNumber():
+                        Overrides.PciDeviceId += " " + self.__Token
+
+                    if not Overrides.PciDeviceId:
+                        raise Warning("expected one or more Hex device ids", self.FileName, self.CurrentLineNumber)
                     continue
 
                 if self.__IsKeyword( "PCI_REVISION"):
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
  2018-10-02 14:46 [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override Tomas Pilar (tpilar)
@ 2018-10-02 14:52 ` Laszlo Ersek
  2018-10-08  1:41 ` Gao, Liming
  1 sibling, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2018-10-02 14:52 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Tomas Pilar (tpilar), Yonghong Zhu, Liming Gao

+Yonghong, +Liming

On 10/02/18 16:46, Tomas Pilar (tpilar) wrote:
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Tomas Pilar <tpilar@solarflare.com>
> ---
>  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( "="):
>                          raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
> -                    if not self.__GetNextHexNumber():
> -                        raise Warning("expected Hex device id", self.FileName, self.CurrentLineNumber)
>  
> -                    Overrides.PciDeviceId = self.__Token
> +                    # Get a list of PCI IDs
> +                    Overrides.PciDeviceId = ""
> +
> +                    while self.__GetNextHexNumber():
> +                        Overrides.PciDeviceId += " " + self.__Token
> +
> +                    if not Overrides.PciDeviceId:
> +                        raise Warning("expected one or more Hex device ids", self.FileName, self.CurrentLineNumber)
>                      continue
>  
>                  if self.__IsKeyword( "PCI_REVISION"):
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
  2018-10-02 14:46 [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override Tomas Pilar (tpilar)
  2018-10-02 14:52 ` Laszlo Ersek
@ 2018-10-08  1:41 ` Gao, Liming
  2018-10-08 15:00   ` Carsey, Jaben
  1 sibling, 1 reply; 6+ messages in thread
From: Gao, Liming @ 2018-10-08  1:41 UTC (permalink / raw)
  To: Tomas Pilar (tpilar), edk2-devel@lists.01.org

Pilar:
  The change is good. Could you also update INF and FDF spec for this usage? If you don't know how to update INF and FDF spec, please submit BZ. I will provide the spec patch. 

  Reviewed-by: Liming Gao <liming.gao@intel.com>

Thanks
Liming
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 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
>OptionROM override
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Tomas Pilar <tpilar@solarflare.com>
>---
> 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( "="):
>                         raise Warning("expected '='", self.FileName,
>self.CurrentLineNumber)
>-                    if not self.__GetNextHexNumber():
>-                        raise Warning("expected Hex device id", self.FileName,
>self.CurrentLineNumber)
>
>-                    Overrides.PciDeviceId = self.__Token
>+                    # Get a list of PCI IDs
>+                    Overrides.PciDeviceId = ""
>+
>+                    while self.__GetNextHexNumber():
>+                        Overrides.PciDeviceId += " " + self.__Token
>+
>+                    if not Overrides.PciDeviceId:
>+                        raise Warning("expected one or more Hex 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
  2018-10-08  1:41 ` Gao, Liming
@ 2018-10-08 15:00   ` Carsey, Jaben
  2018-10-12  5:53     ` Zhu, Yonghong
  0 siblings, 1 reply; 6+ messages in thread
From: Carsey, Jaben @ 2018-10-08 15:00 UTC (permalink / raw)
  To: Gao, Liming, Tomas Pilar (tpilar), edk2-devel@lists.01.org



> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Gao, Liming
> Sent: Sunday, October 07, 2018 6:42 PM
> To: Tomas Pilar (tpilar) <tpilar@solarflare.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf
> OptionROM override
> 
> Pilar:
>   The change is good. Could you also update INF and FDF spec for this usage?
> If you don't know how to update INF and FDF spec, please submit BZ. I will
> provide the spec patch.
> 
>   Reviewed-by: Liming Gao <liming.gao@intel.com>
> 
> Thanks
> Liming
> >-----Original Message-----
> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 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
> >OptionROM override
> >
> >Contributed-under: TianoCore Contribution Agreement 1.1
> >Signed-off-by: Tomas Pilar <tpilar@solarflare.com>
> >---
> > 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( "="):
> >                         raise Warning("expected '='", self.FileName,
> >self.CurrentLineNumber)
> >-                    if not self.__GetNextHexNumber():
> >-                        raise Warning("expected Hex device id", self.FileName,
> >self.CurrentLineNumber)
> >
> >-                    Overrides.PciDeviceId = self.__Token
> >+                    # Get a list of PCI IDs
> >+                    Overrides.PciDeviceId = ""
> >+
> >+                    while self.__GetNextHexNumber():
> >+                        Overrides.PciDeviceId += " " + self.__Token

Can we change to minimize looping string concatenation here?  This in a loop will cause lots of memory allocation/deallocation and slow things down.

Maybe : 
Overrides.PciDeviceId = "{} {}".format(Overrides.PciDeviceId, self.__Token)


> >+
> >+                    if not Overrides.PciDeviceId:
> >+                        raise Warning("expected one or more Hex 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
  2018-10-08 15:00   ` Carsey, Jaben
@ 2018-10-12  5:53     ` Zhu, Yonghong
  2018-10-24 10:15       ` Tomas Pilar (tpilar)
  0 siblings, 1 reply; 6+ messages in thread
From: Zhu, Yonghong @ 2018-10-12  5:53 UTC (permalink / raw)
  To: Carsey, Jaben, Gao, Liming, Tomas Pilar (tpilar),
	edk2-devel@lists.01.org

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 Carsey, Jaben
Sent: Monday, October 8, 2018 11:00 PM
To: Gao, Liming <liming.gao@intel.com>; Tomas Pilar (tpilar) <tpilar@solarflare.com>; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override



> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of 
> Gao, Liming
> Sent: Sunday, October 07, 2018 6:42 PM
> To: Tomas Pilar (tpilar) <tpilar@solarflare.com>; 
> edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in 
> Fdf OptionROM override
> 
> Pilar:
>   The change is good. Could you also update INF and FDF spec for this usage?
> If you don't know how to update INF and FDF spec, please submit BZ. I 
> will provide the spec patch.
> 
>   Reviewed-by: Liming Gao <liming.gao@intel.com>
> 
> Thanks
> Liming
> >-----Original Message-----
> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 
> >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 
> >OptionROM override
> >
> >Contributed-under: TianoCore Contribution Agreement 1.1
> >Signed-off-by: Tomas Pilar <tpilar@solarflare.com>
> >---
> > 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( "="):
> >                         raise Warning("expected '='", self.FileName,
> >self.CurrentLineNumber)
> >-                    if not self.__GetNextHexNumber():
> >-                        raise Warning("expected Hex device id", self.FileName,
> >self.CurrentLineNumber)
> >
> >-                    Overrides.PciDeviceId = self.__Token
> >+                    # Get a list of PCI IDs
> >+                    Overrides.PciDeviceId = ""
> >+
> >+                    while self.__GetNextHexNumber():
> >+                        Overrides.PciDeviceId += " " + self.__Token

Can we change to minimize looping string concatenation here?  This in a loop will cause lots of memory allocation/deallocation and slow things down.

Maybe : 
Overrides.PciDeviceId = "{} {}".format(Overrides.PciDeviceId, self.__Token)


> >+
> >+                    if not Overrides.PciDeviceId:
> >+                        raise Warning("expected one or more Hex 
> >+ 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
  2018-10-12  5:53     ` Zhu, Yonghong
@ 2018-10-24 10:15       ` Tomas Pilar (tpilar)
  0 siblings, 0 replies; 6+ messages in thread
From: Tomas Pilar (tpilar) @ 2018-10-24 10:15 UTC (permalink / raw)
  To: Zhu, Yonghong, Carsey, Jaben, Gao, Liming,
	edk2-devel@lists.01.org

Sorry, was travelling to plugfest. Respinning patches now.

Cheers,
Tom

On 12/10/2018 06:53, Zhu, Yonghong wrote:
> 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 Carsey, Jaben
> Sent: Monday, October 8, 2018 11:00 PM
> To: Gao, Liming <liming.gao@intel.com>; Tomas Pilar (tpilar) <tpilar@solarflare.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override
>
>
>
>> -----Original Message-----
>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of 
>> Gao, Liming
>> Sent: Sunday, October 07, 2018 6:42 PM
>> To: Tomas Pilar (tpilar) <tpilar@solarflare.com>; 
>> edk2-devel@lists.01.org
>> Subject: Re: [edk2] [PATCH] BaseTools: Allow multiple PciDeviceId in 
>> Fdf OptionROM override
>>
>> Pilar:
>>   The change is good. Could you also update INF and FDF spec for this usage?
>> If you don't know how to update INF and FDF spec, please submit BZ. I 
>> will provide the spec patch.
>>
>>   Reviewed-by: Liming Gao <liming.gao@intel.com>
>>
>> Thanks
>> Liming
>>> -----Original Message-----
>>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf 
>>> 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 
>>> OptionROM override
>>>
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Tomas Pilar <tpilar@solarflare.com>
>>> ---
>>> 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( "="):
>>>                         raise Warning("expected '='", self.FileName,
>>> self.CurrentLineNumber)
>>> -                    if not self.__GetNextHexNumber():
>>> -                        raise Warning("expected Hex device id", self.FileName,
>>> self.CurrentLineNumber)
>>>
>>> -                    Overrides.PciDeviceId = self.__Token
>>> +                    # Get a list of PCI IDs
>>> +                    Overrides.PciDeviceId = ""
>>> +
>>> +                    while self.__GetNextHexNumber():
>>> +                        Overrides.PciDeviceId += " " + self.__Token
> Can we change to minimize looping string concatenation here?  This in a loop will cause lots of memory allocation/deallocation and slow things down.
>
> Maybe : 
> Overrides.PciDeviceId = "{} {}".format(Overrides.PciDeviceId, self.__Token)
>
>
>>> +
>>> +                    if not Overrides.PciDeviceId:
>>> +                        raise Warning("expected one or more Hex 
>>> + 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-24 10:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-02 14:46 [PATCH] BaseTools: Allow multiple PciDeviceId in Fdf OptionROM override Tomas Pilar (tpilar)
2018-10-02 14:52 ` Laszlo Ersek
2018-10-08  1:41 ` Gao, Liming
2018-10-08 15:00   ` Carsey, Jaben
2018-10-12  5:53     ` Zhu, Yonghong
2018-10-24 10:15       ` Tomas Pilar (tpilar)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox