From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D17FA0613 for ; Sun, 4 Aug 2019 15:56:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DEBCD1BEB1; Sun, 4 Aug 2019 15:56:23 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 426731BE73 for ; Sun, 4 Aug 2019 15:56:22 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 4 Aug 2019 16:56:16 +0300 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x74DuGsl003808; Sun, 4 Aug 2019 16:56:16 +0300 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id x74DuG0O031610; Sun, 4 Aug 2019 13:56:16 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x74DuGqp031609; Sun, 4 Aug 2019 13:56:16 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: yskoh@mellanox.com, shahafs@mellanox.com Date: Sun, 4 Aug 2019 13:56:15 +0000 Message-Id: <1564926975-31571-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix completion request for inline packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If packets are completely inline the mbuf is freed immediately after data copying and no pointer is stored into elts array to be free on completion. This leads the elts_head is not updated and completion request buffer counter works incorrect. This patch decrements the base value elts_comp used to calculate counter threshold and completion requests flags are set more correctly on the base of MLX5_TX_COMP_THRESH value. Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index a890f41..308133b 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -4097,6 +4097,7 @@ enum mlx5_txcmp_code { * Packet data are completely inlined, * free the packet immediately. */ + txq->elts_comp--; rte_pktmbuf_free_seg(loc->mbuf); goto next_mbuf; pointer_empw: @@ -4283,6 +4284,7 @@ enum mlx5_txcmp_code { * Packet data are completely inlined, * free the packet immediately. */ + txq->elts_comp--; rte_pktmbuf_free_seg(loc->mbuf); } else if (!MLX5_TXOFF_CONFIG(EMPW) && txq->inlen_mode) { -- 1.8.3.1