Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751409AbdH1VG0 (ORCPT ); Mon, 28 Aug 2017 17:06:26 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:35115 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbdH1VGY (ORCPT ); Mon, 28 Aug 2017 17:06:24 -0400 MIME-Version: 1.0 In-Reply-To: <20170828205033.GA6859@anatevka.americas.hpqcorp.net> References: <150393513271.10003.253995897844648312.stgit@dwillia2-desk3.amr.corp.intel.com> <20170828205033.GA6859@anatevka.americas.hpqcorp.net> From: Dan Williams Date: Mon, 28 Aug 2017 14:06:23 -0700 Message-ID: Subject: Re: [PATCH] libnvdimm: clean up command definitions To: Jerry Hoemann Cc: "linux-nvdimm@lists.01.org" , Yasunori Goto , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1622 Lines: 36 On Mon, Aug 28, 2017 at 1:50 PM, Jerry Hoemann wrote: > > On Mon, Aug 28, 2017 at 08:45:32AM -0700, Dan Williams wrote: >> Remove the command payloads that do not have an associated libnvdimm >> ioctl. I.e. remove the payloads that would only ever be carried in the >> ND_CMD_CALL envelope. This prevents userspace from growing unnecessary >> dependencies on this kernel header when userspace already has everything >> it needs to craft and send these commands. > > Userspace needs to include linux/ndctl.h to make the call as > that is where nd_cmd_pkg is defined. > > So you want to have some structures defined in ndctl.h and other > defined in the to be created libndctl-nfit.h? Plus a third header > file for the HPE non-root calls? Yes. ndctl.h exports the ioctl command payloads, everything that goes inside of ND_CMD_CALL is defined by userspace headers. The libndctl-nfit.h header is proposed as a place to land vendor agnostic NFIT-defined payloads, and any vendor specific definitions would remain internal to libndctl as they are today. > Will libndctl-nfit.h be generally available and installed? Yes, that's the plan. > Will it be clean so that other applications can use it to get these > definitions? Or will it be loaded w/ a bunch of stuff only useful > to your ndctl command? Yes, that's the plan. It's a bug if libndctl-nfit.h is not generically clean for issuing the NFIT root device commands via some ND_CMD_CALL helpers from the base libndctl library. In other words libndctl-nfit.h defines the payload and libndctl defines some general helpers for issuing commands.