1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2019 Broadcom
6 #ifndef _ULP_MARK_MGR_H_
7 #define _ULP_MARK_MGR_H_
11 #define BNXT_ULP_MARK_VALID 0x1
12 #define BNXT_ULP_MARK_VFR_ID 0x2
13 #define BNXT_ULP_MARK_GLOBAL_HW_FID 0x4
14 #define BNXT_ULP_MARK_LOCAL_HW_FID 0x8
16 struct bnxt_lfid_mark_info {
21 struct bnxt_gfid_mark_info {
26 struct bnxt_ulp_mark_tbl {
27 struct bnxt_lfid_mark_info *lfid_tbl;
28 struct bnxt_gfid_mark_info *gfid_tbl;
29 uint32_t lfid_num_entries;
30 uint32_t gfid_num_entries;
32 uint32_t gfid_type_bit;
36 * Allocate and Initialize all Mark Manager resources for this ulp context.
38 * Initialize MARK database for GFID & LFID tables
39 * GFID: Global flow id which is based on EEM hash id.
40 * LFID: Local flow id which is the CFA action pointer.
41 * GFID is used for EEM flows, LFID is used for EM flows.
43 * Flow mapper modules adds mark_id in the MARK database.
45 * BNXT PMD receive handler extracts the hardware flow id from the
46 * received completion record. Fetches mark_id from the MARK
47 * database using the flow id. Injects mark_id into the packet's mbuf.
49 * ctxt [in] The ulp context for the mark manager.
52 ulp_mark_db_init(struct bnxt_ulp_context *ctxt);
55 * Release all resources in the Mark Manager for this ulp context
57 * ctxt [in] The ulp context for the mark manager
60 ulp_mark_db_deinit(struct bnxt_ulp_context *ctxt);
63 * Get a Mark from the Mark Manager
65 * ctxt [in] The ulp context for the mark manager
67 * is_gfid [in] The type of fid (GFID or LFID)
69 * fid [in] The flow id that is returned by HW in BD
71 * vfr_flag [out].it indicatesif mark is vfr_id or mark id
73 * mark [out] The mark that is associated with the FID
77 ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
84 * Adds a Mark to the Mark Manager
86 * ctxt [in] The ulp context for the mark manager
88 * mark_flag [in] mark flags.
90 * fid [in] The flow id that is returned by HW in BD
92 * mark [in] The mark to be associated with the FID
96 ulp_mark_db_mark_add(struct bnxt_ulp_context *ctxt,
102 * Removes a Mark from the Mark Manager
104 * ctxt [in] The ulp context for the mark manager
106 * mark_flag [in] mark flags
108 * fid [in] The flow id that is returned by HW in BD
112 ulp_mark_db_mark_del(struct bnxt_ulp_context *ctxt,
116 #endif /* _ULP_MARK_MGR_H_ */