Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1776682imm; Thu, 14 Jun 2018 03:49:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKGBpBGB3fKBoAfJhsigf5zvkNdFU/84c6KF4xHTL12ecNKS6RiTG4OGO2lCWakjOujK14L X-Received: by 2002:a63:3115:: with SMTP id x21-v6mr1809708pgx.373.1528973341908; Thu, 14 Jun 2018 03:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973341; cv=none; d=google.com; s=arc-20160816; b=uqyKotnBCyvP0O7MY1A5jYW5f/zYAmhaXEbg1LHYd9vjfE+4gXbSPZj6+f9m6/ro3C 083rcIMcu6MrcHC3hbFQAeNG1SHxAIIumg67K1mLOco+jYerVQUYlGAS5DQy6R6ct7em lMV1OGaD3gt/U18PzbDFZQroi5gfXNRdPsoNM858ldw+Mlk07EFgOW6dsvo5SQvzF9WU p0ZKRKO8XUcF5hOSIF82Cx1zd203QHhDLPdiR8RaKNj6AF6Bh67trx+2gtkh3CN/+iiA sR/extDIXDaAkByAhWAuQXgTyK3bWrPvbFeDHdSmz4lhn/ULRveD9vI6GfQhblH1fkcv IFmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=F93tUNOxa3RYpZs+qw/6rPP++X4wHmpCAFRWx1g20Rg=; b=RafY/J3lvvnhc9nQ9K0do9r1j6ONEtUza6lpoKp9Ep2KgK5BiH7dFgmiYIvcvtapZc wJ245+KTowrI7jUjK/r8y8OH9ZRdB/bK0yFFJbwiAaBA4r5w8zdDm5wh6q2SBaDrNlEb LvDxvYmTZfPODfcShgO4rymgGYCXS0znMt8O6wH/r6CZXXrRlaAhapCmJjt3gpOM7o9d hQ3OQ6wmmhcqX+XsBD++KzFU82pGVqZTMCI8G2qH7jSDSd/o2fYEYyxgOjrWbxzOmyFH yFaeGX9Rr+untE5eotQEWBXVYSivVfNP/k5bfZqWYVtxVSOJrxi7vLCJ4eHsFnsALAaj A/4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="IRj/exU9"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18-v6si5243584pfr.242.2018.06.14.03.48.47; Thu, 14 Jun 2018 03:49:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="IRj/exU9"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755072AbeFNKsS (ORCPT + 99 others); Thu, 14 Jun 2018 06:48:18 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:45531 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754957AbeFNKsR (ORCPT ); Thu, 14 Jun 2018 06:48:17 -0400 Received: by mail-ot0-f195.google.com with SMTP id a5-v6so6508572otf.12 for ; Thu, 14 Jun 2018 03:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=F93tUNOxa3RYpZs+qw/6rPP++X4wHmpCAFRWx1g20Rg=; b=IRj/exU9xOA2i9KdXj9jBpi5zGZHym5iSYKWL2Nkj9Xqd4YzrET34/o+z2H/ZTGK2U vgJGWTgMP1iFV9+J82Jhb9TTvCEOWvQQtMVK20n1CEcKQNUO2aW1nR+40UDWFxzj16UP xT4MQNrR6Ag+xf0+WR4qVMZJLO48rPl4RDoUM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=F93tUNOxa3RYpZs+qw/6rPP++X4wHmpCAFRWx1g20Rg=; b=j6+D8fLbj3krXsrIio93bnTMHgJHr+vSXgg4jNl6qivxwyD34B7DIrku/IBl1HQhh2 4Fwo6GYP3tXXBWh9t6dHIrBdYVX62fsc4/IiX0DFj6hpPstBBbkdaMhCSFXD1IKV6K3r j4jYblhLj912WID0CvakJuwXTSNG35capvRcLaUthzEb7dnavONyXuLweV/zWPw4ekyD bSeaggr56xqyYzmq0k0IRtwsS2dAzTflhvpYEhPRlHa2103HXhuxFarC20T1mTsS8Cqz KC2Y4mjxIWHcWExF/x8g3H2/dw2ILsNp5BmPE84EmJE67i307RCM5oCNraqFnWTVy6pl pX2g== X-Gm-Message-State: APt69E2yoqg+y9shePKyXBEkFeeEFaGJPnG7MX2k6qS1Acfy7c20ln+X Zgbgi6fbqEVjF8YFignIuwDz7Fet4LwTc0Ney2uRGg== X-Received: by 2002:a9d:60d2:: with SMTP id b18-v6mr937378otk.305.1528973296503; Thu, 14 Jun 2018 03:48:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:4044:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 03:48:15 -0700 (PDT) In-Reply-To: <92a9eeced36f863458ca2fd029f17a20@codeaurora.org> References: <20180614102001.GA20836@lst.de> <92a9eeced36f863458ca2fd029f17a20@codeaurora.org> From: Srinath Mannam Date: Thu, 14 Jun 2018 16:18:15 +0530 Message-ID: Subject: Re: Requirement to get BAR pci_bus_address in user space To: Sinan Kaya Cc: Christoph Hellwig , Bjorn Helgaas , Abhishek Shah , Vikram Prakash , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Alex Williamson , kvm@vger.kernel.org, linux-pci-owner@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sinan Kaya, Here are the details, The issue is, For CMB cards SQs are allocated inside device BAR memory which is different from normal cards. In Normal cards SQ memory allocated at host side. In both the cases physical address of CQ memory is programmed in NVMe controller register. This method works for normal cards because CQ memory is at host side. But in CMB cards pci bus address equivalent to CQ memory needs to program. More details are in the patch: nvme-pci: Use PCI bus address for data/queues in CMB. With the above patch issue is fixed in the NVMe kernel driver, But similar fix is required in SPDK library also. So, We need a mechanism to get pci_bus_address in user space libraries to address this issue. Regards, Srinath. On Thu, Jun 14, 2018 at 4:03 PM, wrote: > On 2018-06-14 06:29, Srinath Mannam wrote: >> >> ++ Alex Williamson, kvm, >> >> Hi Christoph, >> >> Thank you for quick reply. >> >> If we want to add this in vfio then I think we need to do the same in >> uio case also. >> >> As I mentioned in previous mail, in the current implementation >> resource information (address and size) is gathering from resource >> named file created in /sys directory. >> So I expect it would be better to have similar method as existing in >> sysfs. >> > > Can you give some info on why you need the actual bar address value? > >> >> Regards, >> Srinath. >> >> On Thu, Jun 14, 2018 at 3:50 PM, Christoph Hellwig wrote: >>> >>> The only safe way to use PCI(e) devices in userspace is through vfio. >>> I think that is where you need to take your inquiries.