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 723EBA0471 for ; Tue, 16 Jul 2019 04:41:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E9DA2082; Tue, 16 Jul 2019 04:41:56 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 78853271; Tue, 16 Jul 2019 04:41:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 19:41:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,496,1557212400"; d="scan'208";a="342572640" Received: from map1.sh.intel.com ([10.67.111.138]) by orsmga005.jf.intel.com with ESMTP; 15 Jul 2019 19:41:52 -0700 From: Qiming Yang To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Qiming Yang , stable@dpdk.org Date: Tue, 16 Jul 2019 10:38:55 +0800 Message-Id: <20190716023855.184619-1-qiming.yang@intel.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] net/ice: fix outer input set empty X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Should allow the outer input set be empty. Fixes: d76116a4678f ("net/ice: add generic flow API") Cc: stable@dpdk.org Signed-off-by: Qiming Yang --- drivers/net/ice/ice_generic_flow.c | 41 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 05a1678..c2931a1 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -238,13 +238,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], ipv4_spec = item->spec; ipv4_mask = item->mask; - if (!(ipv4_spec && ipv4_mask)) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, - item, - "Invalid IPv4 spec or mask."); - return 0; - } + if (!(ipv4_spec && ipv4_mask)) + break; /* Check IPv4 mask and update input set */ if (ipv4_mask->hdr.version_ihl || @@ -284,12 +279,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], ipv6_spec = item->spec; ipv6_mask = item->mask; - if (!(ipv6_spec && ipv6_mask)) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, - item, "Invalid IPv6 spec or mask"); - return 0; - } + if (!(ipv6_spec && ipv6_mask)) + break; if (ipv6_mask->hdr.payload_len || ipv6_mask->hdr.vtc_flow) { @@ -333,12 +324,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], udp_spec = item->spec; udp_mask = item->mask; - if (!(udp_spec && udp_mask)) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, - item, "Invalid UDP mask"); - return 0; - } + if (!(udp_spec && udp_mask)) + break; /* Check UDP mask and update input set*/ if (udp_mask->hdr.dgram_len || @@ -367,12 +354,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], tcp_spec = item->spec; tcp_mask = item->mask; - if (!(tcp_spec && tcp_mask)) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, - item, "Invalid TCP mask"); - return 0; - } + if (!(tcp_spec && tcp_mask)) + break; /* Check TCP mask and update input set */ if (tcp_mask->hdr.sent_seq || @@ -406,12 +389,8 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], sctp_spec = item->spec; sctp_mask = item->mask; - if (!(sctp_spec && sctp_mask)) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ITEM, - item, "Invalid SCTP mask"); - return 0; - } + if (!(sctp_spec && sctp_mask)) + break; /* Check SCTP mask and update input set */ if (sctp_mask->hdr.cksum) { -- 2.9.5