[1/1] app/test: resolve mbuf_test application failure

Message ID 20230426092750.2423850-1-rkudurumalla@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [1/1] app/test: resolve mbuf_test application failure |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Rakesh Kudurumalla April 26, 2023, 9:27 a.m. UTC
  when RTE_ENABLE_ASSERT is defined test_mbuf application is
failing because we are trying to attach extbuf to a cloned
buffer to which external mbuf is already attached.This patch
fixes the same.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
v2: removed gerrit id

 app/test/test_mbuf.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Rakesh Kudurumalla May 23, 2023, 3:39 p.m. UTC | #1
Ping

Regards,
Rakesh

> -----Original Message-----
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Sent: Wednesday, April 26, 2023 2:58 PM
> To: Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Nithin
> Kumar Dabilpuram <ndabilpuram@marvell.com>; Rakesh Kudurumalla
> <rkudurumalla@marvell.com>
> Subject: [PATCH 1/1] app/test: resolve mbuf_test application failure
> 
> when RTE_ENABLE_ASSERT is defined test_mbuf application is failing
> because we are trying to attach extbuf to a cloned buffer to which external
> mbuf is already attached.This patch fixes the same.
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
> v2: removed gerrit id
> 
>  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
> 8d8d3b9386..e2b81db308 100644
> --- a/app/test/test_mbuf.c
> +++ b/app/test/test_mbuf.c
> @@ -2375,6 +2375,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct
> rte_mempool *pktmbuf_pool)
>  		GOTO_FAIL("%s: Bad packet length\n", __func__);
> 
>  	/* attach the same external buffer to the cloned mbuf */
> +	clone->ol_flags = 0;
>  	rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
>  			ret_shinfo);
>  	if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)
> --
> 2.25.1
  
Ashwin Sekhar T K July 4, 2023, 4:39 a.m. UTC | #2
Acked-by: Ashwin Sekhar T K <asekhar@marvell.com>

Ashwin Sekhar T K 

> -----Original Message-----
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Sent: Wednesday, April 26, 2023 2:58 PM
> To: Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Nithin
> Kumar Dabilpuram <ndabilpuram@marvell.com>; Rakesh Kudurumalla
> <rkudurumalla@marvell.com>
> Subject: [EXT] [PATCH 1/1] app/test: resolve mbuf_test application failure
> 
> External Email
> 
> ----------------------------------------------------------------------
> when RTE_ENABLE_ASSERT is defined test_mbuf application is failing
> because we are trying to attach extbuf to a cloned buffer to which external
> mbuf is already attached.This patch fixes the same.
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
> v2: removed gerrit id
> 
>  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
> 8d8d3b9386..e2b81db308 100644
> --- a/app/test/test_mbuf.c
> +++ b/app/test/test_mbuf.c
> @@ -2375,6 +2375,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct
> rte_mempool *pktmbuf_pool)
>  		GOTO_FAIL("%s: Bad packet length\n", __func__);
> 
>  	/* attach the same external buffer to the cloned mbuf */
> +	clone->ol_flags = 0;
>  	rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova,
> buf_len,
>  			ret_shinfo);
>  	if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)
> --
> 2.25.1
  
Olivier Matz July 5, 2023, 4:12 p.m. UTC | #3
Hi Rakesh,

On Tue, May 23, 2023 at 03:39:53PM +0000, Rakesh Kudurumalla wrote:
> Ping
> 
> Regards,
> Rakesh
> 
> > -----Original Message-----
> > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > Sent: Wednesday, April 26, 2023 2:58 PM
> > To: Olivier Matz <olivier.matz@6wind.com>
> > Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Nithin
> > Kumar Dabilpuram <ndabilpuram@marvell.com>; Rakesh Kudurumalla
> > <rkudurumalla@marvell.com>
> > Subject: [PATCH 1/1] app/test: resolve mbuf_test application failure
> > 
> > when RTE_ENABLE_ASSERT is defined test_mbuf application is failing
> > because we are trying to attach extbuf to a cloned buffer to which external
> > mbuf is already attached.This patch fixes the same.
> > 
> > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > ---
> > v2: removed gerrit id
> > 
> >  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
> > 8d8d3b9386..e2b81db308 100644
> > --- a/app/test/test_mbuf.c
> > +++ b/app/test/test_mbuf.c
> > @@ -2375,6 +2375,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct
> > rte_mempool *pktmbuf_pool)
> >  		GOTO_FAIL("%s: Bad packet length\n", __func__);
> > 
> >  	/* attach the same external buffer to the cloned mbuf */
> > +	clone->ol_flags = 0;
> >  	rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
> >  			ret_shinfo);

I think we can simply remove the call to rte_pktmbuf_attach_extbuf() because
after the call to rte_pktmbuf_clone(), the mbuf is already attached.

I mean something like this:

  --- a/app/test/test_mbuf.c
  +++ b/app/test/test_mbuf.c
  @@ -2345,16 +2345,12 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
                  GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
                                  __func__);
   
  -       /* allocate one more mbuf */
  +       /* allocate one more mbuf, it is attached to the same external buffer */
          clone = rte_pktmbuf_clone(m, pktmbuf_pool);
          if (clone == NULL)
                  GOTO_FAIL("%s: mbuf clone allocation failed!\n", __func__);
          if (rte_pktmbuf_pkt_len(clone) != 0)
                  GOTO_FAIL("%s: Bad packet length\n", __func__);
  -
  -       /* attach the same external buffer to the cloned mbuf */
  -       rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
  -                       ret_shinfo);
          if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)
                  GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
                                  __func__);


Regards,
Olivier
  
Rakesh Kudurumalla July 24, 2023, 6:27 a.m. UTC | #4
> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Wednesday, July 5, 2023 9:42 PM
> To: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Nithin
> Kumar Dabilpuram <ndabilpuram@marvell.com>
> Subject: [EXT] Re: [PATCH 1/1] app/test: resolve mbuf_test application failure
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hi Rakesh,
> 
> On Tue, May 23, 2023 at 03:39:53PM +0000, Rakesh Kudurumalla wrote:
> > Ping
> >
> > Regards,
> > Rakesh
> >
> > > -----Original Message-----
> > > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > Sent: Wednesday, April 26, 2023 2:58 PM
> > > To: Olivier Matz <olivier.matz@6wind.com>
> > > Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> > > Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Rakesh
> > > Kudurumalla <rkudurumalla@marvell.com>
> > > Subject: [PATCH 1/1] app/test: resolve mbuf_test application failure
> > >
> > > when RTE_ENABLE_ASSERT is defined test_mbuf application is failing
> > > because we are trying to attach extbuf to a cloned buffer to which
> > > external mbuf is already attached.This patch fixes the same.
> > >
> > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > ---
> > > v2: removed gerrit id
> > >
> > >  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
> > > 8d8d3b9386..e2b81db308 100644
> > > --- a/app/test/test_mbuf.c
> > > +++ b/app/test/test_mbuf.c
> > > @@ -2375,6 +2375,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct
> > > rte_mempool *pktmbuf_pool)
> > >  		GOTO_FAIL("%s: Bad packet length\n", __func__);
> > >
> > >  	/* attach the same external buffer to the cloned mbuf */
> > > +	clone->ol_flags = 0;
> > >  	rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
> > >  			ret_shinfo);
> 
> I think we can simply remove the call to rte_pktmbuf_attach_extbuf()
> because after the call to rte_pktmbuf_clone(), the mbuf is already attached.
> 
Yes we can remove call to rte_pktmbuf_attach_extbuf()

> I mean something like this:
> 
>   --- a/app/test/test_mbuf.c
>   +++ b/app/test/test_mbuf.c
>   @@ -2345,16 +2345,12 @@ test_pktmbuf_ext_shinfo_init_helper(struct
> rte_mempool *pktmbuf_pool)
>                   GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
>                                   __func__);
> 
>   -       /* allocate one more mbuf */
>   +       /* allocate one more mbuf, it is attached to the same external buffer
> */
>           clone = rte_pktmbuf_clone(m, pktmbuf_pool);
>           if (clone == NULL)
>                   GOTO_FAIL("%s: mbuf clone allocation failed!\n", __func__);
>           if (rte_pktmbuf_pkt_len(clone) != 0)
>                   GOTO_FAIL("%s: Bad packet length\n", __func__);
>   -
>   -       /* attach the same external buffer to the cloned mbuf */
>   -       rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
>   -                       ret_shinfo);
>           if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)
>                   GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
>                                   __func__);
> 
> 
> Regards,
> Olivier
  

Patch

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 8d8d3b9386..e2b81db308 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2375,6 +2375,7 @@  test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
 		GOTO_FAIL("%s: Bad packet length\n", __func__);
 
 	/* attach the same external buffer to the cloned mbuf */
+	clone->ol_flags = 0;
 	rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
 			ret_shinfo);
 	if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)