From nobody Tue May 21 09:05:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611782509; cv=none; d=zohomail.com; s=zohoarc; b=dByGLdgEw+1m5lJ14OUE7mgguc1tsSNLHbR5p1xQFf/46PXfy1JGgkrOIgFUbjGveT6dEs/3wrkeIXHrrrR4N5S7KcdopH/dw/sNw3wt6/OWPlWYfEgWZUp90/iI7wH7vVY/Tdcj59Yhzq1r+DUijlY8hV/t4809Wcn8xkYZMek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611782509; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=YkAnTBu7ZCuuWD+W4OWe1NqQOLeIilwFuGa2G7+CQm8=; b=nEpFiB9CuAk1gXcXmjJ3Bc/Doz+TTHrxJMl9evIcuEaL9ZKzVr4Z3dJp8gCKRsEi9aeR3z9AmwRFh5ZJY2hdqZWd98kO+Ov7aEaVOVYsyrXCw1VZ3fDfKU4H4TC2xFMeWPnPDT6C/UYUyNwk24zl4+Eiiku/XTlZam8SCcYnQ/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1611782509789158.9393915622171; Wed, 27 Jan 2021 13:21:49 -0800 (PST) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-Pbm1oCfWP7e_-CHOqHcThA-1; Wed, 27 Jan 2021 16:21:46 -0500 Received: by mail-wr1-f72.google.com with SMTP id u3so1859915wri.19 for ; Wed, 27 Jan 2021 13:21:46 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id f17sm4665249wrv.0.2021.01.27.13.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 13:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611782508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YkAnTBu7ZCuuWD+W4OWe1NqQOLeIilwFuGa2G7+CQm8=; b=C0FGuV8pdFGlbFrycgdNDMp3QBN1c0Qlp36c2u5EAJ/E4D7JvEgHJI2oioEocIfBEGLBlg X+el8xm+1s2kWtzdVfS6qmk7b53WpmJw0QSWMgJzkY9xyIQXZdRgzKioKiXUUGObQqtDIw 6uMN41iusTm+J2gDeYHrpa2y8w9NR3M= X-MC-Unique: Pbm1oCfWP7e_-CHOqHcThA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YkAnTBu7ZCuuWD+W4OWe1NqQOLeIilwFuGa2G7+CQm8=; b=NnD0Bkre8rNRi5JFR3VsLZ7dF6LZptFyOb0Ex1VailBeqYeCLvY+6xe8NTdjpqWdhs YBZscvBldf92c9/ELK0ug6/XFG0eSwYuLsU4vs4fB1K2KQJ5BnJwz72k7+1cmpRqe3C3 ogFCcI8P34xG+4kA3ChslZc6NgEmE5V5yNXgqbyNWekIRdLknO+YK0E2iT3z1mDVUi94 dcDcqUblMr0KA9B/H0EMg+9MJ6p/AUL/4fqxp4lJwZQ6q9P/xpjF1AvPlPWfkj2IIA3K E0tUQUwUmQoayOyQ1WHzTN+Fra6DdKrEUmK0ITTGk3g+g3r7fGPGYKNo4DVyRJBc/p91 Mirg== X-Gm-Message-State: AOAM53090ahEfrLhHcD3/VLubxy5kA6KZu/5maRMUXZopsdKwr4R4RWB o3xduujed4kkuoJrDUnNarUXms8pNMGywlgHBbPTPpKMibwpRLvKslPIHAz7cdsR3G1DMqPioR6 9YFpWcmJ3S99mRw== X-Received: by 2002:a05:600c:22cf:: with SMTP id 15mr5659892wmg.19.1611782505681; Wed, 27 Jan 2021 13:21:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwyEX0lceUnt/2T9a6OwsoQmL7gv+JXLL9TV9DIaaZgM+D5+VwfFCDDNOnQEOmOTwAJTYLfw== X-Received: by 2002:a05:600c:22cf:: with SMTP id 15mr5659890wmg.19.1611782505563; Wed, 27 Jan 2021 13:21:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , qemu-block@nongnu.org, Kevin Wolf , Stefan Hajnoczi , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/2] block/nvme: Properly display doorbell stride length in trace event Date: Wed, 27 Jan 2021 22:21:36 +0100 Message-Id: <20210127212137.3482291-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210127212137.3482291-1-philmd@redhat.com> References: <20210127212137.3482291-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Commit 15b2260bef3 ("block/nvme: Trace controller capabilities") misunderstood the doorbell stride value from the datasheet, use the correct one. The 'doorbell_scale' variable used few lines later is correct. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Klaus Jensen --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 5a6fbacf4a5..80c4318d8fc 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -745,7 +745,7 @@ static int nvme_init(BlockDriverState *bs, const char *= device, int namespace, trace_nvme_controller_capability("Contiguous Queues Required", NVME_CAP_CQR(cap)); trace_nvme_controller_capability("Doorbell Stride", - 2 << (2 + NVME_CAP_DSTRD(cap))); + 1 << (2 + NVME_CAP_DSTRD(cap))); trace_nvme_controller_capability("Subsystem Reset Supported", NVME_CAP_NSSRS(cap)); trace_nvme_controller_capability("Memory Page Size Minimum", --=20 2.26.2 From nobody Tue May 21 09:05:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1611782518; cv=none; d=zohomail.com; s=zohoarc; b=ELHlh6z/L4Kwy0GDfWBsvdLHnuiUedF5F82n7jUGEsLNkFa1AZUJy7PPWW8jheOXCS0SX27GNhhEoAHEpxucGjUtL3mGiecHPMPA1/zDrCol5qC/PEs1yD+WXuQTu6cXeXOlspfTA/ZYN6U0QSFdAhAXPwo7eSZg0URv++Eac3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611782518; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=LH7rlpbaLs1tBmBzIg89VRyyKUjgUrsdXe1ezZrMVOQ=; b=kM5TJsctGpeLj7fpjxsxT8I7YYaWi8SjivhQSG8qzD+QcQeOoiQPeSJ74vL+fqBf+7OmdC65Z6R4EFDEKfF6v4BeYe5oEuu6+oyVtG6M7pm/oi8Y7DmX0srROyDPjho1frx5kCl/ZYONYhxgrBwk26vJ3PTkFNZ9vDJVPOEsFyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1611782518170946.1818621793711; Wed, 27 Jan 2021 13:21:58 -0800 (PST) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-vM0X1IAtNh2YbylC082X9g-1; Wed, 27 Jan 2021 16:21:52 -0500 Received: by mail-wm1-f70.google.com with SMTP id t13so1543354wmq.7 for ; Wed, 27 Jan 2021 13:21:51 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id u3sm4669392wre.54.2021.01.27.13.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 13:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611782514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LH7rlpbaLs1tBmBzIg89VRyyKUjgUrsdXe1ezZrMVOQ=; b=Q639sYSWjcmPUwOjCJ4gdDcugws3OKMmPIWEuiXYl+DNwmzcNjcjj1X+AOYVjo0rpNSEkv nsEPIWOirigI2r+1fBTJ7b3ETy+wk0zRdC54J/ooTMLXJXQn4HXU1UOUk8/KxfUe/Ut8VQ 0O2u8UJ0Y9ded9cJtRUW+an0+Of9YXs= X-MC-Unique: vM0X1IAtNh2YbylC082X9g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LH7rlpbaLs1tBmBzIg89VRyyKUjgUrsdXe1ezZrMVOQ=; b=UkzKx5i9NuWmsAJG1eGr/O0v/Z4YEWOX7BH5kBrBl8aeq73K0JeDLEr0PEva71gGYd ixiA0ENEytRAE1ZcCFDGHdoiC0F2dWBVKb8MFkWp1j8ezH4lMI0Yk/GrDCHZ55U2zVBv s8vFqy4nLHed9KYFFqcfs3xVhtiITfX0BN50u7LJKq5O7gSi9J5OgwQP2bqjZusgtHPh gzVHPDwNDYd6yo25MUpf5zcPVS2PewfujudL00+93aDJaKRiXgdyAQ3mvhDFWX9McCQG AMrBTn3tCN3gTXpI6WXZFaFv+Z3+gPYJqomHc5wxKo60nhu2r38WWf1dV8pAsAvSrWbg SmqQ== X-Gm-Message-State: AOAM532QeAiSsjjie9vtwlhHSldwWuaYNn6edeBarPFch5CqIDv4wt5d /F0Yw0A7ODL4hXkpJGKDoPBFZx/tYayO7FK0VcbRVAc6pC9aYCMlESB4+7aDGky6m98uvtINGnf tz8QZZlP4CZvinw== X-Received: by 2002:a5d:4485:: with SMTP id j5mr12974364wrq.315.1611782510909; Wed, 27 Jan 2021 13:21:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdWt7TGyPE2DYYOsCSrocY1tlcBltiuxjqNrsNDQKbhRkjzFs0KKLulyXq7SdINlOcRAQByA== X-Received: by 2002:a5d:4485:: with SMTP id j5mr12974353wrq.315.1611782510790; Wed, 27 Jan 2021 13:21:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , qemu-block@nongnu.org, Kevin Wolf , Stefan Hajnoczi , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] block/nvme: Trace NVMe spec version supported by the controller Date: Wed, 27 Jan 2021 22:21:37 +0100 Message-Id: <20210127212137.3482291-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210127212137.3482291-1-philmd@redhat.com> References: <20210127212137.3482291-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) NVMe controllers implement different versions of the spec, and different features of it. It is useful to gather this information when debugging. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Klaus Jensen --- block/nvme.c | 6 ++++++ block/trace-events | 1 + 2 files changed, 7 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index 80c4318d8fc..2b5421e7aa6 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -708,6 +708,7 @@ static int nvme_init(BlockDriverState *bs, const char *= device, int namespace, AioContext *aio_context =3D bdrv_get_aio_context(bs); int ret; uint64_t cap; + uint32_t ver; uint64_t timeout_ms; uint64_t deadline, now; volatile NvmeBar *regs =3D NULL; @@ -764,6 +765,11 @@ static int nvme_init(BlockDriverState *bs, const char = *device, int namespace, bs->bl.request_alignment =3D s->page_size; timeout_ms =3D MIN(500 * NVME_CAP_TO(cap), 30000); =20 + ver =3D le32_to_cpu(regs->vs); + trace_nvme_controller_spec_version(extract32(ver, 16, 16), + extract32(ver, 8, 8), + extract32(ver, 0, 8)); + /* Reset device to get a clean state. */ regs->cc =3D cpu_to_le32(le32_to_cpu(regs->cc) & 0xFE); /* Wait for CSTS.RDY =3D 0. */ diff --git a/block/trace-events b/block/trace-events index 8368f4acb0b..ecbc32a80a9 100644 --- a/block/trace-events +++ b/block/trace-events @@ -136,6 +136,7 @@ qed_aio_write_main(void *s, void *acb, int ret, uint64_= t offset, size_t len) "s # nvme.c nvme_controller_capability_raw(uint64_t value) "0x%08"PRIx64 nvme_controller_capability(const char *desc, uint64_t value) "%s: %"PRIu64 +nvme_controller_spec_version(uint32_t mjr, uint32_t mnr, uint32_t ter) "Sp= ecification supported: %u.%u.%u" nvme_kick(void *s, unsigned q_index) "s %p q #%u" nvme_dma_flush_queue_wait(void *s) "s %p" nvme_error(int cmd_specific, int sq_head, int sqid, int cid, int status) "= cmd_specific %d sq_head %d sqid %d cid %d status 0x%x" --=20 2.26.2