Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 : #ifndef HCCLV2_UB_JETTY_ID_LITE_H
11 : #define HCCLV2_UB_JETTY_ID_LITE_H
12 :
13 : #include "hccl/base.h"
14 :
15 : namespace Hccl {
16 :
17 : struct UbJettyLiteId {
18 : u32 dieId_;
19 : u32 funcId_;
20 : u32 jettyId_;
21 :
22 17 : u32 GetDieId() const
23 : {
24 17 : return dieId_;
25 : }
26 :
27 1 : u32 GetFuncId() const
28 : {
29 1 : return funcId_;
30 : }
31 :
32 1 : u32 GetJettyId() const
33 : {
34 1 : return jettyId_;
35 : }
36 :
37 45 : UbJettyLiteId(u32 dieId, u32 funcId, u32 jettyId) : dieId_(dieId), funcId_(funcId), jettyId_(jettyId)
38 : {
39 45 : }
40 : };
41 :
42 : struct UbJettyLiteAttr {
43 : const u64 dbAddr_;
44 : const u64 sqVa_;
45 : const u32 sqDepth_;
46 : const u32 tpn_;
47 : const bool dwqeCacheLocked_;
48 : const u32 jfcPollMode_; // 0代表STARS POLL, 1代表软件Poll
49 : const u64 sqCiAddr_; // 预留给 软件poll CQ 的Jetty使用
50 34 : UbJettyLiteAttr(u64 dbAddr, u64 sqVa, u32 sqDepth, u32 tpn, bool dwqeCacheLocked = false, u32 jfcPollMode = 0,
51 : u64 sqCiAddr = 0)
52 34 : : dbAddr_(dbAddr), sqVa_(sqVa), sqDepth_(sqDepth), tpn_(tpn), dwqeCacheLocked_(dwqeCacheLocked),
53 34 : jfcPollMode_(jfcPollMode), sqCiAddr_(sqCiAddr)
54 : {
55 34 : }
56 : };
57 :
58 : } // namespace Hccl
59 : #endif
|