patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD
Date: Mon, 9 Oct 2017 12:44:25 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <20171009085345.46357-1-qi.z.zhang@intel.com>

Hi Zhang,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang
> Sent: Monday, October 9, 2017 9:54 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD
> 
> The patch reset tx queue sw_ring's mbuf to NULL after it is free in
> i40_tx_free_bufs, this prevent same mbuf be free again in
> i40e_dev_tx_queue_release. This fix follow the same implemenation of
> non-vPMD.

Wonder why we can't change i40e_dev_tx_queue_release() instead, 
so it will only go through the TXDs that were really armed?
Let say from txq->tx_next_dd - tx_rs_thresh - 1 till txq->tx_tail?
Let say _ixgbe_tx_queue_release_mbufs_vec() works that way.
Then we probably can keep our runtime code intact.
Konstantin

> 
> Fixes: b4669bb95038 ("i40e: add vector Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  drivers/net/i40e/i40e_rxtx_vec_common.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
> index 39a6da0..ed51b4d 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec_common.h
> +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
> @@ -124,11 +124,13 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
>  	  */
>  	txep = &txq->sw_ring[txq->tx_next_dd - (n - 1)];
>  	m = rte_pktmbuf_prefree_seg(txep[0].mbuf);
> +	txep[0].mbuf = NULL;
>  	if (likely(m != NULL)) {
>  		free[0] = m;
>  		nb_free = 1;
>  		for (i = 1; i < n; i++) {
>  			m = rte_pktmbuf_prefree_seg(txep[i].mbuf);
> +			txep[i].mbuf = NULL;
>  			if (likely(m != NULL)) {
>  				if (likely(m->pool == free[0]->pool)) {
>  					free[nb_free++] = m;
> @@ -145,6 +147,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
>  	} else {
>  		for (i = 1; i < n; i++) {
>  			m = rte_pktmbuf_prefree_seg(txep[i].mbuf);
> +			txep[i].mbuf = NULL;
>  			if (m != NULL)
>  				rte_mempool_put(m->pool, m);
>  		}
> --
> 2.9.5

  parent reply	other threads:[~2017-10-09 12:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  8:53 [dpdk-stable] " Qi Zhang
2017-10-09  1:47 ` Wu, Jingjing
2017-10-09 12:44 ` Ananyev, Konstantin [this message]
2017-10-09 13:20   ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
2017-10-10  1:10   ` Zhang, Qi Z
2017-10-10 13:22 [dpdk-stable] " Qi Zhang
2017-10-10  8:48 ` [dpdk-stable] [dpdk-dev] " Bruce Richardson
2017-10-10 11:05   ` Roger B. Melton
2017-10-10 11:39     ` Bruce Richardson
2017-10-10 11:47       ` Roger B. Melton
2017-10-12 11:15         ` Roger B. Melton
2017-10-12 11:30           ` Richardson, Bruce

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=2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /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).