[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 12/42] nvme: add support for the get log page command
From: |
Klaus Birkelund Jensen |
Subject: |
Re: [PATCH v6 12/42] nvme: add support for the get log page command |
Date: |
Tue, 31 Mar 2020 14:49:44 +0200 |
On Mar 31 12:45, Maxim Levitsky wrote:
> On Tue, 2020-03-31 at 07:41 +0200, Klaus Birkelund Jensen wrote:
> > On Mar 25 12:40, Maxim Levitsky wrote:
> > > On Mon, 2020-03-16 at 07:28 -0700, Klaus Jensen wrote:
> > > > From: Klaus Jensen <address@hidden>
> > > >
> > > > Add support for the Get Log Page command and basic implementations of
> > > > the mandatory Error Information, SMART / Health Information and Firmware
> > > > Slot Information log pages.
> > > >
> > > > In violation of the specification, the SMART / Health Information log
> > > > page does not persist information over the lifetime of the controller
> > > > because the device has no place to store such persistent state.
> > > >
> > > > Note that the LPA field in the Identify Controller data structure
> > > > intentionally has bit 0 cleared because there is no namespace specific
> > > > information in the SMART / Health information log page.
> > > >
> > > > Required for compliance with NVMe revision 1.2.1. See NVM Express 1.2.1,
> > > > Section 5.10 ("Get Log Page command").
> > > >
> > > > Signed-off-by: Klaus Jensen <address@hidden>
> > > > Acked-by: Keith Busch <address@hidden>
> > > > ---
> > > > hw/block/nvme.c | 138 +++++++++++++++++++++++++++++++++++++++++-
> > > > hw/block/nvme.h | 10 +++
> > > > hw/block/trace-events | 2 +
> > > > 3 files changed, 149 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> > > > index 64c42101df5c..83ff3fbfb463 100644
> > > >
> > > > +static uint16_t nvme_error_info(NvmeCtrl *n, NvmeCmd *cmd, uint32_t
> > > > buf_len,
> > > > + uint64_t off, NvmeRequest *req)
> > > > +{
> > > > + uint32_t trans_len;
> > > > + uint64_t prp1 = le64_to_cpu(cmd->dptr.prp1);
> > > > + uint64_t prp2 = le64_to_cpu(cmd->dptr.prp2);
> > > > + uint8_t errlog[64];
> > >
> > > I'll would replace this with sizeof(NvmeErrorLogEntry)
> > > (and add NvmeErrorLogEntry to the nvme.h), just for the sake of
> > > consistency,
> > > and in case we end up reporting some errors to the log in the future.
> > >
> >
> > NvmeErrorLog is already in nvme.h; Fixed to actually use it.
> True that! I'll would rename it to NvmeErrorLogEntry to be honest
> (in that patch that added many nvme spec changes) but I don't mind
> keeping it as is as well.
>
It is used in the block driver (block/nvme.c) as well, and I'd rather
not involved that too much in this series.
- [PATCH v6 16/42] nvme: make sure ncqr and nsqr is valid, (continued)
[PATCH v6 15/42] nvme: additional tracing, Klaus Jensen, 2020/03/16
[PATCH v6 14/42] nvme: add missing mandatory features, Klaus Jensen, 2020/03/16
[PATCH v6 13/42] nvme: add support for the asynchronous event request command, Klaus Jensen, 2020/03/16
[PATCH v6 20/42] nvme: provide the mandatory subnqn field, Klaus Jensen, 2020/03/16