From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 123F9A0471 for ; Thu, 18 Jul 2019 03:41:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9D6F1B53; Thu, 18 Jul 2019 03:41:31 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 609341B53 for ; Thu, 18 Jul 2019 03:41:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 18:41:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,276,1559545200"; d="scan'208";a="366758062" Received: from npg-dpdk-cvl-yingwang-117d94.sh.intel.com ([10.67.117.94]) by fmsmga005.fm.intel.com with ESMTP; 17 Jul 2019 18:41:27 -0700 From: Wang Ying A To: qabuild@intel.com Cc: Wang Ying A , stable@dpdk.org Date: Thu, 18 Jul 2019 09:26:58 +0800 Message-Id: <1563413218-373420-1-git-send-email-ying.a.wang@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [DPDK] net/ice: add flow ipv6 tc support X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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") Cc: stable@dpdk.org Signed-off-by: Wang Ying A --- drivers/net/ice/ice_generic_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 2c57276..5725bff 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; } } -- 1.8.3.1