patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] buildtools: fix invalid symbols
@ 2024-06-27 10:11 Mingjin Ye
  2024-06-27 10:50 ` Bruce Richardson
  2024-06-27 11:30 ` David Marchand
  0 siblings, 2 replies; 4+ messages in thread
From: Mingjin Ye @ 2024-06-27 10:11 UTC (permalink / raw)
  To: dev; +Cc: Mingjin Ye, stable, Dmitry Kozlyuk

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: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@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))
     return drivers
 
 
-- 
2.25.1


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

* Re: [PATCH] buildtools: fix invalid symbols
  2024-06-27 10:11 [PATCH] buildtools: fix invalid symbols Mingjin Ye
@ 2024-06-27 10:50 ` Bruce Richardson
  2024-06-27 12:39   ` David Marchand
  2024-06-27 11:30 ` David Marchand
  1 sibling, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2024-06-27 10:50 UTC (permalink / raw)
  To: Mingjin Ye; +Cc: dev, stable, Dmitry Kozlyuk

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: stable@dpdk.org
> 
> Signed-off-by: Mingjin Ye <mingjinx.ye@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(....)

/Bruce


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

* Re: [PATCH] buildtools: fix invalid symbols
  2024-06-27 10:11 [PATCH] buildtools: fix invalid symbols Mingjin Ye
  2024-06-27 10:50 ` Bruce Richardson
@ 2024-06-27 11:30 ` David Marchand
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2024-06-27 11:30 UTC (permalink / raw)
  To: Mingjin Ye; +Cc: dev, stable, Dmitry Kozlyuk

On Thu, Jun 27, 2024 at 12:36 PM Mingjin Ye <mingjinx.ye@intel.com> 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: stable@dpdk.org
>
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>

Is it the same issue as:
https://patchwork.dpdk.org/project/dpdk/patch/20240320155814.617220-1-alialnu@nvidia.com/
?


-- 
David Marchand


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

* Re: [PATCH] buildtools: fix invalid symbols
  2024-06-27 10:50 ` Bruce Richardson
@ 2024-06-27 12:39   ` David Marchand
  0 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2024-06-27 12:39 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Mingjin Ye, dev, stable, Dmitry Kozlyuk

On Thu, Jun 27, 2024 at 12:57 PM Bruce Richardson
<bruce.richardson@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: stable@dpdk.org
> >
> > Signed-off-by: Mingjin Ye <mingjinx.ye@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-alialnu@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


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

end of thread, other threads:[~2024-06-27 12:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-27 10:11 [PATCH] buildtools: fix invalid symbols Mingjin Ye
2024-06-27 10:50 ` Bruce Richardson
2024-06-27 12:39   ` David Marchand
2024-06-27 11:30 ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).