From patchwork Wed May 27 20:12:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 4925 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 1B585567E; Wed, 27 May 2015 22:12:46 +0200 (CEST) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id C636F2A07 for ; Wed, 27 May 2015 22:12:44 +0200 (CEST) Received: by wicmx19 with SMTP id mx19so104476983wic.0 for ; Wed, 27 May 2015 13:12:44 -0700 (PDT) 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; bh=m4kJpY5UZfD4yU9V7vysebfph6vkNo/+LL95La55XEM=; b=YaZ8P8OCHLssWleL4s362fbdrbrKAOs4bSA0ugAPHjkp0MeLRe5eBoUz4m2he8IXMD BneIxrg5MQNEyR22o4Nlpntv9Od4yudXioaCxbVXwKXwf7izS43pJrMi+XgBDkmRw0Gz ZAxTS+iR5vL7PQmazxkgPdLL7LgVMFQVynTh1K/N6K7jmU3HrsHR4eyOsyvK8/vmREGr AtGt1pESaG2Hsrr7ExzOxRelE8WShn5RsSDPgHHb6COG6dSWCJp26voqg6Yave4wBysg eVcM3xZIYpLvAzd3wLhlM6DbuNqoTrjnFFOTqXUpPltFL96id4JGvxtZPsoElw3mG/PP Yd0g== X-Gm-Message-State: ALoCoQkh7L82KIqkvvvSmoq1k856xODceMLFBxHU0MwPW22JfOE4NOtz6AMuJMlG+4qMSUoD2g/j X-Received: by 10.180.105.74 with SMTP id gk10mr54496684wib.29.1432757564568; Wed, 27 May 2015 13:12:44 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id tl3sm52654wjc.20.2015.05.27.13.12.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 May 2015 13:12:43 -0700 (PDT) From: Zoltan Kiss To: dev@dpdk.org Date: Wed, 27 May 2015 21:12:19 +0100 Message-Id: <1432757539-8544-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] ixgbe: fix checking for tx_free_thresh 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This check doesn't do what's required by rte_eth_tx_burst: "When the number of previously sent packets reached the "minimum transmit packets to free" threshold" This can cause problems when txq->tx_free_thresh + [number of elements in the pool] < txq->nb_tx_desc. Signed-off-by: Zoltan Kiss --- drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++-- drivers/net/ixgbe/ixgbe_rxtx_vec.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 4f9ab22..b70ed8c 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -250,10 +250,10 @@ tx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* * Begin scanning the H/W ring for done descriptors when the - * number of available descriptors drops below tx_free_thresh. For + * number of in flight descriptors reaches tx_free_thresh. For * each done descriptor, free the associated buffer. */ - if (txq->nb_tx_free < txq->tx_free_thresh) + if ((txq->nb_tx_desc - txq->nb_tx_free) > txq->tx_free_thresh) ixgbe_tx_free_bufs(txq); /* Only use descriptors that are available */ diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c b/drivers/net/ixgbe/ixgbe_rxtx_vec.c index abd10f6..f91c698 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c @@ -598,7 +598,7 @@ ixgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, if (unlikely(nb_pkts > RTE_IXGBE_VPMD_TX_BURST)) nb_pkts = RTE_IXGBE_VPMD_TX_BURST; - if (txq->nb_tx_free < txq->tx_free_thresh) + if ((txq->nb_tx_desc - txq->nb_tx_free) > txq->tx_free_thresh) ixgbe_tx_free_bufs(txq); nb_commit = nb_pkts = (uint16_t)RTE_MIN(txq->nb_tx_free, nb_pkts);