5948683561f26ee52d03759854dc150e9697f652
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_mark_mgr.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2019 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _ULP_MARK_MGR_H_
7 #define _ULP_MARK_MGR_H_
8
9 #include "bnxt_ulp.h"
10
11 #define ULP_MARK_INVALID (0)
12 struct bnxt_lfid_mark_info {
13         uint16_t        mark_id;
14         bool            valid;
15 };
16
17 struct bnxt_gfid_mark_info {
18         uint32_t        mark_id;
19         bool            valid;
20 };
21
22 struct bnxt_ulp_mark_tbl {
23         struct bnxt_lfid_mark_info      *lfid_tbl;
24         struct bnxt_gfid_mark_info      *gfid_tbl;
25         uint32_t                        gfid_mask;
26         uint32_t                        gfid_type_bit;
27         uint32_t                        gfid_max;
28 };
29
30 /*
31  * Allocate and Initialize all Mark Manager resources for this ulp context.
32  *
33  * Initialize MARK database for GFID & LFID tables
34  * GFID: Global flow id which is based on EEM hash id.
35  * LFID: Local flow id which is the CFA action pointer.
36  * GFID is used for EEM flows, LFID is used for EM flows.
37  *
38  * Flow mapper modules adds mark_id in the MARK database.
39  *
40  * BNXT PMD receive handler extracts the hardware flow id from the
41  * received completion record. Fetches mark_id from the MARK
42  * database using the flow id. Injects mark_id into the packet's mbuf.
43  *
44  * ctxt [in] The ulp context for the mark manager.
45  */
46 int32_t
47 ulp_mark_db_init(struct bnxt_ulp_context *ctxt);
48
49 /*
50  * Release all resources in the Mark Manager for this ulp context
51  *
52  * ctxt [in] The ulp context for the mark manager
53  */
54 int32_t
55 ulp_mark_db_deinit(struct bnxt_ulp_context *ctxt);
56
57 #endif /* _ULP_MARK_MGR_H_ */