| 2168 | } |
| 2169 | |
| 2170 | static 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) |
no test coverage detected