* [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG
@ 2023-03-13 16:56 Pavel Ivashchenko
2023-03-15 10:29 ` David Marchand
2023-03-16 19:14 ` [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled Pavel Ivashchenko
0 siblings, 2 replies; 6+ messages in thread
From: Pavel Ivashchenko @ 2023-03-13 16:56 UTC (permalink / raw)
To: olivier.matz, konstantin.ananyev, mb, ajit.khaparde
Cc: dev, Pavel Ivashchenko, stable
How to reproduce:
1. Define RTE_LIBRTE_MBUF_DEBUG
2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest
PANIC in rte_mbuf_sanity_check():
bad pkt_len
...
#6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
#7 0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
#8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
#9 test_mbuf () at ../app/test/test_mbuf.c:2967
...
(gdb) frame 6
#6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
384 rte_panic("%s\n", reason);
(gdb) p/d m->pkt_len
$4 = 1500
Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
Cc: stable@dpdk.org
Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
---
app/test/test_mbuf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 6cbb03b0af..d471a23805 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
/* split m0 chain in two, between m1 and m2 */
m0->nb_segs = 2;
+ m0->pkt_len -= 500;
m1->next = NULL;
m2->nb_segs = 1;
--
2.39.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG
2023-03-13 16:56 [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG Pavel Ivashchenko
@ 2023-03-15 10:29 ` David Marchand
2023-03-15 16:02 ` Olivier Matz
2023-03-16 19:14 ` [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled Pavel Ivashchenko
1 sibling, 1 reply; 6+ messages in thread
From: David Marchand @ 2023-03-15 10:29 UTC (permalink / raw)
To: Pavel Ivashchenko, olivier.matz
Cc: konstantin.ananyev, mb, ajit.khaparde, dev, stable
Hello,
On Mon, Mar 13, 2023 at 5:57 PM Pavel Ivashchenko
<pivashchenko@nfware.com> wrote:
>
> How to reproduce:
>
> 1. Define RTE_LIBRTE_MBUF_DEBUG
> 2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest
>
> PANIC in rte_mbuf_sanity_check():
> bad pkt_len
>
> ...
> #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> #7 0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
> #8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
> #9 test_mbuf () at ../app/test/test_mbuf.c:2967
> ...
>
> (gdb) frame 6
> #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> 384 rte_panic("%s\n", reason);
> (gdb) p/d m->pkt_len
> $4 = 1500
>
> Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
LGTM, thanks.
Just a small comment.
> ---
> app/test/test_mbuf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
> index 6cbb03b0af..d471a23805 100644
> --- a/app/test/test_mbuf.c
> +++ b/app/test/test_mbuf.c
> @@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
>
> /* split m0 chain in two, between m1 and m2 */
> m0->nb_segs = 2;
> + m0->pkt_len -= 500;
m0->pkt_len -= m2->data_len seems more readable and robust to me.
Opinions?
> m1->next = NULL;
> m2->nb_segs = 1;
>
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG
2023-03-15 10:29 ` David Marchand
@ 2023-03-15 16:02 ` Olivier Matz
0 siblings, 0 replies; 6+ messages in thread
From: Olivier Matz @ 2023-03-15 16:02 UTC (permalink / raw)
To: David Marchand
Cc: Pavel Ivashchenko, konstantin.ananyev, mb, ajit.khaparde, dev, stable
Hello,
On Wed, Mar 15, 2023 at 11:29:50AM +0100, David Marchand wrote:
> Hello,
>
> On Mon, Mar 13, 2023 at 5:57 PM Pavel Ivashchenko
> <pivashchenko@nfware.com> wrote:
>
> app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG
I suggest this title instead:
test/mbuf: fix mbuf autotest when mbuf debug is enabled
> >
> > How to reproduce:
> >
> > 1. Define RTE_LIBRTE_MBUF_DEBUG
> > 2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest
> >
> > PANIC in rte_mbuf_sanity_check():
> > bad pkt_len
> >
> > ...
> > #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> > #7 0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
> > #8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
> > #9 test_mbuf () at ../app/test/test_mbuf.c:2967
> > ...
> >
> > (gdb) frame 6
> > #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> > 384 rte_panic("%s\n", reason);
> > (gdb) p/d m->pkt_len
> > $4 = 1500
> >
> > Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
>
> LGTM, thanks.
> Just a small comment.
>
>
> > ---
> > app/test/test_mbuf.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
> > index 6cbb03b0af..d471a23805 100644
> > --- a/app/test/test_mbuf.c
> > +++ b/app/test/test_mbuf.c
> > @@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
> >
> > /* split m0 chain in two, between m1 and m2 */
> > m0->nb_segs = 2;
> > + m0->pkt_len -= 500;
>
> m0->pkt_len -= m2->data_len seems more readable and robust to me.
>
> Opinions?
Even if the 500 is hardcoded right above, this looks indeed better.
Or this seems fine too:
m0->pkt_len = m0->data_len + m1->data_len;
Thanks,
Olivier
>
>
> > m1->next = NULL;
> > m2->nb_segs = 1;
> >
>
>
> --
> David Marchand
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled
2023-03-13 16:56 [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG Pavel Ivashchenko
2023-03-15 10:29 ` David Marchand
@ 2023-03-16 19:14 ` Pavel Ivashchenko
2023-03-17 8:02 ` Olivier Matz
1 sibling, 1 reply; 6+ messages in thread
From: Pavel Ivashchenko @ 2023-03-16 19:14 UTC (permalink / raw)
To: Olivier Matz, Konstantin Ananyev, Morten Brørup, Ajit Khaparde
Cc: dev, Pavel Ivashchenko, stable
How to reproduce:
1. Define RTE_LIBRTE_MBUF_DEBUG
2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest
PANIC in rte_mbuf_sanity_check():
bad pkt_len
...
#6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
#7 0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
#8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
#9 test_mbuf () at ../app/test/test_mbuf.c:2967
...
(gdb) frame 6
#6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
384 rte_panic("%s\n", reason);
(gdb) p/d m->pkt_len
$4 = 1500
Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
Cc: stable@dpdk.org
Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
---
v2:
* Fixed commit title
* Changed m0->pkt_len -= 500 to m0->pkt_len -= m2->data_len
app/test/test_mbuf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 6cbb03b0af..1f4dd62466 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
/* split m0 chain in two, between m1 and m2 */
m0->nb_segs = 2;
+ m0->pkt_len -= m2->data_len;
m1->next = NULL;
m2->nb_segs = 1;
--
2.39.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled
2023-03-16 19:14 ` [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled Pavel Ivashchenko
@ 2023-03-17 8:02 ` Olivier Matz
2023-03-17 8:09 ` David Marchand
0 siblings, 1 reply; 6+ messages in thread
From: Olivier Matz @ 2023-03-17 8:02 UTC (permalink / raw)
To: Pavel Ivashchenko; +Cc: dev, stable
On Thu, Mar 16, 2023 at 10:14:56PM +0300, Pavel Ivashchenko wrote:
> How to reproduce:
>
> 1. Define RTE_LIBRTE_MBUF_DEBUG
> 2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest
>
> PANIC in rte_mbuf_sanity_check():
> bad pkt_len
>
> ...
> #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> #7 0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
> #8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
> #9 test_mbuf () at ../app/test/test_mbuf.c:2967
> ...
>
> (gdb) frame 6
> #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> 384 rte_panic("%s\n", reason);
> (gdb) p/d m->pkt_len
> $4 = 1500
>
> Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled
2023-03-17 8:02 ` Olivier Matz
@ 2023-03-17 8:09 ` David Marchand
0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2023-03-17 8:09 UTC (permalink / raw)
To: Pavel Ivashchenko; +Cc: dev, stable, Olivier Matz
On Fri, Mar 17, 2023 at 9:03 AM Olivier Matz <olivier.matz@6wind.com> wrote:
> On Thu, Mar 16, 2023 at 10:14:56PM +0300, Pavel Ivashchenko wrote:
> > How to reproduce:
> >
> > 1. Define RTE_LIBRTE_MBUF_DEBUG
> > 2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest
> >
> > PANIC in rte_mbuf_sanity_check():
> > bad pkt_len
> >
> > ...
> > #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> > #7 0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
> > #8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
> > #9 test_mbuf () at ../app/test/test_mbuf.c:2967
> > ...
> >
> > (gdb) frame 6
> > #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
> > 384 rte_panic("%s\n", reason);
> > (gdb) p/d m->pkt_len
> > $4 = 1500
> >
> > Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-03-17 8:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 16:56 [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG Pavel Ivashchenko
2023-03-15 10:29 ` David Marchand
2023-03-15 16:02 ` Olivier Matz
2023-03-16 19:14 ` [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled Pavel Ivashchenko
2023-03-17 8:02 ` Olivier Matz
2023-03-17 8:09 ` 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).