[v2] net/iavf: fix coredump when exiting testpmd

Message ID 20231101013433.534399-1-kaiwenx.deng@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [v2] net/iavf: fix coredump when exiting testpmd |

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/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Kaiwen Deng Nov. 1, 2023, 1:34 a.m. UTC
  Avf releasing mbuf using the vector path release API 
causes a coredump when the basic Tx path is selected.
This commit changes to use the basic path release API
when selecting the basic Tx path.

Fixes: 22f1e7608ebc ("net/iavf: fix AVX2 Tx selection")
Cc: stable@dpdk.org

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Wenzhuo Lu Nov. 1, 2023, 7:53 a.m. UTC | #1
Hi Kaiwen,

> -----Original Message-----
> From: Kaiwen Deng <kaiwenx.deng@intel.com>
> Sent: Wednesday, November 1, 2023 9:35 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhou, YidingX
> <yidingx.zhou@intel.com>; Deng, KaiwenX <kaiwenx.deng@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>
> Subject: [PATCH v2] net/iavf: fix coredump when exiting testpmd
> 
> Avf releasing mbuf using the vector path release API causes a coredump
> when the basic Tx path is selected.
> This commit changes to use the basic path release API when selecting the
> basic Tx path.
Sorry, don't catch the point. 
I see you changed the code when selecting AVX2 non-offload path. Confused about what's " the vector path release API " and what's " the basic path release API ".

> 
> Fixes: 22f1e7608ebc ("net/iavf: fix AVX2 Tx selection")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index
> 610912f635..a16e03d88c 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -4022,6 +4022,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
>  				PMD_DRV_LOG(DEBUG,
>  					"AVX2 does not support outer checksum offload,
> using Basic Tx (port %d).",
>  					dev->data->port_id);
> +				return;
>  			} else {
>  				dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx2_offload;
>  				dev->tx_pkt_prepare = iavf_prep_pkts;
> --
> 2.34.1
  
Kaiwen Deng Nov. 1, 2023, 9:32 a.m. UTC | #2
> -----Original Message-----
> From: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Sent: Wednesday, November 1, 2023 3:53 PM
> To: Deng, KaiwenX <kaiwenx.deng@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhou, YidingX
> <yidingx.zhou@intel.com>; Deng, KaiwenX <kaiwenx.deng@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>
> Subject: RE: [PATCH v2] net/iavf: fix coredump when exiting testpmd
> 
> Hi Kaiwen,
> 
> > -----Original Message-----
> > From: Kaiwen Deng <kaiwenx.deng@intel.com>
> > Sent: Wednesday, November 1, 2023 9:35 AM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhou,
> > YidingX <yidingx.zhou@intel.com>; Deng, KaiwenX
> > <kaiwenx.deng@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xing,
> > Beilei <beilei.xing@intel.com>; Zeng, ZhichaoX
> > <zhichaox.zeng@intel.com>
> > Subject: [PATCH v2] net/iavf: fix coredump when exiting testpmd
> >
> > Avf releasing mbuf using the vector path release API causes a coredump
> > when the basic Tx path is selected.
> > This commit changes to use the basic path release API when selecting
> > the basic Tx path.
> Sorry, don't catch the point.
> I see you changed the code when selecting AVX2 non-offload path. Confused
> about what's " the vector path release API " and what's " the basic path
> release API ".
> 
Hi Wenzhuo:

Thanks for your review.
According to the code below.
"the vector path release API" is iavf_tx_queue_release_mbufs_sse.
"the basic path release API" is release_txq_mbufs.

static const
struct iavf_txq_ops iavf_txq_release_mbufs_ops[] = {
	[IAVF_REL_MBUFS_DEFAULT].release_mbufs = release_txq_mbufs,
#ifdef RTE_ARCH_X86
	[IAVF_REL_MBUFS_SSE_VEC].release_mbufs = iavf_tx_queue_release_mbufs_sse,
#ifdef CC_AVX512_SUPPORT
	[IAVF_REL_MBUFS_AVX512_VEC].release_mbufs = iavf_tx_queue_release_mbufs_avx512,
#endif
> >
> > Fixes: 22f1e7608ebc ("net/iavf: fix AVX2 Tx selection")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
> > ---
> >  drivers/net/iavf/iavf_rxtx.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/iavf/iavf_rxtx.c
> > b/drivers/net/iavf/iavf_rxtx.c index 610912f635..a16e03d88c 100644
> > --- a/drivers/net/iavf/iavf_rxtx.c
> > +++ b/drivers/net/iavf/iavf_rxtx.c
> > @@ -4022,6 +4022,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
> >  				PMD_DRV_LOG(DEBUG,
> >  					"AVX2 does not support outer
> checksum offload, using Basic Tx
> > (port %d).",
> >  					dev->data->port_id);
> > +				return;
> >  			} else {
> >  				dev->tx_pkt_burst =
> iavf_xmit_pkts_vec_avx2_offload;
> >  				dev->tx_pkt_prepare = iavf_prep_pkts;
> > --
> > 2.34.1
  
Qi Zhang Nov. 1, 2023, 11 a.m. UTC | #3
> -----Original Message-----
> From: Kaiwen Deng <kaiwenx.deng@intel.com>
> Sent: Wednesday, November 1, 2023 9:35 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Yang, Qiming <qiming.yang@intel.com>; Zhou, YidingX
> <yidingx.zhou@intel.com>; Deng, KaiwenX <kaiwenx.deng@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>
> Subject: [PATCH v2] net/iavf: fix coredump when exiting testpmd

please remove testpmd from the title if this issue is not specific to testpmd.

You can always add reproduce step with testpmd in commit log.

> 
> Avf releasing mbuf using the vector path release API causes a coredump
> when the basic Tx path is selected.
> This commit changes to use the basic path release API when selecting the
> basic Tx path.
> 
> Fixes: 22f1e7608ebc ("net/iavf: fix AVX2 Tx selection")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index
> 610912f635..a16e03d88c 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -4022,6 +4022,7 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
>  				PMD_DRV_LOG(DEBUG,
>  					"AVX2 does not support outer
> checksum offload, using Basic Tx (port %d).",
>  					dev->data->port_id);
> +				return;
>  			} else {
>  				dev->tx_pkt_burst =
> iavf_xmit_pkts_vec_avx2_offload;
>  				dev->tx_pkt_prepare = iavf_prep_pkts;
> --
> 2.34.1
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 610912f635..a16e03d88c 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -4022,6 +4022,7 @@  iavf_set_tx_function(struct rte_eth_dev *dev)
 				PMD_DRV_LOG(DEBUG,
 					"AVX2 does not support outer checksum offload, using Basic Tx (port %d).",
 					dev->data->port_id);
+				return;
 			} else {
 				dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx2_offload;
 				dev->tx_pkt_prepare = iavf_prep_pkts;