Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp778627pxf; Thu, 11 Mar 2021 14:56:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOonCI3D5WvakbMVcZhrkP0B2UB34bPY1mYEKd46EIDg+SNKRyKZWR/5qlNoXFhne9+++d X-Received: by 2002:aa7:c403:: with SMTP id j3mr10933502edq.137.1615503416580; Thu, 11 Mar 2021 14:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615503416; cv=none; d=google.com; s=arc-20160816; b=n7ojesjULe/ch201TCJBWaIMoKcWTQfoIrXAP0d4gQxlL2FBytJK8JjSRwlGYCFXjW 9R2lU35M5VAzYwWTBjs0xcwq8Z7AtvNmdshulG8XxQnt787mkINeP3WFByrQynhjnK71 1ZMnJzgpM8/hBuQ1vPZxS8DoURQvyg4UsVuY1YWpBU3umQqFSZPSo5yI4IHjBhiVOcKZ egdDAnSlgDHLP+xdUMY5ff+yAAytOpttkAAJYXhTTPHV91tEgYsTeaUnyuL1mfqabcnb WbUITv7cGwtuTxyle9Xg0Cz7oBGY9RZbSFoXkdhygggfYf3gc+7AJDngVVrZxhUBZqK7 CIWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:ironport-sdr:ironport-sdr; bh=3CvboPyoR8R2RMeegtsktI+uLRs3U8aVAdjQs7dd6Gk=; b=od47WdoDq2IVzCHteGZ9UxpxreMfRoEqz8UPPnPLGliCnDvZih3qGjVNyJEuFJRx8i fNgq4Q64gM/zBSCfTkXO7tAWs8PsVhoKGmvjYxj5VXopy+9qwOJUHJfTfNx42u4Kgmqp z9hyn05M6gRQViHs+OgccOgtSMc2unG8c6MSt3K5fnfhR7keCo64LEdhehjSi/IRinqA lzL7NP5fhRaS+J8NKSO96l6EDSdWutrWkCOiZB9nqcwJ2UEZ7C4idsbuKKf/pRgxzyUP dfgn/LS2YYBD4KccyFrf78+eIX2FGO7F6qN+jHo1MDqxhA7x70LmigYU4vLej7ckJygR pVYg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx12si2755414edb.404.2021.03.11.14.56.34; Thu, 11 Mar 2021 14:56:56 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbhCKWxg (ORCPT + 99 others); Thu, 11 Mar 2021 17:53:36 -0500 Received: from mga05.intel.com ([192.55.52.43]:44677 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbhCKWxS (ORCPT ); Thu, 11 Mar 2021 17:53:18 -0500 IronPort-SDR: IMqukzmAhFaQgJrcBIODLP5YjqoPPS50dfdBkSlQZGMQ1LeY7TEOth9Ftb/Mr0H+9UIDJ3fInh laelCMkgQdMg== X-IronPort-AV: E=McAfee;i="6000,8403,9920"; a="273792716" X-IronPort-AV: E=Sophos;i="5.81,241,1610438400"; d="scan'208";a="273792716" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2021 14:53:14 -0800 IronPort-SDR: BnU1jTB+qrvPQr9QBSa1HELuTsIJnS5daNkpyismq4WJ6r58rUNJ+KBsbgbfqudFcqDQrCbdJE AMHvxLTGZ7SA== X-IronPort-AV: E=Sophos;i="5.81,241,1610438400"; d="scan'208";a="448439603" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2021 14:53:14 -0800 Date: Thu, 11 Mar 2021 14:55:34 -0800 From: Jacob Pan To: Jason Gunthorpe Cc: LKML , Joerg Roedel , Lu Baolu , David Woodhouse , iommu@lists.linux-foundation.org, cgroups@vger.kernel.org, Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Alex Williamson , Eric Auger , Jonathan Corbet , Raj Ashok , "Tian, Kevin" , Yi Liu , Wu Hao , Dave Jiang , jacob.jun.pan@linux.intel.com Subject: Re: [RFC PATCH 18/18] ioasid: Add /dev/ioasid for userspace Message-ID: <20210311145534.6fe9bb9a@jacob-builder> In-Reply-To: <20210310192301.GC2356281@nvidia.com> References: <1614463286-97618-1-git-send-email-jacob.jun.pan@linux.intel.com> <1614463286-97618-19-git-send-email-jacob.jun.pan@linux.intel.com> <20210310192301.GC2356281@nvidia.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, Thanks for the review. On Wed, 10 Mar 2021 15:23:01 -0400, Jason Gunthorpe wrote: > On Sat, Feb 27, 2021 at 02:01:26PM -0800, Jacob Pan wrote: > > > +/* -------- IOCTLs for IOASID file descriptor (/dev/ioasid) -------- */ > > + > > +/** > > + * IOASID_GET_API_VERSION - _IO(IOASID_TYPE, IOASID_BASE + 0) > > + * > > + * Report the version of the IOASID API. This allows us to bump the > > entire > > + * API version should we later need to add or change features in > > incompatible > > + * ways. > > + * Return: IOASID_API_VERSION > > + * Availability: Always > > + */ > > +#define IOASID_GET_API_VERSION _IO(IOASID_TYPE, > > IOASID_BASE + 0) > > I think this is generally a bad idea, if you change the API later then > also change the ioctl numbers and everything should work out > > eg use the 4th argument to IOC to specify something about the ABI > Let me try to understand the idea, do you mean something like this? #define IOASID_GET_INFO _IOC(_IOC_NONE, IOASID_TYPE, IOASID_BASE + 1, sizeof(struct ioasid_info)) If we later change the size of struct ioasid_info, IOASID_GET_INFO would be a different ioctl number. Then we will break the existing user space that uses the old number. So I am guessing you meant we need to have a different name also. i.e. #define IOASID_GET_INFO_V2 _IOC(_IOC_NONE, IOASID_TYPE, IOASID_BASE + 1, sizeof(struct ioasid_info_v2)) We can get rid of the API version, just have individual IOCTL version. Is that right? > Jason Thanks, Jacob