From: Ying A Wang Date: Thu, 18 Jul 2019 01:38:43 +0000 (+0800) Subject: net/ice: add flow IPv6 TC support X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=72d138ff0f58d2cf2c3ef58b0f5c32e186b82a15;p=dpdk.git net/ice: add flow IPv6 TC support When set flow ipv6 tc rule, ice_get_flow_field will set error. This patch fixes this issue. Fixes: d76116a4678f ("net/ice: add generic flow API") Signed-off-by: Ying A Wang Acked-by: Qiming Yang --- diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 2c572768b4..5725bff50e 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -282,8 +282,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], if (!(ipv6_spec && ipv6_mask)) break; - if (ipv6_mask->hdr.payload_len || - ipv6_mask->hdr.vtc_flow) { + if (ipv6_mask->hdr.payload_len) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -317,6 +316,11 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], input_set |= ICE_INSET_IPV6_PROTO; if (ipv6_mask->hdr.hop_limits == UINT8_MAX) input_set |= ICE_INSET_IPV6_HOP_LIMIT; + if ((ipv6_mask->hdr.vtc_flow & + rte_cpu_to_be_32(RTE_IPV6_HDR_TC_MASK)) + == rte_cpu_to_be_32 + (RTE_IPV6_HDR_TC_MASK)) + input_set |= ICE_INSET_IPV6_TOS; } break; @@ -486,7 +490,7 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, - "Invalid mask no exist"); + "Invalid pattern"); break; } }