From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 0828CC448 for ; Tue, 30 Jun 2015 11:29:12 +0200 (CEST) Received: by wgqq4 with SMTP id q4so4259333wgq.1 for ; Tue, 30 Jun 2015 02:29:12 -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:in-reply-to :references; bh=cf61w3J50c3LfN3ENge10E780n9jLaSIrCFtfS0PYLQ=; b=b8C5FK7PSykfWT4jREO2CVM/4UAgRnsy7oPxpQlt1BvvvyZORZeQLWr1rONjx0XLfe DWu5AkSggl8HqfrolNkb1sc56+7qi4te3Qvsh/33Z0r5hrYB5X+yhUIcEVsRqGMfBJBY 9ldlkBnCIsTym8Lwa8sgY8Yx02tcErH6nCzxIshsOq9681fqs+84pXI0Rws3Rqddx45R X1H03yfbkmAJDRqfw5CxPDKYT4qlSvBqbCqwUrjGnySOsDPvLchxwZzHriZt67BNrhJL OkfZpgXsd+om9asZxeM0+7HiQSpYysP3DjeVCKqNsid86wGmcHkveXRcgciBdsLsS887 GPqw== X-Gm-Message-State: ALoCoQl5E42b+RhNOB+s79YqVQyBHd9r5ADqSza0Dl9IIaKq9R65aCkQGYPpsqOQCEX91qX0urgC X-Received: by 10.180.188.109 with SMTP id fz13mr31963204wic.74.1435656551915; Tue, 30 Jun 2015 02:29:11 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by mx.google.com with ESMTPSA id v3sm16584713wiy.1.2015.06.30.02.29.10 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jun 2015 02:29:11 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 30 Jun 2015 11:28:04 +0200 Message-Id: <1435656489-27986-19-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435656489-27986-1-git-send-email-adrien.mazarguil@6wind.com> References: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> <1435656489-27986-1-git-send-email-adrien.mazarguil@6wind.com> Cc: Alex Rosenbaum Subject: [dpdk-dev] [PATCH v2 18/23] mlx4: prefetch completed TX mbufs before releasing them 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: Tue, 30 Jun 2015 09:29:12 -0000 From: Alex Rosenbaum Signed-off-by: Alex Rosenbaum Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index f251eb4..52f3fbb 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1205,6 +1205,9 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) max = pkts_n; for (i = 0; (i != max); ++i) { struct rte_mbuf *buf = pkts[i]; + unsigned int elts_head_next = + (((elts_head + 1) == elts_n) ? 0 : elts_head + 1); + struct txq_elt *elt_next = &(*txq->elts)[elts_head_next]; struct txq_elt *elt = &(*txq->elts)[elts_head]; unsigned int segs = NB_SEGS(buf); #ifdef MLX4_PMD_SOFT_COUNTERS @@ -1253,6 +1256,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) if (txq->priv->vf) rte_prefetch0((volatile void *) (uintptr_t)addr); + RTE_MBUF_PREFETCH_TO_FREE(elt_next->buf); /* Put packet into send queue. */ #if MLX4_PMD_MAX_INLINE > 0 if (length <= txq->max_inline) @@ -1283,6 +1287,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) &sges); if (ret.length == (unsigned int)-1) goto stop; + RTE_MBUF_PREFETCH_TO_FREE(elt_next->buf); /* Put SG list into send queue. */ err = txq->if_qp->send_pending_sg_list (txq->qp, @@ -1300,8 +1305,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) goto stop; #endif /* MLX4_PMD_SGE_WR_N > 1 */ } - if (++elts_head >= elts_n) - elts_head = 0; + elts_head = elts_head_next; #ifdef MLX4_PMD_SOFT_COUNTERS /* Increment sent bytes counter. */ txq->stats.obytes += sent_size; -- 2.1.0