From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 081AD11C5 for ; Thu, 28 May 2015 12:51:05 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 28 May 2015 03:50:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,512,1427785200"; d="scan'208";a="701501988" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga001.jf.intel.com with ESMTP; 28 May 2015 03:50:49 -0700 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 28 May 2015 03:50:49 -0700 Received: from orsmsx102.amr.corp.intel.com ([169.254.1.45]) by ORSMSX157.amr.corp.intel.com ([169.254.9.43]) with mapi id 14.03.0224.002; Thu, 28 May 2015 03:50:49 -0700 From: "Venkatesan, Venky" To: Zoltan Kiss Thread-Topic: [dpdk-dev] [PATCH] ixgbe: fix checking for tx_free_thresh Thread-Index: AQHQmLmGh1771kC+3EmrTsm1J15QfZ2RNt66 Date: Thu, 28 May 2015 10:50:49 +0000 Message-ID: <65CC0274-0B2A-460C-B381-59EB8CE9F970@intel.com> References: <1432757539-8544-1-git-send-email-zoltan.kiss@linaro.org> In-Reply-To: <1432757539-8544-1-git-send-email-zoltan.kiss@linaro.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" 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: Thu, 28 May 2015 10:51:06 -0000 NAK. This causes more (unsuccessful) cleanup attempts on the descriptor rin= g. What is motivating this change?=20 Regards, Venky > On May 28, 2015, at 1:42 AM, Zoltan Kiss wrote: >=20 > 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" >=20 > This can cause problems when txq->tx_free_thresh + [number of elements in= the > pool] < txq->nb_tx_desc. >=20 > 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(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxt= x.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_p= kts, >=20 > /* > * 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); >=20 > /* 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 =3D RTE_IXGBE_VPMD_TX_BURST; >=20 > - 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); >=20 > nb_commit =3D nb_pkts =3D (uint16_t)RTE_MIN(txq->nb_tx_free, nb_pkts); > --=20 > 1.9.1 >=20