lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Jul 2019 20:51:45 +0900
From:   Minwoo Im <minwoo.im.dev@...il.com>
To:     Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc:     linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Paul Pawlowski <paul@...rm.io>, Jens Axboe <axboe@...com>,
        Keith Busch <kbusch@...nel.org>,
        Christoph Hellwig <hch@....de>,
        Minwoo Im <minwoo.im.dev@...il.com>
Subject: Re: [PATCH v2 2/3] nvme-pci: Add support for variable IO SQ element
 size

On 19-07-17 10:45:26, Benjamin Herrenschmidt wrote:
> The size of a submission queue element should always be 6 (64 bytes)
> by spec.
> 
> However some controllers such as Apple's are not properly implementing
> the standard and require a different size.
> 
> This provides the ground work for the subsequent quirks for these
> controllers.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> ---
>  drivers/nvme/host/pci.c | 11 ++++++++---
>  include/linux/nvme.h    |  1 +
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 8f006638452b..1637677afb78 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -28,7 +28,7 @@
>  #include "trace.h"
>  #include "nvme.h"
>  
> -#define SQ_SIZE(q)	((q)->q_depth * sizeof(struct nvme_command))
> +#define SQ_SIZE(q)	((q)->q_depth << (q)->sqes)
>  #define CQ_SIZE(q)	((q)->q_depth * sizeof(struct nvme_completion))
>  
>  #define SGES_PER_PAGE	(PAGE_SIZE / sizeof(struct nvme_sgl_desc))
> @@ -100,6 +100,7 @@ struct nvme_dev {
>  	unsigned io_queues[HCTX_MAX_TYPES];
>  	unsigned int num_vecs;
>  	int q_depth;
> +	int io_sqes;
>  	u32 db_stride;
>  	void __iomem *bar;
>  	unsigned long bar_mapped_size;
> @@ -162,7 +163,7 @@ static inline struct nvme_dev *to_nvme_dev(struct nvme_ctrl *ctrl)
>  struct nvme_queue {
>  	struct nvme_dev *dev;
>  	spinlock_t sq_lock;
> -	struct nvme_command *sq_cmds;
> +	void *sq_cmds;

It would be great if it can remain the existing data type for the
SQEs...  But I'm fine with this also.

It looks good to me.

Reviewed-by: Minwoo Im <minwoo.im.dev@...il.com>

Thanks,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ