[dpdk-dev] net/i40e: fix segment num in reassemble process

Message ID 1483932664-38718-1-git-send-email-yao.chenghu@zte.com.cn (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Chenghu Yao Jan. 9, 2017, 3:31 a.m. UTC
  When freeing up last mbuf, start->nb_segs should be decremented
by one. See also ixgbe process.

Signed-off-by: Chenghu Yao <yao.chenghu@zte.com.cn>
---
 drivers/net/i40e/i40e_rxtx_vec_common.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Ferruh Yigit Jan. 9, 2017, 11:55 a.m. UTC | #1
On 1/9/2017 3:31 AM, Chenghu Yao wrote:
> When freeing up last mbuf, start->nb_segs should be decremented
> by one. See also ixgbe process.
> 
> Signed-off-by: Chenghu Yao <yao.chenghu@zte.com.cn>

Fixes: 0e0da28cd888 ("i40e: add vector scatter Rx")

CC:stable@dpdk.org

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit Jan. 9, 2017, 12:04 p.m. UTC | #2
On 1/9/2017 11:55 AM, Ferruh Yigit wrote:
> On 1/9/2017 3:31 AM, Chenghu Yao wrote:
>> When freeing up last mbuf, start->nb_segs should be decremented
>> by one. See also ixgbe process.
>>
>> Signed-off-by: Chenghu Yao <yao.chenghu@zte.com.cn>
> 
> Fixes: 0e0da28cd888 ("i40e: add vector scatter Rx")
> 
> CC:stable@dpdk.org
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index 6cb5dce..990520f 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -71,6 +71,7 @@ 
 					/* free up last mbuf */
 					struct rte_mbuf *secondlast = start;
 
+					start->nb_segs--;
 					while (secondlast->next != end)
 						secondlast = secondlast->next;
 					secondlast->data_len -= (rxq->crc_len -