MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nfp_flow_destroy

Function nfp_flow_destroy

dpdk/drivers/net/nfp/nfp_flow.c:4022–4128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4020}
4021
4022int
4023nfp_flow_destroy(struct rte_eth_dev *dev,
4024 struct rte_flow *nfp_flow,
4025 struct rte_flow_error *error)
4026{
4027 int ret;
4028 uint64_t cookie;
4029 struct rte_flow *flow_find;
4030 struct nfp_flow_priv *priv;
4031 struct nfp_ct_map_entry *me;
4032 struct nfp_app_fw_flower *app_fw_flower;
4033 struct nfp_flower_representor *representor;
4034
4035 representor = dev->data->dev_private;
4036 app_fw_flower = representor->app_fw_flower;
4037 priv = app_fw_flower->flow_priv;
4038
4039 /* Find the flow in ct_map_table */
4040 cookie = rte_be_to_cpu_64(nfp_flow->payload.meta->host_cookie);
4041 me = nfp_ct_map_table_search(priv, (char *)&cookie, sizeof(uint64_t));
4042 if (me != NULL)
4043 return nfp_ct_offload_del(dev, me, error);
4044
4045 /* Find the flow in flow hash table */
4046 flow_find = nfp_flow_table_search(priv, nfp_flow);
4047 if (flow_find == NULL) {
4048 rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
4049 NULL, "Flow does not exist.");
4050 ret = -EINVAL;
4051 goto exit;
4052 }
4053
4054 /* Update flow */
4055 ret = nfp_flow_teardown(priv, nfp_flow, false);
4056 if (ret != 0) {
4057 rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
4058 NULL, "Flow teardown failed.");
4059 ret = -EINVAL;
4060 goto exit;
4061 }
4062
4063 switch (nfp_flow->type) {
4064 case NFP_FLOW_COMMON:
4065 break;
4066 case NFP_FLOW_ENCAP:
4067 /* Delete the entry from nn table */
4068 ret = nfp_flower_del_tun_neigh(app_fw_flower, nfp_flow, false);
4069 break;
4070 case NFP_FLOW_DECAP:
4071 /* Delete the entry from nn table */
4072 ret = nfp_flower_del_tun_neigh(app_fw_flower, nfp_flow, true);
4073 if (ret != 0)
4074 goto exit;
4075
4076 /* Delete the entry in pre tunnel table */
4077 ret = nfp_pre_tun_table_check_del(representor, nfp_flow);
4078 break;
4079 default:

Callers 2

nfp_flow_flushFunction · 0.85
nfp_ct_offload_delFunction · 0.85

Calls 13

nfp_ct_map_table_searchFunction · 0.85
nfp_ct_offload_delFunction · 0.85
nfp_flow_table_searchFunction · 0.85
rte_flow_error_setFunction · 0.85
nfp_flow_teardownFunction · 0.85
nfp_flower_del_tun_neighFunction · 0.85
nfp_flow_is_tunnelFunction · 0.85
nfp_tun_check_ip_off_delFunction · 0.85
nfp_mtr_update_ref_cntFunction · 0.85

Tested by

no test coverage detected