From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4D22C11D2F for ; Mon, 24 Feb 2020 16:47:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 946B520637 for ; Mon, 24 Feb 2020 16:47:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qrth2p9B"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FgISzfJc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 946B520637 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=i0lGG+9vTnNmhwU3AECdqv39scJmAYFi8IjpLMeUeeo=; b=qrth2p9BHZyVaE NixYvNzIbZvqvOCARKsGGbAqeo6wkllh8GoIriTTajK52H37EMLsHrSbxxBVcRerEUSRw8JMElkCB GDhvBvSRFL6W62mCNLIZ3mXziVL4D92EfTNYDqUvUKMYs1V2g0PAVsRvhbpQmguu9GskazvMjrF4I qwkKWqA0lj9ENaNvL+lNrd3coskEHzx6p8L1+D5BoTEUum+qxEjnJOt9s6yQ5IpClInnjfMFSJj9U J1/fn3Fa44W0yMM8KXw81bO9ZDSVBqFsv4HwyPNWlU1/9+qrJKLU1xGCzTRYAGKJJV+raUqAWp7qY wsrG6pOfw3/qVofO3MpA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6GtQ-0002kl-Q6; Mon, 24 Feb 2020 16:47:40 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6Gro-0001Mn-Nl for linux-nvme@bombadil.infradead.org; Mon, 24 Feb 2020 16:46:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=dSAsyR7/gzfJ7uqrRVQHeLA4KGykz6yPPEsyB6aCZp8=; b=FgISzfJcNcFL6BrTkFfrSEGBHJ VpTRmWzH71/JVQeBbSRsxV9fx33Ob3R8zr5iWP2OaV+urCUyI8Vl6UdAw2fk2ELQBFFnoCSWBAijE Ae43Uqii5iJqxET0FzzLhzxF2QKbp0A5ceaZiAqO4u3tja7erBcaw8cOofairyJuVjNmQS60VIvgE DQUpku+9z0vKGuxgPsbOK8K7Nkyp0i6SxZPeoXVMhC0mYKiDKWJlBr7bGP+m0s0unXGIrOxXLHpsY stVf0qUsHZ4zvx1/bAFW3ittLoH9sZRxxfqZ8JxmhbJSIXeN6QAvGdvFNLVYdAy0XgMlbJDv2UuVY 7MAvezjA==; Received: from mail-il-dmz.mellanox.com ([193.47.165.129] helo=mellanox.co.il) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6Grl-0002EY-6A for linux-nvme@lists.infradead.org; Mon, 24 Feb 2020 16:46:00 +0000 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maxg@mellanox.com) with ESMTPS (AES256-SHA encrypted); 24 Feb 2020 18:45:45 +0200 Received: from mtr-vdi-031.wap.labs.mlnx. (mtr-vdi-031.wap.labs.mlnx [10.209.102.136]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 01OGji9O013647; Mon, 24 Feb 2020 18:45:45 +0200 From: Max Gurtovoy To: linux-nvme@lists.infradead.org, sagi@grimberg.me, linux-rdma@vger.kernel.org, kbusch@kernel.org, hch@lst.de, martin.petersen@oracle.com Subject: [PATCH 02/19] nvme: Add has_pi field to the nvme_req structure Date: Mon, 24 Feb 2020 18:45:27 +0200 Message-Id: <20200224164544.219438-4-maxg@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200224164544.219438-1-maxg@mellanox.com> References: <20200224164544.219438-1-maxg@mellanox.com> MIME-Version: 1.0 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: axboe@kernel.dk, vladimirk@mellanox.com, shlomin@mellanox.com, israelr@mellanox.com, idanb@mellanox.com, maxg@mellanox.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org From: Israel Rukshin Transport drivers will use this field to determine if the request has PI. Reviewed-by: Max Gurtovoy Signed-off-by: Israel Rukshin --- drivers/nvme/host/core.c | 6 ++++-- drivers/nvme/host/nvme.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 3a754e0..15d0863 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -470,6 +470,7 @@ static inline void nvme_clear_nvme_request(struct request *req) if (!(req->rq_flags & RQF_DONTPREP)) { nvme_req(req)->retries = 0; nvme_req(req)->flags = 0; + nvme_req(req)->has_pi = false; req->rq_flags |= RQF_DONTPREP; } } @@ -703,6 +704,8 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, nvme_assign_write_stream(ctrl, req, &control, &dsmgmt); if (ns->ms) { + nvme_req(req)->has_pi = + ns->features & NVME_NS_MD_CTRL_SUPPORTED; /* * If formated with metadata, the block layer always provides a * metadata buffer if CONFIG_BLK_DEV_INTEGRITY is enabled. Else @@ -710,8 +713,7 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, * namespace capacity to zero to prevent any I/O. */ if (!blk_integrity_rq(req)) { - if (WARN_ON_ONCE(!(ns->features & - NVME_NS_MD_CTRL_SUPPORTED))) + if (WARN_ON_ONCE(!nvme_req(req)->has_pi)) return BLK_STS_NOTSUPP; control |= NVME_RW_PRINFO_PRACT; } diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index fea20f1..99340d7 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -139,6 +139,7 @@ struct nvme_request { u8 flags; u16 status; struct nvme_ctrl *ctrl; + bool has_pi; }; /* -- 1.8.3.1 _______________________________________________ linux-nvme mailing list linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme