Repository navigation
Expand file tree
/
Copy pathneuron_topsp.h
More file actions
61 lines (52 loc) · 1.7 KB
/
Copy pathneuron_topsp.h
File metadata and controls
61 lines (52 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright 2021, Amazon.com, Inc. or its affiliates. All Rights Reserved
*/
#ifndef NEURON_TOPSP_H
#define NEURON_TOPSP_H
/**
* ts_nq_init() - Initialize notification queue for TopSp.
*
* @nd: neuron device
* @ts_id: TopSp Id
* @eng_index: notification engine index in the core
* @nq_type: type of the notification queue
* @size: size of queue in bytes
* @on_host_memory: if true, NQ is created in host memory
* @hbm_index: If NQ is created on device memory which HBM to use.
* @force_alloc_mem: If true, force allocate new memory (and delete already allocated memory, if any)
* @nq_mc[out]: memchunk used by the NQ will be written here
* @mc_ptr[out]: Pointer to memchunk backing this NQ
*
* Return: 0 on if initialization succeeds, a negative error code otherwise.
*/
int ts_nq_init(struct neuron_device *nd, u8 ts_id, u8 eng_index, u32 nq_type, u32 size,
u32 on_host_memory, u32 hbm_index,
bool force_alloc_mem, struct mem_chunk **nq_mc, u64 *mmap_offset);
/**
* ts_nq_destroy() - Cleanup and free notification queue.
*
* @nd: neuron device
* @ts_id: core index in the device
* @eng_index: notification engine index in the core
* @nq_type: type of the notification queue
*
* Return: 0 on success, a negative error code otherwise.
*/
int ts_nq_destroy(struct neuron_device *nd, u8 ts_id, u8 eng_index, u32 nq_type);
/**
* ts_nq_destroy_one() - Disable notification in the device
*
* @nd: neuron device
* @ts_id: topsp id
*
*/
void ts_nq_destroy_one(struct neuron_device *nd, u8 ts_id);
/**
* ts_nq_destroy_all() - Disable notification in the device
*
* @nd: neuron device
*
*/
void ts_nq_destroy_all(struct neuron_device *nd);
#endif