Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp204547ybs; Tue, 26 May 2020 07:15:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwccdwxu6YlPhBIvIuDfo3KC6oS61jqlnSyXnlLjhKQ3EwDFxdsFvyWzuJEYYgErjHEVyrM X-Received: by 2002:a50:99c9:: with SMTP id n9mr15010149edb.1.1590502541316; Tue, 26 May 2020 07:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590502541; cv=none; d=google.com; s=arc-20160816; b=cjjLfL7XzH+NVRW7eYsZ2k0bODmcUsAg7QRwkuH2YqbW5SZQvchvuX0sNfa2bTqmu8 NZTkcwdC4xv3KQ8IlQIxeQIWOV328iLcvdeqjRQYS5wHbAUg+GEP/ie48jGc+YFYS0/w 87xHCyTANKH7x1AL9V0BNs85SE3TnTQMlmWETMPbYuL2+BSTCVqZsfUpeMzK/3krJ6Zu 9hGIQg3nArYNp0lUbmGoR0PA/OL4fr7TIQGTjKCSwE5In4A5oezx2LaFKuoq5SJCc35m pU16wWOCY5ugv+sQwZgqYEiQpAgMiZChpZLBSscbeYG2pr9sqAnYfbFSFPivQZiv1yIo oQCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=yvsYXwI7dXNMEhJ8bGvEihQOuNoBNPC/wGFY9Be85xg=; b=HT0k83iQx4i91UqJ2d3eap99Pl98xHsT+IC2cds1O2dkqkzExi6fU8yRE0LFNVut3U +S/dMOLWlydKajH6iz5mrO3IxxA3aeNj5n4/Y7ijERSJlJqynWPzHq9pbFe6QqbHZ5tk 0RD58QMEAAcIqb4NHDVZwYvY9jmvX8vTGupOhO4ZxTTzIc29ZfMDi5UajS8hd4VhDdL0 fFVi2nO0n5duCYoasqj/U9VJin/JEZHPSzOkYOmFtjIVY1tAODR9PTLvSsSklXKU0+nf pAJ/2k/p3cHIzVShJ3Y+okajqskYcX9oGZKTOtf1J859ERiLhmXeNe79u3yz6Udg5DDc juhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=jWI5D5V7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df27si7586859edb.441.2020.05.26.07.15.17; Tue, 26 May 2020 07:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=jWI5D5V7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731693AbgEZMOT (ORCPT + 99 others); Tue, 26 May 2020 08:14:19 -0400 Received: from ozlabs.org ([203.11.71.1]:39667 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728682AbgEZMOT (ORCPT ); Tue, 26 May 2020 08:14:19 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49WXvD1JR3z9sRW; Tue, 26 May 2020 22:14:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1590495257; bh=edkHVtYOKN1TVgGDRKISh6yBxBVEyLNdkDMbZWBQadE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jWI5D5V7v1nS5Zu/kPhmvs3xLMxGeKkJ6iQjr/fNYMOTg+mcUqB5qTPqlT8+dPUso W21vKySR0RcRX+BzZRpQwJVNzfGWB1PyKCy7jqsQQaIDKWPXQsD8qdwSOdHrbxrI7z YkLKmvvLfbyd1/tBF9ELEPc87BF6KLYzAPQWtpOxKRwNaZdr38ZyOy2EryhBtYUC/j LBwq3hVjVebNuRw6eVDs6ynqeL3hcPcj8GDQbEc1ygosaYGPm4FIJZrQqKwoqtKTdM zYFV1CbzFadMKF7jhg9nvAOhk5c/oRbdXzM1+TLQoNFqzkRBOdl1l1mXKGgKGib8Xb 8pUdR5p3WJ5Pw== From: Michael Ellerman To: Vaibhav Jain , Ira Weiny Cc: "Aneesh Kumar K . V" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Steven Rostedt , linux-nvdimm@lists.01.org Subject: Re: [RESEND PATCH v7 4/5] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods In-Reply-To: <87a71ww7f9.fsf@linux.ibm.com> References: <20200519190058.257981-1-vaibhav@linux.ibm.com> <20200519190058.257981-5-vaibhav@linux.ibm.com> <20200520153209.GC3660833@iweiny-DESK2.sc.intel.com> <87367t941j.fsf@mpe.ellerman.id.au> <87ftbswhb6.fsf@linux.ibm.com> <87a71ww7f9.fsf@linux.ibm.com> Date: Tue, 26 May 2020 22:14:39 +1000 Message-ID: <875zcigafk.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vaibhav Jain writes: > Hi Ira, Mpe and Aneesh, > > Vaibhav Jain writes: > >> Michael Ellerman writes: >> >>> Ira Weiny writes: >>>> On Wed, May 20, 2020 at 12:30:57AM +0530, Vaibhav Jain wrote: >>>>> Introduce support for Papr nvDimm Specific Methods (PDSM) in papr_scm >>>>> modules and add the command family to the white list of NVDIMM command >>>>> sets. Also advertise support for ND_CMD_CALL for the dimm >>>>> command mask and implement necessary scaffolding in the module to >>>>> handle ND_CMD_CALL ioctl and PDSM requests that we receive. >>> ... >>>>> + * >>>>> + * Payload Version: >>>>> + * >>>>> + * A 'payload_version' field is present in PDSM header that indicates a specific >>>>> + * version of the structure present in PDSM Payload for a given PDSM command. >>>>> + * This provides backward compatibility in case the PDSM Payload structure >>>>> + * evolves and different structures are supported by 'papr_scm' and 'libndctl'. >>>>> + * >>>>> + * When sending a PDSM Payload to 'papr_scm', 'libndctl' should send the version >>>>> + * of the payload struct it supports via 'payload_version' field. The 'papr_scm' >>>>> + * module when servicing the PDSM envelope checks the 'payload_version' and then >>>>> + * uses 'payload struct version' == MIN('payload_version field', >>>>> + * 'max payload-struct-version supported by papr_scm') to service the PDSM. >>>>> + * After servicing the PDSM, 'papr_scm' put the negotiated version of payload >>>>> + * struct in returned 'payload_version' field. >>>> >>>> FWIW many people believe using a size rather than version is more sustainable. >>>> It is expected that new payload structures are larger (more features) than the >>>> previous payload structure. >>>> >>>> I can't find references at the moment through. >>> >>> I think clone_args is a good modern example: >>> >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/sched.h#n88 >> >> Thank Ira and Mpe for pointing this out. I looked into how clone3 sycall >> handles clone_args and few differences came out: >> >> * Unlike clone_args that are always transferred in one direction from >> user-space to kernel, payload contents of pdsms are transferred in both >> directions. Having a single version number makes it easier for >> user-space and kernel to determine what data will be exchanged. >> >> * For PDSMs, the version number is negotiated between libndctl and >> kernel. For example in case kernel only supports an older version of >> a structure, its free to send a lower version number back to >> libndctl. Such negotiations doesnt happen with clone3 syscall. > > If you are ok with the explaination above please let me know. I will > quickly spin off a v8 addressing your review comments. I don't have strong opinions about the user API, it's really up to the nvdimm folks. cheers