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

Function _bnxt_flow_destroy

dpdk/drivers/net/bnxt/bnxt_flow.c:2170–2272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2168}
2169
2170static int
2171_bnxt_flow_destroy(struct bnxt *bp,
2172 struct rte_flow *flow,
2173 struct rte_flow_error *error)
2174{
2175 struct bnxt_filter_info *filter;
2176 struct bnxt_vnic_info *vnic;
2177 int ret = 0;
2178 uint32_t flow_id;
2179
2180 filter = flow->filter;
2181 vnic = flow->vnic;
2182
2183 /* If tunnel redirection to a VF/PF is specified then only tunnel_type
2184 * is set and enable is set to the tunnel type. Issue hwrm cmd directly
2185 * in such a case.
2186 */
2187 if (filter->filter_type == HWRM_CFA_TUNNEL_REDIRECT_FILTER &&
2188 (filter->enables == filter->tunnel_type ||
2189 filter->tunnel_type == CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN ||
2190 filter->tunnel_type == CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE)) {
2191 if (filter->enables & NTUPLE_FLTR_ALLOC_INPUT_EN_DST_PORT) {
2192 struct rte_eth_udp_tunnel tunnel = {0};
2193
2194 /* hwrm_tunnel_dst_port_free converts to Big Endian */
2195 tunnel.udp_port = BNXT_NTOHS(filter->dst_port);
2196 if (filter->tunnel_type ==
2197 CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN) {
2198 tunnel.prot_type = RTE_ETH_TUNNEL_TYPE_VXLAN;
2199 } else if (filter->tunnel_type ==
2200 CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE) {
2201 tunnel.prot_type = RTE_ETH_TUNNEL_TYPE_GENEVE;
2202 } else {
2203 rte_flow_error_set(error, EINVAL,
2204 RTE_FLOW_ERROR_TYPE_HANDLE,
2205 NULL,
2206 "Invalid tunnel type");
2207 return ret;
2208 }
2209
2210 ret = bnxt_udp_tunnel_port_del_op(bp->eth_dev,
2211 &tunnel);
2212 if (ret)
2213 return ret;
2214 }
2215 ret = bnxt_handle_tunnel_redirect_destroy(bp, filter, error);
2216 if (!ret)
2217 goto done;
2218 else
2219 return ret;
2220 }
2221
2222 /* For config type, there is no filter in HW. Finish cleanup here */
2223 if (filter->filter_type == HWRM_CFA_CONFIG)
2224 goto done;
2225
2226 ret = bnxt_match_filter(bp, filter);
2227 if (ret == 0)

Callers 2

bnxt_flow_destroyFunction · 0.85
bnxt_flow_flushFunction · 0.85

Calls 10

rte_flow_error_setFunction · 0.85
bnxt_match_filterFunction · 0.85
memsetFunction · 0.85
bnxt_set_rx_mask_no_vlanFunction · 0.85
bnxt_free_filterFunction · 0.85
rte_freeFunction · 0.85
bnxt_vnic_cleanupFunction · 0.85

Tested by

no test coverage detected