From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 90EAC2C05 for ; Thu, 3 Mar 2016 15:27:43 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id p65so37290123wmp.1 for ; Thu, 03 Mar 2016 06:27:43 -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=SGe610vjmO1iETwt/SJ41UJoN7hQ9CV0HtKqVclEWv3tdHjVONWpH/IaQhtBp2CBcJ ulbkB8mq9W6zx1f8ToxakqQks/HNwlVFUIgId6/ltYNl3MprdDE57gHOMyl1cw5jsIUZ IeUcM7kDQ14xkfo7dxoy7npqEgtkINfbspapn+AfXOep5rLE2mqXn9rYa5VSeg962Oyj xKnK9/Vi1t4h24Xmy3T0tGk9v8xD3Z8z9J+x+K//BDKbSH2ENQpQRwOm3cEAzwNCzvCF CrGyk8tk/J5lO5CatSAXUXN3N+Mh0rDSrDbPMHTweGBqyg3/hQP991NZUR/ORfe9NvWu 1O9Q== 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=MBUYxUK162aKBJT8x9Bbx0MPBNxOYJSn82wjkkQp5uUkPNZBlJbsvsmYEzrXdaJLIB RnOA1zUKLbrZln3lJYPad2wODnLSoWxoigmGxC1eUJEw2k4xDwRpxuLZkeH7EaBOV6nG PvfjNoXFkTWAppbcOJN+NQCMnOPNQM8lqyBV9KsBb5YIfZAVdtD6Snfhkc1VQpDfsFSN vJlKKa/u5zFGqrU7gFmqXx+6MF2SdwjrCi/kCSXc/m7p9kqJBE9QC+5FmxIg9YGToqYQ dz8bV6bWXyv8LvoG5rvaeanOfpI1ej+4I0HY9ft3LuvCdhSmN0Pn4DEZzPZzswvYY7sm +BTg== X-Gm-Message-State: AD7BkJJpyO4FcKbvBehBxXNy/dnpeGrLB59Z4HJek2uKtbrt0bWEMsYni9PpZG9mTSnFxfg5 X-Received: by 10.194.236.233 with SMTP id ux9mr3240257wjc.161.1457015263452; Thu, 03 Mar 2016 06:27:43 -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 k125sm9140488wmb.14.2016.03.03.06.27.42 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2016 06:27:42 -0800 (PST) From: Adrien Mazarguil To: dev@dpdk.org Date: Thu, 3 Mar 2016 15:27:15 +0100 Message-Id: <1457015237-2993-6-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457015237-2993-1-git-send-email-adrien.mazarguil@6wind.com> References: <1456165083-28316-1-git-send-email-adrien.mazarguil@6wind.com> <1457015237-2993-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v3 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: Thu, 03 Mar 2016 14:27:43 -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