From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by dpdk.org (Postfix) with ESMTP id 2D50B4C57 for ; Fri, 30 Jun 2017 15:02:00 +0200 (CEST) Received: by mail-wr0-f176.google.com with SMTP id r103so204144840wrb.0 for ; Fri, 30 Jun 2017 06:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=P6Ln/PIU3ibvtIbK6KSoLOQuRU4G2WDX13Pv4ZSJy7s=; b=JY2DGTMuyrseZx3C5Ddi/tMIfNW5sn0y232SETBxJ5u0MzyhzRIq4D2KRC59Y4ROyi Aw3c7QH24Rqb1acbF4LxES44B5q2U4eew88XJiVI126pqrDbXmX5UZxrpazQj3RHVe/P avCQWaXPEdaXtGtsQNyFpMVA7YGH28vG6n1nujVF5jX6JJHfpp+r7Z3g/C216YQG4nKz GjLdR5SSSYAi4B+htaFEr3Ltn8Kq2UUqJTvahTaxlPazm8lPywB1Pye/x1jWqps/jaCW +gAXph2krm7j0uPe0Q/pM+m3kLjMYC4Iaj88idd6EYm36vjWc4SLoSGnaWzI0iJHx1vk fuJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=P6Ln/PIU3ibvtIbK6KSoLOQuRU4G2WDX13Pv4ZSJy7s=; b=CNxcvIdw6jVrHuuo2QbUOWT34PbPjwJ5S0eS1RfEJC85KydAnIlPqvlxmv88jrgd7k H5SEn8iTjytQwYk4JhVlk1Xwu+F8IyxtUjzOenUh8rpYP8PDZvDXN7VyZwrv1HETriqi oGg4h23JeYCrYqc2pJqG1FBVwjIJzbQOqMT1jicEmhRSbY2KaOcsdtdUFvUhzu9xphXA YBPivGU0wOvcuem5kvQqXrT7hpMxogJv2AeVom5he723/jv5tUbbKxt/yrVL5CzpGbWc CWIvnDG9Ap/aK1sla2+h9lNIkrZdZdm41J1Vx1yFmDA/g+O3PuR9vf4zxhyK0UkVC63S PtRw== X-Gm-Message-State: AKS2vOxYDw2uVvFUtwUe/g1NamJYF0Ovo6/BuxgtLRHPIz5Jk5mNJWql /gXMgo+83ZjRGgVUiP8OHA== X-Received: by 10.223.135.42 with SMTP id a39mr24207433wra.78.1498827719718; Fri, 30 Jun 2017 06:01:59 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id q137sm4925461wmd.32.2017.06.30.06.01.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jun 2017 06:01:59 -0700 (PDT) Date: Fri, 30 Jun 2017 15:01:51 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Yongseok Koh Cc: ferruh.yigit@intel.com, dev@dpdk.org, adrien.mazarguil@6wind.com Message-ID: <20170630130151.GQ18305@autoinstall.dev.6wind.com> References: <20170628230403.10142-1-yskoh@mellanox.com> <20170628230403.10142-4-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170628230403.10142-4-yskoh@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 3/5] net/mlx5: use buffer address for LKEY search X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2017 13:02:00 -0000 On Wed, Jun 28, 2017 at 04:04:01PM -0700, Yongseok Koh wrote: > When searching LKEY, if search key is mempool pointer, the 2nd cacheline > has to be accessed and it even requires to check whether a buffer is > indirect per every search. Instead, using address for search key can reduce > cycles taken. And caching the last hit entry is beneficial as well. > > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_mr.c | 2 ++ > drivers/net/mlx5/mlx5_rxtx.c | 37 ++++++++++++++++++++----------------- > drivers/net/mlx5/mlx5_rxtx.h | 3 +++ > 3 files changed, 25 insertions(+), 17 deletions(-) > >[...] > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index f9b738b4e..a86f41abc 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -267,10 +267,13 @@ struct txq { > volatile uint32_t *cq_db; /* Completion queue doorbell. */ > volatile void *bf_reg; /* Blueflame register. */ > struct { > + uintptr_t start; /* Start address of MR */ > + uintptr_t end; /* End address of MR */ Extra space between the ';' and the comment. > const struct rte_mempool *mp; /* Cached Memory Pool. */ > struct ibv_mr *mr; /* Memory Region (for mp). */ > uint32_t lkey; /* htonl(mr->lkey) */ > } mp2mr[MLX5_PMD_TX_MP_CACHE]; /* MP to MR translation table. */ > + uint16_t mr_cache_idx; /* Index of last hit entry. */ > struct rte_mbuf *(*elts)[]; /* TX elements. */ > struct mlx5_txq_stats stats; /* TX queue counters. */ > } __rte_cache_aligned; > -- > 2.11.0 The pointer to the mempool should be removed from this structure, it was useful in the dataplane to retrieve the lkey, but with this new implementation it becomes useless. This also helps to keep the memory footprint of this array. The control plane can spend some cycles to retrieve the start/end addresses of the mempool to compare them. Thanks, -- Nélio Laranjeiro 6WIND