diff options
author | Tomer Tayar <ttayar@habana.ai> | 2020-09-02 13:43:32 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2020-11-30 11:47:38 +0300 |
commit | f44afb5b5a5d04448da843b2fe872e01669bc317 (patch) | |
tree | 58e09eb0ae0899232ecde2c7b90c3febc15c1e07 /include/uapi/misc | |
parent | f07486745442f6118ede18e2b52ee7be69cde5a4 (diff) | |
download | linux-f44afb5b5a5d04448da843b2fe872e01669bc317.tar.xz |
habanalabs: Add CB IOCTL opcode to retrieve CB information
Add a new CB IOCTL opcode that enables a user to query about a CB and
get its usage count.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'include/uapi/misc')
-rw-r--r-- | include/uapi/misc/habanalabs.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h index 6eff4e05eccb..8c15a7d336a0 100644 --- a/include/uapi/misc/habanalabs.h +++ b/include/uapi/misc/habanalabs.h @@ -483,6 +483,8 @@ struct hl_info_args { #define HL_CB_OP_CREATE 0 /* Opcode to destroy previously created command buffer */ #define HL_CB_OP_DESTROY 1 +/* Opcode to retrieve information about a command buffer */ +#define HL_CB_OP_INFO 2 /* 2MB minus 32 bytes for 2xMSG_PROT */ #define HL_MAX_CB_SIZE (0x200000 - 32) @@ -506,8 +508,17 @@ struct hl_cb_in { }; struct hl_cb_out { - /* Handle of CB */ - __u64 cb_handle; + union { + /* Handle of CB */ + __u64 cb_handle; + + /* Information about CB */ + struct { + /* Usage count of CB */ + __u32 usage_cnt; + __u32 pad; + }; + }; }; union hl_cb_args { |