From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 1FD1CC6A2 for ; Fri, 29 Jan 2016 11:33:30 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id r129so62239559wmr.0 for ; Fri, 29 Jan 2016 02:33:30 -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=UvfCGrtsb07HMa0shHkAdZtdO9aMt6aj/w+mVsVZawc=; b=DbYqj3iG9Z5BhlsAF/kzXYu8j3x93pCxkCgRekF7EIfuUfYvvtmZfDWj4/QgBxjaTc ThTdjogJtilY0hqfWTAlvFJ34dOUCoBPtZYmTYx5xhRIW2Hb1nwS6AMxPRJdH1oYnYyh BttNV5UMLhU6+ceKLLHvX6urAnRQTHrTTa3iGJo1ZctVi7t9FV730RoGpRjTMa23VDMc k83a9z+zYFKrDyPfnOnfpRGtZn3v4dz/ivzwWTBN7yiFptysJqFCKVXNikQ8iPl19Xjl OAGzXKftWmrxfDF7VRUlfII6qd922LaOhYPjsoq1+oTZU1cr+oTJa7elG4YBLSLPrZXE EyqA== 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=UvfCGrtsb07HMa0shHkAdZtdO9aMt6aj/w+mVsVZawc=; b=eo6sbV4Y8yXNtgHa8q3auLwpsoGwKvZPS1BL5psIWf6qpbi4sPwe0+FiN+olcgAkwb yoAOerUyzIY60iSeGHzYHQB3ULloSWIVVWyMBm075ekjy9gePjX06ITLmfq1oTk7F2dN qdXdjuaY5yyIANiBIJE0IU3J5NM5byz+gn3qTLqhENgwGIuabPsky812pyH94Oi365sd AoBOel4crAp34FYI7Mtc491zP83zNSxqJYkkZnuhuWKNe3Z16seSQBfJ855/iZwk0TV5 XGCiHe26Fbruj1QIHkJHMgpU5dfFPdIHdUSzCI25bPGpy6O2sjcpv5v9Q5nGuiF5v3JY qkWA== X-Gm-Message-State: AG10YOTCeWCO4YxQmZ9M6fSWaSahxL2MN2ph6rq0C9mBOEE8tjQtU3kl2GvlmQFmMFK7wvEZ X-Received: by 10.28.172.193 with SMTP id v184mr8780084wme.94.1454063610020; Fri, 29 Jan 2016 02:33:30 -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 y8sm6811532wmg.9.2016.01.29.02.33.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 02:33:29 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Fri, 29 Jan 2016 11:32:52 +0100 Message-Id: <1454063573-1993-6-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> References: <1454063573-1993-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 5/6] 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: Fri, 29 Jan 2016 10:33:30 -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 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index c84ec8c..579efa0 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,24 @@ 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