Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4004466yba; Tue, 7 May 2019 10:29:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfEdWezTmFvS9f1r/BfbSyuPzAHVStJiEgZdjgUDQiGrIppXMPDfClJXqqGcUqkG+IdYOO X-Received: by 2002:a63:8741:: with SMTP id i62mr40570561pge.313.1557250180589; Tue, 07 May 2019 10:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557250180; cv=none; d=google.com; s=arc-20160816; b=zk3J5yt48GyhIuJKUfMEm31V2nUW9l8x+Jx54orCvrBlBm3b8ynKPGV/xfE+/fLBWC k/bkf/YBJhBfWZx6q5V+zDNMswthr9SLLnWwPHzOfLPjmgOdXBwiNslmVQe/erfRneLN p2obLti88mYe8bpw6MP4bDlEM1gPq2VAX6+Cyzlprbeh2RCLSKH49cV7knN5ofJHht6+ xmbp2lwcyib7P+7ZHcBJajhLCXW2DEL/qOGbVfyXEWPUkNZzlsZUEIHCBsg9DPR4kdnH 2i0zymWkcJeRU/r14WOlnLdwGcO3lR9zRWjBFzCZ/PqkGDdgxSnAaae2hj77jSBNXgkf 8eKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1wsvD/HjUeh+2LwufN99Skl+0u0rAN+xQd34k9rnL8Q=; b=xwDoq+ImP80xkt16g97qPPFwSj8ljsXWuNoitb5v6/aAKS+h4ZTg7Z21p3L65uUV5O RbSFdC88thoGd44X26UK8iQuZLhYrMZKqhPG8aqMqsDN/qkJMw4vjowasDRnE9hO2vza SuEVafdIdE/IY61Z1lSLHsawQZQ2dXZwHM0j8YQEkDxG8WrHJTpl7U6kHqKnOlvwjNEr 30+mhB90zdm47d+IiIcEireNHhyjF78gf3v/IAz5TZr8/Phn4Ct9cbE6mr4va51lC5ta ZLKDH/Rh0teMHtksUU8pqyhwY4P338P8YZBeSJSveGIgQTZ6/1phoVGgaPSRfFUMhtaI 319g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si18590971plr.321.2019.05.07.10.29.24; Tue, 07 May 2019 10:29:40 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727510AbfEGR2T (ORCPT + 99 others); Tue, 7 May 2019 13:28:19 -0400 Received: from mga11.intel.com ([192.55.52.93]:60692 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfEGR2T (ORCPT ); Tue, 7 May 2019 13:28:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 10:28:18 -0700 Received: from unknown (HELO [10.232.112.171]) ([10.232.112.171]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 07 May 2019 10:28:16 -0700 Subject: Re: [PATCH v2 4/7] nvme.h: add telemetry log page definisions To: Akinobu Mita , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Sagi Grimberg , Keith Busch , Minwoo Im , Johannes Berg , Christoph Hellwig References: <1557248314-4238-1-git-send-email-akinobu.mita@gmail.com> <1557248314-4238-5-git-send-email-akinobu.mita@gmail.com> From: "Heitke, Kenneth" Message-ID: <81c0d1bd-c117-3fcb-959b-4507504021dd@intel.com> Date: Tue, 7 May 2019 11:28:16 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1557248314-4238-5-git-send-email-akinobu.mita@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/7/2019 10:58 AM, Akinobu Mita wrote: > Copy telemetry log page definisions from nvme-cli. > > Cc: Johannes Berg > Cc: Keith Busch > Cc: Jens Axboe > Cc: Christoph Hellwig > Cc: Sagi Grimberg > Cc: Minwoo Im > Signed-off-by: Akinobu Mita > --- > * v2 > - New patch in this version. > > include/linux/nvme.h | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > > diff --git a/include/linux/nvme.h b/include/linux/nvme.h > index c40720c..5217fe4 100644 > --- a/include/linux/nvme.h > +++ b/include/linux/nvme.h > @@ -396,6 +396,28 @@ enum { > NVME_NIDT_UUID = 0x03, > }; > > +/* Derived from 1.3a Figure 101: Get Log Page – Telemetry Host > + * -Initiated Log (Log Identifier 07h) > + */ > +struct nvme_telemetry_log_page_hdr { > + __u8 lpi; /* Log page identifier */ > + __u8 rsvd[4]; > + __u8 iee_oui[3]; > + __le16 dalb1; /* Data area 1 last block */ > + __le16 dalb2; /* Data area 2 last block */ > + __le16 dalb3; /* Data area 3 last block */ > + __u8 rsvd1[368]; /* TODO verify */ Remove the TODO > + __u8 ctrlavail; /* Controller initiated data avail?*/ > + __u8 ctrldgn; /* Controller initiated telemetry Data Gen # */ > + __u8 rsnident[128]; > + /* We'll have to double fetch so we can get the header, > + * parse dalb1->3 determine how much size we need for the > + * log then alloc below. Or just do a secondary non-struct > + * allocation. > + */ This comment isn't necessary. You usually can't read the entire telemetry log at once and the header is a fixed size. You would likely just read the header followed by reads of the different data areas. > + __u8 telemetry_dataarea[0]; > +}; > + > struct nvme_smart_log { > __u8 critical_warning; > __u8 temperature[2]; > @@ -832,6 +854,7 @@ enum { > NVME_LOG_FW_SLOT = 0x03, > NVME_LOG_CHANGED_NS = 0x04, > NVME_LOG_CMD_EFFECTS = 0x05, > + NVME_LOG_TELEMETRY_CTRL = 0x08, > NVME_LOG_ANA = 0x0c, > NVME_LOG_DISC = 0x70, > NVME_LOG_RESERVATION = 0x80, >