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 AA2AF8E95 for ; Mon, 23 Nov 2015 15:45:31 +0100 (CET) Received: by wmww144 with SMTP id w144so107671474wmw.0 for ; Mon, 23 Nov 2015 06:45:31 -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=5RYebx7gsRRizpgUblRVHGrgw8B+6g8QjbDS9jg0k6o=; b=yF+X6+nKAOewqwzD3sYek1KOctYcZqQ9p+FtyIvY8AQEbwqkhk9aZB46DYvtvEIY1T LBeV/VJXfzo2h2JWEh1gmUvdI7VZx1P/EyPgLKg/g+yAX3/8pDaQS/Tiht/B+W3nPxWV 9GEi13UTCTXS9E4lpUSwZ5o2p+L6apF3IDG88bi23bYodIsmWANz4sJSZtMl1HovYO3Y +Lz6iRMmUl4Opvefa/XmBUF4+ealIvkGZk6l+x2KUCCErhbnC///hA7ZkqzqPVkLs7Mp JK6c3AwyUip22JbWcwvlrEwCC7S9shWpAkCALAmIm7SvEjJO7YXW9S6Jv1sGTy3bybLX bH7w== 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=5RYebx7gsRRizpgUblRVHGrgw8B+6g8QjbDS9jg0k6o=; b=ETw7VzsUF/4DjkrXWyw32J320Fjz9r5ro/0Fq+PlhNBepGPyX0sxc8MM0LqRovxO6Y 5nk/TrIIpLrRp5bveL0iT9JP+NXcQC4hLmR3PXSlPC3nREfxH9/LxB9r9xuwfXVjdaqt oD74SvHI31JX3wgEgIkWCytCZ98JzgwiKH4fvqFXNm+0nZNeYY9Huzj0nWtrEdqrdhP0 Bl5djBAk1d5BHjj9w5h3CeLqtAuBv+wqvAi5o0+d1+L+rM0Yus2qcTRlZ3HmzB+NDYAv VMYdJxu1vagji4Uf67q1C5l3wkp5QQsnr8RU8V1Z8wbg9/kNCtquekkv8ibZt+SUdKTL BTDw== X-Gm-Message-State: ALoCoQmNMnnv/5fJG/NPmH3/z+S13AjXRqsZi5ili4rjXvDBeRhfYyprOkXOe19h+JUrtrqER9+8 X-Received: by 10.28.87.72 with SMTP id l69mr18591345wmb.70.1448289931262; Mon, 23 Nov 2015 06:45:31 -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 a186sm13457914wmh.4.2015.11.23.06.45.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Nov 2015 06:45:30 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 23 Nov 2015 15:44:41 +0100 Message-Id: <1448289889-9590-7-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 06/14] mlx4: 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:31 -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: 7fae69eeff13 ("mlx4: new poll mode driver") Signed-off-by: Nelio Laranjeiro Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 3e05373..4f57e2d 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1306,7 +1306,6 @@ mlx4_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; @@ -1316,7 +1315,7 @@ mlx4_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