patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ye Xiaolong <xiaolong.ye@intel.com>
To: Xiao Wang <xiao.w.wang@intel.com>
Cc: dev@dpdk.org, qi.z.zhang@intel.com, stable@dpdk.org,
	Anna Lukin <annal@silicom.co.il>
Subject: Re: [dpdk-stable] [PATCH] net/fm10k: fix mbuf free in vector Rx
Date: Mon, 28 Oct 2019 13:39:57 +0800	[thread overview]
Message-ID: <20191028053957.GB33024@intel.com> (raw)
In-Reply-To: <20191026003322.131809-1-xiao.w.wang@intel.com>

On 10/25, Xiao Wang wrote:
>There's a corner case that all the Rx queue mbufs are allocated but none
>of them is used, this patch fixes mbuf free for this case.
>
>Fixes: b6719f8a04bb ("fm10k: release mbuf for vector Rx")
>Cc: stable@dpdk.org
>
>Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
>Signed-off-by: Anna Lukin <annal@silicom.co.il>
>---
> drivers/net/fm10k/fm10k_rxtx_vec.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
>index 45542bef3..d76dfd16f 100644
>--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
>+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
>@@ -359,8 +359,15 @@ fm10k_rx_queue_release_mbufs_vec(struct fm10k_rx_queue *rxq)
> 		return;
> 
> 	/* free all mbufs that are valid in the ring */
>-	for (i = rxq->next_dd; i != rxq->rxrearm_start; i = (i + 1) & mask)
>-		rte_pktmbuf_free_seg(rxq->sw_ring[i]);
>+	if (rxq->rxrearm_nb == 0) {
>+		for (i = 0; i < rxq->nb_desc; i++)
>+			if (rxq->sw_ring[i] != NULL)
>+				rte_pktmbuf_free_seg(rxq->sw_ring[i]);
>+	} else {
>+		for (i = rxq->next_dd; i != rxq->rxrearm_start;
>+				i = (i + 1) & mask)
>+			rte_pktmbuf_free_seg(rxq->sw_ring[i]);
>+	}
> 	rxq->rxrearm_nb = rxq->nb_desc;
> 
> 	/* set all entries to NULL */
>-- 
>2.15.1
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel. Thanks.

      reply	other threads:[~2019-10-28  5:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26  0:33 Xiao Wang
2019-10-28  5:39 ` Ye Xiaolong [this message]

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=20191028053957.GB33024@intel.com \
    --to=xiaolong.ye@intel.com \
    --cc=annal@silicom.co.il \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiao.w.wang@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).