1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2020 Broadcom
11 #include <sys/queue.h>
13 #include "rte_ethdev.h"
15 struct bnxt_ulp_data {
16 uint32_t tbl_scope_id;
17 struct bnxt_ulp_mark_tbl *mark_tbl;
18 uint32_t dev_id; /* Hardware device id */
20 struct bnxt_ulp_flow_db *flow_db;
23 struct bnxt_ulp_context {
24 struct bnxt_ulp_data *cfg_data;
25 /* TBD The tfp should be removed once tf_attach is implemented. */
29 struct bnxt_ulp_pci_info {
34 struct bnxt_ulp_session_state {
35 STAILQ_ENTRY(bnxt_ulp_session_state) next;
37 pthread_mutex_t bnxt_ulp_mutex;
38 struct bnxt_ulp_pci_info pci_info;
39 struct bnxt_ulp_data *cfg_data;
40 /* TBD The tfp should be removed once tf_attach is implemented. */
42 uint32_t session_opened;
45 /* ULP flow id structure */
50 /* Function to set the device id of the hardware. */
52 bnxt_ulp_cntxt_dev_id_set(struct bnxt_ulp_context *ulp_ctx, uint32_t dev_id);
54 /* Function to get the device id of the hardware. */
56 bnxt_ulp_cntxt_dev_id_get(struct bnxt_ulp_context *ulp_ctx, uint32_t *dev_id);
58 /* Function to set the table scope id of the EEM table. */
60 bnxt_ulp_cntxt_tbl_scope_id_set(struct bnxt_ulp_context *ulp_ctx,
61 uint32_t tbl_scope_id);
63 /* Function to get the table scope id of the EEM table. */
65 bnxt_ulp_cntxt_tbl_scope_id_get(struct bnxt_ulp_context *ulp_ctx,
66 uint32_t *tbl_scope_id);
68 /* Function to set the tfp session details in the ulp context. */
70 bnxt_ulp_cntxt_tfp_set(struct bnxt_ulp_context *ulp, struct tf *tfp);
72 /* Function to get the tfp session details from ulp context. */
74 bnxt_ulp_cntxt_tfp_get(struct bnxt_ulp_context *ulp);
76 /* Get the device table entry based on the device id. */
77 struct bnxt_ulp_device_params *
78 bnxt_ulp_device_params_get(uint32_t dev_id);
81 bnxt_ulp_ctxt_ptr2_mark_db_set(struct bnxt_ulp_context *ulp_ctx,
82 struct bnxt_ulp_mark_tbl *mark_tbl);
84 struct bnxt_ulp_mark_tbl *
85 bnxt_ulp_ctxt_ptr2_mark_db_get(struct bnxt_ulp_context *ulp_ctx);
87 /* Function to set the flow database to the ulp context. */
89 bnxt_ulp_cntxt_ptr2_flow_db_set(struct bnxt_ulp_context *ulp_ctx,
90 struct bnxt_ulp_flow_db *flow_db);
92 /* Function to get the flow database from the ulp context. */
93 struct bnxt_ulp_flow_db *
94 bnxt_ulp_cntxt_ptr2_flow_db_get(struct bnxt_ulp_context *ulp_ctx);
96 /* Function to get the ulp context from eth device. */
97 struct bnxt_ulp_context *
98 bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev *dev);
100 #endif /* _BNXT_ULP_H_ */