Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp113969pxj; Thu, 3 Jun 2021 02:11:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQXsy5rPBM+uKZXv8dCXHpbt5OXBQU9KhANiH1gbGhWWH2oVM9ixpC/NXL7FvYz/XtmP9V X-Received: by 2002:a50:eb47:: with SMTP id z7mr43318001edp.68.1622711503843; Thu, 03 Jun 2021 02:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622711503; cv=none; d=google.com; s=arc-20160816; b=v6SW0sm3ohQV+s1ssdQZHjFw2yw1K5/F8PH6sybSqhyO9ljmcmWybZ1EH7NPYXPSMr AxrJDvQ8RUYmwEzSx3KFTBr35mkenH40ZAH455Oxy2sRXCzWLaZV+jSho0uNJ19seBu2 HUsKYrGcZCyPHabmegyRG6Zu/hoRVPF5zcCTED3sMU5jwjR1qmZ+BGPLLIhzVHL6xp6N LrOSuHee77B0wohXi21GaBL+FN9NHyrMw5KvjANO9lzxxZoGULYyJCDMsdjLGA/JrGTb 5AjRNgK65xaUUJY5b/+7bP1+/KUxkRIQl2gUUflOEUelxvsWZniAtq0QCKvOAAmM92u8 Cxnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zCaGYq1J0r09swzyvt3MCukZ81BMLP+G4SY3vP2mGDs=; b=lrde6dacbX5BYnh85nvxpDx3dFpYPmb3IZyGhc606AsQ4ZNkhHaYGjNZxA9lgtzXpG AW5uWnusETXnXtixlJSO368f6k3Li7s4rnTDyScfMbNup0tu7EMXEWCglmCVgIIn2sV5 q3/HotODrUlzw9iZk91ZlPAcmG3edm0IOyHPE82CxKoC7JGJ18h3+uXcKBJoEIlmBaQr alcJ8k3jwyOLbGQMlN+8QvW5l09jKxD5Hq3GBN1skDEFQ/HYQW9LO7nsgOxQRGFD/yW5 2A2J7ec/BK2QOnhzTC0EeMtlfnOmDKU6JpqPHpJluSrpBPpsZlj/hqP314Xd8JhrfPDd 5SNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t/rqjzqj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb8si2225122ejc.558.2021.06.03.02.11.18; Thu, 03 Jun 2021 02:11:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t/rqjzqj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbhFCJJh (ORCPT + 99 others); Thu, 3 Jun 2021 05:09:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:52844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhFCJJg (ORCPT ); Thu, 3 Jun 2021 05:09:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CBF80613AD; Thu, 3 Jun 2021 09:07:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622711272; bh=tyTxLmRzGcLrgS5s1ZrV5gXEzztjA30ML1iCEHzJ9Ys=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t/rqjzqj4JsVvW4HTGMme6CBwV0/ZE4SynU6ck6KdisYT5/MNBHA2UjAfyxV6ceij FSnjsE66z2H0mzgwqGfxn6pI6kjUvd9NXANos5c0mrcQuoEN7yt09/12nTyorr5d7z jY2bVMlAXhsgoHya2sbDUmeDCmX2FIs2+mJVlHWmWOfufGwfUnwbHYLRNzifgwi+dS OdvukMKMRXhtBCsJxoEUhMTd8NonP5CeE+YZUCkQqTHuWRarmoaPS+9Z2Jy0JPWRZA GlRbFZqocJGyaAtGJWKgJlqxWo9/GCsyC2faCyXaz9icR9gaoadu1ucwkYLYGnSlnn 4RgCVPHJ1Cy6A== Date: Thu, 3 Jun 2021 12:07:48 +0300 From: Leon Romanovsky To: Anand Khoje Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, dledford@redhat.com, jgg@ziepe.ca, haakon.bugge@oracle.com Subject: Re: [PATCH v2 3/3] IB/core: Obtain subnet_prefix from cache in IB devices Message-ID: References: <20210603065024.1051-1-anand.a.khoje@oracle.com> <20210603065024.1051-4-anand.a.khoje@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210603065024.1051-4-anand.a.khoje@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 03, 2021 at 12:20:24PM +0530, Anand Khoje wrote: > ib_query_port() calls device->ops.query_port() to get the port > attributes. The method of querying is device driver specific. > The same function calls device->ops.query_gid() to get the GID and > extract the subnet_prefix (gid_prefix). > > The GID and subnet_prefix are stored in a cache. But they do not get > read from the cache if the device is an Infiniband device. The > following change takes advantage of the cached subnet_prefix. > Testing with RDBMS has shown a significant improvement in performance > with this change. > > The function ib_cache_is_initialised() is introduced because > ib_query_port() gets called early in the stage when the cache is not > built while reading port immutable property. > > In that case, the default GID still gets read from HCA for IB link- > layer devices. > > Fixes: fad61ad ("IB/core: Add subnet prefix to port info") > Signed-off-by: Anand Khoje > Signed-off-by: Haakon Bugge > --- > drivers/infiniband/core/cache.c | 7 ++++++- > drivers/infiniband/core/device.c | 9 +++++++++ > include/rdma/ib_cache.h | 6 ++++++ > include/rdma/ib_verbs.h | 6 ++++++ > 4 files changed, 27 insertions(+), 1 deletion(-) Can you please help me to understand how cache is updated? There are a lot of calls to ib_query_port() and I wonder how callers can get new GID after it was changed in already initialized cache. Thanks