From patchwork Wed Feb 20 05:11:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 10821181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CB666C2 for ; Wed, 20 Feb 2019 05:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 738252DEBE for ; Wed, 20 Feb 2019 05:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 682A92DEC4; Wed, 20 Feb 2019 05:11:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1DDEA2DEBE for ; Wed, 20 Feb 2019 05:11:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 15F93209574CA; Tue, 19 Feb 2019 21:11:16 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.132.97; helo=apc01-pu1-obe.outbound.protection.outlook.com; envelope-from=decui@microsoft.com; receiver=linux-nvdimm@lists.01.org Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-eopbgr1320097.outbound.protection.outlook.com [40.107.132.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7F524208AE3FA for ; Tue, 19 Feb 2019 21:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x5u90kJi5VnbjR2ygYwtGYoe2/sLV3Z3y9/+Qa77eA4=; b=ibYnSw1wKbabcMsHDbNf6UXnSdD+nRWMwPcDjR1tGKk6DY7ii+eV3mbbS2dg6pK+zVKX04rezm2C66221rMSBc+A3TCnCBvUKRQ99rWD6qc+jlYWcXDXcTVXvCxNP/xxp8Tb9u3HtiInyoTwRnQ7oHoJ1dId5dS33sn6NI9hpJ4= Received: from PU1P153MB0169.APCP153.PROD.OUTLOOK.COM (10.170.189.13) by PU1P153MB0105.APCP153.PROD.OUTLOOK.COM (10.170.188.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.0; Wed, 20 Feb 2019 05:11:11 +0000 Received: from PU1P153MB0169.APCP153.PROD.OUTLOOK.COM ([fe80::7822:a20:e63c:de2f]) by PU1P153MB0169.APCP153.PROD.OUTLOOK.COM ([fe80::7822:a20:e63c:de2f%9]) with mapi id 15.20.1665.002; Wed, 20 Feb 2019 05:11:11 +0000 From: Dexuan Cui To: Dave Jiang , Vishal Verma , Dan Williams , "linux-nvdimm@lists.01.org" , Michael Kelley , "qi.fuli@fujitsu.com" , Johannes Thumshirn Subject: [ndctl PATCH v2 3/4] ndctl, lib: implement ndctl_dimm_get_cmd_family() Thread-Topic: [ndctl PATCH v2 3/4] ndctl, lib: implement ndctl_dimm_get_cmd_family() Thread-Index: AdTI2q9TbSFgGnHRQvql/Od6kAUVag== Date: Wed, 20 Feb 2019 05:11:10 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-02-20T05:11:09.0273980Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=8d416a6f-11e9-4e1e-ae71-8176c93ae572; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic x-originating-ip: [2001:4898:80e8:9:e09f:1351:8c90:7b8c] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2c79d2e1-6101-4281-c02d-08d696f1d433 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600126)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:PU1P153MB0105; x-ms-traffictypediagnostic: PU1P153MB0105: x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; PU1P153MB0105; 23:U7NUJl/GExA5tKLKD7uddnPhP1PtxazL8cEhmfzn7?= nyRkRDSSPj9pd+CVC7ucaN0ld4I0VFiAF/ExOy4RpFPcYM+LBLbzty6EnKbOxiCHTGVcYuop5STHfcDeQn1PAEs1dalvwJtgZfi7hZSFqnxeCNUvlat/AJakGZPLS7lKRVB36fRpftcZ980yti7pCuCLNvy62EA/gbwNkd+cxdd49Vo0EAADWXo+N+bUVcvGVSCWl/gCq3W20gpZV0enS1418n/NPzbYNTuJdFDvCHO/bLRmC68qFt0RJsD85CLGgKK7fULUDB5poPWFuZRafbQKux7X4rZgBqY+i5hGSPIOsu0aiu2+IgVanWFdHEea0LPjPn+m2UnfN0wdamy9A9iwRlrcnxPiFVFajQU6MEVIT3bix0JNPxFv22R4LbJOTquQ7q5X3duFQplncWeDj2kmQ3Kp7g+KRprHmWZreCCtTbvZ2nJkveRQmOxuCMUWLDz9VjuzKW9PpzdlxiSmPhuVj60O5f10gY3X2BCn4IGVPNxO3I4ZLNxXDt6UAgTiBI8uPDR+wqh9qgnf7OCH9E7eYa9H/xZpFmYWrzpalUNNS41tVjEQ5r8YKgYEorIr6ES+98HIQm91TixvF+wZxkNbI7mH02YV7Aq5OlXY9XSUT0GBViIKkNiWb0sdFZi1w0YimDpTuCvUbi6UO06Sxk54+1DLDiFui9cqVbdonRiY2QqXmrtA6vmkbdBBJWGXG2AHp9ecSJHwpPY9F1ryYBLb1+Geud0p1enXxRsoxs3g1yqRuXzcApoVEl4dt8ST1sVFT39tYUlAYHPdBiFqCORq0x1olCXDR7fOsYSJTVEu68Vo7HShUPZYO9q3zzbuMLhMYYkTdhV0fcRtjeYo0UrX4m8YQFAV34WWtRwtmU9yi9why8bcivHt7oWR+TY9fDHKOhR73TpFSC/a1cnrSNnWcmoldGQLOkzpDoJK4bqyLtg3JlqqX/tYQKIgWrtkBS5msYi8jKQe2M9EzBvxmy7qKW9CKE5P0HXqP98vvOu/lytHppNanGp2uhl9Lv7GA+ZZGa4jP+WOVLCGiDV9OvWWOrlcIGaunsspnJnspM+QYDCoIkfE0XZYLizihg9jpMs6npNsDYFZlWsaizUXmAX5ZeDIEnqkooPHfSlV4GhYGzq3Be7KoesxCOCaxJGVIZSEJgvhuL3LNfglH7ySxeD x-microsoft-antispam-prvs: x-forefront-prvs: 0954EE4910 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(346002)(376002)(136003)(396003)(189003)(199004)(33656002)(478600001)(110136005)(316002)(14454004)(22452003)(106356001)(2906002)(46003)(8990500004)(6506007)(476003)(486006)(71200400001)(71190400001)(256004)(186003)(6116002)(105586002)(10290500003)(68736007)(1511001)(97736004)(10090500001)(6346003)(102836004)(9686003)(6436002)(8676002)(55016002)(5660300002)(81156014)(7736002)(305945005)(7696005)(86612001)(25786009)(53936002)(2501003)(74316002)(99286004)(86362001)(8936002)(81166006); DIR:OUT; SFP:1102; SCL:1; SRVR:PU1P153MB0105; H:PU1P153MB0169.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=decui@microsoft.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 74V4uLFPG1IuryaQ2xH/tYWZmE0g/LxM//T8W2SDO0cv7+xOiHoxtyjsPyHXXEFHZYChFLNnTAFldiMGJ3g36iAtmtANwldBedRMioyhs46BBL5d+deBPJjEHAbuROiYD7ZuR2eADjsxIVRWE8JDBzPOACnO5akGCxIXC79kcjfJFNel6cqDAZbYV7wScIHhCcTeAyTEYpmCPTbVF9Wb6Mx27DkSAVY223vRlwahnwbJKx32kQwR4FNgUW1zoUOPcSE64T0t6DsFi4R8spReWcOS/Tw3jx9rCRgVebYQtrJzdmnYwzuBLLhMxAnZ83Xc8VQCiDkmEgb2w8x1CQ0qx20qvDwc4PVp8wbQOPsKHv2BmOgdBz4oKXIH0RHQ943Vq0KzPENIl+t4WOBdV40F8BQzcWDlgriy6F7jFhivUX8= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c79d2e1-6101-4281-c02d-08d696f1d433 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2019 05:11:10.6202 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1P153MB0105 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Let's export the family info so we can do some family-specific handling in ndctl/monitor.c for Hyper-V NVDIMM. Signed-off-by: Dexuan Cui --- ndctl/lib/libndctl.c | 5 +++++ ndctl/lib/libndctl.sym | 1 + ndctl/libndctl.h | 1 + 3 files changed, 7 insertions(+) diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c index 48bdb27..1186579 100644 --- a/ndctl/lib/libndctl.c +++ b/ndctl/lib/libndctl.c @@ -1550,6 +1550,11 @@ NDCTL_EXPORT struct ndctl_dimm *ndctl_dimm_get_next(struct ndctl_dimm *dimm) return list_next(&bus->dimms, dimm, list); } +NDCTL_EXPORT unsigned long ndctl_dimm_get_cmd_family(struct ndctl_dimm *dimm) +{ + return dimm->cmd_family; +} + NDCTL_EXPORT unsigned int ndctl_dimm_get_handle(struct ndctl_dimm *dimm) { return dimm->handle; diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym index cb9f769..470e895 100644 --- a/ndctl/lib/libndctl.sym +++ b/ndctl/lib/libndctl.sym @@ -38,6 +38,7 @@ global: ndctl_bus_wait_probe; ndctl_dimm_get_first; ndctl_dimm_get_next; + ndctl_dimm_get_cmd_family; ndctl_dimm_get_handle; ndctl_dimm_get_phys_id; ndctl_dimm_get_vendor; diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h index 0debdb6..cb5a8fc 100644 --- a/ndctl/libndctl.h +++ b/ndctl/libndctl.h @@ -145,6 +145,7 @@ struct ndctl_dimm *ndctl_dimm_get_next(struct ndctl_dimm *dimm); for (dimm = ndctl_dimm_get_first(bus); \ dimm != NULL; \ dimm = ndctl_dimm_get_next(dimm)) +unsigned long ndctl_dimm_get_cmd_family(struct ndctl_dimm *dimm); unsigned int ndctl_dimm_get_handle(struct ndctl_dimm *dimm); unsigned short ndctl_dimm_get_phys_id(struct ndctl_dimm *dimm); unsigned short ndctl_dimm_get_vendor(struct ndctl_dimm *dimm);