From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id A0F0B2E8B for ; Mon, 22 Feb 2016 19:18:33 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id g62so168903428wme.0 for ; Mon, 22 Feb 2016 10:18:33 -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=X+4gcOe1j7saBxHmpUFwi2zfpam3IoB2NN4UEy3U8M0=; b=YAMje+M3WrPrOzFvUWxUkljFI5hTTeyMIl2HO1D9BcEWzzKsxiGkBXNLnnAsoKMwLa IZK7RRUlLgYExESPUou30el/jfQCXvs7R/rSRSUUhqCq+3M2pEOk4V7F1dgjPCwhfUab yYESxVHl5YAWeeY4pv6+fJCVlduZJsmwegmHzmiJ2bc2c0HSzNMfS/ZosK4XqD7Zx7zW QsPCCGmoo0klCeUaahNENktAxOVn6EEfdvZ2YYCmxb9YOK/VfLIZpUiGsA4Va59joLJn Wx9dLCs+mUBw7+sIMJwHvND4r3mgpXQ1Lk6lvbZGRtXUDaNpF3enYcBTPllmXXtmES/M Va9A== 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=X+4gcOe1j7saBxHmpUFwi2zfpam3IoB2NN4UEy3U8M0=; b=L+WLeFrEHUl6FtkG7/cJ+RiyWVQWOR6eJSLxZfbQDf7W3NowQSOYA8CACf2iBJ7uCD yAMTZ4irQ1YkkCgGrIpCEK0rDX4IaMcHzXueTkyggtRHXj8H1uk3gkZKkjtEA/pm6GWM UQT2EHDydRL+ThBEHajY7Qzhs620eqIN2xccukJc9aYzzkeePpk2SjzhyH5+LPqdek6k XjxmSNWF3roMOsmY+4Rv6Nvz3w9UY/3sh/vuXdGHau0qmvuqOQdaZefD78pBAY4Nmz5K rbYkawRMeztQRGFOnViBGWKYmorF9AGHvAj/jodqxVq6tfigI7O0BWpNNMfP/LjqF7u3 AvJg== X-Gm-Message-State: AG10YOTqonH+Hbs5Fmqjc+dR6fItb3zxNmGWOWLzi0Ht74cK0dZPkmOXSMSzvEwUcuuLzPll X-Received: by 10.194.2.202 with SMTP id 10mr33172591wjw.94.1456165113538; Mon, 22 Feb 2016 10:18:33 -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 a128sm22196207wmh.6.2016.02.22.10.18.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Feb 2016 10:18:32 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Mon, 22 Feb 2016 19:18:01 +0100 Message-Id: <1456165083-28316-6-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> References: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 5/7] mlx5: avoid lkey retrieval for inlined packets 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, 22 Feb 2016 18:18:33 -0000 From: Nelio Laranjeiro Improves performance as the lkey is not needed by hardware in this case. Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index c84ec8c..b82017e 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -512,16 +512,6 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) /* Retrieve buffer information. */ addr = rte_pktmbuf_mtod(buf, uintptr_t); length = DATA_LEN(buf); - /* Retrieve Memory Region key for this memory pool. */ - lkey = txq_mp2mr(txq, txq_mb2mp(buf)); - if (unlikely(lkey == (uint32_t)-1)) { - /* MR does not exist. */ - DEBUG("%p: unable to get MP <-> MR" - " association", (void *)txq); - /* Clean up TX element. */ - elt->buf = NULL; - goto stop; - } /* Update element. */ elt->buf = buf; if (txq->priv->vf) @@ -545,12 +535,25 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) send_flags); else #endif + { + /* Retrieve Memory Region key for this + * memory pool. */ + lkey = txq_mp2mr(txq, txq_mb2mp(buf)); + if (unlikely(lkey == (uint32_t)-1)) { + /* MR does not exist. */ + DEBUG("%p: unable to get MP <-> MR" + " association", (void *)txq); + /* Clean up TX element. */ + elt->buf = NULL; + goto stop; + } err = txq->send_pending (txq->qp, addr, length, lkey, send_flags); + } if (unlikely(err)) goto stop; #ifdef MLX5_PMD_SOFT_COUNTERS -- 2.1.4