Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-14 Thread Akinobu Mita
2019年5月14日(火) 0:23 Chaitanya Kulkarni : > > On 05/13/2019 12:46 AM, Minwoo Im wrote: > >> +static int nvme_get_telemetry_log_blocks(struct nvme_ctrl *ctrl, void > >> *buf, > >> + size_t bytes, loff_t offset) > >> +{ > >> +loff_t pos = 0; > >> +u32

Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-13 Thread Chaitanya Kulkarni
On 05/13/2019 12:46 AM, Minwoo Im wrote: >> +static int nvme_get_telemetry_log_blocks(struct nvme_ctrl *ctrl, void *buf, >> + size_t bytes, loff_t offset) >> +{ >> +loff_t pos = 0; >> +u32 chunk_size; >> + >> +if

Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-13 Thread Akinobu Mita
2019年5月13日(月) 23:03 Christoph Hellwig : > > Usage of a scatterlist here is rather bogus as we never use > it for dma mapping. Why can't you store the various pages in a > large bio_vec and then just issue that to the device in one > get log page command? (or at least a few if MDTS kicks in?)

Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-13 Thread Akinobu Mita
2019年5月13日(月) 22:55 Keith Busch : > > On Sun, May 12, 2019 at 08:54:15AM -0700, Akinobu Mita wrote: > > +static void nvme_coredump_logs(struct nvme_dev *dev) > > +{ > > + struct dev_coredumpm_bulk_data *bulk_data; > > + > > + if (!dev->dumps) > > + return; > > + > > +

Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-13 Thread Christoph Hellwig
Usage of a scatterlist here is rather bogus as we never use it for dma mapping. Why can't you store the various pages in a large bio_vec and then just issue that to the device in one get log page command? (or at least a few if MDTS kicks in?)

Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-13 Thread Keith Busch
On Sun, May 12, 2019 at 08:54:15AM -0700, Akinobu Mita wrote: > +static void nvme_coredump_logs(struct nvme_dev *dev) > +{ > + struct dev_coredumpm_bulk_data *bulk_data; > + > + if (!dev->dumps) > + return; > + > + bulk_data = nvme_coredump_alloc(dev, 1); > + if

Re: [PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-13 Thread Minwoo Im
> +static int nvme_get_telemetry_log_blocks(struct nvme_ctrl *ctrl, void *buf, > + size_t bytes, loff_t offset) > +{ > + loff_t pos = 0; > + u32 chunk_size; > + > + if (check_mul_overflow(ctrl->max_hw_sectors, 512u, _size)) > +

[PATCH v3 5/7] nvme-pci: add device coredump infrastructure

2019-05-12 Thread Akinobu Mita
This provides three functions to implement the device coredump for nvme driver. nvme_coredump_init() - This function is called when the driver determines to start collecting device coredump. The snapshots of the controller registers, and admin and IO queues are captured by this.