X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fice%2Fice_generic_flow.c;h=d3391c86c04865a558f5fff36c55993a73bb29fc;hb=0663a84524e5c63cb737cd723b4ea33493e8d17a;hp=54b0316b9d29974397b8152d87972fca290a64d8;hpb=610bc231d09bbb80dfee3d0003605d19cc41c04f;p=dpdk.git diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 54b0316b9d..d3391c86c0 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -65,6 +65,12 @@ enum rte_flow_item_type pattern_empty[] = { RTE_FLOW_ITEM_TYPE_END, }; +/* raw */ +enum rte_flow_item_type pattern_raw[] = { + RTE_FLOW_ITEM_TYPE_RAW, + RTE_FLOW_ITEM_TYPE_END, +}; + /* L2 */ enum rte_flow_item_type pattern_ethertype[] = { RTE_FLOW_ITEM_TYPE_ETH, @@ -212,6 +218,27 @@ enum rte_flow_item_type pattern_eth_qinq_ipv6[] = { RTE_FLOW_ITEM_TYPE_IPV6, RTE_FLOW_ITEM_TYPE_END, }; +enum rte_flow_item_type pattern_eth_ipv6_frag_ext[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_IPV6, + RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT, + RTE_FLOW_ITEM_TYPE_END, +}; +enum rte_flow_item_type pattern_eth_vlan_ipv6_frag_ext[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_VLAN, + RTE_FLOW_ITEM_TYPE_IPV6, + RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT, + RTE_FLOW_ITEM_TYPE_END, +}; +enum rte_flow_item_type pattern_eth_qinq_ipv6_frag_ext[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_VLAN, + RTE_FLOW_ITEM_TYPE_VLAN, + RTE_FLOW_ITEM_TYPE_IPV6, + RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT, + RTE_FLOW_ITEM_TYPE_END, +}; enum rte_flow_item_type pattern_eth_ipv6_udp[] = { RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_IPV6, @@ -1455,6 +1482,14 @@ enum rte_flow_item_type pattern_eth_qinq_pppoes[] = { RTE_FLOW_ITEM_TYPE_PPPOES, RTE_FLOW_ITEM_TYPE_END, }; +enum rte_flow_item_type pattern_eth_qinq_pppoes_proto[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_VLAN, + RTE_FLOW_ITEM_TYPE_VLAN, + RTE_FLOW_ITEM_TYPE_PPPOES, + RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID, + RTE_FLOW_ITEM_TYPE_END, +}; enum rte_flow_item_type pattern_eth_pppoes_ipv4[] = { RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_PPPOES, @@ -1766,6 +1801,7 @@ enum rte_flow_item_type pattern_eth_ipv6_pfcp[] = { typedef struct ice_flow_engine * (*parse_engine_t)(struct ice_adapter *ad, struct rte_flow *flow, struct ice_parser_list *parser_list, + uint32_t priority, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error); @@ -1790,7 +1826,7 @@ ice_flow_init(struct ice_adapter *ad) TAILQ_INIT(&pf->dist_parser_list); rte_spinlock_init(&pf->flow_ops_lock); - TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) { if (engine->init == NULL) { PMD_INIT_LOG(ERR, "Invalid engine type (%d)", engine->type); @@ -1816,7 +1852,7 @@ ice_flow_uninit(struct ice_adapter *ad) struct ice_flow_parser_node *p_parser; void *temp; - TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) { if (engine->uninit) engine->uninit(ad); } @@ -1893,8 +1929,10 @@ ice_register_parser(struct ice_flow_parser *parser, } else { if (parser->engine->type == ICE_FLOW_ENGINE_SWITCH || parser->engine->type == ICE_FLOW_ENGINE_HASH) - TAILQ_INSERT_TAIL(list, parser_node, node); + TAILQ_INSERT_HEAD(list, parser_node, node); else if (parser->engine->type == ICE_FLOW_ENGINE_FDIR) + TAILQ_INSERT_TAIL(list, parser_node, node); + else if (parser->engine->type == ICE_FLOW_ENGINE_ACL) TAILQ_INSERT_HEAD(list, parser_node, node); else return -EINVAL; @@ -1914,7 +1952,7 @@ ice_unregister_parser(struct ice_flow_parser *parser, if (list == NULL) return; - TAILQ_FOREACH_SAFE(p_parser, list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(p_parser, list, node, temp) { if (p_parser->parser->engine->type == parser->engine->type) { TAILQ_REMOVE(list, p_parser, node); rte_free(p_parser); @@ -1955,11 +1993,10 @@ ice_flow_valid_attr(struct ice_adapter *ad, } else { *ice_pipeline_stage = ICE_FLOW_CLASSIFY_STAGE_DISTRIBUTOR_ONLY; - /* Not supported */ - if (attr->priority) { + if (attr->priority > 1) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, - attr, "Not support priority."); + attr, "Only support priority 0 and 1."); return -rte_errno; } } @@ -2044,17 +2081,141 @@ ice_match_pattern(enum rte_flow_item_type *item_array, item->type == RTE_FLOW_ITEM_TYPE_END); } +struct ice_ptype_match { + enum rte_flow_item_type *pattern_list; + uint16_t hw_ptype; +}; + +static struct ice_ptype_match ice_ptype_map[] = { + {pattern_raw, ICE_PTYPE_IPV4_PAY}, + {pattern_eth_ipv4, ICE_PTYPE_IPV4_PAY}, + {pattern_eth_ipv4_udp, ICE_PTYPE_IPV4_UDP_PAY}, + {pattern_eth_ipv4_tcp, ICE_PTYPE_IPV4_TCP_PAY}, + {pattern_eth_ipv4_sctp, ICE_PTYPE_IPV4_SCTP_PAY}, + {pattern_eth_ipv4_gtpu, ICE_MAC_IPV4_GTPU}, + {pattern_eth_ipv4_gtpu_eh, ICE_MAC_IPV4_GTPU}, + {pattern_eth_ipv4_gtpu_ipv4, ICE_MAC_IPV4_GTPU_IPV4_PAY}, + {pattern_eth_ipv4_gtpu_ipv4_udp, ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY}, + {pattern_eth_ipv4_gtpu_ipv4_tcp, ICE_MAC_IPV4_GTPU_IPV4_TCP}, + {pattern_eth_ipv4_gtpu_ipv6, ICE_MAC_IPV4_GTPU_IPV6_PAY}, + {pattern_eth_ipv4_gtpu_ipv6_udp, ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY}, + {pattern_eth_ipv4_gtpu_ipv6_tcp, ICE_MAC_IPV4_GTPU_IPV6_TCP}, + {pattern_eth_ipv4_gtpu_eh_ipv4, ICE_MAC_IPV4_GTPU_IPV4_PAY}, + {pattern_eth_ipv4_gtpu_eh_ipv4_udp, ICE_MAC_IPV4_GTPU_IPV4_UDP_PAY}, + {pattern_eth_ipv4_gtpu_eh_ipv4_tcp, ICE_MAC_IPV4_GTPU_IPV4_TCP}, + {pattern_eth_ipv4_gtpu_eh_ipv6, ICE_MAC_IPV4_GTPU_IPV6_PAY}, + {pattern_eth_ipv4_gtpu_eh_ipv6_udp, ICE_MAC_IPV4_GTPU_IPV6_UDP_PAY}, + {pattern_eth_ipv4_gtpu_eh_ipv6_tcp, ICE_MAC_IPV4_GTPU_IPV6_TCP}, + {pattern_eth_ipv4_esp, ICE_MAC_IPV4_ESP}, + {pattern_eth_ipv4_udp_esp, ICE_MAC_IPV4_NAT_T_ESP}, + {pattern_eth_ipv4_ah, ICE_MAC_IPV4_AH}, + {pattern_eth_ipv4_l2tp, ICE_MAC_IPV4_L2TPV3}, + {pattern_eth_ipv4_pfcp, ICE_MAC_IPV4_PFCP_SESSION}, + {pattern_eth_ipv6, ICE_PTYPE_IPV6_PAY}, + {pattern_eth_ipv6_udp, ICE_PTYPE_IPV6_UDP_PAY}, + {pattern_eth_ipv6_tcp, ICE_PTYPE_IPV6_TCP_PAY}, + {pattern_eth_ipv6_sctp, ICE_PTYPE_IPV6_SCTP_PAY}, + {pattern_eth_ipv6_frag_ext, ICE_PTYPE_IPV6FRAG_PAY}, + {pattern_eth_ipv6_gtpu, ICE_MAC_IPV6_GTPU}, + {pattern_eth_ipv6_gtpu_eh, ICE_MAC_IPV6_GTPU}, + {pattern_eth_ipv6_gtpu_ipv4, ICE_MAC_IPV6_GTPU_IPV4_PAY}, + {pattern_eth_ipv6_gtpu_ipv4_udp, ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY}, + {pattern_eth_ipv6_gtpu_ipv4_tcp, ICE_MAC_IPV6_GTPU_IPV4_TCP}, + {pattern_eth_ipv6_gtpu_ipv6, ICE_MAC_IPV6_GTPU_IPV6_PAY}, + {pattern_eth_ipv6_gtpu_ipv6_udp, ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY}, + {pattern_eth_ipv6_gtpu_ipv6_tcp, ICE_MAC_IPV6_GTPU_IPV6_TCP}, + {pattern_eth_ipv6_gtpu_eh_ipv4, ICE_MAC_IPV6_GTPU_IPV4_PAY}, + {pattern_eth_ipv6_gtpu_eh_ipv4_udp, ICE_MAC_IPV6_GTPU_IPV4_UDP_PAY}, + {pattern_eth_ipv6_gtpu_eh_ipv4_tcp, ICE_MAC_IPV6_GTPU_IPV4_TCP}, + {pattern_eth_ipv6_gtpu_eh_ipv6, ICE_MAC_IPV6_GTPU_IPV6_PAY}, + {pattern_eth_ipv6_gtpu_eh_ipv6_udp, ICE_MAC_IPV6_GTPU_IPV6_UDP_PAY}, + {pattern_eth_ipv6_gtpu_eh_ipv6_tcp, ICE_MAC_IPV6_GTPU_IPV6_TCP}, + {pattern_eth_ipv6_esp, ICE_MAC_IPV6_ESP}, + {pattern_eth_ipv6_udp_esp, ICE_MAC_IPV6_NAT_T_ESP}, + {pattern_eth_ipv6_ah, ICE_MAC_IPV6_AH}, + {pattern_eth_ipv6_l2tp, ICE_MAC_IPV6_L2TPV3}, + {pattern_eth_ipv6_pfcp, ICE_MAC_IPV6_PFCP_SESSION}, + {pattern_ethertype, ICE_PTYPE_MAC_PAY}, + {pattern_ethertype_vlan, ICE_PTYPE_MAC_PAY}, + {pattern_ethertype_qinq, ICE_PTYPE_MAC_PAY}, + {pattern_eth_arp, ICE_PTYPE_MAC_PAY}, + {pattern_eth_vlan_ipv4, ICE_PTYPE_IPV4_PAY}, + {pattern_eth_qinq_ipv4, ICE_PTYPE_IPV4_PAY}, + {pattern_eth_qinq_ipv4_udp, ICE_PTYPE_IPV4_UDP_PAY}, + {pattern_eth_qinq_ipv4_tcp, ICE_PTYPE_IPV4_TCP_PAY}, + {pattern_eth_vlan_ipv4_udp, ICE_PTYPE_IPV4_UDP_PAY}, + {pattern_eth_vlan_ipv4_tcp, ICE_PTYPE_IPV4_TCP_PAY}, + {pattern_eth_vlan_ipv4_sctp, ICE_PTYPE_IPV4_SCTP_PAY}, + {pattern_eth_vlan_ipv6, ICE_PTYPE_IPV6_PAY}, + {pattern_eth_qinq_ipv6, ICE_PTYPE_IPV6_PAY}, + {pattern_eth_qinq_ipv6_udp, ICE_PTYPE_IPV6_UDP_PAY}, + {pattern_eth_qinq_ipv6_tcp, ICE_PTYPE_IPV6_TCP_PAY}, + {pattern_eth_vlan_ipv6_udp, ICE_PTYPE_IPV6_UDP_PAY}, + {pattern_eth_vlan_ipv6_tcp, ICE_PTYPE_IPV6_TCP_PAY}, + {pattern_eth_vlan_ipv6_sctp, ICE_PTYPE_IPV6_SCTP_PAY}, + {pattern_eth_pppoes, ICE_MAC_PPPOE_PAY}, + {pattern_eth_vlan_pppoes, ICE_MAC_PPPOE_PAY}, + {pattern_eth_qinq_pppoes, ICE_MAC_PPPOE_PAY}, + {pattern_eth_pppoes_proto, ICE_MAC_PPPOE_PAY}, + {pattern_eth_vlan_pppoes_proto, ICE_MAC_PPPOE_PAY}, + {pattern_eth_qinq_pppoes_proto, ICE_MAC_PPPOE_PAY}, + {pattern_eth_pppoes_ipv4, ICE_MAC_PPPOE_IPV4_PAY}, + {pattern_eth_pppoes_ipv4_udp, ICE_MAC_PPPOE_IPV4_UDP_PAY}, + {pattern_eth_pppoes_ipv4_tcp, ICE_MAC_PPPOE_IPV4_TCP}, + {pattern_eth_vlan_pppoes_ipv4, ICE_MAC_PPPOE_IPV4_PAY}, + {pattern_eth_qinq_pppoes_ipv4, ICE_MAC_PPPOE_IPV4_PAY}, + {pattern_eth_vlan_pppoes_ipv4_tcp, ICE_MAC_PPPOE_IPV4_TCP}, + {pattern_eth_vlan_pppoes_ipv4_udp, ICE_MAC_PPPOE_IPV4_UDP_PAY}, + {pattern_eth_pppoes_ipv6, ICE_MAC_PPPOE_IPV6_PAY}, + {pattern_eth_pppoes_ipv6_udp, ICE_MAC_PPPOE_IPV6_UDP_PAY}, + {pattern_eth_pppoes_ipv6_tcp, ICE_MAC_PPPOE_IPV6_TCP}, + {pattern_eth_vlan_pppoes_ipv6, ICE_MAC_PPPOE_IPV6_PAY}, + {pattern_eth_qinq_pppoes_ipv6, ICE_MAC_PPPOE_IPV6_PAY}, + {pattern_eth_vlan_pppoes_ipv6_tcp, ICE_MAC_PPPOE_IPV6_TCP}, + {pattern_eth_vlan_pppoes_ipv6_udp, ICE_MAC_PPPOE_IPV6_UDP_PAY}, + {pattern_eth_ipv4_udp_vxlan_ipv4, ICE_MAC_IPV4_TUN_IPV4_PAY}, + {pattern_eth_ipv4_udp_vxlan_ipv4_udp, ICE_MAC_IPV4_TUN_IPV4_UDP_PAY}, + {pattern_eth_ipv4_udp_vxlan_ipv4_tcp, ICE_MAC_IPV4_TUN_IPV4_TCP}, + {pattern_eth_ipv4_udp_vxlan_ipv4_sctp, ICE_MAC_IPV4_TUN_IPV4_SCTP}, + {pattern_eth_ipv4_udp_vxlan_eth_ipv4, ICE_MAC_IPV4_TUN_IPV4_PAY}, + {pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp, ICE_MAC_IPV4_TUN_IPV4_UDP_PAY}, + {pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp, ICE_MAC_IPV4_TUN_IPV4_TCP}, + {pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp, ICE_MAC_IPV4_TUN_IPV4_SCTP}, + {pattern_eth_ipv4_nvgre_eth_ipv4, ICE_MAC_IPV4_TUN_IPV4_PAY}, + {pattern_eth_ipv4_nvgre_eth_ipv4_udp, ICE_MAC_IPV4_TUN_IPV4_UDP_PAY}, + {pattern_eth_ipv4_nvgre_eth_ipv4_tcp, ICE_MAC_IPV4_TUN_IPV4_TCP}, + {pattern_empty, 0}, +}; + +static bool +ice_pattern_is_supported(__rte_unused struct ice_adapter *ad, + const struct rte_flow_item *pattern) +{ + uint16_t i; + + for (i = 0; i < RTE_DIM(ice_ptype_map); i++) { + if (ice_match_pattern(ice_ptype_map[i].pattern_list, + pattern)) { + return ice_hw_ptype_ena(&ad->hw, + ice_ptype_map[i].hw_ptype); + } + } + + return false; +} + struct ice_pattern_match_item * -ice_search_pattern_match_item(const struct rte_flow_item pattern[], - struct ice_pattern_match_item *array, - uint32_t array_len, - struct rte_flow_error *error) +ice_search_pattern_match_item(struct ice_adapter *ad, + const struct rte_flow_item pattern[], + struct ice_pattern_match_item *array, + uint32_t array_len, + struct rte_flow_error *error) { - uint16_t i = 0; struct ice_pattern_match_item *pattern_match_item; /* need free by each filter */ struct rte_flow_item *items; /* used for pattern without VOID items */ uint32_t item_num = 0; /* non-void item number */ + uint16_t i = 0; /* Get the non-void item number of pattern */ while ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_END) { @@ -2076,25 +2237,33 @@ ice_search_pattern_match_item(const struct rte_flow_item pattern[], if (!pattern_match_item) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "Failed to allocate memory."); + rte_free(items); return NULL; } ice_pattern_skip_void_item(items, pattern); - for (i = 0; i < array_len; i++) + if (!ice_pattern_is_supported(ad, pattern)) + goto unsupported; + + for (i = 0; i < array_len; i++) { if (ice_match_pattern(array[i].pattern_list, - items)) { - pattern_match_item->input_set_mask = - array[i].input_set_mask; + items)) { + pattern_match_item->input_set_mask_o = + array[i].input_set_mask_o; + pattern_match_item->input_set_mask_i = + array[i].input_set_mask_i; pattern_match_item->pattern_list = array[i].pattern_list; pattern_match_item->meta = array[i].meta; rte_free(items); return pattern_match_item; } + } + +unsupported: rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, pattern, "Unsupported pattern"); - rte_free(items); rte_free(pattern_match_item); return NULL; @@ -2104,6 +2273,7 @@ static struct ice_flow_engine * ice_parse_engine_create(struct ice_adapter *ad, struct rte_flow *flow, struct ice_parser_list *parser_list, + uint32_t priority, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error) @@ -2113,13 +2283,13 @@ ice_parse_engine_create(struct ice_adapter *ad, void *meta = NULL; void *temp; - TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) { int ret; if (parser_node->parser->parse_pattern_action(ad, parser_node->parser->array, parser_node->parser->array_len, - pattern, actions, &meta, error) < 0) + pattern, actions, priority, &meta, error) < 0) continue; engine = parser_node->parser->engine; @@ -2137,6 +2307,7 @@ static struct ice_flow_engine * ice_parse_engine_validate(struct ice_adapter *ad, struct rte_flow *flow __rte_unused, struct ice_parser_list *parser_list, + uint32_t priority, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error) @@ -2145,11 +2316,11 @@ ice_parse_engine_validate(struct ice_adapter *ad, struct ice_flow_parser_node *parser_node; void *temp; - TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) { if (parser_node->parser->parse_pattern_action(ad, parser_node->parser->array, parser_node->parser->array_len, - pattern, actions, NULL, error) < 0) + pattern, actions, priority, NULL, error) < 0) continue; engine = parser_node->parser->engine; @@ -2199,7 +2370,7 @@ ice_flow_process_filter(struct rte_eth_dev *dev, return ret; *engine = ice_parse_engine(ad, flow, &pf->rss_parser_list, - pattern, actions, error); + attr->priority, pattern, actions, error); if (*engine != NULL) return 0; @@ -2207,11 +2378,11 @@ ice_flow_process_filter(struct rte_eth_dev *dev, case ICE_FLOW_CLASSIFY_STAGE_DISTRIBUTOR_ONLY: case ICE_FLOW_CLASSIFY_STAGE_DISTRIBUTOR: *engine = ice_parse_engine(ad, flow, &pf->dist_parser_list, - pattern, actions, error); + attr->priority, pattern, actions, error); break; case ICE_FLOW_CLASSIFY_STAGE_PERMISSION: *engine = ice_parse_engine(ad, flow, &pf->perm_parser_list, - pattern, actions, error); + attr->priority, pattern, actions, error); break; default: return -EINVAL; @@ -2317,7 +2488,7 @@ ice_flow_flush(struct rte_eth_dev *dev, void *temp; int ret = 0; - TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { ret = ice_flow_destroy(dev, p_flow, error); if (ret) { PMD_DRV_LOG(ERR, "Failed to flush flows"); @@ -2358,15 +2529,16 @@ ice_flow_query(struct rte_eth_dev *dev, ret = flow->engine->query_count(ad, flow, count, error); break; default: - return rte_flow_error_set(error, ENOTSUP, + ret = rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, actions, "action not supported"); + goto out; } } +out: rte_spinlock_unlock(&pf->flow_ops_lock); - return ret; } @@ -2377,21 +2549,21 @@ ice_flow_redirect(struct ice_adapter *ad, struct ice_pf *pf = &ad->pf; struct rte_flow *p_flow; void *temp; - int ret; + int ret = 0; rte_spinlock_lock(&pf->flow_ops_lock); - TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { + RTE_TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { if (!p_flow->engine->redirect) continue; ret = p_flow->engine->redirect(ad, p_flow, rd); if (ret) { PMD_DRV_LOG(ERR, "Failed to redirect flows"); - return ret; + break; } } rte_spinlock_unlock(&pf->flow_ops_lock); - return 0; + return ret; }