lightnvm: introduce ADDR_PADDED to signal padding
PATCH 1/1 lightnvm: introduce ADDR_PADDED to signal padding
When REQ_FUA or REQ_FLUSH are sent from the block layer, a target might need to pad some sectors in order to meet device constrains. ADDR_PADDED allows to signal that such sector has been padded. It can be used to mark both lbas and ppas.
--- include/linux/lightnvm.h | 1 + 1 file changed, 1 insertion(+)
include/linux/lightnvm.h +1 -0
@@ -214,6 +214,7 @@ struct nvm_tgt_instance { };#define ADDR_EMPTY (~0ULL) +#define ADDR_PADDED (~0ULL - 1)#define NVM_VERSION_MAJOR 1#define NVM_VERSION_MINOR 0
Signature · 1 line
2.5.0
PATCH 1/2 lightnvm: free metadata dma on rrpc when needed
rrpc has assumed that medatada is always sent as a dma buffer to the device. When this is not true, do not attempt to free a non-allocated dma region.
--- drivers/lightnvm/rrpc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/lightnvm/rrpc.c +5 -3
@@ -707,10 +707,12 @@ static void rrpc_end_io(struct nvm_rq *rqd)rrpc_unlock_rq (rrpc, rqd); -if (npages >1 ) +if (npages >1 ) {nvm_dev_dma_free (rrpc->dev, rqd->ppa_list, rqd->dma_ppa_list); -if (rqd->metadata) -nvm_dev_dma_free (rrpc->dev, rqd->metadata, rqd->dma_metadata); +if (rqd->meta_list) +nvm_dev_dma_free (rrpc->dev, rqd->meta_list, + rqd->dma_meta_list); + }mempool_free (rqd, rrpc->rq_pool); }
Signature · 1 line
2.5.0
PATCH 2/2 lightnvm: enable metadata to be sent to device
In reply to Javier GonzálezEnable 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.
--- drivers/nvme/host/lightnvm.c | 1 + include/linux/lightnvm.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/nvme/host/lightnvm.c +1 -0
@@ -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 );
include/linux/lightnvm.h +6 -2
@@ -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;
Signature · 1 line
2.5.0