Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3974108yba; Tue, 7 May 2019 10:00:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMCqwgFk1TQz4MYHRrkIX5HW4MCHKzRX8t9pywP191+mP55SJPZ5zinVVH5XWja5iQHuzP X-Received: by 2002:aa7:86c3:: with SMTP id h3mr41048908pfo.169.1557248421641; Tue, 07 May 2019 10:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557248421; cv=none; d=google.com; s=arc-20160816; b=WvZVsKTcWpXCAMk/qpNE1BX6yxCJdnvw45QTnJ2XJTq94s2XQWgJd7QSIaLYfgzkZS oByaFj6VALyYLi/lpfXRXbQ7LzoePDKJjZZx+YkSzc99JQSmm2Bo4hdJ9vMIIbIKsUWT wGUxOjFz11K9pTy28EpINlHJ5xt5dLhSVnyCQJ5QG+/yc1HH6WnzMx4+gGTn7472q6f+ luEZSmwu4fuq+JNjXEbCIjKKI43y+Qg4MQPcfJT7za19MQStkV/Esj3Lo3QxgRiVbLIX Iu/4+myKkAx55TyQ2OAPh32nNZy6Vbpo9yl/E+GraUCofIDV47x9CMqhDPA3Ctc9rY4k etTQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xkDmKHN/t0FLLqvqBKew99AjKdIrGt8ctiEpmuZPQEg=; b=aPX4/3Wh2fd1xk5OPoQLeJ1Tn5yJDcAZBBoNLr7YaYTTShCUmQReeO+KRoaS8rxfLE V8MIWIEGDo8TWtzbBJHCSgccpvZiyupKD8fXiRhv4PF0ooPj9PB+Nw9XyjZE/noJyWlB fKaxz638SCGeRJYEisyhXSk+I55JV4UUNLIlimvBYb+HjWcod4tukSrp/Qfm8iTWcfuC wWCo3I6hRoAqmG8UhallD9ohRl1i6KYiBFztjjoXwXPFL9L0VqdRRvzawvJr89574/iF CcIkMAhb+5Yh87GaxVaC2M9wv/zaIK5wZv/tQsqT1rYxaxkJ+977gl1em1Vqcw5k7K4N HCYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mL/DwRZ6"; 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 j11si17018885pgq.399.2019.05.07.10.00.05; Tue, 07 May 2019 10:00:21 -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="mL/DwRZ6"; 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 S1727330AbfEGQ7E (ORCPT + 99 others); Tue, 7 May 2019 12:59:04 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:44699 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727242AbfEGQ7C (ORCPT ); Tue, 7 May 2019 12:59:02 -0400 Received: by mail-pl1-f195.google.com with SMTP id d3so4455491plj.11 for ; Tue, 07 May 2019 09:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xkDmKHN/t0FLLqvqBKew99AjKdIrGt8ctiEpmuZPQEg=; b=mL/DwRZ6NNE/tDrfyJO92P34yidij+IBavjnpFg+vLE7NxYbAdRI3A3VMvYhslLP+M nzJpelgOI5WlnMSUiO2DLDiObsStnF75NA5K4GOPR2Tpf+Mte7AeN7m9u/GkN1tkj/BA ioJAXF1PTTz56OYBYzX4N0FBnJtVbr/5AaT9pmbrAyIIdbgWmPJvFlXLcV14BAJyA0Rz 6edAUUl/bt2Lpp5VTwHKdXY226DIe11A2NmQRFKad4Vq37ZUnT9N8mOH7YS6tKEWWlvT lxcCLHwCrgm9u2hi7xdJyey5Fz+2mmlkZCtuWAgSPr2pP9tw7C3PR0P9oK7glcguRLgT Ec2A== 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=xkDmKHN/t0FLLqvqBKew99AjKdIrGt8ctiEpmuZPQEg=; b=hD+x4MmxayLWnpEbpvG43iSBI4UL657gg8Gq2Pv8NoEE3Jam3t8jathnCzLzvGv8XF gC8Z6yZ9RfhZKz0egFvpiDQKCDqvaKwQaa97QIDNGFF+/y47oRIn+s4Ct4STLWeOmkaI Ijy4t0LLqhgSLxkeo3pEamHAFFR60x1H7Dwm7395WwIP1Y9Mt4OL26AGVGg2XMV0mrLS fLXq1MpbwO3816wIZuz8ZUE5n2SawTByhP8F3GAePAqLiYKVl+zB6dDC9Kh5ulLvUe8/ w8oBEgPNwSmHZbwPoDOkatWX4AZ714wQlq84p5WP1B9UFI3RatGJDzPIIq4P+GsjkIdH yTAA== X-Gm-Message-State: APjAAAXlEgbpLrYFmcwC+Mj2w+suGb/0Sq7P2a5akB1+P3czBTXWrgtd EBbKuVhCJ6ixwPsw5hR+/rQ= X-Received: by 2002:a17:902:b606:: with SMTP id b6mr5432879pls.100.1557248342269; Tue, 07 May 2019 09:59:02 -0700 (PDT) Received: from mita-MS-7A45.lan ([240f:34:212d:1:1b24:991b:df50:ea3f]) by smtp.gmail.com with ESMTPSA id r12sm18140093pfn.144.2019.05.07.09.58.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 May 2019 09:59:01 -0700 (PDT) From: Akinobu Mita To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Akinobu Mita , Johannes Berg , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Minwoo Im Subject: [PATCH v2 4/7] nvme.h: add telemetry log page definisions Date: Wed, 8 May 2019 01:58:31 +0900 Message-Id: <1557248314-4238-5-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557248314-4238-1-git-send-email-akinobu.mita@gmail.com> References: <1557248314-4238-1-git-send-email-akinobu.mita@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ + __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. + */ + __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, -- 2.7.4