From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 6F1ED2A5F for ; Mon, 1 Jun 2015 18:16:00 +0200 (CEST) Received: by wgbgq6 with SMTP id gq6so119023151wgb.3 for ; Mon, 01 Jun 2015 09:16:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=X87iAUe+vCB7+MVk5B6OCKWWOjemeF6UYXJjHmkfxEI=; b=SXlr4wYLnCpfZxJ/AoBZjqzPF6HGLqi8Vb79ItnZDSlW8/51eAiEY9V/T6QJiiF90g D//KuhY7E26+VjOQL5mJ+zO8wr3N2xqAbKHwdU+q/7bxyOoVt9FtQFVWFBum9E1i7Dd9 xSlCMVzl9YaceOPXvpQHefMcCoV58wDsWwpsrr3Wv/x0MeMp0yH4soiEWHlOQdg+dL5F 3HOKv+lePYwpNCaD7AtQq2m7FO9980eeDug9Mk76cgdV7WTMqgXIiRiii3D9muNLco4K bz5HKycScmIrHAffTm/z6I3ENZi8P7H+zkS7Q0zWjjfHDwK00rXPF9hApihw1KOOOcQk ho6Q== X-Gm-Message-State: ALoCoQmTNLDtMejLLOMuE8FCZpHUnMf2jVyhdgG5wlh5D+uLR1AfXYJaRIPYt7rWlwuJG3KCp5ck X-Received: by 10.180.90.209 with SMTP id by17mr22367763wib.2.1433175360219; Mon, 01 Jun 2015 09:16:00 -0700 (PDT) Received: from [192.168.0.101] ([90.152.119.35]) by mx.google.com with ESMTPSA id gs7sm17374430wib.10.2015.06.01.09.15.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 09:15:59 -0700 (PDT) Message-ID: <556C853E.8090902@linaro.org> Date: Mon, 01 Jun 2015 17:15:58 +0100 From: Zoltan Kiss User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@dpdk.org References: <1432757539-8544-1-git-send-email-zoltan.kiss@linaro.org> In-Reply-To: <1432757539-8544-1-git-send-email-zoltan.kiss@linaro.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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: , X-List-Received-Date: Mon, 01 Jun 2015 16:16:00 -0000 Hi, Anyone would like to review this patch? Venky sent a NAK, but I've explained to him why it is a bug. Regards, Zoltan On 27/05/15 21:12, Zoltan Kiss wrote: > 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); >