From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-accelerators@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
Kenneth Lee <liguozhu@hisilicon.com>,
Zaibo Xu <xuzaibo@huawei.com>,
Zhou Wang <wangzhou1@hisilicon.com>
Subject: Re: [PATCH 2/2] uacce: add uacce module
Date: Thu, 15 Aug 2019 16:12:25 +0200 [thread overview]
Message-ID: <20190815141225.GC23267@kroah.com> (raw)
In-Reply-To: <1565775265-21212-3-git-send-email-zhangfei.gao@linaro.org>
On Wed, Aug 14, 2019 at 05:34:25PM +0800, Zhangfei Gao wrote:
> diff --git a/include/uapi/misc/uacce.h b/include/uapi/misc/uacce.h
> new file mode 100644
> index 0000000..44a0a5d
> --- /dev/null
> +++ b/include/uapi/misc/uacce.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +#ifndef _UAPIUUACCE_H
> +#define _UAPIUUACCE_H
> +
> +#include <linux/types.h>
> +#include <linux/ioctl.h>
> +
> +#define UACCE_CLASS_NAME "uacce"
Why is this in a uapi file?
> +#define UACCE_DEV_ATTRS "attrs"
Same here.
> +#define UACCE_CMD_SHARE_SVAS _IO('W', 0)
> +#define UACCE_CMD_START _IO('W', 1)
> +#define UACCE_CMD_GET_SS_DMA _IOR('W', 2, unsigned long)
> +
> +/**
> + * UACCE Device Attributes:
> + *
> + * NOIOMMU: the device has no IOMMU support
> + * can do share sva, but no map to the dev
> + * PASID: the device has IOMMU which support PASID setting
> + * can do share sva, mapped to dev per process
> + * FAULT_FROM_DEV: the device has IOMMU which can do page fault request
> + * no need for share sva, should be used with PASID
> + * SVA: full function device
> + * SHARE_DOMAIN: no PASID, can do share sva only for one process and the kernel
> + */
> +#define UACCE_DEV_NOIOMMU (1 << 0)
> +#define UACCE_DEV_PASID (1 << 1)
> +#define UACCE_DEV_FAULT_FROM_DEV (1 << 2)
> +#define UACCE_DEV_SVA (UACCE_DEV_PASID | UACCE_DEV_FAULT_FROM_DEV)
> +#define UACCE_DEV_SHARE_DOMAIN (0)
> +
> +#define UACCE_API_VER_NOIOMMU_SUBFIX "_noiommu"
> +
> +#define UACCE_QFR_NA ((unsigned long)-1)
> +enum uacce_qfrt {
> + UACCE_QFRT_MMIO = 0, /* device mmio region */
> + UACCE_QFRT_DKO, /* device kernel-only */
> + UACCE_QFRT_DUS, /* device user share */
> + UACCE_QFRT_SS, /* static share memory */
> + UACCE_QFRT_MAX,
These enums need to be explicitly set, as per the documentation,
otherwise they could be messed up when dealing with odd compilers.
> +};
> +#define UACCE_QFRT_INVALID UACCE_QFRT_MAX
Why not just use INVALID instead of MAX?
thanks,
greg k-h
next prev parent reply other threads:[~2019-08-15 14:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 9:34 [PATCH 0/2] A General Accelerator Framework, WarpDrive Zhangfei Gao
2019-08-14 9:34 ` [PATCH 1/2] uacce: Add documents for WarpDrive/uacce Zhangfei Gao
2019-08-14 9:34 ` [PATCH 2/2] uacce: add uacce module Zhangfei Gao
2019-08-15 14:12 ` Greg Kroah-Hartman [this message]
[not found] ` <5d5a6757.1c69fb81.e0678.2ab2SMTPIN_ADDED_BROKEN@mx.google.com>
2019-08-19 10:22 ` Greg Kroah-Hartman
2019-08-20 12:38 ` zhangfei
2019-08-20 14:31 ` Greg Kroah-Hartman
2019-08-15 14:13 ` Greg Kroah-Hartman
2019-08-20 13:08 ` zhangfei
2019-08-20 16:59 ` Greg Kroah-Hartman
[not found] ` <5d5cf0fc.1c69fb81.ec57f.b853SMTPIN_ADDED_BROKEN@mx.google.com>
2019-08-21 9:17 ` Greg Kroah-Hartman
2019-08-21 14:30 ` zhangfei
2019-08-21 16:05 ` Greg Kroah-Hartman
2019-08-26 4:10 ` Kenneth Lee
2019-08-26 4:29 ` Greg Kroah-Hartman
2019-08-27 11:42 ` Kenneth Lee
2019-08-27 18:48 ` Greg Kroah-Hartman
2019-08-15 14:20 ` Greg Kroah-Hartman
[not found] ` <5d5a6f5b.1c69fb81.9d35e.5303SMTPIN_ADDED_BROKEN@mx.google.com>
2019-08-19 10:24 ` Greg Kroah-Hartman
2019-08-20 12:36 ` zhangfei
2019-08-20 14:33 ` Greg Kroah-Hartman
2019-08-24 12:53 ` zhangfei
2019-08-24 15:40 ` Greg Kroah-Hartman
2019-08-15 16:54 ` Jonathan Cameron
2019-08-23 9:21 ` zhangfei
2019-08-23 16:36 ` Jonathan Cameron
2019-08-23 16:42 ` Jonathan Cameron
2019-08-15 17:04 ` [PATCH 0/2] A General Accelerator Framework, WarpDrive Jerome Glisse
2019-08-20 14:26 ` zhangfei
2019-08-26 4:14 ` Kenneth Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190815141225.GC23267@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=liguozhu@hisilicon.com \
--cc=linux-accelerators@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=xuzaibo@huawei.com \
--cc=zhangfei.gao@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome