[v1] net/iavf: fix cannot release mbufs issue

Message ID 20201111030651.15535-1-ting.xu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v1] net/iavf: fix cannot release mbufs issue |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Xu, Ting Nov. 11, 2020, 3:06 a.m. UTC
  In the function _iavf_rx_queue_release_mbufs_vec to release rx mbufs,
rxq->rxrearm_nb is given the value of rx descriptor number at last.
However, since the process to release and allocate mbufs lacks the
initialization of rxrearm_nb, if we try to release mbufs next time, it
will return without releasing directly. In this patch, rxrearm_nb is
initialized to be zero in rx queue reset.

Fixes: 319c421f3890 ("net/avf: enable SSE Rx Tx")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jingjing Wu Nov. 11, 2020, 5:16 a.m. UTC | #1
> -----Original Message-----
> From: Xu, Ting <ting.xu@intel.com>
> Sent: Wednesday, November 11, 2020 11:07 AM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>; Xu, Ting <ting.xu@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v1] net/iavf: fix cannot release mbufs issue
> 
> In the function _iavf_rx_queue_release_mbufs_vec to release rx mbufs,
> rxq->rxrearm_nb is given the value of rx descriptor number at last.
> However, since the process to release and allocate mbufs lacks the
> initialization of rxrearm_nb, if we try to release mbufs next time, it will return
> without releasing directly. In this patch, rxrearm_nb is initialized to be zero in
> rx queue reset.
> 
> Fixes: 319c421f3890 ("net/avf: enable SSE Rx Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ting Xu <ting.xu@intel.com>

Acked-by: Jingjing Wu <jingjing.wu@intel.com>
  
Qi Zhang Nov. 11, 2020, 8:19 a.m. UTC | #2
> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu@intel.com>
> Sent: Wednesday, November 11, 2020 1:16 PM
> To: Xu, Ting <ting.xu@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> stable@dpdk.org
> Subject: RE: [PATCH v1] net/iavf: fix cannot release mbufs issue
> 
> 
> 
> > -----Original Message-----
> > From: Xu, Ting <ting.xu@intel.com>
> > Sent: Wednesday, November 11, 2020 11:07 AM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xu,
> > Ting <ting.xu@intel.com>; stable@dpdk.org
> > Subject: [PATCH v1] net/iavf: fix cannot release mbufs issue
> >
> > In the function _iavf_rx_queue_release_mbufs_vec to release rx mbufs,
> > rxq->rxrearm_nb is given the value of rx descriptor number at last.
> > However, since the process to release and allocate mbufs lacks the
> > initialization of rxrearm_nb, if we try to release mbufs next time, it
> > will return without releasing directly. In this patch, rxrearm_nb is
> > initialized to be zero in rx queue reset.
> >
> > Fixes: 319c421f3890 ("net/avf: enable SSE Rx Tx")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Ting Xu <ting.xu@intel.com>
> 
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
>
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index baac5d65c8..8f43208c80 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -194,6 +194,7 @@  reset_rx_queue(struct iavf_rx_queue *rxq)
 	rxq->nb_rx_hold = 0;
 	rxq->pkt_first_seg = NULL;
 	rxq->pkt_last_seg = NULL;
+	rxq->rxrearm_nb = 0;
 }
 
 static inline void