From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752353AbcDZOfe (ORCPT ); Tue, 26 Apr 2016 10:35:34 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35741 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752300AbcDZOfb (ORCPT ); Tue, 26 Apr 2016 10:35:31 -0400 From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: mb@lightnvm.io Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 2/2] lightnvm: enable metadata to be sent to device Date: Tue, 26 Apr 2016 16:35:17 +0200 Message-Id: <1461681318-29571-2-git-send-email-javier@javigon.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461681318-29571-1-git-send-email-javier@javigon.com> References: <1461681318-29571-1-git-send-email-javier@javigon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable metadata to be sent to the device through the metadata field on the physical rw nvme command. When a single ppa is sent to the device, a 64-bit integer can be sent as metadata; when a ppa list is sent, a 64-bit integer list mapping to the ppa list can be used to send metadata. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 1 + include/linux/lightnvm.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index 4956de3..7886c2c 100644 --- a/drivers/nvme/host/lightnvm.c +++ b/drivers/nvme/host/lightnvm.c @@ -504,6 +504,7 @@ static inline void nvme_nvm_rqtocmd(struct request *rq, struct nvm_rq *rqd, c->ph_rw.opcode = rqd->opcode; c->ph_rw.nsid = cpu_to_le32(ns->ns_id); c->ph_rw.spba = cpu_to_le64(rqd->ppa_addr.ppa); + c->ph_rw.metadata = cpu_to_le64(rqd->metadata); c->ph_rw.control = cpu_to_le16(rqd->flags); c->ph_rw.length = cpu_to_le16(rqd->nr_pages - 1); diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 208887f..f0936e3 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -237,8 +237,12 @@ struct nvm_rq { struct ppa_addr *ppa_list; - void *metadata; - dma_addr_t dma_metadata; + union { + u64 metadata; + dma_addr_t dma_meta_list; + }; + + u64 *meta_list; struct completion *wait; nvm_end_io_fn *end_io; -- 2.5.0