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 __rte_unused,
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(parms->tbl_scope_id);
72 if (tbl_scope_cb == NULL) {
73 TFP_DRV_LOG(ERR, "Invalid tbl_scope_cb\n");
77 return tf_insert_eem_entry
78 (tbl_scope_cb, parms);
81 /** Delete EM hash entry API
88 tf_em_delete_ext_sys_entry(struct tf *tfp __rte_unused,
89 struct tf_delete_em_entry_parms *parms)
91 struct tf_tbl_scope_cb *tbl_scope_cb;
93 tbl_scope_cb = tbl_scope_cb_find(parms->tbl_scope_id);
94 if (tbl_scope_cb == NULL) {
95 TFP_DRV_LOG(ERR, "Invalid tbl_scope_cb\n");
99 return tf_delete_eem_entry(tbl_scope_cb, parms);
103 tf_em_ext_system_alloc(struct tf *tfp __rte_unused,
104 struct tf_alloc_tbl_scope_parms *parms __rte_unused)
110 tf_em_ext_system_free(struct tf *tfp __rte_unused,
111 struct tf_free_tbl_scope_parms *parms __rte_unused)
116 int tf_tbl_ext_system_set(struct tf *tfp __rte_unused,
117 struct tf_tbl_set_parms *parms __rte_unused)