Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp783034ybi; Wed, 17 Jul 2019 04:52:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRDN15It4rP1XfozfM9S67J1TnmNQ0DW+dhpv87bEPGht8PfMa7BWSNZWsSiX2cixv3dJL X-Received: by 2002:a17:902:b789:: with SMTP id e9mr41454467pls.294.1563364354056; Wed, 17 Jul 2019 04:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563364354; cv=none; d=google.com; s=arc-20160816; b=hsAGJtblM4wjl8Dbo9n/ICSDADJc+MiBqBV8ByLRoB6nTh35o+WUSYYYrrdF3V4cgk xo61YKG3ACJMYKRzPG2eipSdZcChfkZVg9HkAyGQpJzMhig4Ja1xWpIuqLFiEmp+nphN 1VnCyHvUHc0CIYn8UymhSjZWCRV5O1NkcvIxH1dXWcNMKiATAWD3IHcaelEGgRp5jLpn Jz8YVhxHHzCoDdczBJgTLL90d3gYe6dmIV18sqPKafGPG/J9SlB62kVPn4J5kMH6q/BL ft76HENU+G8ILu/V3HqK4QiSezqh5K4HRB2TVv8DBuYYqRA/a5+MFtys8L91O65x32Sa phuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GIJbr25lVT/D/Vy27DLzuKerhv8UbYHOIOCQJikwBFA=; b=eCedyOdL4UBGIOxppMsy2fkJIzThfNg+AwL+pREbat9bIGh8dg9024PfvoYtdsbFOK 3ncQ93jSyirH02OT0zPSwmkrqco2hsI27xaA6F/2M04YB4AoxF3+N49l5lwjSWJGvyCE ApXVjC9c5+tZnLf82Jf+o6/QQroOf5YQbCkIiA2ytdVL+bL0DMSierbkP9b71+7MG8xg rHns6DJzF6OvhYj0lcUNs3VhFMlBv6rb8wCd9uBzNAEk97uQfeTK4AXvFjPAg9OFaoRt K520G9/ZiNumiwLfbhHArL03Qd9aGDJhqDNiHTpqd92MFLa3zTRtbH22WfTGm0l3Txgk 0HQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="uIzwJ/ze"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si16869986plb.314.2019.07.17.04.52.18; Wed, 17 Jul 2019 04:52:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="uIzwJ/ze"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732806AbfGQLvu (ORCPT + 99 others); Wed, 17 Jul 2019 07:51:50 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44464 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732650AbfGQLvt (ORCPT ); Wed, 17 Jul 2019 07:51:49 -0400 Received: by mail-pf1-f196.google.com with SMTP id t16so10711210pfe.11 for ; Wed, 17 Jul 2019 04:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GIJbr25lVT/D/Vy27DLzuKerhv8UbYHOIOCQJikwBFA=; b=uIzwJ/ze91LaMB3BoL1PAbHbciev+otvhS8f4ghjEtZICozZi6YfWLlksybW7RfJ0w ol5s203a37yS0N/j6P6msr0Cn7wmAtOdEA+oSWiYe8+nJcErHR2bCcuQ8lqR1s42okzP fFrIHf6Uc38uyBGRDbcz2YxUkNNMN7d3DXupfXAH3T4izSWPcr9xnXFGgHDgZGRDNWFm xXKfS3WW53MdkuPvAXfZUbvsyzckXH+dcknPhehbXdI3zL8kbZK9W7Kp8OymyGg/1FPk y+tEpiS4sguwTasF3IEkweGCeeoDZUcXb/7UEKMuKaU2Qsm8N7Jan9Q5KeuRT0VVz23W FmdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GIJbr25lVT/D/Vy27DLzuKerhv8UbYHOIOCQJikwBFA=; b=qBPp3A2I7qDZa3/E0we4Y0pzw28qzv/qrng69RhCdPkelxr7NoDYlE2vQLyhqEsYsy n3yfWkeip5fKlJyHY3sqLcbRX+toZ1VTwz8narCce4O646cCylJBW2k53hi9pBJoo3Lf XTaK4tfaCepL6mmV5sUGJx656LLD/Aty7j1Xa6akfRCW+YfDSfdp6+N10MoN5OdnwSNA Vb01Oci3sNV/p8mVjklW5f+rPOTxsUvkesYrOYYqguBkx/Qgse4Hou/c0qWLPutQP2CD HUhKYKolCeaWRDsWhg/1fG+QH+CcrEk3kBBRkwLPxD6ZPyrz4uw2be7OiUbACPdCElbu wjvg== X-Gm-Message-State: APjAAAWNXOVvUhlIZAmXF7/HatCnc8OQU2cMDIZ6QAHwhTZL3s4m5E64 rUMrZ/FnbGAwvdBBpwkixIg= X-Received: by 2002:a63:ee08:: with SMTP id e8mr16191189pgi.70.1563364309173; Wed, 17 Jul 2019 04:51:49 -0700 (PDT) Received: from localhost ([123.213.206.190]) by smtp.gmail.com with ESMTPSA id u6sm20799749pjx.23.2019.07.17.04.51.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jul 2019 04:51:48 -0700 (PDT) Date: Wed, 17 Jul 2019 20:51:45 +0900 From: Minwoo Im To: Benjamin Herrenschmidt Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Paul Pawlowski , Jens Axboe , Keith Busch , Christoph Hellwig , Minwoo Im Subject: Re: [PATCH v2 2/3] nvme-pci: Add support for variable IO SQ element size Message-ID: <20190717115145.GB10495@minwoo-desktop> References: <20190717004527.30363-1-benh@kernel.crashing.org> <20190717004527.30363-2-benh@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190717004527.30363-2-benh@kernel.crashing.org> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 Thanks,