/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2019-2020 Broadcom
+ * Copyright(c) 2019-2021 Broadcom
* All rights reserved.
*/
#include "rte_ethdev.h"
#include "ulp_template_db_enum.h"
+#include "ulp_tun.h"
+#include "bnxt_tf_common.h"
/* NAT defines to reuse existing inner L2 SMAC and DMAC */
#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC 0x2000
uint32_t dev_id; /* Hardware device id */
uint32_t ref_cnt;
struct bnxt_ulp_flow_db *flow_db;
+ pthread_mutex_t flow_db_lock;
void *mapper_data;
struct bnxt_ulp_port_db *port_db;
struct bnxt_ulp_fc_info *fc_info;
uint32_t ulp_flags;
struct bnxt_ulp_df_rule_info df_rule_info[RTE_MAX_ETHPORTS];
struct bnxt_ulp_vfr_rule_info vfr_rule_info[RTE_MAX_ETHPORTS];
+ enum bnxt_ulp_flow_mem_type mem_type;
+#define BNXT_ULP_TUN_ENTRY_INVALID -1
+#define BNXT_ULP_MAX_TUN_CACHE_ENTRIES 16
+ struct bnxt_tun_cache_entry tun_tbl[BNXT_ULP_MAX_TUN_CACHE_ENTRIES];
};
struct bnxt_ulp_context {
int32_t
bnxt_ulp_cntxt_dev_id_get(struct bnxt_ulp_context *ulp_ctx, uint32_t *dev_id);
+/* Function to get whether or not ext mem is used for EM */
+int32_t
+bnxt_ulp_cntxt_mem_type_get(struct bnxt_ulp_context *ulp_ctx,
+ enum bnxt_ulp_flow_mem_type *mem_type);
+
+/* Function to set whether or not ext mem is used for EM */
+int32_t
+bnxt_ulp_cntxt_mem_type_set(struct bnxt_ulp_context *ulp_ctx,
+ enum bnxt_ulp_flow_mem_type mem_type);
+
/* Function to set the table scope id of the EEM table. */
int32_t
bnxt_ulp_cntxt_tbl_scope_id_set(struct bnxt_ulp_context *ulp_ctx,
struct bnxt_ulp_flow_db *
bnxt_ulp_cntxt_ptr2_flow_db_get(struct bnxt_ulp_context *ulp_ctx);
+/* Function to get the tunnel cache table info from the ulp context. */
+struct bnxt_tun_cache_entry *
+bnxt_ulp_cntxt_ptr2_tun_tbl_get(struct bnxt_ulp_context *ulp_ctx);
+
/* Function to get the ulp context from eth device. */
struct bnxt_ulp_context *
bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev *dev);
bnxt_ulp_cntxt_ptr2_ulp_vfr_info_get(struct bnxt_ulp_context *ulp_ctx,
uint32_t port_id);
+int32_t
+bnxt_ulp_cntxt_acquire_fdb_lock(struct bnxt_ulp_context *ulp_ctx);
+
+void
+bnxt_ulp_cntxt_release_fdb_lock(struct bnxt_ulp_context *ulp_ctx);
+
+int32_t
+ulp_post_process_tun_flow(struct ulp_rte_parser_params *params);
+
#endif /* _BNXT_ULP_H_ */