Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3584825imm; Thu, 17 May 2018 11:03:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoRT+YnzErZ3+2n6upW07yJQxsL2IWIzOP298SU/nLupRN9HGEvCB6t5UAIh1cFkiGm263H X-Received: by 2002:a17:902:7487:: with SMTP id h7-v6mr6023289pll.154.1526580218846; Thu, 17 May 2018 11:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526580218; cv=none; d=google.com; s=arc-20160816; b=VgPj8uPstKQLxK1bC+vYwK7NQ0ukJao/xVdCdSJha+NkSyakQYwrpnXz3U5OTIQZDx jfRqKaAWgbQJdBrM3p2nydMzqXhpnzTjiACkM+y+nyCGzCjTYtc51iNSrwy+KQm8Gdrc QZnH/Mu+2Mwu9hV+zWEvTdARdi7/RsxC4zWOSMq9xT27ZmfwMLbYMgHVbT6ZKqDCee1b dMmob2YOxdcLvBCqMaQveCWesNI8ggLIXarIrFIPDTKci5BgkKzlCFpbpDXESsVTejGM +dmlkyFtFCzafwy/cs8izo0i3VI+yHFwY31kG/i/aZIeKpT42it91hnJPF3s7F6vXm+s xdUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Vth9dUCRGOeb8y2Dd7M+7OZ/e4EcaQEBJYg58Cu1MDQ=; b=owLKMbyz1AtcazH8qxmZaNx6wzvbotVOSyqM8msW7rr3sSIScZuY3Y4TnWYoQ+JFwj grmkGWBEh0HrY5uZXZ3EjlripUHMl95mmOgpTsdex/Kb1kQEDdCeh7TsoP/bTKArPbpI 285/GzybTpvYgIJszqFqQiIZqlN2M+gfBVrmZGay60gHO0euCP/NgNx4IYTOdozupVrL IH+QLdHE5DU4uF0qhJ5b4T2kwqeE75y+x81hXs4934KD5+yXvdcg4MSWNWFDnWPtqYOP UH/w9TsyoeGDCRrivAK9S8ff8shYt//WuuPXfoamPFeHXk7KNAYEE717HfVmyncHVRZx bUDw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16-v6si4724224pgn.79.2018.05.17.11.03.23; Thu, 17 May 2018 11:03:38 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbeEQSCo (ORCPT + 99 others); Thu, 17 May 2018 14:02:44 -0400 Received: from mga12.intel.com ([192.55.52.136]:8510 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752201AbeEQSCm (ORCPT ); Thu, 17 May 2018 14:02:42 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2018 11:02:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,411,1520924400"; d="scan'208";a="40182978" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by fmsmga007.fm.intel.com with ESMTP; 17 May 2018 11:02:41 -0700 Date: Thu, 17 May 2018 12:04:44 -0600 From: Keith Busch To: Bharat Kumar Gogada Cc: "axboe@fb.com" , "sagi@grimberg.me" , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "keith.busch@intel.com" , "hch@lst.de" Subject: Re: INTMS/INTMC not being used in NVME interrupt handling Message-ID: <20180517180444.GG23555@localhost.localdomain> References: <20180516144240.GA20223@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 17, 2018 at 11:15:59AM +0000, Bharat Kumar Gogada wrote: > > > Hi, > > > > > > As per NVME specification: > > > 7.5.1.1 Host Software Interrupt Handling It is recommended that host > > > software utilize the Interrupt Mask Set and Interrupt Mask Clear > > > (INTMS/INTMC) registers to efficiently handle interrupts when configured > > to use pin based or MSI messages. > > > > > > In kernel 4.14, drivers/nvme/host/pci.c function nvme_isr doesn't use > > > these registers. > > > > > > Any reason why these registers are not used in nvme interrupt handler ? > > > > I think you've answered your own question: we process completions in the > > interrupt context. The interrupt is already masked at the CPU level in this > > context, so there should be no reason to mask them at the device level. > > > > > Why NVMe driver is not using any bottom half and processing all > > > completion queues in interrupt handler ? > > > > Performance. > Thanks keith. > Currently driver isn't setting any Coalesce count. > So the NVMe card will raise interrupt for every single completion queue ? > > For legacy interrupt for each CQ > CQ-> ASSERT_INTA-> DOORBELL-> DEASSERT_INTA is this flow correct ? Mostly, yes. There could be a case where the controller wouldn't deassert INTx if there are more completes past the CQ head doorbell write. > Is the following flow valid > CQ1->ASSERT_INTA->CQ2/CQ3->Doorbell->DEASSERT_INTA ? > > When using legacy interrupts, if CQ1 is sent followed by ASSERT_INTA, can the EP send > another CQ2,CQ3.. before DEASSERT_INTA of CQ1 is generated? I assume you are saying CQ entry 1, CQ entry 2, etc ... The end point may continue posting those completion queue entries while the interrupt is asserted. It should not deassert the interrupt until the host acknowledges all outstanding completions with a CQ doorbell write.