DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Deng, KaiwenX" <kaiwenx.deng@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "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>,
	"Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>
Subject: RE: [PATCH] net/iavf: fix core dump when exiting testpmd
Date: Tue, 31 Oct 2023 08:15:36 +0000	[thread overview]
Message-ID: <DM4PR11MB5994D1AE2866FB773930C7ACD7A0A@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20231026085444.497296-1-kaiwenx.deng@intel.com>



> -----Original Message-----
> From: Kaiwen Deng <kaiwenx.deng@intel.com>
> Sent: Thursday, October 26, 2023 4:55 PM
> To: dev@dpdk.org
> Cc: 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>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: [PATCH] net/iavf: fix core dump when exiting testpmd
> 
> release null mbuf results coredump.
> This commit adding mbuf check before releasing.
> 
> Fixes: 12016895fcf3 ("net/iavf: fix buffer leak on Tx queue stop")
> 
> Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
> ---
>  drivers/net/iavf/iavf_rxtx_vec_common.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h
> b/drivers/net/iavf/iavf_rxtx_vec_common.h
> index e18cdc3f11..f50a500536 100644
> --- a/drivers/net/iavf/iavf_rxtx_vec_common.h
> +++ b/drivers/net/iavf/iavf_rxtx_vec_common.h
> @@ -187,8 +187,11 @@ _iavf_tx_queue_release_mbufs_vec(struct
> iavf_tx_queue *txq)
> 
>  	i = txq->next_dd - txq->rs_thresh + 1;
>  	while (i != txq->tx_tail) {
> -		rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
> -		txq->sw_ring[i].mbuf = NULL;
> +		if (txq->sw_ring[i].mbuf) {
> +			rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
> +			txq->sw_ring[i].mbuf = NULL;
> +		}

Could you explain how to reproduce this issue in the commit log.

Looks like it is to fix the scenario that queue stop and start again and some mbuf will be double free at some time?

> +
>  		if (++i == txq->nb_tx_desc)
>  			i = 0;
>  	}
> --
> 2.34.1


  reply	other threads:[~2023-10-31  8:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26  8:54 Kaiwen Deng
2023-10-31  8:15 ` Zhang, Qi Z [this message]
2023-11-01  1:34 ` [PATCH v2] net/iavf: fix coredump " Kaiwen Deng
2023-11-01  7:53   ` Lu, Wenzhuo
2023-11-01  9:32     ` Deng, KaiwenX
2023-11-01 11:00   ` Zhang, Qi Z
2023-11-02  4:43   ` [PATCH v3] net/iavf: fix mbuf release API selection Kaiwen Deng
2023-11-08  9:33     ` Zhang, Qi Z
2023-11-08 12:02       ` Zhang, Qi Z
2023-11-09  1:42         ` Deng, KaiwenX
2023-11-09  4:58     ` [PATCH v4] " Kaiwen Deng
2023-11-09 12:23       ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM4PR11MB5994D1AE2866FB773930C7ACD7A0A@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=kaiwenx.deng@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=wenzhuo.lu@intel.com \
    --cc=yidingx.zhou@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).