X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=inline;f=drivers%2Fnet%2Fice%2Fice_hash.c;h=0fdd4d68d4ab283d9421e55d19a6511547aed5e5;hb=1d6cf7df2adb8d6e77a69be859917b0f34a29f35;hp=2e9c1bc671b086564eee365fa1335988f64bdd5c;hpb=2f11d96feadd8c0cbabfc2be72307f797cb0d0af;p=dpdk.git diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 2e9c1bc671..0fdd4d68d4 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -120,22 +120,22 @@ static struct ice_pattern_match_item ice_hash_pattern_list_os[] = { /* Supported pattern for comms package. */ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = { - {pattern_eth_ipv4, ICE_INSET_NONE, &hint_1}, - {pattern_eth_ipv4_udp, ICE_INSET_NONE, &hint_2}, - {pattern_eth_ipv4_tcp, ICE_INSET_NONE, &hint_3}, - {pattern_eth_ipv4_sctp, ICE_INSET_NONE, &hint_4}, - {pattern_eth_ipv6, ICE_INSET_NONE, &hint_5}, - {pattern_eth_ipv6_udp, ICE_INSET_NONE, &hint_6}, - {pattern_eth_ipv6_tcp, ICE_INSET_NONE, &hint_7}, - {pattern_eth_ipv6_sctp, ICE_INSET_NONE, &hint_8}, - {pattern_empty, ICE_INSET_NONE, &hint_0}, - {pattern_eth_ipv4_gtpu_ipv4, ICE_INSET_NONE, &hint_9}, - {pattern_eth_ipv4_gtpu_ipv4_udp, ICE_INSET_NONE, &hint_9}, - {pattern_eth_ipv4_gtpu_ipv4_tcp, ICE_INSET_NONE, &hint_9}, - {pattern_eth_pppoes_ipv4, ICE_INSET_NONE, &hint_10}, - {pattern_eth_pppoes_ipv4_udp, ICE_INSET_NONE, &hint_11}, - {pattern_eth_pppoes_ipv4_tcp, ICE_INSET_NONE, &hint_12}, - {pattern_eth_pppoes_ipv4_sctp, ICE_INSET_NONE, &hint_13}, + {pattern_eth_ipv4, ICE_INSET_NONE, &hint_1}, + {pattern_eth_ipv4_udp, ICE_INSET_NONE, &hint_2}, + {pattern_eth_ipv4_tcp, ICE_INSET_NONE, &hint_3}, + {pattern_eth_ipv4_sctp, ICE_INSET_NONE, &hint_4}, + {pattern_eth_ipv6, ICE_INSET_NONE, &hint_5}, + {pattern_eth_ipv6_udp, ICE_INSET_NONE, &hint_6}, + {pattern_eth_ipv6_tcp, ICE_INSET_NONE, &hint_7}, + {pattern_eth_ipv6_sctp, ICE_INSET_NONE, &hint_8}, + {pattern_empty, ICE_INSET_NONE, &hint_0}, + {pattern_eth_ipv4_gtpu_eh_ipv4, ICE_INSET_NONE, &hint_9}, + {pattern_eth_ipv4_gtpu_eh_ipv4_udp, ICE_INSET_NONE, &hint_9}, + {pattern_eth_ipv4_gtpu_eh_ipv4_tcp, ICE_INSET_NONE, &hint_9}, + {pattern_eth_pppoes_ipv4, ICE_INSET_NONE, &hint_10}, + {pattern_eth_pppoes_ipv4_udp, ICE_INSET_NONE, &hint_11}, + {pattern_eth_pppoes_ipv4_tcp, ICE_INSET_NONE, &hint_12}, + {pattern_eth_pppoes_ipv4_sctp, ICE_INSET_NONE, &hint_13}, }; /** @@ -424,26 +424,31 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, /* Check rss supported pattern and find matched pattern. */ pattern_match_item = ice_search_pattern_match_item(pattern, array, array_len, error); - if (!pattern_match_item) - return -rte_errno; + if (!pattern_match_item) { + ret = -rte_errno; + goto error; + } ret = ice_hash_check_inset(pattern, error); if (ret) - return -rte_errno; + goto error; /* Save protocol header to rss_meta. */ - *meta = rss_meta_ptr; - ((struct rss_meta *)*meta)->pkt_hdr = ((struct rss_type_match_hdr *) + rss_meta_ptr->pkt_hdr = ((struct rss_type_match_hdr *) (pattern_match_item->meta))->hdr_mask; /* Check rss action. */ - ret = ice_hash_parse_action(pattern_match_item, actions, meta, error); - if (ret) - return -rte_errno; + ret = ice_hash_parse_action(pattern_match_item, actions, + (void **)&rss_meta_ptr, error); +error: + if (!ret && meta) + *meta = rss_meta_ptr; + else + rte_free(rss_meta_ptr); rte_free(pattern_match_item); - return 0; + return ret; } static int