From owner-svn-src-all@freebsd.org Sun Mar 11 06:32:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3683F310DC; Sun, 11 Mar 2018 06:32:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48CD37B40D; Sun, 11 Mar 2018 06:32:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id u5-v6so7618239itc.1; Sat, 10 Mar 2018 22:32:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=G/5XKTqq9DMbm6Jl3Ybnm1j0ZZDnEZAO1ToEH6Txodc=; b=hwknC9hQNF5TEMIqHyr28jHgcTgLC8jzRAg0ZR2JbGECvJnnV4mUtJ60ddX053g4/t 2fhUj0MtKy4M+JhT/3oX7gJ0qzzbx8zFjbF4PyJpEGDRSousiPPmNTsvAfzHVPsj7wGl ONGQRPrAu4g+IaC+lE1UxuoFnOYvFEky7IjpS1ag2rUnNBXn4dIOHUlgAuC84z/GyHXw 5MoY2LOp39TMZnf+3gwNLlURbu7OuExti8piQEy+lW4R9aj3nRzKo7lo7HcAkV7y/QIZ hjzuX42UmmzmKBYslDyxnutIhzkHDe9iQQDLXqsMAoy6jURSkshWqfdNRPiUxXuIhorL 2Siw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G/5XKTqq9DMbm6Jl3Ybnm1j0ZZDnEZAO1ToEH6Txodc=; b=HvzlzaXNXoL/u75wVFfpqvV0H9T5GlYSb8srK1nrMmUH5iarCwoS4MUIG8Qm8wcyYB 511izzEivqSW8Ddr4unnKyUTt0bS0n6LSWJ8ceWXzgjhxWt3bls11gKeX5QrGiNiKJCU AL0i76uKB4fz8VKZgMrTMEoekzrlJH/xB7EyMe5m8/0ZsPy1xpO4aEcblfiE4pkYXJOJ NEuQqevIugtgU40VqsEMyiuxZqx0OnzjL+8rMxuwUtJq+RmymeGdpmgX6ubNgfxyi/Ea MEg2o4B6G+q9f3WPxFHT04N/Hv44UPoHT2NBIfAXekJa3qZ5BXtgit8Q+1tkzDyzm98o ftKw== X-Gm-Message-State: AElRT7F5LxcQBNikkQg0i6pL7TydRaoYmDGtnykBEac7WcOUQSXool91 qY5ilnqZR4Z/EVn00BIAltleVoOw X-Google-Smtp-Source: AG47ELsI486uUfScjxEYYdtnzDCWYgZ5EY4hwl7cVt0l+vS+TYxdkSrVV7GXEAaQmGAOP7UjMhTcmA== X-Received: by 10.36.249.203 with SMTP id l194mr4121312ith.81.1520749951342; Sat, 10 Mar 2018 22:32:31 -0800 (PST) Received: from spectre.mavhome.dp.ua ([2600:1700:3580:3560:228:f8ff:fe04:d12]) by smtp.gmail.com with ESMTPSA id n123sm1570212itb.31.2018.03.10.22.32.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 22:32:30 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r330759 - in head: sbin/nvmecontrol sys/dev/nvme To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803110509.w2B5928t008519@repo.freebsd.org> From: Alexander Motin Message-ID: <76181c29-2b3b-b89b-0186-22863273891c@FreeBSD.org> Date: Sun, 11 Mar 2018 01:32:29 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 06:32:33 -0000 On 11.03.2018 01:12, Conrad Meyer wrote: > On Sat, Mar 10, 2018 at 9:09 PM, Alexander Motin wrote: >> Author: mav >> Date: Sun Mar 11 05:09:02 2018 >> New Revision: 330759 >> URL: https://svnweb.freebsd.org/changeset/base/330759 >> >> Log: >> Add new identify data structures fields from NVMe 1.3a. >> >> ... >> Modified: head/sbin/nvmecontrol/identify.c >> ============================================================================== >> --- head/sbin/nvmecontrol/identify.c Sun Mar 11 04:37:05 2018 (r330758) >> +++ head/sbin/nvmecontrol/identify.c Sun Mar 11 05:09:02 2018 (r330759) >> @@ -95,25 +95,35 @@ print_controller(struct nvme_controller_data *cdata) >> ... >> + ((cdata->mic >> NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT) & >> + NVME_CTRLR_DATA_MIC_SRIOVVF_MASK) ? "SR-IOV VF, " : "", >> + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT) & >> + NVME_CTRLR_DATA_MIC_MCTRLRS_MASK) ? "Multiple controllers, " : "", >> + ((cdata->mic >> NVME_CTRLR_DATA_MIC_MPORTS_SHIFT) & >> + NVME_CTRLR_DATA_MIC_MPORTS_MASK) ? "Multiple ports" : ""); >> ... >> Modified: head/sys/dev/nvme/nvme.h >> ============================================================================== >> --- head/sys/dev/nvme/nvme.h Sun Mar 11 04:37:05 2018 (r330758) >> +++ head/sys/dev/nvme/nvme.h Sun Mar 11 05:09:02 2018 (r330759) >> @@ -153,6 +153,17 @@ >> #define NVME_PWR_ST_APS_SHIFT (6) >> #define NVME_PWR_ST_APS_MASK (0x3) >> >> +/** Controller Multi-path I/O and Namespace Sharing Capabilities */ >> +/* More then one port */ >> +#define NVME_CTRLR_DATA_MIC_MPORTS_SHIFT (0) >> +#define NVME_CTRLR_DATA_MIC_MPORTS_MASK (0x1) >> +/* More then one controller */ >> +#define NVME_CTRLR_DATA_MIC_MCTRLRS_SHIFT (1) >> +#define NVME_CTRLR_DATA_MIC_MCTRLRS_MASK (0x1) >> +/* SR-IOV Virtual Function */ >> +#define NVME_CTRLR_DATA_MIC_SRIOVVF_SHIFT (2) >> +#define NVME_CTRLR_DATA_MIC_SRIOVVF_MASK (0x1) >> + >> /** OACS - optional admin command support */ >> /* supports security send/receive commands */ >> #define NVME_CTRLR_DATA_OACS_SECURITY_SHIFT (0) >> @@ -166,6 +177,21 @@ >> /* supports namespace management commands */ >> #define NVME_CTRLR_DATA_OACS_NSMGMT_SHIFT (3) >> #define NVME_CTRLR_DATA_OACS_NSMGMT_MASK (0x1) >> +/* supports Device Self-test command */ >> +#define NVME_CTRLR_DATA_OACS_SELFTEST_SHIFT (4) >> +#define NVME_CTRLR_DATA_OACS_SELFTEST_MASK (0x1) >> +/* supports Directives */ >> +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_SHIFT (5) >> +#define NVME_CTRLR_DATA_OACS_DIRECTIVES_MASK (0x1) >> +/* supports NVMe-MI Send/Receive */ >> +#define NVME_CTRLR_DATA_OACS_NVMEMI_SHIFT (6) >> +#define NVME_CTRLR_DATA_OACS_NVMEMI_MASK (0x1) >> +/* supports Virtualization Management */ >> +#define NVME_CTRLR_DATA_OACS_VM_SHIFT (7) >> +#define NVME_CTRLR_DATA_OACS_VM_MASK (0x1) >> +/* supports Doorbell Buffer Config */ >> +#define NVME_CTRLR_DATA_OACS_DBBUFFER_SHIFT (8) >> +#define NVME_CTRLR_DATA_OACS_DBBUFFER_MASK (0x1) > > This seems like a suboptimal way to represent and check single flag > bits. Is there a reason the conventional (1<