[RFC PATCH] nvme: Submit uevents for log page notification
Christoph Hellwig
hch at infradead.org
Wed Jun 14 08:05:46 PDT 2017
Given that we have the uevent discussion again can you resubmit this
with the comments address, most notably only enabling it for the
uevents we want userspace to handle. Maybe including whatever
code you have on the userspace side (even if it's an ugly prototype)
On Thu, Mar 30, 2017 at 10:36:09AM +0200, Christoph Hellwig wrote:
> The uevent itself looks fine to me, but we really need to figure out
> how we can clear log pages in kernel space where needed.
>
> We should already be doing this for the namespace changed one, and
> it will be very important at least for ANA as well.
>
>
> A few more mechanical code comments below:
>
>
> > +void nvme_uevent_work(struct nvme_ctrl *ctrl, int log)
>
> static?
>
> > {
> > u32 result = le32_to_cpu(res->u32);
> > + u8 log_page = (result >> 16) & 8;
> > + u8 event_type = result & 7;
> > bool done = true;
> >
> > switch (le16_to_cpu(status) >> 1) {
> > @@ -2173,7 +2202,6 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
> > /*FALLTHRU*/
> > case NVME_SC_ABORT_REQ:
> > ++ctrl->event_limit;
> > - schedule_work(&ctrl->async_event_work);
>
> This seems to disable any action on AERs in the kernel..
>
> > diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> > index 9690beb..3930a12 100644
> > --- a/drivers/nvme/host/fc.c
> > +++ b/drivers/nvme/host/fc.c
> > @@ -1936,6 +1936,8 @@ nvme_fc_complete_rq(struct request *rq)
> > nvme_requeue_req(rq);
> > return;
> > }
> > + if (req->errors & NVME_SC_MORE)
> > + nvme_uevent(&dev->ctrl, NVME_LOG_ERROR);
> >
> > if (blk_rq_is_passthrough(rq))
> > error = rq->errors;
>
> We'll really need to factor the common request completion code
> into a helper in common code first..
>
> > diff --git a/include/linux/nvme.h b/include/linux/nvme.h
> > index c43d435..e711de6 100644
> > --- a/include/linux/nvme.h
> > +++ b/include/linux/nvme.h
> > @@ -16,6 +16,7 @@
> > #define _LINUX_NVME_H
> >
> > #include <linux/types.h>
> > +#include <linux/kfifo.h>
>
> This should move to drivers/nvme/host/nvme.h instead.
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
---end quoted text---
More information about the Linux-nvme
mailing list