On Thu, Jun 27, 2024 at 12:57 PM Bruce Richardson
<bruce.richard...@intel.com> wrote:
>
> On Thu, Jun 27, 2024 at 10:11:44AM +0000, Mingjin Ye wrote:
> > ELF files generated by higher version compilers wrap multiple
> > symbols prefixed with "this_pmd_name".
> >
> > This patch fixes the issue by filtering invalid symbols.
> >
> > Bugzilla ID: 1466
> > Fixes: 6c4bf8f42432 ("buildtools: add Python pmdinfogen")
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Mingjin Ye <mingjinx...@intel.com>
> > ---
> >  buildtools/pmdinfogen.py | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
> > index 2a44f17bda..6ea97caec7 100755
> > --- a/buildtools/pmdinfogen.py
> > +++ b/buildtools/pmdinfogen.py
> > @@ -200,7 +200,8 @@ def dump(self, file):
> >  def load_drivers(image):
> >      drivers = []
> >      for symbol in image.find_by_prefix("this_pmd_name"):
> > -        drivers.append(Driver.load(image, symbol))
> > +        if len(symbol.string_value) != 0:
> > +            drivers.append(Driver.load(image, symbol))
>
> One small suggestion. Empty strings evaluate to boolean false, so the
> condition can just be simplified to:
>
>         if symbol.string_value:
>             drivers.append(....)

I have the same comment than what Ali tried with:
https://patchwork.dpdk.org/project/dpdk/patch/20240320155814.617220-1-alia...@nvidia.com/

I would prefer we don't rely on the content of symbols (that we don't
know anything about) when we can filter on the symbol names exactly
which is something DPDK controls.

My suggestion is to filter symbol *names* with regex ^this_pmd_name[0-9]+$.


-- 
David Marchand

Reply via email to