From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 7A8AB91D0 for ; Mon, 23 Nov 2015 15:45:57 +0100 (CET) Received: by wmvv187 with SMTP id v187so164332079wmv.1 for ; Mon, 23 Nov 2015 06:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gHyttUZtdJK7x8tcKW7S7EX+6g+RLFQUhZNisnriSYM=; b=QZF9l7/+rtYT3OsHVLAAKgGf8OWiszZAxJM2uKVi0luP9EFva8v0usVc6LZKjGBooN rVxVqgmkrwGEIu16sFZ0IJCtKRgs4iFh5IaA6wUy/z8OZqb2jvrGkDAEbHB2Dggd30mp bQCkcVPqHWVw+BREhbE/3Mi3TNbxPCNdgG6bodnUm7yPl5g0BA3mXyR8No0Xdz06Wfh0 K/oJdr8+SnURfjnqr6YXt/tF7eda3FIviyMzH/bJLl1OuZOxq2aSCE3vROjYKdVBTKZH 3rr4fBu8lceMpkMQpltuiRaVtOa7Cm6UG0LJnGD57bLSLYjGqjUYePoxtygMgnGuGB07 x34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gHyttUZtdJK7x8tcKW7S7EX+6g+RLFQUhZNisnriSYM=; b=m5NpIhQFxupr1vY+gUFKFjr7ri7Gh8CQVGloi6Rb40bJDZ6OrCLcRiun/I/WPD3zc6 4hoyiBnkE492R0sF6YIMG5ube6j834iWDYu8+AbV101Yveb9w7BxMWit0Ul+nWnU9sx0 ysRKsRn6x/OMaBsIASzyUBVRSCTCI4kGTS0xF7CU0DnCCvLrT6sjq//nyaTMcx4XUZE+ 6p3+QlQxH39tNWssdRMpirjspxZ7g2HnS257Sr4i7xOeqknY9PcnayoERdCtqTts+hwY mMvVBXfCeyERAlOSo3EdPiX0CXi8X3VVz3jBD+qBQY7C/6WCJbwCUwneKTYHEHFTQqax Xh7Q== X-Gm-Message-State: ALoCoQkXiTj9gnChN2mi5p4bwAgnEXStdWwLnAQlTp/oKNELyQVLPbAnCJ6kBMmF+HCrX9q/GPo1 X-Received: by 10.28.227.198 with SMTP id a189mr16554865wmh.74.1448289957344; Mon, 23 Nov 2015 06:45:57 -0800 (PST) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id cw3sm13597275wjb.26.2015.11.23.06.45.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Nov 2015 06:45:56 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 23 Nov 2015 15:44:48 +0100 Message-Id: <1448289889-9590-14-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1448289889-9590-1-git-send-email-adrien.mazarguil@6wind.com> References: <1448289889-9590-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 13/14] mlx5: fix available entries in TX rings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Nov 2015 14:45:57 -0000 From: Nelio Laranjeiro The number of available entries in TX rings is taken before performing completion, effectively making rings smaller than they are and causing TX performance issues under load. Fixes: 2e22920b85d9 ("mlx5: support non-scattered Tx and Rx") Signed-off-by: Nelio Laranjeiro Signed-off-by: Adrien Mazarguil --- drivers/net/mlx5/mlx5_rxtx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index eb6c9f7..fa5e648 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -436,7 +436,6 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) { struct txq *txq = (struct txq *)dpdk_txq; unsigned int elts_head = txq->elts_head; - const unsigned int elts_tail = txq->elts_tail; const unsigned int elts_n = txq->elts_n; unsigned int elts_comp_cd = txq->elts_comp_cd; unsigned int elts_comp = 0; @@ -446,7 +445,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) assert(elts_comp_cd != 0); txq_complete(txq); - max = (elts_n - (elts_head - elts_tail)); + max = (elts_n - (elts_head - txq->elts_tail)); if (max > elts_n) max -= elts_n; assert(max >= 1); -- 2.1.0