1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2020 Broadcom
7 #include <rte_common.h>
13 #include "tf_em_common.h"
17 #include "tf_ext_flow_handle.h"
22 /** insert EEM entry API
26 * TF_ERR - unable to get lock
28 * insert callback returns:
30 * TF_ERR_EM_DUP - key is already in table
33 tf_insert_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb __rte_unused,
34 struct tf_insert_em_entry_parms *parms __rte_unused)
39 /** delete EEM hash entry API
43 * -EINVAL - parameter error
44 * TF_NO_SESSION - bad session ID
45 * TF_ERR_TBL_SCOPE - invalid table scope
46 * TF_ERR_TBL_IF - invalid table interface
48 * insert callback returns
50 * TF_NO_EM_MATCH - entry not found
53 tf_delete_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb __rte_unused,
54 struct tf_delete_em_entry_parms *parms __rte_unused)
59 /** insert EM hash entry API
66 tf_em_insert_ext_sys_entry(struct tf *tfp,
67 struct tf_insert_em_entry_parms *parms)
69 struct tf_tbl_scope_cb *tbl_scope_cb;
71 tbl_scope_cb = tbl_scope_cb_find
72 ((struct tf_session *)(tfp->session->core_data),
74 if (tbl_scope_cb == NULL) {
75 TFP_DRV_LOG(ERR, "Invalid tbl_scope_cb\n");
79 return tf_insert_eem_entry
80 (tbl_scope_cb, parms);
83 /** Delete EM hash entry API
90 tf_em_delete_ext_sys_entry(struct tf *tfp,
91 struct tf_delete_em_entry_parms *parms)
93 struct tf_tbl_scope_cb *tbl_scope_cb;
95 tbl_scope_cb = tbl_scope_cb_find
96 ((struct tf_session *)(tfp->session->core_data),
98 if (tbl_scope_cb == NULL) {
99 TFP_DRV_LOG(ERR, "Invalid tbl_scope_cb\n");
103 return tf_delete_eem_entry(tbl_scope_cb, parms);
107 tf_em_ext_system_alloc(struct tf *tfp __rte_unused,
108 struct tf_alloc_tbl_scope_parms *parms __rte_unused)
114 tf_em_ext_system_free(struct tf *tfp __rte_unused,
115 struct tf_free_tbl_scope_parms *parms __rte_unused)